commit 6e1686be672fdd5dcacfe832ea7d0958a0ae9132 Author: sergiu Date: Wed Sep 18 11:11:16 2019 +0300 Simulator first commit diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3b66410 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "git.ignoreLimitWarning": true +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d467af1 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +Tested with +-ubuntu 16.04.6 +-openssl: 1.0.2g +-node: 8.16.0 + +Requirements +-curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - +-sudo apt-get install -y nodejs +-sudo apt-get install -y build-essential +-rm package-lock.json && rm -rf node_modules && rm -rf ~/.node-gyp only if package-lock.json/node_modules or node was installed +-sudo apt-get install libasound2-dev +-sudo npm i -g node-gyp \ No newline at end of file diff --git a/certs/1947-cert.pem b/certs/1947-cert.pem new file mode 100644 index 0000000..fd99b54 --- /dev/null +++ b/certs/1947-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTI1 +MTU3WhcNMjkwODE5MTI1MTU3WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMTk0NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAMjO6wGnH5R/AjHxvoGwIS7VcT+FgQzMsXgfMnquQXhDk/4yUfib +x67pwpiUB60di2QKQlkI3jZOPvqNebhR2AfpZ3xVqzXZvy1UcWF6Q5JtiLfeLdNe +IdpP32W0nLoE9Nb1IMCCSPW5ruEUXkk0WtBLUWKsoZi+3YrBcIZ8knw+IQJAN2pn +fYy6oV7r8JahWBTRRlpLA8JqGQPyCFXFOhPo/y/oFB4ebGc0Ikiehfb7Dh7d4Yux +2ga+a4xho7Tfa0uhvWjk0kARREYJD31CcEPoyghfX7PpQodvPHSRIN7qwWRhTnRs +eeghBgsiYtDQtw+DdXK2o/7dR9KxQYM1FcsRmPWsLdn+y4HmG6pglG2G6WAAzC43 +R2HY0gUr0AK/yeMQz+7b1FG4ca1hGvW9arZTh4OK9KMCgG+SAaF6oAlDloJdV8vV +615z+QEXYHOFPz/GCE0q22IIhMlCp39Y0eRjmVKrlr/wQF/iBSocg7/62Tqlg+oc +sh1I4gDLQg8XoiPLDuqWkCiQorI/GJs7BIkpBrlrR1MBacSYQBaMnav3B43WHPQo +uPNCHq5u8ILkqOEoVO3AkvIzOcu/q5egUGswrNWenrotO3kabojaOyK0cvHbjFZW +qh1zd5DlrXaBFxpUXpwZofgKYpyVbLoDhPpdMuJfR0lGxfBsppdawuHjAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAKIuMQWeTK571f8o7lttc0LrRd9KqnnYqvu3Bwhz +kYXGvyIiFZDHoVyWkhNMya/55+Y7NDcH+TvK9NkYRYlldkQqwtozr+eJ0lw5+0vK +/6Q3iDMqQyjJdDAsFC4/WWXQb8OKCuRK2lFMm9C9BSSX+4FjX/BoyR/0yZaAd66o +DimBicWqcwSzCGipjPFwAOSvK3ficFiRk0ZZRn2avKhNXq6353BLN4NzzBgI9uNL +++9MtJ6rZahY2u7BfM7eG4HJ69a2yPTSDQcOfE4qNdIEy210lCYdz8X1pIU2IMDw +xThR8SGSCzL/Tq8KAk9ClrY5QyI2wUqhhSqBiHzjCCP77bu1E4lHm9oNk0/OQ88o +nprCPNiFywI8gd8oTfggujm/ddMXpkoRMiS103bMZufjAGh90iaFvXyIKJ8hr2np +KEaEDgfjJas+ugsH64DcHz/nJY7TpAFapDl2S+Vfgr30EuebFSffUx4ZV8Dzj2nG +ScLGJtYNjWKBB9aknI2jKwxUCuILBnL1IPUWBXGgQIqZInTFX+pycbh9hLgZt1MD +KIr9jYC2JB4+WTgG5DBHcMjncbBs7pvttKv5f4iRpPntbP2I3+OiYujfp4PEIy07 +7bTKPy+VXmGeAaPwez4eV90qY1zyLEUdMe2OYUaAAwx5tnWNMF2J6V5MwRMtrdRD +thhm +-----END CERTIFICATE----- diff --git a/certs/1947-csr.pem b/certs/1947-csr.pem new file mode 100644 index 0000000..20f500a --- /dev/null +++ b/certs/1947-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDE5NDcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDIzusBpx+UfwIx8b6BsCEu1XE/hYEMzLF4HzJ6rkF4Q5P+MlH4m8eu6cKYlAet +HYtkCkJZCN42Tj76jXm4UdgH6Wd8Vas12b8tVHFhekOSbYi33i3TXiHaT99ltJy6 +BPTW9SDAgkj1ua7hFF5JNFrQS1FirKGYvt2KwXCGfJJ8PiECQDdqZ32MuqFe6/CW +oVgU0UZaSwPCahkD8ghVxToT6P8v6BQeHmxnNCJInoX2+w4e3eGLsdoGvmuMYaO0 +32tLob1o5NJAEURGCQ99QnBD6MoIX1+z6UKHbzx0kSDe6sFkYU50bHnoIQYLImLQ +0LcPg3VytqP+3UfSsUGDNRXLEZj1rC3Z/suB5huqYJRthulgAMwuN0dh2NIFK9AC +v8njEM/u29RRuHGtYRr1vWq2U4eDivSjAoBvkgGheqAJQ5aCXVfL1etec/kBF2Bz +hT8/xghNKttiCITJQqd/WNHkY5lSq5a/8EBf4gUqHIO/+tk6pYPqHLIdSOIAy0IP +F6Ijyw7qlpAokKKyPxibOwSJKQa5a0dTAWnEmEAWjJ2r9weN1hz0KLjzQh6ubvCC +5KjhKFTtwJLyMznLv6uXoFBrMKzVnp66LTt5Gm6I2jsitHLx24xWVqodc3eQ5a12 +gRcaVF6cGaH4CmKclWy6A4T6XTLiX0dJRsXwbKaXWsLh4wIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBABfO4q7Z4Rd0sNMWuGRD6JVVliBX/iI5sCIjBOltuzdp7iO0 +UuR6evJS21qcArWwG/LHLT/1LAFWPF7gp4J2bnQHoE3x0XoRvqShsfACUATWW8n0 +X6sfBCA9ik0427TS2KkkEXThpVUfCfUzLErvYdQ9ECJbjFZ+n8oSlI81dvUtJ9To +gDYHaYqRmI172HkcgNjhbt5AXQjN8Fo2i4IdH+1J/JOLYjRWac4KDIRSIMQadUna +OoDmsF+2Hi7M9WNkLntEc7RguxxVvyYbe3G4WVIlqzUkqt6lPxuSA/pbcG3qY0zM +uYGCYQbcCpqzTwEKcLbB1fndx1VtxgxaIeePEDFKqJJiCVdpfco6n1/zoWBuch26 +Uniun331piDS2CMasu7Zohvf1MTEkD0AfiTaNrrY/O6wmuDt72ho9ASktIsQKuge +LhZPmpNlbcwippEVn2s15y1SvOyw88hpqjZC6mpmZCNjtUy37OMLBeSCo51j91I5 +7TVALIONKssXMYDDp8ZjB8G467lsv5sbDDcB+tmEwOijPk43EykiWFBnrKuZO4fk +POHo+sbjScdCLyyzcsfrDm4QF9syfDnsBGJ4IlrstpM1JYCgw3LcMa054JquyP09 +CwNqxHtuOocpXhQOd+GeBtNgPsGRZ75Zl0myfk9N93rAxWAfZBfXyfG0Ou6k +-----END CERTIFICATE REQUEST----- diff --git a/certs/1947-key.pem b/certs/1947-key.pem new file mode 100644 index 0000000..d74e675 --- /dev/null +++ b/certs/1947-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAyM7rAacflH8CMfG+gbAhLtVxP4WBDMyxeB8yeq5BeEOT/jJR ++JvHrunCmJQHrR2LZApCWQjeNk4++o15uFHYB+lnfFWrNdm/LVRxYXpDkm2It94t +014h2k/fZbScugT01vUgwIJI9bmu4RReSTRa0EtRYqyhmL7disFwhnySfD4hAkA3 +amd9jLqhXuvwlqFYFNFGWksDwmoZA/IIVcU6E+j/L+gUHh5sZzQiSJ6F9vsOHt3h +i7HaBr5rjGGjtN9rS6G9aOTSQBFERgkPfUJwQ+jKCF9fs+lCh288dJEg3urBZGFO +dGx56CEGCyJi0NC3D4N1craj/t1H0rFBgzUVyxGY9awt2f7LgeYbqmCUbYbpYADM +LjdHYdjSBSvQAr/J4xDP7tvUUbhxrWEa9b1qtlOHg4r0owKAb5IBoXqgCUOWgl1X +y9XrXnP5ARdgc4U/P8YITSrbYgiEyUKnf1jR5GOZUquWv/BAX+IFKhyDv/rZOqWD +6hyyHUjiAMtCDxeiI8sO6paQKJCisj8YmzsEiSkGuWtHUwFpxJhAFoydq/cHjdYc +9Ci480Ierm7wguSo4ShU7cCS8jM5y7+rl6BQazCs1Z6eui07eRpuiNo7IrRy8duM +VlaqHXN3kOWtdoEXGlRenBmh+ApinJVsugOE+l0y4l9HSUbF8Gyml1rC4eMCAwEA +AQKCAgAYACs0el4a6IdBouwrIfsFVvt/JRzEg96eRdRJt3QZxLH2itsjRLM8I7Jf +fCnitgpH/bXqYFX21alPVwN6VUXlxC7bPH4HJKxl5ZbbmLpk0PSrTUHa5oBTUIKZ +7FljHl6JJqkweSHxRK0zN7UBOOG1zZq/mXSDBiUChZZGbLMxaFeXpkc5T39BB7lr +1/Vce5JEgrLO7fJYFUhCIXZ/keAcKxf9CNcGtoosV53VYiUO3PjWFZz0jmBJuA6w +q6beYmm3k3BJDjhW8flgCYsxZHR4mWU0VPniTfnmqBPotsPgANz2e27eGW0EopXP +VN/Mp3WJxCOQf2Xge2AvPYJgBUNCWPd3T6xzHkXRTKFj4aN1L1XD1KqE02vfrisV +k1ND05jB22l38SPrrMURbjEZmpFaXR7eYCQdY7o6A4UC0vMezracAmOYwPF2cAAf +c1P3LlVeqEcFr1hcF2WZfuzCMAGo+vcVCB5v0QnPiiAJd4VqcQCIigU1eE70sajx +WGBbD/jqzVqdrPVG45m8seyuQmOpK+P0yMb8HpDqaJDnpwZm+ISBkYlzn95wQQm6 +ybjE21gqRHtnferr+37VxHcKzPmscWInlwUStBdI1qOqUysuZ0J8zViIUSfj8CH1 +dqIJyxXGXJvWgBz3ehSF7mLsgstL8Hz7uvlnWnvJFTTYBcCqqQKCAQEA5R0KMJ/I +CULX/yj7ZB4RV9hIcvT7zMGgyKU010yv7gG6h83T5SLaQy7lfp7pZOi/sBDBGsnB +efMBYMgYGU6cWcbyM7UTyQjMHW+zTOrAiGvNAX6jOaKnEWYkPStNv49jCVtdDL1h +Sp+mlS+MouoJFHH0hSLW+rSBUhARb9OkLwurmSo9QzsnuWLMKHr4QChPupTB2rhP +oyRFFmFAZy1Mvex/a0PTdiJrnxs3SP1N83ZPUtTZrSTIdNuVve8ENVlgOsZw5usa +jiyoSzDS6nnOzRwKykMthf/mVJ+5KQtBX1IU0Tp0I/e/FBC6iVJj1uWaPRqGgLz9 +VwkiCaUnCP/y7QKCAQEA4F+K5uyHVIKyYoeZi7KRCa4PNLzGCzK86UIZKluszFZo +yG8ObSu8qA62ITeV6oiI6KUFeBfgEV90eb7vL8YLKopqpLrVcls41sNdj8gTEEld +u11QtS7QN3sr6qUK+dc+Gs3C7Hyen4+lEmmUuwi8vInNJsKuOc1WZW27JzcBwlFJ +4BNxwnxj7/g3iyX7HyPgz9WHHSHsV4msj3S+KObHpTxS81x47d8c8kS8z+EltWNo +3KsfLWYxHb2ib8ixOTUHAQ7KH/gRtayj+NQ/C0HQzQBK6s7O4j29aTs1voukkwcX +JezJ7zYVTeiD3Cmq/nLnVr4M+cr2zYwfs07rvZ9+DwKCAQAU63HivrQlJFVUlwld +OuGag8UZugTDzWpA59TLU9U8hivh+ok+gtArEj0iMqBc9mOKT/1R1No1qFqX261X +ojXkfKXg0sfbs1Hv3iMhAs5RpoYxfL6qpI9cp1bnvux6cT05vX3hi+k2Rx2Owai1 +t2jc1QrenS/D9HdaZt0wuMJlCUvB0HmHif82ji7WA2Rnd0bQYoTQ08Nxwf4M7RRU +V26KaO25fZfxUXNCM9n4cCiN8l+L0KOPi6xB/0rM7OYVePOwai4k55KlKK61LuAT +SMv5LnZNwZSGh7cgQvVFKiHt8jC0agHwxs5LprthjoRPOue6bJGbb6YyLENPXiUS +TUyBAoIBAQC+gqFQHflyWl7YpkZLhVz9GRu0La0CiRw5+nOfsaNxBNWHijR3obFY +CNXAMpBKSY/l6WhRZgRM+/3L+cDhkYidoFWYdUMTDD2grNVeZgU5yPGbS0ph7NPC +qATMAULmjEohPCCL5+xPkwoYLimo/WwzsdXNWXPRhHYdPSSx0VTfB2JwrlHjTvcU +JHAU6DTnZfFWxvkoVUt1sGIilH95/yn5NNVB6XyMjOrpElA3OfZoo3XAGFQqmiCO +Hhw0SfWgm1PNJB+fMWToGyRG/QBisIl35w21fc/P7ZhMJ4gkuDEO3fBbtUhookVI +l2qOn5qe3jVrQ4eE+T7BnH62IwarRSclAoIBAELTFoh6ZQOcDdoe8hmMzvkX5lgB +KpSa7Aw42cC7VFQu8t7hdBgGktZgMK8bme2SLua7OpS+CaFpeve8xwMcS2xcF0k+ +eb+MxLK4JKF7M+VbL97gF/cJciZxemdazgbg2FQymbZt6p2O+F4W+lJE6z9PEnVA +Yza6t0cBEJ3RPEAlX64Z2d8OxkKiHqllFHBTy1t/3jbWckk1K1BGLvhrVUfCSQ9K +M6z2NIbLNiEuk++FwhaQIZUxjm466MZwbAQvk4RXE6VyO59UZKeR1RBrHtUka+Jm +6dVw41w3P8KFQoTN7VovMYRhqCQUGFIbLgpE0R15mnbRIE2NDtBgKXrGI1g= +-----END RSA PRIVATE KEY----- diff --git a/certs/1949-cert.pem b/certs/1949-cert.pem new file mode 100644 index 0000000..b982820 --- /dev/null +++ b/certs/1949-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTE0 +NTQ3WhcNMjkwODE5MTE0NTQ3WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMTk0OTCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAMULfiVs6gNmB0AfjNsXIygz9OQ8j39cPtAkvcnNDc/ses4mX4fF +vG3dTAB5DkRDvuZMKjPL8cK8kqz78ToXijMZAV6nXBHKR+cU+wx21fc58Ugc/poD +qu9voq7S46kLBOMXNGYp6xwWsCIVqSrwHZWsWkeEHEtUS14UwdT+995kVTpsx5aw +PW+dloAE4v+XY9kvsj1z+RDvb226iMTrm3uHJzbOtncbE8ap5sFv4R92BuPMOB6w +NvPohh0KZFE830kNnFrFrj9TEfz3yXy5zjae9LaNw/QM4sRWHIS1qd8VmAxLlCwK +KfVJDl5DcUCAqA4jM7rNTXpCKWrZixGecE0KHSelCqQ66uhODjMFJ4tL0/T03LIn +WtCjne39SdWHoG9CVxDeOAvVpmym6wH8jZtCN7DSLO2e+9t43bWgftNvrAcKZMaj +DXdiERLvqPL+WFJtdUwuYCfVuhaH1TNHMmw9dTYng1c7et2gcpEsRWZiR03S5tQO +rlcoxXUZdZi71DVDVb92qiPUea9F11vGL9l+81oUJUp7xktlvfzEyPeclfez5oYF +8Di2fl9vf0bTmebo3gJ0TxMEwRCL/011npxQegbLtGWuWB5DMrBB/ZQ8ibOMPTWa +WURJjCnUoDG+UJsNEKLajzWZpYBLPvtOiV91qBK9hCbFDDNjd67pjAW3AgMBAAEw +DQYJKoZIhvcNAQELBQADggIBALwYZdfHSuBTG3RsJbkOrAADjX70QYQzBC2w3qQd +T2DB0uhmGHyUjt70R19hZU9vDyYChKyoclg/3cKdG5bl26gRD5MZREnADdB/UW9l +ixrvCzJse+6sqvok1OwJvWqqUsZN/0rDf7CpPjlj8lTg5TV4SgMXkyostNTrEJxQ +Mq8Vaz9DkBCoYSNztWGs4y3v/ZHeP5g5dbqgVyq/0uTf7W35MRX0UPxpe6DgBKdY +21Tj4rpo6zkZ+X9lEQV1ZVdzXmtMSWs2KIHcSM9xPB8CULYmyXcCb9JW2sNqw2ZR +0yS51WhfzRUOtRRg8zSZ+Jr0JlCl99ChRVuTHfV3imWkhPt6bzQ5Dzdm5GbMllWS +e9wCJAJmu0PT7iAW/1RW4gwbqqFWZb6vcfeypQarr6SsI5g5gQH0VfMMJphv1g+m +vI2+1CkmIU1G6pz/Ax0R3viCQY6pAbtMeAMT8cTB+VJQWFjljzWJ6AJuSIdI482g +d0g7rnTth7SrbsMmdwXNgZDMqyGYDmvBBHpi+GgLY1ML+IO0NcHHwTQ96JidqeZ9 +RxLOuOXayJtnUFc8NIGxklinf4fbySRgLe9NDutpR8rsfD6/7NWfOJ8Q+Afb/m5Y +YPPX6+OtFmOZTBJ6n+D4hYkF+SDtOHrXqYcbvKRAbYaLgnmbLiXhbIFX+dxsZqio +NQyv +-----END CERTIFICATE----- diff --git a/certs/1949-csr.pem b/certs/1949-csr.pem new file mode 100644 index 0000000..a03268e --- /dev/null +++ b/certs/1949-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDE5NDkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDFC34lbOoDZgdAH4zbFyMoM/TkPI9/XD7QJL3JzQ3P7HrOJl+Hxbxt3UwAeQ5E +Q77mTCozy/HCvJKs+/E6F4ozGQFep1wRykfnFPsMdtX3OfFIHP6aA6rvb6Ku0uOp +CwTjFzRmKescFrAiFakq8B2VrFpHhBxLVEteFMHU/vfeZFU6bMeWsD1vnZaABOL/ +l2PZL7I9c/kQ729tuojE65t7hyc2zrZ3GxPGqebBb+EfdgbjzDgesDbz6IYdCmRR +PN9JDZxaxa4/UxH898l8uc42nvS2jcP0DOLEVhyEtanfFZgMS5QsCin1SQ5eQ3FA +gKgOIzO6zU16Qilq2YsRnnBNCh0npQqkOuroTg4zBSeLS9P09NyyJ1rQo53t/UnV +h6BvQlcQ3jgL1aZspusB/I2bQjew0iztnvvbeN21oH7Tb6wHCmTGow13YhES76jy +/lhSbXVMLmAn1boWh9UzRzJsPXU2J4NXO3rdoHKRLEVmYkdN0ubUDq5XKMV1GXWY +u9Q1Q1W/dqoj1HmvRddbxi/ZfvNaFCVKe8ZLZb38xMj3nJX3s+aGBfA4tn5fb39G +05nm6N4CdE8TBMEQi/9NdZ6cUHoGy7RlrlgeQzKwQf2UPImzjD01mllESYwp1KAx +vlCbDRCi2o81maWASz77TolfdagSvYQmxQwzY3eu6YwFtwIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAGX6XKX/0SLpwB9ajik7CBwb6vSEmyW6HjJCm/ZEPIgczE8Y +B+vhxewVHa/uO62XA+LOu7mrzMMX2a7tV2qd2y2eGki1hG2iwCUqgV8eHzvsc6vu +O9EvfSGvAE+I8vvLaRgOo/8pni9eTgFgAV2RO4ILG5LxgorhzpLHQ5Bo5RXShxOc +EJxQQexjoa+YunZ4FSHyYiMIgGxp2k7SR9Nsj7TkNuRCmQdeXM5o0UCzTDGmXGvP +XNkqeGI6YrPrrxVmXUL0YQ3Djn4M/NKrtSq9oX5oyh+aGJk5rDtb0ABXAvsHIrTz +KuEJD44858SeOv0/RXV+yWquE3wFPnvNQ4rdTon9uME8HeuKgSPkCZGdaeSenv65 +TqZ6SgqRVAPkwewjfIBWvKhmtLDM2dh9OlOQwa0z/fPJfGCBffw3Ao4Vgzol7iAV +r1oXPgQAU89QZLl0BIQUijiXqEx/+tSJo++9dhY12Ex1qzxuE8nAg0G/64OwEJgs +JQJseYkW4V1dW+ZWI6Bh/shng8+ebIucAEdAmTJlDFJ7Pn8iv0iH5xN6rjvcnzuM +Rhtl1V/Vhp2el6EizYhBTI5mR8+sFxBnJSqZaDGGf4nyDuzbTCXsVrlb5RGGBhgO +vonoAD4pQEIyY6aUcaGIr1FkiFSfNCwOaQ/tlLjJuujvzrClbwFr0tYZwK4D +-----END CERTIFICATE REQUEST----- diff --git a/certs/1949-key.pem b/certs/1949-key.pem new file mode 100644 index 0000000..acb69fe --- /dev/null +++ b/certs/1949-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAxQt+JWzqA2YHQB+M2xcjKDP05DyPf1w+0CS9yc0Nz+x6ziZf +h8W8bd1MAHkOREO+5kwqM8vxwrySrPvxOheKMxkBXqdcEcpH5xT7DHbV9znxSBz+ +mgOq72+irtLjqQsE4xc0ZinrHBawIhWpKvAdlaxaR4QcS1RLXhTB1P733mRVOmzH +lrA9b52WgATi/5dj2S+yPXP5EO9vbbqIxOube4cnNs62dxsTxqnmwW/hH3YG48w4 +HrA28+iGHQpkUTzfSQ2cWsWuP1MR/PfJfLnONp70to3D9AzixFYchLWp3xWYDEuU +LAop9UkOXkNxQICoDiMzus1NekIpatmLEZ5wTQodJ6UKpDrq6E4OMwUni0vT9PTc +sida0KOd7f1J1Yegb0JXEN44C9WmbKbrAfyNm0I3sNIs7Z7723jdtaB+02+sBwpk +xqMNd2IREu+o8v5YUm11TC5gJ9W6FofVM0cybD11NieDVzt63aBykSxFZmJHTdLm +1A6uVyjFdRl1mLvUNUNVv3aqI9R5r0XXW8Yv2X7zWhQlSnvGS2W9/MTI95yV97Pm +hgXwOLZ+X29/RtOZ5ujeAnRPEwTBEIv/TXWenFB6Bsu0Za5YHkMysEH9lDyJs4w9 +NZpZREmMKdSgMb5Qmw0QotqPNZmlgEs++06JX3WoEr2EJsUMM2N3rumMBbcCAwEA +AQKCAgBsG+shM4mNRcxSlTzd8+rZIvCIzOVaVk0sPAxZDQU4ACI8uvcM8iN5D8Kk +O8blE1pI1p8M/idt1bKP8EcgvUuYz25d9WrhY99hXLSE2Sp50zObgjT6YWrGpbRX +QOOhmqcaxV99ciBJr/UBLms7YLSKqx55QHWZqu0S+EaEy0NJpDjSrl4vQhDjDU5G +fOfinbgtsCqV5uxPK18yj/Z8PFx5QOT2ACJCZPvLsuolVXHppgMPtrtPsxTja78x +bcMugzxqw2n2r6Dzo2sqJPVKVlNayomvI0bQvsUoPaq18Un7WMisbkckhosQxf15 +IH2hizUpVI0MP5nzqxs4QZU4nHo2AkAI6+oWJzJWSONjQaLK91vtljQlTP9Y7xKq +9OLFL6SpEs1P/ssY8SwH5hwaPmRB407lH4fwwoaRfj+2zr1YleblzNGdRt9MzMkQ +eN/eEtfsDg2mBAlqYe9m7xf4aRtZl9WuWYtKwhQnjHcLVznNtSSBxVeu4GW1fNlT +6JpWma6lxZGRCA/ci2bxml1Kwmfgc9m/+lfDR5Swqh1SaNXcGI0RhMelA8qpkbVh +bRgACGQQq8VrDohW5khrsJRv1cHZD1y1e9D4NFUKPFrgJKjJD6iVtLNk5gjkqZdh +yULrjb6xyLuerehzn22ffIdf1QMd59L1s/ePc8U72E6OC7KQgQKCAQEA/aURLf4D +9VO/KzsTdD5jyYa/vY2+BcAdFcwwtwUYFyVAg5nmX2/qBGFseoLTew7bkkEyFuez +NUMMpiUKOJUtLNuvdaENYQbrraKawTJizL79LuZtKbvlBjVJfnwp7UQoXC7OrUI/ +eJOYb8T6ZXpeTEac8ox92WEnC6lsOZzMcR7N3kg458ORTSttWd42/MSVoo9vjrzr +1SYO3HH2nO8z+r982/gE4LKG0/gJFyG+fdIo3muI9oBFeI3SP+FkzvkuGjQydVt0 +0lXhUWaQpmTSUIR7Tpl7V64jJmYOAduMn1Tlpsh712cxAyLqN+qI8eHdxrj26m+C +Y5hqcC9UhlUJwQKCAQEAxt/iJoTwoQC6FvyzaWzOU95DZ42GO1vDtJTRDIB8v2OT +cuBuTw7ucpCKDtxM0VERPQ+aVMwfF3lJXDFKJ+YuDTiW8pzDsuygIzMPwi+EWUii +A+4fvqrARvAF9E2KuKUI8UcoVtY0MccdFot8xhZUQIFZoGa5K5fjRIoMdpMRKrYX +XJIquZViEhBChlWXTQNw1JB8cbAuTJPGgGlqzfatbFUuFoax4EoxwCFYNtmtJ6px +1zpfjEPTMGeZ58lL3IXI/iLhXpwtqKVmv4K+w1MdjFl6TTlDgmIl/x29jhZZ3KmJ +j59hBOn3eXXXvRdJYsNor9Fb85DIqsA+yIFQihG9dwKCAQAT5p2gdCuvVfDL3Yi7 +OCHwL+hfYP2lydr+WNUBpx6qwjt7l9mhZ1B/I321Zwpcv1+u6/qYHXnMFgSqDIHu +ypWOzXXIzugT0s0vBHEL834Y/mszANVTzvA7OncXu3o2qYBZKzsAERCVz07IhjX3 +PFClv2yVAzzkj2DW42YgZxMLVRVl+VitpoSB/4RG5s59qpbq+EISevQt9xx3Y2Gs +EoCLjfan85++WYOGohFkhTtC9/hI6zsFzC6nNMloRbD5JEffunSzDIfv8NkK3/c9 +du+hbaOXGSe6S2lqm9tBfg5cefbCzTwaPHh1/IlP9dDk2YnjC6Qj5LfgRJclUjFZ +kNaBAoIBAHzdfOSqe1rbVfuw1gTPaAyIdNHDrg/+4bWz6j1rPuf74UwzVY8V1Ojh +j40dDK4vtB8eeMvdDXhzknfsCp9aineKnFvfyY/BuhnfqXlG1FYqoG7PR+cy1l6z +vUlSllKwbBjxkIZVH5hRaBYLpl/JDUUi8d8gIAsa5nrWIlUgqZqjka9xppm3DUhC +JUKq4sBb9K/BuCC5eZhjADMH/SMsSl7GbJWAJJaqfuofBYAK1AkfnzJ/WBZ9T1AI +/DznylW/Oh82T0JT1OcaUpTTxmpk+Rxx4bQyzAxFC45OYgGgTvOZDuG6M/Qd4l/E +eZwjztPP1R7u2EjpEtUCt2i0qJjH4qkCggEBAO7pmidWfL2ObdRlpTRgFTpw2RlR +ygkFd6oW1huRSMUhcWMvJCpPAO01wqV6oLkc+ecJOeeGyMFO8TGKLIYKOfXDNIBv +moycIQSi8uJjIqzKnewTw/4akZwnEGLLy6yFU9EtvlnNDeK2/Pn6BuK1csCa/Bc7 +uDjygKL4d4WPQER8UPAlSOpfiYvx3f8Uf7vgkrMZlPtpIzhcbjRP7vHUucWCUToA +ACE1W4SIvR/43apzoJQw1yTrMbrhxXMytWcJyHy2oeuJwhjuk8ZetAfLPLS4Hdyd +YhwRIu7klAxhGFc4sLK/1zsPB3FnV0LG8kdkp3dhkLCj+JCB4T1p55ZY2bE= +-----END RSA PRIVATE KEY----- diff --git a/certs/1950-cert.pem b/certs/1950-cert.pem new file mode 100644 index 0000000..b7b1f5f --- /dev/null +++ b/certs/1950-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTE0 +NTQ3WhcNMjkwODE5MTE0NTQ3WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMTk1MDCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAMuRagSFtl6ef9yBf6J7F6kjGVDUqIUYf82FRSvxjRpq3SOinwYR +EiXeQ5+s+M96PxNJbUz7jBRpxJaIyX+PnTUsun8fll1bjHl1DCAG8nbZAqh3aZwz +atuyFDElKcR1x40qiIAtNfRFMFZdrT8Q2PTRS3YaSY2e2oL8WKc58cCvYJsl9YID +k5/vkejMBO1BOYKaxPz2CCM5NT1i+PxMP1Jjaco+WuVLzQ1/nYJX7WRX6O4o4PSS +izzNESq2xEMeHA71rwaI44qsqW4/QPVnyOJBaJ31lqSDpOVHzKTnbAu75KEd9N8Q +2BAR6qy59dLYKQUQ/LKsMeaJcXpUubnqssiQ+UM4sMCJsfkAh1/ZORRR7HcGxpfy +B/wqYekV18bvOGQtxZFnQujSxJ0Bww0DCRh6/tF7xMU3PC8GiHe1MHDe98nxN5oX +tx1zkF+ISdixVeAL/+P1X5nYV3/oHBKVe70JFtBYFQK8ST07ynPy2MfDokLohFcU +1iPqKFMVUT0jfP8lKGp7rwmPbon4u3b67JthBwWjh01uAi6WLnp5qtkwvNUGrNco +83+IO1jcabeiL+SLORKGEkHLO59irrlr1STZCe8YEpdRyR/1GY5flTaAcoTNP/I7 +yb4GsHYJrQxBc6MtPisgZ5v77ODLbZMW+1vra/sSW50L26MBgHRRX3bZAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBABGwtxxzhVSTb/0Ar07IiDagswZcQsDPxztK4cTk +p9zu14rLo0OwzUymFbslT1DQUQ7esxW62x+cqDU9MDYXwQpBMoJ/hhq6G6jqsmRg +f+oBF+hQPJpLyeXLziTkCZ9jnss6ThT9lHAUsgdtPdfsYbqyrm5LH5e6XzFFVASX +hZ4+QCCnBPGYZdwv1iEd0o7secH3jW0Yvw6roIj35FblSLMj65yfqr/44W2qNwxu +F21XDipISY90PtEmIu7h1Sc99v3GBFrTRiv0ZjGkNhatonWA3DRqS28e1kJyYeYC +tujYFAuhOQvNxn0gOrkVFa/v2pvaVoriEsSYaWBCikGJQOcbrFbW6Cof1w0qCs/r +/yUaZnUDlTvHfxV97LTJlrQE/v1dTmHG+g4Mkk6/82+UQLurb1Lqxd8V9HpTHVHy +B0ggG+NLF/Nc33UsvnbBynOKaYGgVG21FBn2gNnpkruwlnbjKwEMxVESOUpaGNMa +ESlE7634B5jdlHDMhtnttSX3zruXq3Xz67/P9kSI5brdD5lFB/Yu3yVz6pONTKoz +gBx2AAXDQ8w4fI76BeSVhuRoozVkikpSndYen3WBlT29Yw0ZH/eVHXxEZDlIPUKt +PWnyKHlooWIxd8SLzeeLZl7eXNGp9kdYzsX70tEuoqjTSxJcY/GVgEFBLSwgSpoR +Ipjo +-----END CERTIFICATE----- diff --git a/certs/1950-csr.pem b/certs/1950-csr.pem new file mode 100644 index 0000000..b63e63a --- /dev/null +++ b/certs/1950-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDE5NTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDLkWoEhbZenn/cgX+iexepIxlQ1KiFGH/NhUUr8Y0aat0jop8GERIl3kOfrPjP +ej8TSW1M+4wUacSWiMl/j501LLp/H5ZdW4x5dQwgBvJ22QKod2mcM2rbshQxJSnE +dceNKoiALTX0RTBWXa0/ENj00Ut2GkmNntqC/FinOfHAr2CbJfWCA5Of75HozATt +QTmCmsT89ggjOTU9Yvj8TD9SY2nKPlrlS80Nf52CV+1kV+juKOD0kos8zREqtsRD +HhwO9a8GiOOKrKluP0D1Z8jiQWid9Zakg6TlR8yk52wLu+ShHfTfENgQEeqsufXS +2CkFEPyyrDHmiXF6VLm56rLIkPlDOLDAibH5AIdf2TkUUex3BsaX8gf8KmHpFdfG +7zhkLcWRZ0Lo0sSdAcMNAwkYev7Re8TFNzwvBoh3tTBw3vfJ8TeaF7cdc5BfiEnY +sVXgC//j9V+Z2Fd/6BwSlXu9CRbQWBUCvEk9O8pz8tjHw6JC6IRXFNYj6ihTFVE9 +I3z/JShqe68Jj26J+Lt2+uybYQcFo4dNbgIuli56earZMLzVBqzXKPN/iDtY3Gm3 +oi/kizkShhJByzufYq65a9Uk2QnvGBKXUckf9RmOX5U2gHKEzT/yO8m+BrB2Ca0M +QXOjLT4rIGeb++zgy22TFvtb62v7EludC9ujAYB0UV922QIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBALeWfPHrDa748s89gFZXuUH/ap2+3G2IW0KUYa06TNWDLBwZ +e0Ky75gwIRfrp6gQRQc8/su+zKgPTA2WxHx5YbvPxMrxVzxHRQeg8gn6haiz78FE +jZ79g4XnhCYPRgQiuKDI0t96BagYfgr2DuNTZbVWJ08Wg+jAgK1GVpY/YewoAufF +qk0BC6lplT0v18aOvjWINkhd499bjBstkBH5u6Ac7FwHjzrBjT2GW/dR4lcGmvnT +0zJGFEE3We26i0uMoLC4yV6gc9OETLLVu4TUbn1qC+F5YZT39q92AIN73LP1AEYX +P2VQkwNQ3dMIFwSBBaGtCgCTYabzuMdFhMg7BfDE8Xy/LNkTxH9v3Uqbr24njxRY +VkoFBGEDV9D1aKVMHfyg8jjFrDSYpTcPAQKQThMxP4HqlBXVXTjRkT0ctvMKQ+cs +Gwnnn/bRJbmSKZffHtXN15sLExyuom3L69wAtlTdTfIGaOWVcAY82gaQOrldWjz8 +GuhBDpQNlFkEy5pWMyKr6WdexV+YMjufRTA5E2Q2JSztlVWDanpnpvLuC5ev65Mp +NTT74SOcPNtEOLa5VHnWfs1Oh7mY5kmXFhl0RW0p5YM0SsExkNJI5i3KPzJvAmIQ +Rr8m58nrnDnl3/vKBK2J4epCvtrOr3mpUEP0fWLaLcbidYXXMroD+OYeyqcx +-----END CERTIFICATE REQUEST----- diff --git a/certs/1950-key.pem b/certs/1950-key.pem new file mode 100644 index 0000000..3849ab5 --- /dev/null +++ b/certs/1950-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKwIBAAKCAgEAy5FqBIW2Xp5/3IF/onsXqSMZUNSohRh/zYVFK/GNGmrdI6Kf +BhESJd5Dn6z4z3o/E0ltTPuMFGnElojJf4+dNSy6fx+WXVuMeXUMIAbydtkCqHdp +nDNq27IUMSUpxHXHjSqIgC019EUwVl2tPxDY9NFLdhpJjZ7agvxYpznxwK9gmyX1 +ggOTn++R6MwE7UE5gprE/PYIIzk1PWL4/Ew/UmNpyj5a5UvNDX+dglftZFfo7ijg +9JKLPM0RKrbEQx4cDvWvBojjiqypbj9A9WfI4kFonfWWpIOk5UfMpOdsC7vkoR30 +3xDYEBHqrLn10tgpBRD8sqwx5olxelS5ueqyyJD5QziwwImx+QCHX9k5FFHsdwbG +l/IH/Cph6RXXxu84ZC3FkWdC6NLEnQHDDQMJGHr+0XvExTc8LwaId7UwcN73yfE3 +mhe3HXOQX4hJ2LFV4Av/4/VfmdhXf+gcEpV7vQkW0FgVArxJPTvKc/LYx8OiQuiE +VxTWI+ooUxVRPSN8/yUoanuvCY9uifi7dvrsm2EHBaOHTW4CLpYuenmq2TC81Qas +1yjzf4g7WNxpt6Iv5Is5EoYSQcs7n2KuuWvVJNkJ7xgSl1HJH/UZjl+VNoByhM0/ +8jvJvgawdgmtDEFzoy0+KyBnm/vs4Mttkxb7W+tr+xJbnQvbowGAdFFfdtkCAwEA +AQKCAgEAkB3BfbQgGTqC8NwpPSGB7bcwi/4R1DA1Ao4wG10l9Sbkqf7OMGBThcWm +AFxXxaMZFpFsNQz87dK3X481f/5vYJ7q5Wa6cBuJBs+rptzkOOmHrTbk6LWqGCEp +lGVn/XMYtEMBYiUfxnBZOTuWlEhcIG4vy0vu+LkWn5cBOFqYYT6H2S71cXcQwzC7 +DqGpd0Iu8dyaSy/vMOimXXA9L3jXd39z/L9KYHzajYzkOMwA/4IRINKF9//rXT8c +wS2lIpMlcB3VLH4rARkd1jQny9UO7cc6xmGApbWhPsUnBzPjVSdPRBVOL8HgBPh6 +OJBqjTuFRtXw4JlxtnFliiKDXjDfIkWtDL9zzxuIMG4Vrq+ERrfbN3n4h4SBtzt5 +TsyLXfPK9J8kk6g44KZOEevjZ1iJskly9RfM4MBx/OmYK+jj15w0L6EO093XbhNp +FwKofVfU3PZBTUY8VEXLn2mFEV9tEEURW7fm4ZzncquBrsMsQ5RXArJBloB24bzP ++up37suV/vNPD7IJTLvtemS8AipZ2birDA4Dl9gp1QawlJE179iqQ92qeRCwjJld +glNiCiNl9MSnj6Nn8JVvtD2kNY6BETChVrxEfKz+Ag9QfSafEmZEXD9ycaMDGjEx +hqZgN2ZWjDPsVfkxdIDF3gP6a5hSkMgi7IDO9uVyzIcRsCfJJVUCggEBAO1wpNVK +h2xyn210+l1qQ1Fovsohuhc9DfJNDhNNAvfGfl5/Hn2bWx0TmOP16hNEgj8hDLGJ +nZGITj1ZXNgCprea+oZPWG6UzyEAFoi0+YtJjWa2EpsR3bFp/xLNCDmAwOQ/E1dq +Aa2g3KlVkFJcinC2353CqpzhLK0zsChbf4ItaYcV8Sk5olTDw8Svz281efYFbFrV +tJD9fj/o5nrTa9oQFjBsoLlawpEbsOr8ovm2vyKl7rB2mTKWE9KMqlLSgNrcygrh +A90NphvpC4n/7bjblmDg/WcnYq/91rn820k9GgU7KNNSHZGklPJiiFwYkv5fh6Rs +GhDN6PYQ4oGyvCMCggEBANt690B/V3WLQAxvs0UGG2JPDWfO4s3CQ4rK9PGGXX+W +LdugxH3Tn5G2d1oHlUXIEcWmgF+ChZ8Ihu8gyLN6bSSy26u8i+bblPLavL94RLhm +utV0nWg4ogO3Cx1Pjd/BOnhQpB3nBY+Qpf0/bXwhNMByMZDiNlpizxrTR02twbc+ +llgXp6iJ5wKNTCW4OTKEjOGiyS/6ElFsxCdAw+2RkvF1mBkmW9EW1fMRT93CZX0O +Ao++DHkbmzEj9ILnpgnnu6MwMDzlx/QKpzktFmyG30ls7bUEbyc6g7Qq2257kjmo +VU9y1bA7mwRjCo8WnsTC8TYrYnE14RNVLgURO+TjYtMCggEBALaZSio9hqf//ltO ++rucXOjehNst1M7KRU9xssFlGEM0gzpoyCoQr6FM0Od+1uS6au/hmsFt859YE9Na +RexZHZ1VshRYMMnZ5vCaALphcweLKRM0MlrPAo7N1TvAMfMG8VCWsWkoPOIqM4iG +JNcyE8Va3d2VN2AuSw1oErD2rLiP8/fPCAeMKyrE4mkAS6ZamdB5mzq/3n0idVTw +507OCMNKW8Yhw/jHs5mkkgok/7DKuXML6OQMUQR2Jghl5RaMjEvEQBzdrvrw5C3S +qu0VxNvFA4C9hiMuRtbRf7DIpFtOghRDysG5BMRcra8512P8Ag9dqBLqj6EcuWuC +0K6tpcECggEBAK/YyZjnbg9DTkGojR1UU0RkyfzOCXGJn8vn6HBKk0bR8FPzbvrR +Pxvj8aQ0Ryjtry+Iw3nCfYR5tIKK5cLG6ANrOg1St1RzwdcB4hAWMBj+VdsH38XM ++iG32jPVtXn8uvgCxDshCZeI8TUCSJoXkMhPtd67H4kzeXOoq4xVFsvWXWafLTkf +o/KresMN4uXSxX1Si5bg6SRL3K0GevQwmmbTLNWZoh7YCPsCd9bZFa8oNm0se5nc +wG6SvCjVqHZvMCsDROLFx3qDvo9UzI6PUP7nQ1yw/M2VWEhVvhG69+EyOYe6HfNh +DkZpg+A442QKPHCGOg0yee6fZIuyzyYH+PkCggEBAN7cwKtVdIx1aZhohJ+GGLwq +S4f9dbVwKDkX5FUAsqvLwRF82MauHmJhagXoti9hEa7FdI3XeZxbrPiQUFpQ2mn0 +HUcR3CANaDO1YvB0Hj0mZDsSkgLROwUMOdh79imZOB8ptVNV+hw4r7b+AsAaXztu +RsclQV/Qx8kTjXCJOQydFjJrDet3VMLb2RPuAfeSLB1p5S7YjuKSR86v8m3dVkaF +NAB3LdZlS1WTwgtOsiF3d6WLEr4BbCxoH4ue7LSdIMcuBRemDWyLWTWW5XSlvz6Z +0K5NRC4rlhEpK7xxF6sjS6KsiViR+IsJcqE3KJANISLJDAZTrPMfvBlHejo/eIw= +-----END RSA PRIVATE KEY----- diff --git a/certs/1957-cert.pem b/certs/1957-cert.pem new file mode 100644 index 0000000..2e5bfa4 --- /dev/null +++ b/certs/1957-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTI0 +MzE2WhcNMjkwODE5MTI0MzE2WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMTk1NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAMXyq2d0+/vhaRIh2BAJLW3YR9zOfc3zvD/vvc+fB/7hMmwK3lug +IWEE7d3vlRd5+Ers6xjML3/9mOfXyx6rjYhruXwK64cCZO+uEmTi5qnmKhUcO7ie +/tbKekyxLcs1vDI0GuGkGq+BG0rr8XeeTJhyYHUamp9ePJMCDLcVinOVWIA+dD5l +/X8gDlCr6TAnH1WU5MyV8Q3KFVumepeWLWNlf+twvDKFkxKZhgo2NY8bECbR49zH +1weK2fIKTO+H0utStypBfzQkLRj70G6bRIgUqjTQOCeRgdppB7K3xXuLF/2ppmba +D/N0NxZuAmopp8GzmF4uGcHX6+XCk9SOXqhAntvGg1YPKq9CH5tbg5Nk0Ow1v6Ht +3gcqk8sqog8SN17puA6ecBHg25zMwjE3lC0914CzFzjb5JpV5hA4a5Ptb+jBOoYJ +6XB5y3jpPVaZ+GAde/fac3dqtZNZizWC6H18mRG70m47b7oiWrym5uXfbHH7CNgW +N5MS2E24dkZ3pUzwN6CdOGy4Jg9KpFG+BIVtOfI4UNEW/N7etZ8UhURAl4tfN6d+ +zdX3s0o6OJdikR9J0Wtd1gXu8GYTLGK531SPjmzwS8DkRbUfzkn7ifKGNhxQW/Ta +GbYW429dwQAiZqq1DG9ue/chroUBSLgejdOag7LWMBkXY3ao+mcBTTLvAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAFTKp5AVhU0gC72AJ0MXvKldbSGjZImC5lzxY2lV +f4cvK+y02aaqNNe80ZNncBwDHd3ecJIGxW2cjqTFBFL6kE1WXAUhE03+LaUeRJ3y +zLFikb/CVasoggCiBN46w5idL3aWDBXAmQBvN27A0QpoROmkrXfxr/ZhXEXqlGhy +oQuJUQ36TBFbKTNbvJz/Iqc9rlaiQ+heFRnqDXcQj4GhIAYvHs0rFmX1zvchhDLD +v8fTqXTgPSveynrK2EMuucrQmGMRoDzlUz61c6//GWY00cwL9mGJF8gbxLOQdBzZ +qRhzRCTMB2rL8e2MElA6xWo2v7Tcps7439UlC1aXCN3Ay2dcGkKmmki10cald1Ln +GKK/P9N+lClTSgD863dI4IMc+hhLW3HFWn2lT/idhQk2GwAYnAxUZLgAE7mUZitr +8U+59sAFhBQIQ9YOXrYs/nDHEh9y4K4vqU/RfX3gE9FocOYf0Cqn8I5/nJMMJtgf +cVlBegkXIoBvxPGFKU0NW6oMJBj4suDJ5LNzEgeU0tuZGDY11yjDhtST9mL1vdRX +C+PzgsUDf2y0wk1xKs02m6dJz4vyD6A2LyWWKM0KT87F5JYYCii2yUlEB9ioAHIe +gDQdHBsEQjJM7DtineztFndl26Q7rSQloFJT3a5WRt8H0IQk8nVqLPoYLCj/iR5/ +Lkwm +-----END CERTIFICATE----- diff --git a/certs/1957-csr.pem b/certs/1957-csr.pem new file mode 100644 index 0000000..6bd8271 --- /dev/null +++ b/certs/1957-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDE5NTcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDF8qtndPv74WkSIdgQCS1t2Efczn3N87w/773Pnwf+4TJsCt5boCFhBO3d75UX +efhK7OsYzC9//Zjn18seq42Ia7l8CuuHAmTvrhJk4uap5ioVHDu4nv7WynpMsS3L +NbwyNBrhpBqvgRtK6/F3nkyYcmB1GpqfXjyTAgy3FYpzlViAPnQ+Zf1/IA5Qq+kw +Jx9VlOTMlfENyhVbpnqXli1jZX/rcLwyhZMSmYYKNjWPGxAm0ePcx9cHitnyCkzv +h9LrUrcqQX80JC0Y+9Bum0SIFKo00DgnkYHaaQeyt8V7ixf9qaZm2g/zdDcWbgJq +KafBs5heLhnB1+vlwpPUjl6oQJ7bxoNWDyqvQh+bW4OTZNDsNb+h7d4HKpPLKqIP +Ejde6bgOnnAR4NuczMIxN5QtPdeAsxc42+SaVeYQOGuT7W/owTqGCelwect46T1W +mfhgHXv32nN3arWTWYs1guh9fJkRu9JuO2+6Ilq8publ32xx+wjYFjeTEthNuHZG +d6VM8DegnThsuCYPSqRRvgSFbTnyOFDRFvze3rWfFIVEQJeLXzenfs3V97NKOjiX +YpEfSdFrXdYF7vBmEyxiud9Uj45s8EvA5EW1H85J+4nyhjYcUFv02hm2FuNvXcEA +ImaqtQxvbnv3Ia6FAUi4Ho3TmoOy1jAZF2N2qPpnAU0y7wIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAIQEr/WYNTlys/Sd6mb3HJPml0LLD8xK/uQKLPDMPPDcbwan +V/Ze+Xo0pSuT0dOYGPBh3LJCzdikIU8HysQauRY3ntDdUvHnH94yT0cBduv9TIx0 +5U2njcNx+HBSAhoOGbBerKeixpkGL96A6Gb94H794KwFAb9G7SQQstjFTW/9nxcZ +83gW/PsAtmyjyNJsBbV4iZiZPXs+E7lulCMLaxpbdfonklNzvCkTBfkriiUzaZ9s +Jk0gTtQIQGh06fZA+ut2QOv9mNtEweYHL4O753YLpsvzjlVvqMnstqMdTwMAqoFm +9+zwAOXd2WiicelvBOuRW8iwlMnjjKiMVAU/xbPa1JCeLJiLb0LDjjRSaBlNGhOe +9wk7+ZUNxG+v+1Wsn4JBWlsfSlu/h0v9tdCBRe3wXFclvOuzQeeO/quzHNlK/8K1 +17gE6TQTfamYfU9uU6yBLowo43096yh9tAz8ocZiz8pmHsn+5DB0PGAg3YTNPhLS +np6TCj6yxVQ1IUdJXIXdK+eWjRLX6uTlctcI1CJjyWViLHsth3aCHESzNL4BT7Lx +lEozCBELPv5J3/ZJ0+muhz5jpAnxf9/U0CgqT0BDL50MUjxBXdhTYOmA6A2Vfohq +4kve1k6v4WM4kit6xdApSMy3mDJIO5V3cIUY/TmNxEiM+C8wW9b4DypkUmJQ +-----END CERTIFICATE REQUEST----- diff --git a/certs/1957-key.pem b/certs/1957-key.pem new file mode 100644 index 0000000..d1a342d --- /dev/null +++ b/certs/1957-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAxfKrZ3T7++FpEiHYEAktbdhH3M59zfO8P++9z58H/uEybAre +W6AhYQTt3e+VF3n4SuzrGMwvf/2Y59fLHquNiGu5fArrhwJk764SZOLmqeYqFRw7 +uJ7+1sp6TLEtyzW8MjQa4aQar4EbSuvxd55MmHJgdRqan148kwIMtxWKc5VYgD50 +PmX9fyAOUKvpMCcfVZTkzJXxDcoVW6Z6l5YtY2V/63C8MoWTEpmGCjY1jxsQJtHj +3MfXB4rZ8gpM74fS61K3KkF/NCQtGPvQbptEiBSqNNA4J5GB2mkHsrfFe4sX/amm +ZtoP83Q3Fm4CaimnwbOYXi4Zwdfr5cKT1I5eqECe28aDVg8qr0Ifm1uDk2TQ7DW/ +oe3eByqTyyqiDxI3Xum4Dp5wEeDbnMzCMTeULT3XgLMXONvkmlXmEDhrk+1v6ME6 +hgnpcHnLeOk9Vpn4YB1799pzd2q1k1mLNYLofXyZEbvSbjtvuiJavKbm5d9scfsI +2BY3kxLYTbh2RnelTPA3oJ04bLgmD0qkUb4EhW058jhQ0Rb83t61nxSFRECXi183 +p37N1fezSjo4l2KRH0nRa13WBe7wZhMsYrnfVI+ObPBLwORFtR/OSfuJ8oY2HFBb +9NoZthbjb13BACJmqrUMb2579yGuhQFIuB6N05qDstYwGRdjdqj6ZwFNMu8CAwEA +AQKCAgBVOHeQz+2YcGAi/U0fAkR7sQynRIMnAtM+F4H5e/ceRWfG2hsHCXa1ZUDf +NsFSXSGHaF6Cy417pfuJfP8m0ibZ3774Z18lPeOkyKWEp6c06DGf6wrPHiyK3psu +n20euqCuYH5ePJ98hbHxXIkVvaIuU7exUuXUzOZ5R/2faPe1cUur0reLEa/EZlGj +a4+2OnGkD7k9VyRzklgFoDPRRUd/LniXLW7otVcvP8dUaChA1x7qB5z5NVQfHCle +qg6bZTdqNq9C0vXnxddglTEUHWawy2zH1gkHB/8GwAcfazzrRmPqwnowd5s8bgE1 +d+E0QYDGxQJJMcHHEaWuwkmQzkZzmPJLpWD78IkgRAp1JoOiksOZM9Uzmh15Ab4V +PPUgDP9pcTY3anE+4Gu+v3ql4NMOC9mK+qIT0WRaKsdbVLA0W0NE+XykeUHp+t6i +3hEQ8JwSuU6ELjOQn0EkT5F8LFpElliC7phhB8JB7s7hDxqEBkjWKqUvSM6G+S8X +JFRbPgGjA3ue6MhSYqyrlew0d9NZEvJxYyroK20Bpij7OXpQRqeb/0RPDENeT88b +lLYQbUH3XPZBHuBUWrJRhG9oSiPPi1jHciO+HWuRzBhezI1OtwAba3Lc71hnrN8m +N8snHfx2Yxz6YHXV9c3TGGeLaJ57ZEXioSWYk5+HM0FFREEPoQKCAQEA9NdZvSnI +eK3w6zVAVSWVZx1EfwA7P7eSWtlf2Q51z3ZHk+lBW7j1PWb5Gj5rseN5FT3p3Dar +b2w/MFTmyEGjEfW1vccOwS3CkNMf0+fXclYHcJRPDMhdl9C+hokw6fY+P/+WO5V+ +9Wr2cn1HzppKYPZWxF3ygVpXvGHO1BikKmvx8aJPeWcXA6ILSCLjSYzybQJW3Yk3 ++0D8CYqgPrDBttKSg5fmWFAEtfc0UI0CpXJqyr9QtIDNASNFQzUsYPdAmRLiU384 +erVJQsF6UGh3/hwzmKdsEL2fV8cdSOgDnJtA3bhc+YJX8ziC0BzwS5O4BY6FrGg4 +jkHnh87IA5xqPwKCAQEAzvgyyQGRRqIwu5XBY4qq8MVbcyYUEzmQNeQ4NYKILMG0 +QmdDD5dHvToWsFoKbcYgcFq9pM+QNshUxGEeS708DTqhX3TmXjlXQQUSK4S9oGzm +/COOYDGO3ElpXTHDb260WQ1ahNgpg1d4JJyJ+f3qGxx32wHM6V1Pl3sTHe48vf7s +hv4uacUX8ajOGcDEkXwcmiXyiIh5DLv+iBg14M3FUS5VR01Gv3Pb4T8im5lC0GNI +neemYyp1VoSWCknvXzGARvDQdWkY9LH9e2vH/kbJALsZeMxZE+3eGaBYAboeyB+X +Ud4ZGoXFgoj7RGQsEC+KJmOrq521Ga8l1lJG9UkrUQKCAQBAlEShNlIgMpDnGSac +zsr3ZarZbLA0ADFkMQ2s7Ll6PRJoGxAYJ1LYHT77AxfY1czsI2Z5pRnWy9Bm6R3u +GBHw/MQxCD4GChHVrTop5G7ZQ4O22Ad5saeuEWsPhUQXkdGdg8aWdLoF9W6HiC/W +eK/Bn3gHV1hNcgzOLWYmX1F9tvcb6tnXha92T9l1723PypNu2T0cNcNETEGuKphV +sL2HgUcP2pLxHDoB3PA5htf515H/ZDLfSVHJSQpNzcqk0NKDDY4Qw++bvhFSwEGI +z+VGax3Y1+ATElDjECvTPQ8m0XRshuJPFWgpSPCH//oJlS7mmE79yIeSTiPJmGr9 +ONZ1AoIBAGu3186v5ylo7o4i8gTZvgAT53W1wssCsaCqx+pppnAM3MGWtttdc/Pz +UK22Hylk7assPvmRIdCxURToKvlmYuPLuQNSdzdhBp2LgxptOrhNFaby5n4ALQdP +mevsI3hSmMCkZ5EuY+S82IXNhy46TeaQWXz9oeVvMCZ54sg4HxsPm5Dip8tazgxz +O9lBb8z8WHKN/3258a6EBYRVfW0kC2cmAzJZ8NFh/nVsA5oSGSkWE0xDrWB9T5aY +6PIv6sqTm9zQJt6EtX1dSb07qloYAzNDLY2mZVIvAeI6hrNXZ//mGT59pnkcWGCI +5KWCsUA3TeKPC2EFcqUMeFfkeJPe4hECggEBAO1gfYcEAP0p3aGZ/OC1lxS6hU0R +cNdxrPsTNTGnpPrJh+qltIhyX0bgwiDh5eCIgx8mmJ7cqUWdUoB2DboVBZcuubGf +Bop7+/+58w/97b3uLPQSOTIG7tkT4X+GwAnDrOu8jXlLoLW51MV4cDb2cV1Wm8Lq +fzIdgFOR/0+yOlLGvZoe6yxpMLYv0xQp1LTlmnPHmvmf1w7oCyNBOJg+eh9/nr7c +3jog1V9JY58nOZ7Kty7GZ6P4tf3ozw3VrabjMA79LpNWHWJ+/fL7+4lFwu107f5k +1QSJjLzEGYWU5dKSB5yObVA11BxrlsxAAvlJgXMlnrGduWFgDq14UvOmZoM= +-----END RSA PRIVATE KEY----- diff --git a/certs/1967-cert.pem b/certs/1967-cert.pem new file mode 100644 index 0000000..614c6d0 --- /dev/null +++ b/certs/1967-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTI1 +MTU1WhcNMjkwODE5MTI1MTU1WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMTk2NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAM6w2x2WR3yPxUPARtM0/LFIRWib1kiwe3hgzVk/fzJOTdflz7JG +1Y/D+SOGAHFqVlqxXU7/d+Knl9DrOuizP6qV2JxfMtF864/jhSxI2GK7I6pvRhDv +UOSkfqtymMr0mc33+ko+q5/BMnRxpIpldZUWTLFOdiGSeRF29wXAWW1yc+S7wGjh +OikfD5U4VCTO+OagTfz1EWJgcep2bV53LyYVpbx5qOoKtRHoNSE8zqTBrJTnpC8N +laY2XKOGAgddYtjfm9J6mAG4fFS2L+a93IQdzDyJeLl7S4lD8QkC8Fys1YUd3tX7 +C4pmqIES4bTp3h9JAu68pPf/0KBAyVLEiYJ4diWcr/Gfvk0cib17anfhlChwHkbH +zeoLOBbT/LqeapaCnU7mTuh+UBxFiu3h8kLC+Ev9W6uyKIxYe/DQMMUTQeZqv8K2 +XXxSt6NV+ThFaO/bH754keqW7CJ6PlCIb0SfcCa/cne+YPEES3stS6DMaDbusafI +Ggbm+Tkbj81JAfr50ClVfWjqc3Hye1fjBOMCBAZblQJplusxdi80RxVX8nzmaM5v +1CYFcNMLDsbyI0fyrllz580pVNkN/91/JmcdS6vELgM8ij6vkDgcKXF8kyovhCPw +EJuGcAN9yX88pOim2JUoXCiwCcUn1ZxbvDoIonhBQq1DEP0j8Ec4UhK5AgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAL1ohmAcIo9CIIVOrNx6g+gc0cxHmP700wzZYUUS +2OHH8kcdEwdpZOub07TfexkRs22PXjjjf+lTUGHUd30kUaujdmvVQ63R9r3qqApx +aK1LB0wkvlyU5n+KSdtv4Z+WeCDeEgWkXoYmMmFhJor+fdYoA1aNTZqxPgc4g1QF +2tSgji8jgCJUUfHLk9ddzEnJGu6RgbPfM6xpidUaIY0gkoL0KELgZFlWmgs8jJTF +/jbr7UPc0uWTyGeYktFkGSFEQaevRS0qWHXzmXmg2cdzi4wcec4K7xKDFHhwabrI +ydhsMCheKEnqAMuqWkI6c4rXIVz4olNIUfPKeRasrt61F9fB5mSVGxF/0dZFJx5P +Yt9KrS1rFF+GaP1Vz9VHOlCw52FNW3olrD7rCfVZeOKwrREsFoB68CwO1g+ojEej +D2MU+swmOF3CCsdNRKMdZ6WdsVQL/meToVF0gtJlnoEypA1+glh62NWSfB940sgk +6kVXcOFxTrj2SLXtRUHUnoB0sPP6TokZ2JAmYbL43wycp5CmVHbkq4o1Cpbtb9Pt +n7UXYZCr36/uIRsVnJsaKPe4ga17sSsV1VYyDd3t0EzuZzd8uUGrnsSzuHRxMBCw +mZVQvRne6a8RBEdxsTcU0VhTKhKJJeYPt8DXKtVWEgkIhUiMh52WD1u4see+5GFt +BrX5 +-----END CERTIFICATE----- diff --git a/certs/1967-csr.pem b/certs/1967-csr.pem new file mode 100644 index 0000000..6df7f0b --- /dev/null +++ b/certs/1967-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDE5NjcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDOsNsdlkd8j8VDwEbTNPyxSEVom9ZIsHt4YM1ZP38yTk3X5c+yRtWPw/kjhgBx +alZasV1O/3fip5fQ6zrosz+qldicXzLRfOuP44UsSNhiuyOqb0YQ71DkpH6rcpjK +9JnN9/pKPqufwTJ0caSKZXWVFkyxTnYhknkRdvcFwFltcnPku8Bo4TopHw+VOFQk +zvjmoE389RFiYHHqdm1edy8mFaW8eajqCrUR6DUhPM6kwayU56QvDZWmNlyjhgIH +XWLY35vSepgBuHxUti/mvdyEHcw8iXi5e0uJQ/EJAvBcrNWFHd7V+wuKZqiBEuG0 +6d4fSQLuvKT3/9CgQMlSxImCeHYlnK/xn75NHIm9e2p34ZQocB5Gx83qCzgW0/y6 +nmqWgp1O5k7oflAcRYrt4fJCwvhL/VursiiMWHvw0DDFE0Hmar/Ctl18UrejVfk4 +RWjv2x++eJHqluwiej5QiG9En3Amv3J3vmDxBEt7LUugzGg27rGnyBoG5vk5G4/N +SQH6+dApVX1o6nNx8ntX4wTjAgQGW5UCaZbrMXYvNEcVV/J85mjOb9QmBXDTCw7G +8iNH8q5Zc+fNKVTZDf/dfyZnHUurxC4DPIo+r5A4HClxfJMqL4Qj8BCbhnADfcl/ +PKToptiVKFwosAnFJ9WcW7w6CKJ4QUKtQxD9I/BHOFISuQIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAHTqv+a73b+0YTehwwGn41aGndqtV4US87/RnxyOWpAtlvnQ +2fe1S1DXCH2vfXrqAhYLU92vyTOU4y9TWX1ai9EbQBDD2+xgcimW3QAst0ToL5J2 +n9J/1GegyvjnANKmV12ed/mXu4kIq5iVPS5rCna+rMhmE87WPvEiFeW6pG1vJHno +0Y8GSWkK5LkB4VmTYGstL9fDQsVhle6rCCthxPRLTU1SjFH2V7z7CBOVlKDE7b30 +BQd8zr4qMTxy9aLUUs6B5GIu5w4Kv0aiRHxM7fBxbbaFU+/qB4TQRFJkea8oWvdN +VsA2ysTVQl5zv1gH2HDieok+WJmz0kB6ZLIlCCIJdNY8K0iN//q7xVNRuOGL6kqX +0JjDt0BB8Gsznd+YA4g5tpFy2PliRWOqwvQv9S3jr9OzSbGokArjUhQlWR6xnyAL +kd5AJNnSUBXfwqEcMBpNJyqO8jJuyiUpuBxmdlHGxsqW0JOPZkL1OPh/yNFRxjeK +NhTWhB5Z7iI5uv68zoWHyFExge8l2FFM58jRYq5UuuIaYGWD8yU1fSOlAAq9hpVG +3tlHNPk/huxWuRx4zu+Tspz2TtXCCT+URw+JW6JBnK4+k+F/BX2eADfAbQViR4Hx +yDQ+2CMdxHNFd90pN72YhxdkN+tCqjSvn5MAR6yVr67UYFSQadUGNnEZSE62 +-----END CERTIFICATE REQUEST----- diff --git a/certs/1967-key.pem b/certs/1967-key.pem new file mode 100644 index 0000000..7f6fd0b --- /dev/null +++ b/certs/1967-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAzrDbHZZHfI/FQ8BG0zT8sUhFaJvWSLB7eGDNWT9/Mk5N1+XP +skbVj8P5I4YAcWpWWrFdTv934qeX0Os66LM/qpXYnF8y0Xzrj+OFLEjYYrsjqm9G +EO9Q5KR+q3KYyvSZzff6Sj6rn8EydHGkimV1lRZMsU52IZJ5EXb3BcBZbXJz5LvA +aOE6KR8PlThUJM745qBN/PURYmBx6nZtXncvJhWlvHmo6gq1Eeg1ITzOpMGslOek +Lw2VpjZco4YCB11i2N+b0nqYAbh8VLYv5r3chB3MPIl4uXtLiUPxCQLwXKzVhR3e +1fsLimaogRLhtOneH0kC7ryk9//QoEDJUsSJgnh2JZyv8Z++TRyJvXtqd+GUKHAe +RsfN6gs4FtP8up5qloKdTuZO6H5QHEWK7eHyQsL4S/1bq7IojFh78NAwxRNB5mq/ +wrZdfFK3o1X5OEVo79sfvniR6pbsIno+UIhvRJ9wJr9yd75g8QRLey1LoMxoNu6x +p8gaBub5ORuPzUkB+vnQKVV9aOpzcfJ7V+ME4wIEBluVAmmW6zF2LzRHFVfyfOZo +zm/UJgVw0wsOxvIjR/KuWXPnzSlU2Q3/3X8mZx1Lq8QuAzyKPq+QOBwpcXyTKi+E +I/AQm4ZwA33Jfzyk6KbYlShcKLAJxSfVnFu8OgiieEFCrUMQ/SPwRzhSErkCAwEA +AQKCAgBJOml3Mw4CuKEoHtA49hXs7XEB3exudnBYNtuqGhADj7COpDIQtH3nYIQ9 +LLWteQI9QYeQfHxKBhyIfT6ywQb2df53cFb912dR5EcDaI+ZcznwoVnOmCstxoXG +UmSFy2FOkuPPOCLwB6/Lh5PHIKkm9+6WBvldbZqNMHvWQs6sMxeSW16RCfLkLMgF +kx5kqBuRAgx/aYgONaNGcUzQYiOHN7Yvb18EBGUgggeIzhVcU+3EF8mYjhSN/caW +fNztJQ3nTlnTmXGPcoBCNwYDlxKwkCoS7JWkCWW6rSKRkcP84ZMIhYu0fiwZjcN3 +b2wd/5mdte1fDeDYqH6OuEVbmJwqxQVq6qHqj4r/iqcRgMNPJ8M2O3u3NOl1WEBP +zTOZWkJdk+uQrwSDrCNuWnaghUoG/70RQfX6ESHyIEg5YslMchm+fgxDOPGcf0XJ +bH5M7nGk4nE/3hy6rvBDwr3S8Wg/HcAkINc46U6UrtMCcpB71ZyI0hkvVgRgpJ71 +DR5F4W4YxY2Qvxb0Khvao5AfrAWq/9fnINSgku14C8APMEdEezDWLJnBjWxgrNUI +4Ls55ZrzwkAGvYjawQOKAzTO1gxVEMj0+vsBW5KkfLW3shbfjvXMpkFicirA8ZTi +CO1x4gfDkyhVgdsujkEw6HIpVMRZ9jQS5DR2aMT0rk7DKU7OHQKCAQEA9paDh1ej +1fmHSKD8Gg7dmTMI+uab6nCOKYSjCgJtm4u0/VxFVcgHw5MG7Rcts72OxExAmrCu +iKhu0CuZfWHrxNOmuZAIBd1PThXwoeWGpEN2/EdcY5KpNK5/pkD3lJfY5a3mVGQu +Ef0grWfeFy8wM4QI0DCKeYgr2jIrY4fK6AeQSRHwIlbCqYWA69XZ+L+gcEHfuUwx +xnPj3sPnxdbh+MXUwV2sq3D820ftdKvdkb52bWL/RbcFUDM+mpiRmO73Qh00wIIq +Uuin9+L5WlWaXAzwpgQl79YxQ8jOBSJId/CDwuUaMwr2oAMDpxTUeA9zcgbeDVdN +WuHtB5nE9mfJhwKCAQEA1pR+z/mBP/o2UwakyDo1HMUJHNaGjQxGX8q3JhodOnxy +jqVq3miSgfen/DajBOMwUgYUD+iFi7cNZlRbqAb3QhR+vOuT9GtYCmq3rD2pv8TM +H2t7N1AQLkoWTC7EXCPjODIjpymn26aNDsDCWJhn14t/ZyEDB/GgYiyRjKR+Wi/P +kO5QK2zpblfVLp3IUDJ2HmZxBo13TYu3MAf92ANTtFINFsQrnzXVhfX8Bt3tPMAM +0Db0jXobloMiWnRzCo35dqxYV5uzy2kSVLtoi7VTZZKh+DeaNBQk/qk95ZckEzLh +6K6Y0vnvghZmMbMlEPW+w+DAwXiot2zd3WODgKlRvwKCAQEAxgNZvY4n90S4WR9F +MluroUE1Pd1/aMRXtIlZL0mB4P1QKoA1AUxux6NCVZNeVM6sXX9qBY5JqV2wFqRc +Ti4a2OSpJqu9dZAhBfBiWm9pLnEqlC1tyFvWWoKh6MyUw5MoTk/V/QCxaiqdWgJl +erKe/09QkHXaTPuHU2EkLHm3+5lPSQ4JilmnWd/mBfulXLXszRho4nCIK/eWDaW9 +ccY7kbyzO0/Qv58svZ3F1gHJHCcZDIAJw17T+nIcHKLVkDyc+09etBQSjp9bepie +aecB3Fdby8Ta/fw/dVJD9iVwkjfmZtP4tPJh1150SXBVqc+mgfN3zrjDWm7AG3Fk +lAYF8wKCAQAZfHmzagcX+jgJlHht77vvNtfmPPSuPA7/wawPMnrWP4G7v5n54KHG +HgwtwK+MHQ/YLjCj0xJJjexhgxN/2ZP0nUqQVcq09Sr30cUPCCPpSw6TjMiNwUyq +stIDKmrYJssOGaZybFgrlpSac/qhWzi6OS9gqGMbxm8uOezvr3nybEtTA3syLTVs +jbIcX1EzdUriQXibNqI866NOaSSVS4/dkwFK+vHTbyl1R8ovZpyO4qCi+mQBicdN +ETY7WClxz3sZxU6Y2T15o3kx5zB7p4XIQqpKORBvrxTVynQ3mMQII7sBT/uG03jH +ErIApS553TZTPZanZBVl8+BGM1OjLHkxAoIBAGlXsPFzabsqxksESbDtdv3tLeU4 +0RXY/AGNpOwBbjnA5ffvlQQ4/7ZvWvAkOG4h7Rwz3NTcm7LEv2ppP1EoqDE7ecSn +TO64QvNnBEPSxIHzCeu1fulaWZ3DKMfrNRLR9oP0qqu9QiVfxmBuiKfW864SSkQ9 +5pyQxcomRd1kjgP9QCB4QqKoA7DWDYN6hswI5j/0M7O+kmno75h3iNEUnGKzQvN/ +A4xTJi/GKFMdAJ0DIUKfS5R57co21mWzluYcpZfDs043E1nk9EXJOnb6IAwJaogx +fg9wiIxN/vyFbn4cpvE05GFOrK5VsBQHZ+0CDK4TVdLfak/fyCsuS3x7Qj8= +-----END RSA PRIVATE KEY----- diff --git a/certs/1977-cert.pem b/certs/1977-cert.pem new file mode 100644 index 0000000..b7207c0 --- /dev/null +++ b/certs/1977-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTMx +MzMyWhcNMjkwODE5MTMxMzMyWjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMTk3NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBANzn7cHWXUUMAfzfs98LDbaBUTd7R4Q1q47e2YWuim3+StEVt8TD +xt0f8TlDmvZlEB8PtczupT7qLFK9tXrEHSaKgBTK79SiEF6hQzl8w51bjrnbqchf +5Y5pt//FFm+L0GKFxLJ6psRTXcrZtJd0rw9zItjzmiuLv0hyTnEOfdxhSNFWYtce +y3j59eQSLdvHIZVBP6f4ejRRZAeW9n3OEUIBiQ1u37I8O/QI8o663PeNcQ2Ya7pF +GoxaSJA3r8sfOR/AcBrE6xPAmwvOfITSuoLcE6o2qcElxUA2b7DhArR+uVkfshe7 +gpoXoNxkfZ6oma6F9Hr9tuAvLAJq13sDC23kGpRMV6xIVO1dWSe+fb7yfF3Ne7HJ +VT16iG0kIHZC1BN8Tu/eflO+dPZeShp7vR4wDTRWW/dy1nBGqzNz5+QaBRyF2F1n +fzwvJFD7amx8zOFtAwnsR5PS6nq1SwzmlsA0Zjt6K87wor5iEVxbGvesrIp/3dso +e9mjrj5Clbemeowi8l5js+uQsqkB7iuLz4DPDDX1SXdEjyoTPVN9dW35zqarV9Dl +qwaZxNAuYURFNjaV7rUs2kVeroBF5GXZXqOLPIdwPqLMPdWTiua4k5CMozn2FeIG +QJBdhlZGCOOqNC2dlOUuElOs8csPyvEASrykXMAh/iXFB0GRoNpOfTARAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAFGWL5H4S8uvGS5Ia+4ov8k2vjEWaDiXolfadqSv +bQzo2JHBar53lOsjw6WW8VBtJlR4z2Vd7wWAvoVTUxVZUFJ6oi9mjDO1iH4Q65r6 ++acEkxs6CKzdIhEuJpIPGCdBcq2tJN7qKTOos2bmcAPbXyRZS77r1VfCcO4MQ3cm +2Vj+68fYwqZroy4ryBgTI4eH6O/Nlc5F4Fd30AWj0UPC4bJqoQ9M/VNwlPTqv0Cv +NxNd1FShB2Db4Q7HJkyYqxb/5qW12Igdt1FVAyPf96wWFEWTWq4ciUBTTYEx92nY +hQbQoXSQ+9yjmQgyYEn3Sz/sl9Bbf0p8j5UKtIYuWPnirjXt7ezcXFKyPlJXXaJq +RUttiizP9+9EBUwV9p3vcT3bXX/VChKH/LRR/e9j4HENEvnKB9y1opWazdP6TGr2 +ZzgYQs6tnWkh1h/R9TeO0zyo7Z3CeupOsxlPW7WxFnqnU9cJMRsqo9fXH8c+jTgN +04jsJ5Kh9EYcISNwY1ivaQ7TGLheAv7JqLvXg3vh/3x0yCWRAb3AZ9VQmX9t7ku7 +IoE3b0UM3UMh+qIomSN23wcPnGOQ4/ZvYugPMAOMKXrpkYJ02u+Dxx4aY2Tk45mR +i3qC8ko7vcmdTLirKwy0WcemAmWtGlaOzgbnOUITV2+pouAx0xjT+zaxhW/uRsTa +i4c6 +-----END CERTIFICATE----- diff --git a/certs/1977-csr.pem b/certs/1977-csr.pem new file mode 100644 index 0000000..c1e384e --- /dev/null +++ b/certs/1977-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDE5NzcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDc5+3B1l1FDAH837PfCw22gVE3e0eENauO3tmFropt/krRFbfEw8bdH/E5Q5r2 +ZRAfD7XM7qU+6ixSvbV6xB0mioAUyu/UohBeoUM5fMOdW46526nIX+WOabf/xRZv +i9BihcSyeqbEU13K2bSXdK8PcyLY85ori79Ick5xDn3cYUjRVmLXHst4+fXkEi3b +xyGVQT+n+Ho0UWQHlvZ9zhFCAYkNbt+yPDv0CPKOutz3jXENmGu6RRqMWkiQN6/L +HzkfwHAaxOsTwJsLznyE0rqC3BOqNqnBJcVANm+w4QK0frlZH7IXu4KaF6DcZH2e +qJmuhfR6/bbgLywCatd7Awtt5BqUTFesSFTtXVknvn2+8nxdzXuxyVU9eohtJCB2 +QtQTfE7v3n5TvnT2Xkoae70eMA00Vlv3ctZwRqszc+fkGgUchdhdZ388LyRQ+2ps +fMzhbQMJ7EeT0up6tUsM5pbANGY7eivO8KK+YhFcWxr3rKyKf93bKHvZo64+QpW3 +pnqMIvJeY7PrkLKpAe4ri8+Azww19Ul3RI8qEz1TfXVt+c6mq1fQ5asGmcTQLmFE +RTY2le61LNpFXq6AReRl2V6jizyHcD6izD3Vk4rmuJOQjKM59hXiBkCQXYZWRgjj +qjQtnZTlLhJTrPHLD8rxAEq8pFzAIf4lxQdBkaDaTn0wEQIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBALqicSXb7BWqmCd3t9PScQjIHWcZ737n1Ca2XTbfYNY7wL0T +XexUXI6cXSg+BcEFxWNWtuEmDeedek0tE5O2Xd1Ktj8p7bGM/CWiEkFQNB0OyAG4 +WkZgLBsHz62iWkd7NoZtjPX0ulRQIoYVgaQosNzRTq9kOSkDxbY7UiXJ5zJWeMKz +wJZF74jTtAHk4Wb33PFpIMS7Qk+sNsOahq10CrBUgsUgtd3xq63DjmzvAhfyfHSz +H/Dee4X4ehcdOY6VdJHMYik0mtkpFB00PushPeu2Jjagg+nMKrxlnN37nUAWWvQ+ +Xhki30bV9i0f+owFg7ifnG8m5QHaMcKYMpHr5ZVnlPbNNnJcQC7gKnD5wcyhfex6 +Id/0Uz22uvU2bzd0Zgw2uYKQFRsNoY8WE21oiKCxiiuNbFTpHfjgpYyT4ptKEZ+8 +M7QvbDlV13BGpZHB7fcn5NT0W8gfQX8Efph76yiJBeQEQfpnS0O91BJEnHmU6HsD +w8S/xYnDHE8G3OUs+q26fpNRLIrDnLtSkNsAhDhtMEf52u7W2xpElYb1ow3c/7wZ +29zN615EcK0U3RQcyhwqP8qvTk4ojCOOp3+7597ov0uGORzfwZP0dbtkA9i8v5Nc +mRXWN7S3sjBlb1obE3UhP1wM6JcNjTdK023NpKrt9+Y1nvPSNCsFFX125345 +-----END CERTIFICATE REQUEST----- diff --git a/certs/1977-key.pem b/certs/1977-key.pem new file mode 100644 index 0000000..9fee4f2 --- /dev/null +++ b/certs/1977-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEA3OftwdZdRQwB/N+z3wsNtoFRN3tHhDWrjt7Zha6Kbf5K0RW3 +xMPG3R/xOUOa9mUQHw+1zO6lPuosUr21esQdJoqAFMrv1KIQXqFDOXzDnVuOudup +yF/ljmm3/8UWb4vQYoXEsnqmxFNdytm0l3SvD3Mi2POaK4u/SHJOcQ593GFI0VZi +1x7LePn15BIt28chlUE/p/h6NFFkB5b2fc4RQgGJDW7fsjw79Ajyjrrc941xDZhr +ukUajFpIkDevyx85H8BwGsTrE8CbC858hNK6gtwTqjapwSXFQDZvsOECtH65WR+y +F7uCmheg3GR9nqiZroX0ev224C8sAmrXewMLbeQalExXrEhU7V1ZJ759vvJ8Xc17 +sclVPXqIbSQgdkLUE3xO795+U7509l5KGnu9HjANNFZb93LWcEarM3Pn5BoFHIXY +XWd/PC8kUPtqbHzM4W0DCexHk9LqerVLDOaWwDRmO3orzvCivmIRXFsa96ysin/d +2yh72aOuPkKVt6Z6jCLyXmOz65CyqQHuK4vPgM8MNfVJd0SPKhM9U311bfnOpqtX +0OWrBpnE0C5hREU2NpXutSzaRV6ugEXkZdleo4s8h3A+osw91ZOK5riTkIyjOfYV +4gZAkF2GVkYI46o0LZ2U5S4SU6zxyw/K8QBKvKRcwCH+JcUHQZGg2k59MBECAwEA +AQKCAgEAioJRrWw/Zv+0b13EZmGD458J0YPWv6r3Osm4Ef3yhi0ftCGt7A3lLtjM +Y19kVoHfrdon36ryqZQi3m5cz/EPZg8JaAAmiGhlYzAx+mWkMZIq15ZHyn92a+kV +maV1/9Lmgh/lyRLmZcrv0DTY6u4apdFHVEjJrewdr8scK/8uI3RMOBW2O7PvWJdB ++hL79gXRpMgYpbVCynMOCUQ6oX8Hix9zU5zlXdgur0C89Yls6zsgW6nqQgz6LG6f +eO2xp+aX5rS+lcpKq0Pk824w3QdUMqDTI7LKlXSdTTnUpk8vZwTeKmeZPxAvP3b5 +QbcwnL6SPb94H3XdqItrSMi8+0BZdQ98dtjcYzsXkzvMiztuiIihESb50PXpvs8s +wYzjGraag7Aoby8vbcaWLF3JUZty9FION6o43AMcLrvP8exK0y20P6oiYID179OP +v7EC5hmfE4IcWNjwsOWGGEkcMC+8NyIgcclF4P0wuOHXDELoyDILLS3bFUuqHTir +/yFdcqHmubZQwt3beg2MVlLDqQXRTzbcjn7MRGiW5qtXK2htYIHq2uDBU/Poaar8 +nhyk/YlnfsQE89LL/Fn/3EEbM3BVrrZpE3KaiIU3wtHbIpnH4ho9GdCg04K6FhDZ +N+IiK2MgN6VYpwYhG0rpmKL+TXxhHRpRmEEzSxlkPn2kBpRKe8ECggEBAPLvsrnG ++9TPaSEbJDDvqENg6a11xQHY5FWOGg8N06ijm5l0xmSKEZyQlTVrRt3cFci9ZNh8 +OVmrzH7yQCCEm8PFBm4IPC2IEhlLdyYA5MtMp0m8wPpiZZqTUwfbgJkFawQrmalT +idJ0cvofUZ9z8S7bL+TC3ahwdCQfJmw2KjJgOEzudWRAOM6otsOIWGDZ7KyqyJ1w +wTpz7iAtHznOxxBfz44yTJkRl4KWTwolmMRa2JcDPDjYv57wbXijDJOYbs/LXtLb +Lic/kLTXY/k97GJ21w+z/+meOK7X4H5NcNH/9FWD716BOsn0rmWSOfRy++NwyGNh +QCeOYNbJucISOY0CggEBAOjI9QbLn678xIgy594I3j8CLIfR8V28EDlD4glOfqhP +p0qquBG5RHZYYyDpGOnhbteVhmymtl+WoVaLorvld2HKrlzHKsy6LlZXhbmV8UZd +IhU4gsaGf8sZSwTAWsNcT4q9b6RKXPjKZ0zVUkPoJWYypS8gc/OGqy5psJyOU6s3 +fGYV5RG0F2CWhOB2jBzQt0t/3ts7GVbQQWSWAXr+I6Opa+lpd+gLzjZ3cAOLRlbi +vgoPiEFh/eyfG/D39PLiZWZXtD3oqCex/VcgO4VuPNwBWYT0b2JmOzSt24GlL5QG +tABSErNIOSH0itsroRNHD1qVrgPEkTU2V88vHgE1tZUCggEBAKGyY4594D7MctgD +PbqIucFnLwIyohdRquE7PSMJ+/iCNV4VuLtQntpL7dRpe/jNtX4weYASZwXFcM6K +JZ6/RQIwENCKEKvppspJTZvw+lhKxAozZWsCtUgGiTxwoI65aXqUHqnynYiD08eh +su1j+YNLhvxHq8uiVdt5FFTwVHPFUZP7IA3DJUyARW2uQcztIDfpULBiTWq/oR6v +idorRJoke3zVA+DaMbNMon1Jev4uzXzuPVZFBn4e325tcECJNDCA17OXCYg8KfAE +cVmDGuSK3yhnkY2Ir4fIznaiytYr/BAzSc7oSx4DC1U11/dZ1UiUV/y1zULG5LPx +/v8qrD0CggEAW3Ash1nOxL63OES+vYHAQwHImiVGaSppOQVIMZ2qtNRtAzBiE1wx +30bC0XeeeKg7kOVEI0OtGYkioMtCxgnRxhEGQp1dW4O6leHVPlv+pUQKEknbXL4S +TqYFyL0CKgEFoZrd0qv/Lx7aStz0boYuwqEcL5HQ2hTJAvczD5v8k6G89KCfFUAn +eqJFWaJXUS5PAZId6QGi523wceFWfYh8WVpAcDQkjHquqshpsIqxu4lfWrZVMFGc +m6i4IgRULF/vsq66tyK/grAwsluP5c6yizzgfBBD/GPp17x/H8LSGJQ1enbCr7er +8YGMVaEiqV7dUhi/fO1mmH9bKJ/6akE9rQKCAQBeQiWh/7s5YNH3r7Zf/lq6f5A9 +qQgTAKnSQ7wYXchRTqqhHOpiU63N43MbrHTsnt7pyDMwMnJh/h0Zr6jAXKVHJbHM +dxPEODYB4FtRMQabtMaSsGcjnbro8IgqWB17XtG3ckIcshRxcA7S1GffO3wXUI78 +eHKDeZH5bq+VacVlPMGFcMfcdJ9gTTjzMVgCoVhXq+7HkKjD1zDzm7vnLt3VysLf ++O3l6W0Xfmy1e/hFGDOh9/rRa6eBiG21iKygf9kz2ztjW8UpkNHXGZj7qJsQeLXi +7wlxAX8aMM9y6UWBrNY9YqeHpMCfrIPjQuc74BWPjfg9gGTKZ6KZfXp+R5TU +-----END RSA PRIVATE KEY----- diff --git a/certs/1987-cert.pem b/certs/1987-cert.pem new file mode 100644 index 0000000..aba06f7 --- /dev/null +++ b/certs/1987-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTMx +MzMwWhcNMjkwODE5MTMxMzMwWjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMTk4NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAKgv/4fn6pew9/XDpHTfFWB+215me1h2iGqnbAXOpGJnGqW68uoK +QlGsd8cAu6RN9w2xFilzupIw7/qkWSw4owJax+VMKYVPlb7yaddRn3QMipcLCvKr +edqUUMy0EM9DALCaCYYhHv+Blyv9KLpbEx16qV/l/Haz1zgVqxZv28UvEH+1lsjY +wQ0qR4FVVPjXELe5woVBU63r2NnCwaueUbdqOFD5jXfeMUeZLiU/qs71Nswresje +C9Lxc24a7l+IdVHSzLjlQ210rvj0RP4lnpCoBfYM6jul9xef/g6EcauVJKX6ndao +A3XBvIZyta040LnLAwv26PWT5nqYNTEaV7zC7RuC/WwZJfQtw4Of94xYRDfWs1zs ++8zKc32xds+9b/xXJTXRbhWG1hLeDdtVU5UAMHQRZ/oN3Y874Un4D6AJZxTwcxdd +RS2uF/CCInmpezVK/np57+OCFbAI3biLbgDoNmOTK+MVturQrFdE2ywwj2kH3GJR +z1DruweP20s4RwGadlPYQQ6V5MwKz+ou/KiHAN7TOz4fBa/bXRA0CEdFiji1Tj6N +WUFLULSdS1gZw184GjhNGZueMBu4F8AGclLR/knfcE5aCT7UsTwNYDoBaO0JAWl0 +JWU1IYoeB5kPcheqwuRxERqG9AxjFF6pu2EVf8OPVoYjufpN/D76jO/DAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAE/HTSc+ndo8KsOOGvVinaCT9cnJUOBcJKRqoLuR +z69YVKbKyiPiOOO//NmBncxERK4SN4ibDUANLnFrNSP7cdVwlfbxrABmVO55lop7 +enPblOMoW9PnE2cGLIL+klpdjN6chsSBx9qq2t3kL2WzQKCgV97U1HgvbUlxwXYj +wZG4L/ZNffqF9kSlJAOzrNDE5oi2SkGzqW1YvG9fMUZFnq7FRn0SImIaMJmFvbNM +qxAl2h92sTHX8QRnryopQPuRlkDArFE6nN7gBoq8thSShYJV3uCCXfgm4hEXGs13 +y5OIVJyBnT/id3u43782jvovaJQoclcGi9SmcF2FLlc1bsSOLljIunUII0lm/bNP +0MKDKuAZlKEq+HLaWkjVCiaWcwpf1KpJQFNkunjGLc2Wqw64ihOYGKVkTtegV1CZ +mpQInZHTP2y1wkTjGR71QBGEWKUPo+KHYBCUnPsZvolxt8HEK+AyXsfuUzxCkDyj +rtmG+DiIdXSuaygPWJ5Ros3379WMQ3QCJQmFLIeWpROKwsg9zGlvRntajLwe3t7M +y2QI0wDF4mY/JBdIc+lHK1vWZM/B4gaqyP/+qWlR70cbATzTfXhFhQUg93hwkzLN +eh29bFxFMTppENoqT5P03S8G76fv1qjuY6tX5fhfRiA5qTb2uF6/R/qge6L77y5s +fTKf +-----END CERTIFICATE----- diff --git a/certs/1987-csr.pem b/certs/1987-csr.pem new file mode 100644 index 0000000..1602f85 --- /dev/null +++ b/certs/1987-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDE5ODcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCoL/+H5+qXsPf1w6R03xVgftteZntYdohqp2wFzqRiZxqluvLqCkJRrHfHALuk +TfcNsRYpc7qSMO/6pFksOKMCWsflTCmFT5W+8mnXUZ90DIqXCwryq3nalFDMtBDP +QwCwmgmGIR7/gZcr/Si6WxMdeqlf5fx2s9c4FasWb9vFLxB/tZbI2MENKkeBVVT4 +1xC3ucKFQVOt69jZwsGrnlG3ajhQ+Y133jFHmS4lP6rO9TbMK3rI3gvS8XNuGu5f +iHVR0sy45UNtdK749ET+JZ6QqAX2DOo7pfcXn/4OhHGrlSSl+p3WqAN1wbyGcrWt +ONC5ywML9uj1k+Z6mDUxGle8wu0bgv1sGSX0LcODn/eMWEQ31rNc7PvMynN9sXbP +vW/8VyU10W4VhtYS3g3bVVOVADB0EWf6Dd2PO+FJ+A+gCWcU8HMXXUUtrhfwgiJ5 +qXs1Sv56ee/jghWwCN24i24A6DZjkyvjFbbq0KxXRNssMI9pB9xiUc9Q67sHj9tL +OEcBmnZT2EEOleTMCs/qLvyohwDe0zs+HwWv210QNAhHRYo4tU4+jVlBS1C0nUtY +GcNfOBo4TRmbnjAbuBfABnJS0f5J33BOWgk+1LE8DWA6AWjtCQFpdCVlNSGKHgeZ +D3IXqsLkcREahvQMYxReqbthFX/Dj1aGI7n6Tfw++ozvwwIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAF5ACN+SUs5YlWJRAMMKm41inud8TrSmZkdYfkAIvO1CcXVj +8QErSQNcV8SyQw3ApfZ9d9auFtq5/vhNGFK7/YtvTqImg+uq6/MaM6GMHxe4feeH +vJl1Z6ahbjbAQC3zxtZCcOVT34ra+XOmYYo+c8ezXqRK2oCEku6/kMdfm7fOnagM +hLORlVuf3qq0dSQfGFus/nU6HAxe6iBEpiEK092VcSc3SEMw/aK2ahKdQQMP9OH3 +miuLJ9ltOTB8EkncZYmyxtP3uI52hXcIbmLHdKmrmhEK2vqW4dAvt7yQ6abDdd2a +ayg9LnPdm9sxuGFs61XXX3RUEWsNsG6F9IyjeUVmSsCOkhuOpBFWlMxNnMUeBAXD +N8A1fMJw9OIspsWQYWaxYIVz7lq8Ajs40xjHmtz6lJyk47rmtne8dT5DHE4+3lg2 +czNt0VoJNQMGWqVPAkzEwC7tIehsHg72RennVaOHKHW5yQ+d5kXqNmcBsvKNhxy0 +xvNgvUXIoJg85OwaUwmIuBKBWyeot57r2TErDrll0Qn81AgsIYIjIpcVT+TE3/ZS +cXeYSWlhYtGZ/m+N3OhPfr5yE0QVzTks7gTbb2b6H5kDAv1xWwjO72nxFqgbRYTe +g/42qtWbVYy/8vmnNBQ+tBd1kYU65Ip+IzqNhhGaNMO8pDmZL6xEPWPDfJbs +-----END CERTIFICATE REQUEST----- diff --git a/certs/1987-key.pem b/certs/1987-key.pem new file mode 100644 index 0000000..8bee056 --- /dev/null +++ b/certs/1987-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAqC//h+fql7D39cOkdN8VYH7bXmZ7WHaIaqdsBc6kYmcapbry +6gpCUax3xwC7pE33DbEWKXO6kjDv+qRZLDijAlrH5UwphU+VvvJp11GfdAyKlwsK +8qt52pRQzLQQz0MAsJoJhiEe/4GXK/0oulsTHXqpX+X8drPXOBWrFm/bxS8Qf7WW +yNjBDSpHgVVU+NcQt7nChUFTrevY2cLBq55Rt2o4UPmNd94xR5kuJT+qzvU2zCt6 +yN4L0vFzbhruX4h1UdLMuOVDbXSu+PRE/iWekKgF9gzqO6X3F5/+DoRxq5Ukpfqd +1qgDdcG8hnK1rTjQucsDC/bo9ZPmepg1MRpXvMLtG4L9bBkl9C3Dg5/3jFhEN9az +XOz7zMpzfbF2z71v/FclNdFuFYbWEt4N21VTlQAwdBFn+g3djzvhSfgPoAlnFPBz +F11FLa4X8IIieal7NUr+ennv44IVsAjduItuAOg2Y5Mr4xW26tCsV0TbLDCPaQfc +YlHPUOu7B4/bSzhHAZp2U9hBDpXkzArP6i78qIcA3tM7Ph8Fr9tdEDQIR0WKOLVO +Po1ZQUtQtJ1LWBnDXzgaOE0Zm54wG7gXwAZyUtH+Sd9wTloJPtSxPA1gOgFo7QkB +aXQlZTUhih4HmQ9yF6rC5HERGob0DGMUXqm7YRV/w49WhiO5+k38PvqM78MCAwEA +AQKCAgB2vhyNGWH5YwpNy6kKko4HKMk8ZuJi3J0Hn9iWaQSKLP0VUV47eq7D9x5B +s/TG1fy8//ADqB9rI33q2anTnNEJ0oobC6Cs7DlvLLspOAl553jZlwRNvF81wU0i +mWbczhNom/hpaGz4O8g9WGku2Sovv/BhMoECVYp3oGTAXI0vNEFTySMB/naeEuGV +IGfzn/O/ozkA19R6kG7zn5sYzZgoBKhqEyacIJVuVWnNBpxTrbDYiUIRGyQB9FJo +xD7T2AXslQXQ7JykZKM8RUmInYrL2rUKuKePIWfImD7IhR2z5IKRZNWXPdvjgbrW +uZonCFvlML2f7t0etSMeHuQ/HLgf+gG7xXg/AJASWdHZZsbYLjM1FOsDy6jP4M+m +2Y2pEBJuxhSO7D3k3PhIQaiCsTp/SxMOetO4Kxp91n1wWq+lOxrtG83TpbNNbOpQ +o2P3K7j81+0hmT8QQB5HxYsLz+cuncDmCoE/8Y/Rak38qqS7rF6Aqt1bloLltxq4 +7H6pZC6S7HWjwZq0W1d9+u5USCJmbq7h6zr0fBhXR/V6DFlogJNl8GSMDoYSJRhr +DzNKzdROPST+iO2YlrthlOIcSt09LUbUEAwBYCRfs7u92qkrbBqTrvQA0ohZ25Tu +MnQmsaL9yj3yhLPJyVrlc7ey0UAMqaiz4w1rAxEfdk4Hmt8mYQKCAQEA0h2xsphf +lXh6iDsRoSowvusn/eYhCGt2DLzxXINZNpkqkDpamxrFEI76zHOkLzMc2PS65kF0 +JJra4DK4H66iEDRS6ncqHDkZxdxHgjt9piNOVtvO0s6g4gtvDyxDrpzU8HANQqOi +n0ZCMejcS3JXdlADPINxzTwXEioDEeoUyFl0MOjz4uttnn4nZ49UqqoQT4rX9XA0 ++W/7FTNMj6cAgl5qE0TISOrYq+DQ+2tuPJNoFzbvsSjl4ucuRtIcnLjJmxRlB5Jv +5nkvJksRL8EK8sSEwsJzu+HNBBBWPMfayeOICjAVwm2oAaRQ+svZxFNmbtRt933e +duP+DnPxiSuXKwKCAQEAzOpWPl0I7LdigmB4UkG3l3hb6+DIYGIcG23k4dso52CR +qSeqqdsMamMVOaqRelnJIgIpwrDyYa6+InSJokpw6uPFcxtSlVa6+P+qYmo6omXU +mh4rZAZwt6l0HCWGo7mIcrFehHSWAWQEODZEsc7dMpV1kO691rNQi5A+KJXbTBZH +QF0HTkxmfwJh6+roieVXiGuADhEl8cheDV2HTZAtpNGtCg+W+2X78TU4GOd1zZFd +BcJulhjTL6N8VzbqK98MOhyOLGrsg8wU0KZcUKzQ564+5zTKujdU758eZOSlVM6O +UI92HEYKdzXSw2EJiz1jdwZZuNBxrEJ9lbDspeo9yQKCAQAJ5aosHm9KLB2hcx7W +d5VKOOtuUzu1GNK7sN6xm+JE5xwRJR6FddJYgFOh88SFEKRIN+bh161v1/d9XgY8 +P86UctKBBtHt+GaVYlXf9YtqmvkisEHivibn3uABV/VsMSj6llyZifmsBPQzQ6O0 +zhL+mLA+Vnay0yTHD0GLw3ntIgGOGDr8slg8gfa7Mw4q583S4Vhg0EM+iJ7MFdmC +XrxwZ6AZfkDs5lsEZZeScDIGGm9pwIWz05hYgsk0PstoOnAMpP5JSAWLVqP46spJ +dI9edhFG1z/6Vp2AloBpZoSQw+3xhOhRezbRtPq3hYihbchCajEv2jbzZLPf3GhB +LNN3AoIBABtePPCNWnDLOWPyYH+T+WJIl/ZUCk8dK2XacpRbwgXNFwdBngCbmffn +jeEqz81Iip15LnyrR2QWg5x0diFv0c79ZtSt1ITPlZ9F/kqwp24jLZb76o2scoeF +IVXVCTt6vyeaWuZT7+j1o76iOOCKoW5tGcump0IyptJNDJA9G5H488E764rgl1vl +RJDOygoI0H0O5oZ6cdfuC+m7ESQh2obF3leWp3KiN1kK45gn6crv3D21rzFq1WHq +cuPvGK2NV8O3JqH2Eeq0ah9H6NJ5klkvI4WbvmvKkhSC6vtMsmw2PjmyP3MdQ66S +SLkBj9XB+DPgbEFLzbLVGpLQk3rBY0kCggEBALeQ+8z8mTOvO1aHgwNoJ0kSLb9D +tfoJFRFd0H9Lc3zf0tXyl2cOaeniQuDJugH5Eocn7Cq3pm9LdpgMiQwkiE/5zGkY +IJN1pc2bBpaZ+ptc3uGhYBGB23yrhmhxxjmRtUBlTbGnDv2xD7J4cycV0bQ3LAIw +qYHyQYTY5xcdDbGwNgl4z+Ig+tbsp2Wlew5nrRN3WKG8vFMEbIBWA3jHJPFJXpGF +mq5Wp4Ul1cJicOMAF1n71OntN03mczjnqnOHGnnD7Kt347Wp8UF5BWn7mDmoDEQI +gb7pws7MgJvnCthbEVezdILiK7Casuk6UAzvGWYcSxSSDI4HWi79QyPnApU= +-----END RSA PRIVATE KEY----- diff --git a/certs/1997-cert.pem b/certs/1997-cert.pem new file mode 100644 index 0000000..e4bdea8 --- /dev/null +++ b/certs/1997-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTMx +MzM5WhcNMjkwODE5MTMxMzM5WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMTk5NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBALPZzW85w4i8HiMZgzoWcdynNgZIc+TOaJcbB+NXBUFEBThiDrEF +novYuYHxo09qV/zea7HSe6kp0zY0Edq8tXiSCG4VLs4tDa7O4l2gUjjremlCqFdg +rb7eLluXuy1g3r4n551TFQ4qBYwysljvkS9CxVwKaY3Sq2g0WQ/kOrcTZ34Heqcq +mj9N+zdQby9EvOFRraDmx3squBV6xKRLyUZK77UAeVasB90qsBmdHniltXN119cH +2rBnR9I+iUFP7KNACyO494qPFFhiYnBiy5roFY9G66meF6nTidkK9cUucqbzUS9j +B1sts3V0FQBwjCw6tRUa2QunRkJgjOzaQS/IPgwXPj5JWuD/0AzETI+JkR/XOlHF +QzeO0p0UvCfOAx2nFLdLYlulA1MIQjlCL6k2ubDv4SBX6lcAH/SJ0ZerNy0EdCDY +RO28k6GM07MRDfgk/zNgUiItsB8+Pbg0hGMxf8upapDjZ84hRtOzREXQxFoJcI9v +Q0shSZgygb52xMJwMHHjjCMzpIOnn3qaqSDFaacqFjuHF5leB933J9iSpKO61Eo5 +6eo95MJciDX1gFu1tMeq3B58gkTCMAyio7bZO/hcHmki5Q4smhn03qbtSEB3i/hR +sbOG3X5APbjbSjOGf9OBTLHeDx4xP2EU0ZsPQj4Lz+xd1T6ccxPg9wv3AgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAHwnKQt5L3mTmvzQLcy0KmKwcxwNcB20Emq9sq1s +kqacfcpg36Ti9blhN4pOOuRhQ16FVa+irz7HDO0FUt+0MXLiAxhzxanXCbNwkWtz +HZmUHh7utDqki5knwxogbUGgoiSUeWjrVSoU3eG6xvKHGskpG85gsT9JIWO04C7j +WRSjZoCZvRl7+mlUaQlhftY3fmoISDc9ObVQgw3ZFwMpGzWNkA5DtN7xwsf/vCkb +Y0HZBKk2PZYUYRq+Odsm3IrRcdnZ4Vg0oVPN8vV44L4gQ6MfivSKo4HvbYpT+X5x +S9Anp5DndR8kcjl/B0nVwSHRHjed3k+jpq1JYsNDWDf+K/sPpj7X3SB38uqizWjG +yIe7xPBvog2a9mUBYSYO/X4GWS3z8MmE9XrFG6G440+eecZINBF/f3Rs3Bw2UjU/ +KA9tevdzTo0O0/YJX9L7AEJKjDZPa4e+tqKg+L/M9cogUh5aROryrJfPIrnyCX1z +Q1Q1yqZvKJzft3AxCs7ZL2ppYVu+VbOg1uH9rDfcSb2qIZOE6vlQdazMcgWLhYIJ +rmRW30BUtvUZlYtiesPUyyMs1KSBFvTgDCM9OAC1nr/GlH4rimcZrumapFpEhAn5 +gtxEHCd232TNjCkohR5RgUB+9W3rr/Rj8AxOywS53H1pHtlX1qqH0ErQoyTybkdS +AJtX +-----END CERTIFICATE----- diff --git a/certs/1997-csr.pem b/certs/1997-csr.pem new file mode 100644 index 0000000..70ae2d6 --- /dev/null +++ b/certs/1997-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDE5OTcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCz2c1vOcOIvB4jGYM6FnHcpzYGSHPkzmiXGwfjVwVBRAU4Yg6xBZ6L2LmB8aNP +alf83mux0nupKdM2NBHavLV4kghuFS7OLQ2uzuJdoFI463ppQqhXYK2+3i5bl7st +YN6+J+edUxUOKgWMMrJY75EvQsVcCmmN0qtoNFkP5Dq3E2d+B3qnKpo/Tfs3UG8v +RLzhUa2g5sd7KrgVesSkS8lGSu+1AHlWrAfdKrAZnR54pbVzddfXB9qwZ0fSPolB +T+yjQAsjuPeKjxRYYmJwYsua6BWPRuupnhep04nZCvXFLnKm81EvYwdbLbN1dBUA +cIwsOrUVGtkLp0ZCYIzs2kEvyD4MFz4+SVrg/9AMxEyPiZEf1zpRxUM3jtKdFLwn +zgMdpxS3S2JbpQNTCEI5Qi+pNrmw7+EgV+pXAB/0idGXqzctBHQg2ETtvJOhjNOz +EQ34JP8zYFIiLbAfPj24NIRjMX/LqWqQ42fOIUbTs0RF0MRaCXCPb0NLIUmYMoG+ +dsTCcDBx44wjM6SDp596mqkgxWmnKhY7hxeZXgfd9yfYkqSjutRKOenqPeTCXIg1 +9YBbtbTHqtwefIJEwjAMoqO22Tv4XB5pIuUOLJoZ9N6m7UhAd4v4UbGzht1+QD24 +20ozhn/TgUyx3g8eMT9hFNGbD0I+C8/sXdU+nHMT4PcL9wIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAG25eBS32O7gt6PHrdL/AwPFtScFxMj2Uwt5AAg1ad0LUbCD +q3bvsF3SPUaI4z/He1nmBALAKgtM4jlUB6vJA7aXd9eMtd5uWPS0lxc5dKZo8W1c +Y5VHU6nZ+TPGTh8PUbSBGb7Af6YjHqeN9V71ybJi6cCmsQe0lpRN8DYI2jFA8Vky +OZ0tTRB0VqmmKGatEbaxy/zEV9E+CavqrPJ2CJhOgQZedZpckEOwMpmiCwG2gMIw +2PalWBoGQTbrTOJuI4VMaKmwVj7v27yvuwNx5NTnupagWo9weGweV64HGRufPRlr +mWYKU4a0TUbAF8TFPihQHDPm08I03xxrqVN5+s5NLJaraujKOBgxK87x5zISwPL1 +bok+CihutXrTTFjshWYGwWjydgSWjaylI8cGn81Rit1J8EELKH0iNzg7LzY8cGJQ +c9bBVZkTKVF0+LkGzHVoHvJUOlzAU1JSGGmsPnB3SoeWBFsUKixCqCs74z9RZoO8 +BoNxGCSyEENp8sCs2ovwafLypTZxxsMaKyMJ9mG/UaTaoevC/OsfYnTzqu/f5KPa +sBtKQHxz1eJRpDhQ1XcmoONZUISgJDflFRJfJYiDxnVJHDeYbMvr4oPUXkAc1LLE +9iufG8RbN9tI0Mhj4+lK18CguGaumOHfkIN7o8smTmQfzWyUVYGLjJT2ZqGH +-----END CERTIFICATE REQUEST----- diff --git a/certs/1997-key.pem b/certs/1997-key.pem new file mode 100644 index 0000000..8c62dc2 --- /dev/null +++ b/certs/1997-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEAs9nNbznDiLweIxmDOhZx3Kc2Bkhz5M5olxsH41cFQUQFOGIO +sQWei9i5gfGjT2pX/N5rsdJ7qSnTNjQR2ry1eJIIbhUuzi0Nrs7iXaBSOOt6aUKo +V2Ctvt4uW5e7LWDevifnnVMVDioFjDKyWO+RL0LFXAppjdKraDRZD+Q6txNnfgd6 +pyqaP037N1BvL0S84VGtoObHeyq4FXrEpEvJRkrvtQB5VqwH3SqwGZ0eeKW1c3XX +1wfasGdH0j6JQU/so0ALI7j3io8UWGJicGLLmugVj0brqZ4XqdOJ2Qr1xS5ypvNR +L2MHWy2zdXQVAHCMLDq1FRrZC6dGQmCM7NpBL8g+DBc+Pkla4P/QDMRMj4mRH9c6 +UcVDN47SnRS8J84DHacUt0tiW6UDUwhCOUIvqTa5sO/hIFfqVwAf9InRl6s3LQR0 +INhE7byToYzTsxEN+CT/M2BSIi2wHz49uDSEYzF/y6lqkONnziFG07NERdDEWglw +j29DSyFJmDKBvnbEwnAwceOMIzOkg6efepqpIMVppyoWO4cXmV4H3fcn2JKko7rU +Sjnp6j3kwlyINfWAW7W0x6rcHnyCRMIwDKKjttk7+FweaSLlDiyaGfTepu1IQHeL ++FGxs4bdfkA9uNtKM4Z/04FMsd4PHjE/YRTRmw9CPgvP7F3VPpxzE+D3C/cCAwEA +AQKCAgBKXpoQkDZG6GMd6ILXFkjnEU3Js1QZHTEqqsbMP0OxBUuTURj6InS5J1ku +XplFUZgovGCUG5F/Fgh8tXNcnAP+Y4SQ4LmGECNEUdBRHuZhGx53QFUULKor7vwE +a+2+ifwRbbbc22otfTrmCmCtXgMPI/Ewai3Ts3WllV/urlWJNsDo4HbbgUZfPwPO +j7gqN6ZTFc9SZZu/Vp7gYu/FcIE+S+ZrVlLWgDSQRAKl1M6w3PT3VZd3F4xavZp5 +Wdqv4zjbGLSChQ33gcrL8YL7Lh87YxTnNlBkxzbJxuuNkHaonthSKPM9QRndnjxD +KUk18VRFRdFzdLKjmvv2nq4nkui5A/iZ6qttG912frAvo5R7G66bEHtsGzlO2tYN +xGqjtkZm7LvXutd8vD9gVPPdmTvulKLmV7gJGv2+6ow2ois6KfLKsezwF2S/RhQb +15ojVoI/aVDUqjZdo6h0JfDJYLJVz/0vT6vgmshNYgCHcNOI3MhLEFLx8zbD4CFC +ZOsKesFesuxrR6NZyF3NWckJ/gSApaxfiigxYYGA7YOvr911fWZRrjVx7/lZX9G+ +oFNRx5epwOrBPCVprHKi8WWNRVpJpx1e66efELByPxtcZdBoYFtN1RLdzrUFd2i6 +LbUL3/Gj9dBf5jP41lprYZQglRBcy+6xi+YRzZs8zX1kqch2AQKCAQEA20acGITg +/QVJSkLL0pFIimPirhQMHavu5zf4r8XhHq5OOYE4D2v5QeW3LqqzgOStbVfAQsXv +OK8B6sfIw9blV79yy+/KnzMfIOkhSZqBDNPg9UlUfbS+IaM6vftTA8NBrLNytezB +seXXZcKPEIZzs2mv7nL8JWjleZ48nxdpHcOnT8P+tzkKuTerXBWI5mL9gUJdpbpf +OEUAOMdO+fd20T6mHzDuA8tZxST2nk2H5QWA1kIwrT8cG/miODIpcjHo1Po2tFfg +lkR/DYe6mT1FlFRFpzHLVzczMnJY8UajkJ55XMA2063DVJ9X7qu8r7jY7z1mX+fv +PhA24BpSA0cztwKCAQEA0fjbAwTc6HrAcOg4aCbUIDknQOS1Ni6PKXdEz3BmMJPA +GFe3GCYTAFeRJ0cqVyM8BHdC1gGHBMrc/ywZ9CLcJN5ZGqG3GmEh5kLpWR7eWizP +PvlDGkhfrrysvnvpdxOramUyx3p7SIxtz+ctnHqLt2WMXK5uFjFjllCcF/4oZzaY +4ChzvUjXmjUEz5QI/UC/OedhL1fIt/3XFgTFEKNQYntZMjk3z2LUs73O0m0kYe7O +s0VgoIV9PVBz8tfZfRQkiIRamnNqlQUxdEOTE2ntc15Tm3uqJgTfNM8Jb+v/Nx8D +XBOEvD7GiY6XZ8zxbeRU4g4Cr2yGoV2gAaAdWoVpwQKCAQBTtnVJdxFeB3KfgzjF +Punuy4ty4fxuJ4GhjGDI2kbDq8/5bDe2y4Xxfn2ct1aoUqVTJTklROO7RDT7KSKg +gZ41DcYJzZYRiTbNHbOzoeS6vPkZK9Gx3BrqRKLcfOKIgTbFdAzLH4QjIphFJS3x +JSNuz153LjbNIWraL2r9YbajwlpRvYW09XX+mB43nZESQ6B8hJWz+572oIEhLBYe +oDcgU0agidGUaUHwXdg5P2guKxewtLxYp8tXcspXoe7oxd0Z0hyoZRQ8yhGnXLYE +Yrv5kOK2ne//b/d/vt/t3QX85EN5AXjs/12fJOYxHCeA/pTzYQGAg892ZkJM9D9z +OO+pAoIBAQDOG7SIax6Zid0bN6ge/HZfRxr0BUyn6d4Xuv6tjUySRIZcnsWYi889 +F7fhUWcLcAe67oKJ5afumV+Dj3vOfOWRvzzB+pns6AnJqEa8d6OV6sRosW8f/okF +0ijTNnj+rS0nXD0TOHSJy2cDnI7WOiiplqHIXGStnj9+TpRarN5mKl64Mp0h4b3Z +nk+hn1OPnR3Yrfpk6YuaqC6Ya4gxg84lTaVJuobBKOdXpGq/feknxK3bpa9rAn3k +UPPwHddcgwg1hY4WbFLkAtv/n1FgzisKgz4YsrRba47anJxL4+F67xNyL6qsygZD +Atg2SSN4VpjH6S7TmfkxruCgl9YYhDtBAoIBAQDNzG1cerhBPVV8Hy4lUW6tNTpH +AULbMTbwqfO9HKpK0KFY9nU1W6bS7v7UwFqBYLLuGDlxIDx8nAKswyRRHyCNtMXk +7Gpwp9NCKM4Fuy1k6DH7PcKTcphHOa90Vo4rlHSlB2FIdYsKx0VBoVNC5TBK3T84 +ChAmtRWWNKpMVZKEjzO89OstU+mFGpWRN0AvXFLhUgwHNWpd0mUQx7LmFRjVb8ln +FCecvtJ1fZMa7JgjPYHWVE+nEpNoL9Rwl7dyjmy1BFoVcf4B/xymGYi4vWwNFLzP +nML2VV8QZTQ1eZgFo3DkdlgzjDfmH6oaTeSxZemldp7tfZ7um3uM2mK/fpIR +-----END RSA PRIVATE KEY----- diff --git a/certs/2007-cert.pem b/certs/2007-cert.pem new file mode 100644 index 0000000..5f2e2cd --- /dev/null +++ b/certs/2007-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTMx +MzM1WhcNMjkwODE5MTMxMzM1WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjAwNzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBALzFwumQpE5iiCmUpOXgEXyAL4TQ4UPNqU6SmTywkQVDnbAxp58B +Ybl6CUayWD7UBN9OZgVYK5wsA3qnO05zsopKomEUqlTIagZxMgoXKbht+Kxl1+qU +cKv3PZoj91l6q2ewy5jaxVIc+E6qn3h3XdE3I8UyqMEZaV0jrQAFtA/XkU1FtH6H +gaGE85VtLbzXwDzWTBYvzTpagN+3lX7VrzPOLZhbkkRuSASdw0IZsiyrPthVkS4H +KpAwNM3Se8te0Tp7mYi0JKWW8IDfVLxFR7YqAjL5FBoviebBY6ARWtYrMKWGxQCv +RBWR3zvEclIEcX7WHeRpiwEr9HxutsfVJ4hxyNescJAop969R27NQqdh5ujuFdX0 +dBtejDXbXiXDwXJVnaM1DezrzT1jbB2aB6UShqa+YR/WNms9KOB/SWMXLVUD4F1u +7qD4SJpypFq9BqJGkYMYJSrj1jVS/bCCHFi9QJkqK94FmhPGm+003TTHB54wm2lE +MpngxzauqvkOSPvVD1eSpxVaQ7OpWJp572dm6xywfVp2zM+TlLU0AO+4hJUY43B/ +LSc0QhmIvR1uPm7yyHcPU1XxsFFoUnUvMpO+JAgwlry9bUSxY0ueC4LskMR4yg8T +UzaZYxyB9mJPWuJLFOCPxYbuxsO5T7+ucgFYC/H9SZadoW+0OCgXuDKfAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAC1CYLyACId/PVFVk60UtYJNNgz6ND4/CkJPG4uo +PenB0wX8XcHg94h2KvqGPFBvr+dyJRZkjRleENORFrgahqiYLGhra7qQBapS/vln ++IYZJqhkz0qCDcjhgfDVr6aEmM6Jie4T+Wp0mNU7lbOtd3brcnTVQWOEpCShopWf +0XprHtDIwmEaqNcBz2VNC5CYZT7Xu1LKQX/EljK+5+44LeqzD8FA7tjpcxYGZavw +dAaVf8sNX1buOpxnMpP42ClrCAg98m96QPtXdkeX2qyBTlhWx7N+/tNiK6tQKm41 +cf+Ti75d1kTwvBvstsvTUnE8KaeQ8LsNEK5kRB4ULLKZcuf8TEdj58BjXlqNFLXn +nGOXYIla1yvEYBdSzqTCc0mZTIj80Hzp5xthKRPaGCzRkDAO1PLD12KsUm5SvNK7 +AbJ3uZgaoafvpzzd/pVVQYHEZRVEZAUFtALLMAV/uulBJ3XKY60suROjwoAaVq8o +vd4ZTQrfuiR7iErWx8HJUumxhttjOzOL0FX12rPjKY04Njw65C94CsTmLUTbRoft +sErTHtnvZBzkiB+j5ToEET/UcYKrQ8CQL493YKDRB5fuTs3fn1ul1cHjxMkT8mLv +/c9Gg4JRXjVvgg9ck8mCc7ePsh6a7xREC3CcSYNHGPYUXhd0mVXYwJ2uI3gLHPL8 +P+7f +-----END CERTIFICATE----- diff --git a/certs/2007-csr.pem b/certs/2007-csr.pem new file mode 100644 index 0000000..465c5f0 --- /dev/null +++ b/certs/2007-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIwMDcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQC8xcLpkKROYogplKTl4BF8gC+E0OFDzalOkpk8sJEFQ52wMaefAWG5eglGslg+ +1ATfTmYFWCucLAN6pztOc7KKSqJhFKpUyGoGcTIKFym4bfisZdfqlHCr9z2aI/dZ +eqtnsMuY2sVSHPhOqp94d13RNyPFMqjBGWldI60ABbQP15FNRbR+h4GhhPOVbS28 +18A81kwWL806WoDft5V+1a8zzi2YW5JEbkgEncNCGbIsqz7YVZEuByqQMDTN0nvL +XtE6e5mItCSllvCA31S8RUe2KgIy+RQaL4nmwWOgEVrWKzClhsUAr0QVkd87xHJS +BHF+1h3kaYsBK/R8brbH1SeIccjXrHCQKKfevUduzUKnYebo7hXV9HQbXow1214l +w8FyVZ2jNQ3s6809Y2wdmgelEoamvmEf1jZrPSjgf0ljFy1VA+Bdbu6g+EiacqRa +vQaiRpGDGCUq49Y1Uv2wghxYvUCZKiveBZoTxpvtNN00xweeMJtpRDKZ4Mc2rqr5 +Dkj71Q9XkqcVWkOzqViaee9nZuscsH1adszPk5S1NADvuISVGONwfy0nNEIZiL0d +bj5u8sh3D1NV8bBRaFJ1LzKTviQIMJa8vW1EsWNLnguC7JDEeMoPE1M2mWMcgfZi +T1riSxTgj8WG7sbDuU+/rnIBWAvx/UmWnaFvtDgoF7gynwIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAFwzrx2meK0Dihp0Dk53zNmVS/Qv9Pv3YYl3EtMmWEHYQYV+ +1bWE8CAkL/ai4o/R9GG/p6aeOjdkFl12Ez7/XyaY5RO5Lpbbys/yRIpjB+ScY57i +zLs3uKzmBMh9Yq+Mr9/0QH/Y8bffQmPI4vVa15FIQVkIGwBqqJveCSEpX5POWz1o +xHfdCZrs6vW07ItEUz6EleNyxVD1VKK49eECNbXNmjQG+ja6UdsJCmpUuEqxCiKV +uZEkyDvUO1/fmFmK2TlIn/1AMK+6+IUeHpY0KXjvf9c9OLjNisFlCCk1MJPoSuRR +s2Er3v8xWsPOlP84HdxghgY10y88U80/ZqYQtE39EgESxBh7DVDCoa47xl9CibTr +deTmwIuhnAx5iE15TTmtvjwyTcNQFQSLDY6c85+QXod+uTkfN87GntTlXtCgtAea +TeRMJXhLdvHZ60hcfhMLVjC2Ustcr35+oLMGSZNywb+7xGiBJez0LsLNZ5Bfp4jf +rlwbnckFJPmLmZLDOn4qunVDuL1LVqw/r39HF6MGrKvWS/M+Mj4zAoPxPgoEB49i +ifADTJMfAeNjKQlKg7H+FOCpkVREQGjX9Wlmeg2D4HeQ9cVYP6/rnBA3ckUKJ6LL +0IheZF9DKRk987l+hDpnLxsHgEEcT4k0vUXyXUduLT2y1BRXB5JtFDS99NlF +-----END CERTIFICATE REQUEST----- diff --git a/certs/2007-key.pem b/certs/2007-key.pem new file mode 100644 index 0000000..3f161fd --- /dev/null +++ b/certs/2007-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAvMXC6ZCkTmKIKZSk5eARfIAvhNDhQ82pTpKZPLCRBUOdsDGn +nwFhuXoJRrJYPtQE305mBVgrnCwDeqc7TnOyikqiYRSqVMhqBnEyChcpuG34rGXX +6pRwq/c9miP3WXqrZ7DLmNrFUhz4TqqfeHdd0TcjxTKowRlpXSOtAAW0D9eRTUW0 +foeBoYTzlW0tvNfAPNZMFi/NOlqA37eVftWvM84tmFuSRG5IBJ3DQhmyLKs+2FWR +LgcqkDA0zdJ7y17ROnuZiLQkpZbwgN9UvEVHtioCMvkUGi+J5sFjoBFa1iswpYbF +AK9EFZHfO8RyUgRxftYd5GmLASv0fG62x9UniHHI16xwkCin3r1Hbs1Cp2Hm6O4V +1fR0G16MNdteJcPBclWdozUN7OvNPWNsHZoHpRKGpr5hH9Y2az0o4H9JYxctVQPg +XW7uoPhImnKkWr0GokaRgxglKuPWNVL9sIIcWL1AmSor3gWaE8ab7TTdNMcHnjCb +aUQymeDHNq6q+Q5I+9UPV5KnFVpDs6lYmnnvZ2brHLB9WnbMz5OUtTQA77iElRjj +cH8tJzRCGYi9HW4+bvLIdw9TVfGwUWhSdS8yk74kCDCWvL1tRLFjS54LguyQxHjK +DxNTNpljHIH2Yk9a4ksU4I/Fhu7Gw7lPv65yAVgL8f1Jlp2hb7Q4KBe4Mp8CAwEA +AQKCAgEAlBnvzsEtN1Y0j7LQII3ICk6jeWdLpJ+A+mUnlibM0D15RNfgM26pFhR5 +nJ6lfz1mSTA/+GdxZ4hcfmkfrXA2Hitp9BJ7hCLsk/tRD/uWPt0AoXkRijhFoZVL +HlijYe9M9QAO6/CPqNmTslxI2wGDeHXzOW6CWWUvdeRcgUz4NQmiNObAMhjsCiW9 +2XkbzjHS36gdb7a3I9YHj/1/a1AIsfNLcGI/gjKni/+eRojUchk0KBQR3/O9X/yC +IQzHFQphyqlYDpmOut+N9v3AhCkyluekbAtgyx6K6aDGIbob8zVVaDgw7VWUa/vT +ERgRvOlBhgpEz4RCi3vJx6ow+tzvstClMBp8besBUUs6uMeKIbjO3sqG73cbsD23 +OYXbaFRlbCtENyZ0vVWL80gDhQrnxlirVrlQXeWPJ2/ovMKgbOmKIMZpN3edSKDm +aOlvcfrLJWjVu+h+BGwKtmKTsVskvej5KFVqBDJP+Dbu6iEQf6Q4R97rb5HS4+yr +kWXtndqYARb/O77u91b2mYAjgwEYHma7sNSN8KX0NWwV+Kl5eCifVjcjBxc27oB8 +u2x7y2VIflYn6yE9gnl8jCbE/Dfzd7+EJptgZ13uXHU5feV1OqWyJIgtkxpf08G0 +4C44WeBE+XOhZ5xvluNo3AoOZqEOEn/pT+Rkt64GmaN1ITOhHQkCggEBAPaEQs2z +524QMhRkYX3DxkKM7JLePWRIwWFE15XJGYd3Broh526gjZnFhNhEhMafhD8reV7F +POOvmQ5WBwWzeJS1cy8Q1y97qsLTs+Y+UQ8FeSsCc1W3CDhUGfuOavnihnmaZNwG +AUBDTPuX6D/J8dbZ4YLhiOhNCAtRDFbVykQ0p9XdFb23dSP4R/px4RFQbNrUeABX +DfX6lzncEl2VZ9BEDosKx2Nqywgx7fR2yYozxzd94EcHO0da15ExiXscf0selsDI +U1HrkLWPm/QALqMVI5C5i+B3qaXO0FWzHF8+nKugl7efV14jpEQSUxb0KppczaYv +iLIEYTLrAKvqCdMCggEBAMQI03dls1yUarEK0smJ76vNozoiPdKRMXG2hV2e5Sby +iPWiYzjZDAq9qmTLEua7E05BwMaFtZ6uhxsU2LECgM2GZOIW4zb00K/aSrMh9EyT +qyqhFiGgis7sJnU+MKGsKpx6OB3C37Y1D9Gqt7CeA86i3sDRkYv0rUjhRCGeEUS4 +Z3/Lbynv7Z1IjjK/VeHpTRzvIMLRDyD88TIRPKDn/DlKhidGXAiszEAAovJ7/aku +gAvrGi4CDKjlFs2yqHlFp52bNS85lr2+lUVcSWDE6YPTomiVkngdS9mIEeeFfz3w ++hM1mBMHUzGpNv5fHOwR0FurpdKrhcD2foj0gaPTiIUCggEBAO245670YSX7Sj/t ++THNfEArI+wRkoRFwO4q8/bGwe6ncn5GOaat/z8dgZkIoj3kECTWqKkibTBn4qI3 +hXgS9SH6xMPLaqeoiyhr/Nz4lTR2I729FDnBUpT3TUMPuMuWjfVwVPj0dXpiLDem +6tmwxZ1Z6SVMlrjlp+85zjti2TXizULoe5HC+5yfTdIOxWrr8r0oDTzOtnDRocmz +FqbWcBEfwCKHV3Xgwz/43i5T6tByVBeINKJqL9kEmkKy0ZA+D+cB7YCk7exezOK5 +RTwMfOzZcr2aoG/rFVcG1FMAcUjL2UuMhyIU76yhlEPso+HLvdWzzsEGr7xzisQO +aUxfWe8CggEASJfwHz3VDsqTO96DMkjXLSrocCWv+SL1SWPKvWGTADo+R6AL2Ehf +8jZMPCkLZdAPFSK6TYnEOO/ubjPpDpubsQA8qZDKMVa1VPmkQfOn8ReaAh5HAMrf +vEKs9yvBfI0x9mI4F6VLjMDXi9AJV+kcBdBAZuz0VfyUkvGAdmZ/hJA5G5TtJH2J +432z0s0R86eee8F9w0cBsDia5OyHJBrkRx720OJ4QGok9OqHbP5Hb/gdSMyWFEWE +BKNZL3EifE40BOQt7MAJt1g1FMtZDPG+e6fKc6o35C0NIpAF+VNxTDHJmYV2PE2x +HCnKiKYWIsFyBBBrRrlnvY5KS1MoEs/JtQKCAQEAvRV3yYsy5ewwMRHhYsTlrjf3 +RG5c7dzSWdAemoNzatOeQob89VUghX25Fg+mfi87SUCc92/kh5+DGReMOysof881 +7VCs2TxFfyRNBUs0qPPI4Vauzd54YwQDpYVcG1t/FvgXsA9HTb0mhLDasutae46k +wetXcPgZW62ksjP8W5EiHHuAY7HjnWjyuw7byntkR9ZlwXMR+FOjU7LWgdR0tJqC +/t0xb49TPjvMzcEyuBYHzSglTh2R+cD8Pr2taxsS23XNoLYWsIfCteBn2lBjrsYr +uDMA4ndDgvZ/8dnwcUTReGIzUQrwAy1eGqWzInivQfnwjtV/d81nodh7UhrJmA== +-----END RSA PRIVATE KEY----- diff --git a/certs/2017-cert.pem b/certs/2017-cert.pem new file mode 100644 index 0000000..f3986ef --- /dev/null +++ b/certs/2017-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTMx +MzMzWhcNMjkwODE5MTMxMzMzWjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjAxNzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAKlPJJ4qytcoNERNLubMfAGfp8zK5hepl1jLs4j8Wjmei1eyXIDh +eulb1n8ZfLAk3hnzOJMe8hugLVHcQYTLGWsO1PEat509fr/cRX/4MfTvbc2FZnnV +HEPiazn7lr+Cy0/qWnCwEaI/WvsJxiDP6u8I5EfOqIV3ZKCkKY86QA5J2jGQKOBd +aR0sgXyRtLnaM1dPgVOkkZGV3+SwxltN8uAn7gTifly93xLkMVL/0ih+8hZt+2Hs +O4C/4tIKwLFxOgZdANfBmcMV/UYuVrKHsXUWubgc4cdv8oKOnbTncm10IqvqKBeh +Uq0G5K9zbhbFe+TrGppN0f5MCPmvhpKME92Rc7DeB0RJYoo28TzDnu4aVTmcidIn +ueVQhQwMvPwc8P/u0uBYbdUaPcUKyYpvz0fw00PODgzlad2mNNBxyr6ADFrYgnqL +eS1HnoL78BGHyuDCv3lpHUtm/zy7oepVcWcfJCcsDbKYTpLa4SflzjuRXhq8+fty +ncYA6AHJo2IgCuQaX7N3TK7Kzg8yV1phAtn8aitNyYtYkoBPgs3ZFGZi6ggJ85u6 +rhUzCelt7GoFwiwzLYqYpbVjZYuqkHLvDzK3/xfN9YP7R6rnqIQjaGzENh2ELiMJ +3dDFa9mdzBi6r4GxpboPcM7MBOUn6TAGdA9fSiUd9l7oD9Zt2RoVUmLlAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAEC8KwqtduExRuX6XV+/mo/VnDo1Otmhf8841pf2 +bwYfKjl4tHvnndRjr4VfpAssOj1KeXkCJWjC0C6yWPLumSUlMPn+xA+PICAMOag2 +BSAfPPHDVTuhoLlTV65ku9KghQszwlsLocEFzHaI9M+CXAYuO5LTFYGK3uLoBmpa +se5rxms0KYloxYbP5JEAPBz4uM/swLPPfVyvk216HaDu92JR2ub7RrtO8+hllCf6 +7Xw7cJerJGOpUF10A2mGuqF/zV8sIbBvUqA2CZSxM8KGjK++nN4XZq6MwJ+NDuJR +2PM+Xuu7qoeL1IXduKoHacTkkhDoqncCxrsiJZuQHKr/FXHBtbCEcksbYuVJ9jny +j/+tJWUzibs8akp1oV1AxAWVLYeF2MRFHreHpu/2M1l66sbeiqh/VOzh3wBhG7Zt +AcIDv6O+HiFnf9OZBXa+hK2Gdf5AJGpYPZLVGqPBrfTNgC9PHQKW4kqooVeIBzvR +aSa9e2pCoZxyOJCtFYFPljozHpqJP6SBuT0gQIUX9vr5FTqanXLGFwGiVlvG6Fy3 +3N80oFujj6qf+U3DE32laQfOupnHU5163AWo97Kt9Xwyi89sz2/ZxpJnu6p+ptab +GMTEsolCl2jshW+PD/slH+/xt5zCAimeYS/5TqzKqDvDcHcli2TM/ISqDUkUaL1C +cwEv +-----END CERTIFICATE----- diff --git a/certs/2017-csr.pem b/certs/2017-csr.pem new file mode 100644 index 0000000..9d2ea8b --- /dev/null +++ b/certs/2017-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIwMTcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCpTySeKsrXKDRETS7mzHwBn6fMyuYXqZdYy7OI/Fo5notXslyA4XrpW9Z/GXyw +JN4Z8ziTHvIboC1R3EGEyxlrDtTxGredPX6/3EV/+DH0723NhWZ51RxD4ms5+5a/ +gstP6lpwsBGiP1r7CcYgz+rvCORHzqiFd2SgpCmPOkAOSdoxkCjgXWkdLIF8kbS5 +2jNXT4FTpJGRld/ksMZbTfLgJ+4E4n5cvd8S5DFS/9IofvIWbfth7DuAv+LSCsCx +cToGXQDXwZnDFf1GLlayh7F1Frm4HOHHb/KCjp2053JtdCKr6igXoVKtBuSvc24W +xXvk6xqaTdH+TAj5r4aSjBPdkXOw3gdESWKKNvE8w57uGlU5nInSJ7nlUIUMDLz8 +HPD/7tLgWG3VGj3FCsmKb89H8NNDzg4M5WndpjTQccq+gAxa2IJ6i3ktR56C+/AR +h8rgwr95aR1LZv88u6HqVXFnHyQnLA2ymE6S2uEn5c47kV4avPn7cp3GAOgByaNi +IArkGl+zd0yuys4PMldaYQLZ/GorTcmLWJKAT4LN2RRmYuoICfObuq4VMwnpbexq +BcIsMy2KmKW1Y2WLqpBy7w8yt/8XzfWD+0eq56iEI2hsxDYdhC4jCd3QxWvZncwY +uq+BsaW6D3DOzATlJ+kwBnQPX0olHfZe6A/WbdkaFVJi5QIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAEkrOT6+CJ4zD7LVWet4ODAuB9K5IYeMeRyOM4OvJdxX0qVB +ShhmmhWcm5nahj1ajFskhwoDW03RQhG2uDerh9X4IeWA9OqDaT2AgrhFhjlQ5TTH +HhSfWKKhvhBo/saHHljgpoKc0op5ag2PhMRRne+JmLvuXF9cov8oeA4zglFdfamh +kDG9FlBexvW6XyvlBuCYbAYiD36KQyofV6hHM+99A9uTmGSwRndX5S1pSM+Mt23d +/SsfaC1i47phmvS37oDSjqxNF4K+0hfLfWgf7RmKRw3Tt5YPhPEu0zEe0zWUUTul +VhpNp7hwUi10DH3/aSD5Xzgd0R8Nv+Tg82dlKJCqRbTaTuF88h62Nx3KGpdWfye9 +0qr3Vgij/7DQ32r1X1TTHnZTAVK+FUuX0+s0AyZ8oJ57LvuAJsZV3QUFXnOtIXfv +8f2kRt5GTexM1gnNem+IiauXW8dB+JZK7uZ8HER7pLdmEXOWfbNPI1acwya9d481 +TQS8x4rFkxIK2ffIijKbHtorLmq4Xn0WzQuHM5x1hd7RzO1Ol/D9siJ7CuBe1KIv +SS0DEVqwyXC3Dme0MDi7dbmMeZ7Mu07tV571g5hDoTZi+1JZuyYyMZ8qPUshRXqD +8slkmkYbA3E8iGueI+B3WTU06AbFMTcGbNMGmk3swuRYpKJdH+Wq+6EJVMsc +-----END CERTIFICATE REQUEST----- diff --git a/certs/2017-key.pem b/certs/2017-key.pem new file mode 100644 index 0000000..d5ce366 --- /dev/null +++ b/certs/2017-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAqU8knirK1yg0RE0u5sx8AZ+nzMrmF6mXWMuziPxaOZ6LV7Jc +gOF66VvWfxl8sCTeGfM4kx7yG6AtUdxBhMsZaw7U8Rq3nT1+v9xFf/gx9O9tzYVm +edUcQ+JrOfuWv4LLT+pacLARoj9a+wnGIM/q7wjkR86ohXdkoKQpjzpADknaMZAo +4F1pHSyBfJG0udozV0+BU6SRkZXf5LDGW03y4CfuBOJ+XL3fEuQxUv/SKH7yFm37 +Yew7gL/i0grAsXE6Bl0A18GZwxX9Ri5WsoexdRa5uBzhx2/ygo6dtOdybXQiq+oo +F6FSrQbkr3NuFsV75Osamk3R/kwI+a+GkowT3ZFzsN4HREliijbxPMOe7hpVOZyJ +0ie55VCFDAy8/Bzw/+7S4Fht1Ro9xQrJim/PR/DTQ84ODOVp3aY00HHKvoAMWtiC +eot5LUeegvvwEYfK4MK/eWkdS2b/PLuh6lVxZx8kJywNsphOktrhJ+XOO5FeGrz5 ++3KdxgDoAcmjYiAK5Bpfs3dMrsrODzJXWmEC2fxqK03Ji1iSgE+CzdkUZmLqCAnz +m7quFTMJ6W3sagXCLDMtipiltWNli6qQcu8PMrf/F831g/tHqueohCNobMQ2HYQu +Iwnd0MVr2Z3MGLqvgbGlug9wzswE5SfpMAZ0D19KJR32XugP1m3ZGhVSYuUCAwEA +AQKCAgAS7w/YRE7UyuE1djA1jU6c297nDxW2NbgALR+RxS7N3MYWc5LWsuCM8kFF +i3MfO7A+1K1R/pbysfH/gpMtJ41bJJh5shQwmGzxRc/b5MSpcJEl97IjE8sKaGq3 +XERafGUCNeIRUg9WxqEFC+3FQ5sxShxFT34XFugA8vrW0pvRPT8SZd28YZXctlpw +tNayJg2xyOlckj3ZOxqDt6UnFst/d9etYirhcjZdJXnCn2tALhoimgAPzlxFJLBX +7u3nqhLkHUh32GW6pF3jmFEHvBcDUhxI06oIJKPJJ+vJDE0GooMyGIiNQ/Q791Zh +rJX2I/Wb/xLFiMhgGN60FYYGI3YhFY66Ml5kDLmJT9k0iyn57kLt/NR6XiluvQoK +pFpmUsLEWeHOSlnUhRSJoSmO1I14YD4gx0jn6huEh0T83znYywNbY9zFfTnAltUw +ZI+P2uQY4ep876/eSIewALMDdNgUcNP3+tPxmvk34I1ZZX5izmRd8B5qmJF00hLA +L4y+aqki8EIroEn5ypxtjXwaaWKgyiiUfB23sGFAs03pIX0M+Vj6n5tpwKVq3ywf +U1KHOolQxgcYyTXKWmMVy19/uy6SlL9ZRP5Wz4m/11zVO0GdPemtSuPZgw97y0Hx +iI8dJqnj2U/5zmmabsDXuefCkrBwSE2ZQMxTVm4/aVBiBFIlAQKCAQEA0p+FFxkB +SCQuKsaPcbSLZCGhaQdWeRZGgue4fi7kiQ413XR+s9f1hyNrTglXaIm6HlralPEi +HNSi7ED4gGl1o3VW+D8BRJtg8lx7eJschosN5am7DPONekD5Y9MQVPh7Szxlryw8 +Ory+xqo/GB4iogWYpGK7nQlDxOouM2BxDbkGPtbQtUV3BiPyJVmhrgK8P/WCqJTl +3YNO/DFVCdpzSDnNVJDhy2MFsiAvBx1TuopVsWD4JVVmSFsvw5u5jc+TvhHlxMwq +5yJs8fk0OZvZE55KhQLTmu+N8wHqfTUDe1Kps3pOKNyStdArSGw0Y8D5s8YiqoMr +GaLdykyWp62epQKCAQEAzckJeQRSnUoGWfjagZOU96E68n08nJZirDHJ9HGQ2R0M +V4CJYzFZn0qZQAKZ25BpMN4pHNS13VDraIxXf7GNbwKVqkGuFza8WYbwFXq8iui3 +g19Yf7GDyay+oaYeOX5uHm5YxozY8Ko28Ci6znbEaaniB/Ou8kFup7rSfl88Zp7v +hKkhRB7T2UPwNDqtb04kn/Cr+WoGnevXSsYoLX7QnVy2nmaOVyIjxvKDVjjwmjXN +GVQtAPfzuSbs2DSSccJ53qYc5C9CB4Qq9DqpOblHPsKJPYOHW+TnqhRCPhVLU5Xm +qAEMLf78QfaasIaSaVgyz3ZnCOTk1rfvm3y/n2C/QQKCAQEAhb4TleIj5TpMMo9Z +ILujU5bjVrz5FPSnG5KmnUGLjtf+Ljw+BFcaqpA8IBZgcZobHBFXAQLJRYNkXR64 +bVoKAByPeB0R4g3EFsHRCXl9OJXt4irQAt5YtQuzEMdCdKJAMDsO2pf9OtMFVUNf +wyHHnhhtn9yuA36RkOWfJrKTt0IJDDf92U1d0gFbTopG1ycXgImWSRQbjnhF3HA6 +7oHPeEpz7sH9Dtg3Eq/LDPp7Y1VaKsNHbvV2eHWms9AbmEf6KdRVkYyPpas/gLtc +hURIKGP4L9PmqFh7S5ao3o6eQl3wMm50WRAO/PJNubQz5C/yn0wuURXvdVzs9vuB +IsJlnQKCAQB7b56F/6jKfk+nAlWXKf5ON2ETeTm1N6PCZC8euExJX1o61ngSjtSS +bv3T3nuJr2rZjDke+RyJv3MliCEoEEmlD+jUcodJl2SNUxqJ19BmhkclvzhniARk +IYFLl0hD9ml5SXlox62NVpyTm+rJ04XnV6akXHBREhyc8bw3X0rsx2MmsQiqQs+S +YGUh/xxvSnE/mu6dMhL8AS5nxMru10WtTqKgCyZQb8MEIA3V11vDNIhtLAe+r/x6 +0DV7TrWVFTFi80MbQJmbxpS5YMKHRHLO24PU6SN1ZK3tYC+H69/+KElt9wrmQC/y +JUkOn/oMxIHd3cjaFeqKPVS1cLPElxTBAoIBAAFIhZj0beZMKcQRCth58OjMf6Tk +Mw1essK1WqAu6qpKFGs8YYSsq4zKHKWVE+s+NLhFfIJH/tTPaXuTsFAFhkpoe4DT +f12JAXOq9VYZCYsCEz+HgOsqc7hNGv6VhNZGxvu+c0JRf0Vxxj7HwbLihUXDRY/s +kaABYqWcA62AhHDOk237xw7XSl+Tj0Vo+pqRMA2RB8S5TY6Fx/oR/LXKIzYwoXcD +F2r1BXIxNNSng/8d/ONMc21hCuuI8u+tDCDsn7fKuyKUUtfsAh7/uE8nryfoW/HG +KpQIbyKC+i14xQzTmNbFQvybjbJEj77Q9BYSuveZNd45YUFE9fbMamKOSAs= +-----END RSA PRIVATE KEY----- diff --git a/certs/2027-cert.pem b/certs/2027-cert.pem new file mode 100644 index 0000000..f70fefd --- /dev/null +++ b/certs/2027-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTMx +MzMxWhcNMjkwODE5MTMxMzMxWjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjAyNzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAPNcceTaL3MpnT6bhvm0uNYTAbjJr/D7jQ3eVCMPdw+XbEefzwxo +WJpNlkamyrRKxCmghEOlScceJRUoW6RDUjWAQ54Mgv+j1mP0uz+qG0yDTxGJYbWC +adL0PwlC1T7+/cjLgzbrY923V/b8OZ9Ro4MKbF7hYH0pdywiX+XWkmndAgCGlexs +xo24Qi3pZYfUd5LhSkGql+I2pRFVhunrExEmtgGexHPV50ClubNNsvJsNvqWLdX3 +wm8cVSEdMXP4RRZQFw195LMsywT8ZNTByENAOdJM+5ZrsCZ5+8TjeMVFTDeYF6iV ++JrvVPalM2WlBLpU1YXszHpctADNoLIGaU/z7HP+8Ggsazc8a97FNKq/rZuDEM3X +o74gvTkqso2Y0U2yW9v16oT9nembgMlWgDbtEFw8GR2F9xU3x6EZoDB9bEieqeL7 +luIYlbk2kW8QjwZZe53LH51QD28ask4pyh5yUTdZ1Ht1u1JlWkrb/eGpBQnjUhkX +dECAb5iY18r3NgUEPaWXHuY3ar3tp9jWk4eP71frqqz+esnvafI9taHkXTGCZvn3 +nuWWQYQj4NL0LXRpTTkcDEkNJsO92w0JfS3OCEJ9VLVNt6NkuX70bzXy5f79DC5Z +MUtUxu/qknJ7tXTA5V98aD8aisK83NZioC2XdAEUcJN3Qv/y9YcmC71DAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBACo/5pVH5F8h4u4+psHuoCcxjSAwBDPbvMfYn0Nl +hfse+myVBbFe3xhzi73er+dSBAtaXO4DCZlJ7BU3NINVGnGKC8vPrYXH7C/ABcjR +W41q8UmHaMRbziLDGoZomNMPWPRvgVuklaeQ6jBldfaF2ER8iOKwdKylPvWM9mS6 +NPA4s1fLM332c9AFkMMQZYwUZZbgawIjz62dv9USCumhWP48mJ/36dHH6++Wep4H +ib7WXtcIeSya51YzZUy1b0ePwAyyusfAEXeJfPMh+DYtgqr7EUgN1tyTOjSQNlBC +UFj1BQZ4EzTtmgTQvsBTozlgsxL+ax34Jsdk/mJw/UwK1z2rGxL3YZv72IzhmatR +XLHrQXnzIYK4BXBYZJ7DNyGDRTYh0ND/DYw2kQJj8pCyj506Yhi5ojWt8ook0XtY +25cPY0empnWBpf49C3zqRBXLsAsaAZqXrfqjF/Ko8dxdgumw6nSQVlKrcwAtmBo/ +EejCun42OKRzIP6GM+KqcP3MvHogYROYWqPHxXpy1bKb37QeLgw8QAwGtmI3IW4v +e7zHkON0LcWxxuHA+aZczMiu6GYG8z8802uhfJcqayYcbwnopMEEJVYphdCmegz+ +XZlbC3JwdartgyONh4w3zBsVO3GcQMdw36jsJPOvQeFGuL3hfyNXj7mY2KEAgE2D +AxqL +-----END CERTIFICATE----- diff --git a/certs/2027-csr.pem b/certs/2027-csr.pem new file mode 100644 index 0000000..18a7818 --- /dev/null +++ b/certs/2027-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIwMjcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDzXHHk2i9zKZ0+m4b5tLjWEwG4ya/w+40N3lQjD3cPl2xHn88MaFiaTZZGpsq0 +SsQpoIRDpUnHHiUVKFukQ1I1gEOeDIL/o9Zj9Ls/qhtMg08RiWG1gmnS9D8JQtU+ +/v3Iy4M262Pdt1f2/DmfUaODCmxe4WB9KXcsIl/l1pJp3QIAhpXsbMaNuEIt6WWH +1HeS4UpBqpfiNqURVYbp6xMRJrYBnsRz1edApbmzTbLybDb6li3V98JvHFUhHTFz ++EUWUBcNfeSzLMsE/GTUwchDQDnSTPuWa7AmefvE43jFRUw3mBeolfia71T2pTNl +pQS6VNWF7Mx6XLQAzaCyBmlP8+xz/vBoLGs3PGvexTSqv62bgxDN16O+IL05KrKN +mNFNslvb9eqE/Z3pm4DJVoA27RBcPBkdhfcVN8ehGaAwfWxInqni+5biGJW5NpFv +EI8GWXudyx+dUA9vGrJOKcoeclE3WdR7dbtSZVpK2/3hqQUJ41IZF3RAgG+YmNfK +9zYFBD2llx7mN2q97afY1pOHj+9X66qs/nrJ72nyPbWh5F0xgmb5957llkGEI+DS +9C10aU05HAxJDSbDvdsNCX0tzghCfVS1TbejZLl+9G818uX+/QwuWTFLVMbv6pJy +e7V0wOVffGg/GorCvNzWYqAtl3QBFHCTd0L/8vWHJgu9QwIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAI2qYSTuT/FVZ632bJzrg21JbQKI8DcJLvgqCz7wikDy1m6s +1cx658I8BcCFWRH7veT+UBnlXdme9DTXa1TIloEup5iATTciJzDi7ZX0ch3Sjd3O +4y08B60X80RWY9AyxYKKX7r2xs8YoO8WFPBPU6phjmmHwXx+EHmjSpIbYLxfDwPE +zWE5G9Ca1A5f82Id1TGMI71kvSpGBLEh9YcKP7IK/uRZUr/NonzdP6JKYOIfgDCw +B7oJaLdXw3VDsOFIWib45NpghcVbscivqNaTCbgsz10oAy+yVZfVNZIOuu5PR8wy +cAdSt0JC3UggSEhVdPJvOKp8Ociat9QdWkHsX/iqoqmFc8kU2lg+RXgS2XYodCvo +/YwWLpZWqWUksvBfbfuq66JBFOS/+Dj88k6/aQyPcPwKL+/gpbATOYdfZpC1ZJ+N +d9l2IDf2f7tvfelmWV5DwN6M8MS/a/dDDioXEA8VVJeybkho6M/bGvp/2h+VBMas +0fBmtDmHFuYkeRLpG4Fectj8SoFDEV8NTEXH+E0p0lcHCZUWEmCVE9laAGTQZ6JR +LoR+DQAoItapCP0uQ7KqvIA6+xmiowHZr4gP2FmR2gc8Gi2Qm+Ur8bY0OVmSWdHh +Ht28qCbwifHChqdFkS2RDxv63Cstz6HNLs7ZTWi9C9jMGW6humQt5ZiC4LYH +-----END CERTIFICATE REQUEST----- diff --git a/certs/2027-key.pem b/certs/2027-key.pem new file mode 100644 index 0000000..6cf34f3 --- /dev/null +++ b/certs/2027-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEA81xx5NovcymdPpuG+bS41hMBuMmv8PuNDd5UIw93D5dsR5/P +DGhYmk2WRqbKtErEKaCEQ6VJxx4lFShbpENSNYBDngyC/6PWY/S7P6obTINPEYlh +tYJp0vQ/CULVPv79yMuDNutj3bdX9vw5n1GjgwpsXuFgfSl3LCJf5daSad0CAIaV +7GzGjbhCLellh9R3kuFKQaqX4jalEVWG6esTESa2AZ7Ec9XnQKW5s02y8mw2+pYt +1ffCbxxVIR0xc/hFFlAXDX3ksyzLBPxk1MHIQ0A50kz7lmuwJnn7xON4xUVMN5gX +qJX4mu9U9qUzZaUEulTVhezMely0AM2gsgZpT/Psc/7waCxrNzxr3sU0qr+tm4MQ +zdejviC9OSqyjZjRTbJb2/XqhP2d6ZuAyVaANu0QXDwZHYX3FTfHoRmgMH1sSJ6p +4vuW4hiVuTaRbxCPBll7ncsfnVAPbxqyTinKHnJRN1nUe3W7UmVaStv94akFCeNS +GRd0QIBvmJjXyvc2BQQ9pZce5jdqve2n2NaTh4/vV+uqrP56ye9p8j21oeRdMYJm ++fee5ZZBhCPg0vQtdGlNORwMSQ0mw73bDQl9Lc4IQn1UtU23o2S5fvRvNfLl/v0M +LlkxS1TG7+qScnu1dMDlX3xoPxqKwrzc1mKgLZd0ARRwk3dC//L1hyYLvUMCAwEA +AQKCAgBWk5XFN8XXr39MbaIYJa34IqzjI4VfMu6cd3LxQig2OMWBuZ28KUcUJfQH +UIEeoNamhH9pXV0g5F2G6GOpzXVqqSXlDUhxT8UOrFsNLCQoFTLE514GZ83kCZZ/ +YfJhRe/dRmF44UcW8ontyQ9q2W1VShkBrCZagKzv247IQoy18rUqoLandI8yjdGl +aboAF5sues2jDOCZzpzszMOBZmrTGDV54BS9rORnQE4PNt4plkv82/6Ud18JjkfO +zwbv3eweIwIAf8Aj6hSTwoLQmdv36NppMY/zlH4HQjBKfC5T5/JUeNw50pit7eUJ +Ff5x88H51AJecb7Q7TfwbTb0/ojqAhRMsM+OEGI8hzvEscXr+4jKAMH887Gj0X63 +LUwJxwvcZwOKZljvTExot2U/lFnpXMU6YWoMpwurImyh2RTjSjz3vnUf63EnUNWq +FWuWyssiOIq4yzpgNs8uvX5HxcnurK+KmUo+/bvSpXSNmOSGYwsysnyjPS90wzfu +XFflyQqV9uJCrQlouv7g5ZNV7gOobop/2NJQzQ7RqtD0+wB2uA5z32q2s7FyHRVG +z009MYS2CXQIIO6h5V8ErLwuFmCZ5UWfEGk+QZWHTDic1tJaRPa871XmjwWgtWgF +yAYCTAqVRFoxttmphnx6FsLfhhIJMjxGyKIPmGJq/7sOm8cEMQKCAQEA/8GfAPae +sKbCrc2cQfgT2j7lyNibd1whRAsNTtC/QdccSuhWlzVXNSMjNum7xZKGQ1dgmG1z +avo/gUo9eoFvnmoCFiMI/G3H7r2jVWK1A2WE5whWsY8dHnl3xat9NHYYqHVxKaWz +kC7JpT88pc1eS6+g9GlbdjZ/46HYJGVbdcJPUfsfLpiZMSWm8ZNGtW5EvXV6l7V9 +wqgzh/Jbbk4rfHEP9Yw8WNYY4TeaCYenwnviAadPDXJ81McvdiCG4IvfpJhlxt0R +lM1gN7/Ck1bFeHC0YwSmIn7vZE6Cpim9pRJjNExKsxRvd5guxhsiGAH5eVlzY+N2 +yyYyZf9MnmwISwKCAQEA85fM9BdKtVrAU0dafLUvooAj6tE9b75/yRGaQ2OAadK0 +Kr4/J1qFOck3YT3UTz2KSop944D+yFZUzlR/Ffidl0BbYTg4H10/yABDK+IpFqkj +PeOwF3n0L1o9VWOEl104A/Zrbc30pAAEqxOh5kZ7LZ5uG7nesVdhYtUXUKkBSd3r +deOYp2U+E4FRCtAjN1GdlMTVBgT/+36gRKzr5SPI1qeEeJFe5A5RBaOXriZ6tt8t +THjCBi6DdJEkhyPYwbvGSPobvOjFTR2B84/SUtorpBKPUzW58XRV9G/qS+7CJUym +8c6btXin8SXCvH80tv73x3oUanpr43Z7232WR+vz6QKCAQEAqNAqnb4rPLq14XbH +3xtaL0I49ftTktNy+bC51f4fX9wWxrLZBPGmYGKTCdn5oQ14Jdb04WfNOR148WQJ +dGUfQdcDDY2Ojt//iewOdXuzs0w9DyoH3ydxtv3COu1YtVoGKJtsWGsRPOhFHRfC +dkY6KYcBnJI2Vq7ed2gKfOuSFQZuyNQS3vTGmRQbP3VQxMzF/rAefSjEm8neSauF +AigCuB8Aw7kO1CxtO6sxt3ydFNgkc6b1nRCmqOPYxgXuQSTSN5iIBV1CD5AIJIQk +cJBjw33Q81LMPhS++tx/jCIdFWovpQN+gvnIIY6HwSeDt4kGHD0Y1yP681iBB6Yd +8quoRQKCAQADArtLwQXxW9/Ip7ccl3ixP3gyLMffm7EkoQ0RDCfIJwyHArbxG5NN +9YizsPnwyMfux+tqZmu/uiFuM2kmsl3wQqFegD1hVdu18xrhbfgoCYsf9rJ0d9Nm +ymy7o3E+Fa7djawiPUtqw31LSADWQcS/+ZdOzGtOMdBIUm3pV01mxlFksZ1vZDby +MsT3pz7oLiAOeKhRXLp1N0lvz9tSh7CxxnxCqTlNBEhIE4+KXXtiyztaGJv9S5Hg +XPLgoLbLHjEDMeQp346gt16lzf9BeuTTME+JLb7QlymAzelNavQHVf0yO+V8xrL8 +rgTMI55ZLKmPU5jw//ZZZ1t8iP7UgLwRAoIBAA1wmRj28icP334PXdJdCIzHdZIO +A6kny4z9TzeiQaMxwoeAHqWBYi3E2TmR9damJPdXmxHAA7ARhKpoDuYQN4nqmYJb +Te5hVAoxe9Qa0diilJJ28omXFnQ8kZlkxGHcoi9ZMYZq7XTPg6b8S/8ExRuN/rLo +TVwwNINjy3GGCI2CQgPQhbKLdNSK8EZuZxzIha3rO7YXX65P/JSs/pTiggjxmkCR +kfrSijHCMbERGj4tJoAljL/s+2ZjoRF/a+PaMugyK/orD6X+JRsy27SkggRNw+DH +SPnNKciZN474bojJNUeV66SrtVSAsp93GYqGRgNrLVOvwIb2WT9Megsl/2g= +-----END RSA PRIVATE KEY----- diff --git a/certs/2037-cert.pem b/certs/2037-cert.pem new file mode 100644 index 0000000..edd45e3 --- /dev/null +++ b/certs/2037-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTMx +MzM2WhcNMjkwODE5MTMxMzM2WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjAzNzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAKsgcycsCQBrN5wTBPmHkczV+FjutDOZEiJpzjFv7VJ+c09TOK4g +WHqxyXYWfZq+O3R4WDYhgc/21qs7NemOhsjr+wDtxmq4hx7OV3MbdHdjXUercQz6 +1IQtS/MsacN7dXWJH9yfCkUILw2z4b9cvZvBd9kHwkMCVvQJYdhxL77g1uXB28Cx +98Bh1GL2b4/fh8HaXfB+tZtOWO/chWTCHHY8tsh9c5+2gmFGaCQve/nBG2hBu2Bc +9fEBPiTJXImpHnBo8nzeaZqwylM1h+rJVV0bJgSEwik+X1RH3nNgO9RXmo1GTQxN +OTlt6UjHo2I9gb/PpJb8o4+luyZ9UdrJuVExdaxnlVODAvfMOf3PCjTlN8CW5jB1 +OpzQwe2hNA+vMdUjGOv0yAzWZEGcTfm1xPu/tKnI7eukHvBqSFwuXPd2YpMkB3sy +885v373JKViu5F2Zo/mkpqxOgOppse9SXwS43EvG8ZnOMUVqo0l1uQFuyrensewO +TLEFVoNlKAspVDsh55BJk2BBt5l8XEwLOyQHA4G67tZ1xSiCgagAJ/+sCtpLh2no +IHoT0RRUPtvcI9J6W/qYWIV88oc8NvtAhqrmfhDSYjiLCb2daFy6aAWbhMePdwoZ +al864oaea6yJL836ipr3i81yWyzyLgPgwCO9s+f/zxv8N1Z5Rx5gQIHpAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAMRivux480yTNCItF6074qPGhIN2FTF5hUXmZC9W +oLAoCIAJ09k8jCU/EdFamHpDFzR0Ek3JYUnH4uwmqoLWpUsty3ly2ImpS+gSbezp +yACAU4tEkHnsHZfRhphyR+hhLNVtO+xAwA3POo+niBozRCu1yBmWlID1fApIQ04X +rwpKl95/Xo4qlCjpTq2agiEVYpkF4f77ns8xgEtS7SS7EML6V7qllvMzFFHsKF+/ +mT91hjxRXkc2PC2nonUHnw6+VL+906bo0wlu8iiKbAWVmStDymtyeRzX4vcjsG4W +u2FatRYKlWKzpMpZPjY+JSu2C0YJ9cD7b9OmyEkiH2N9JvkUV21dWdms/6A0E0/O +czQbY5zDcWhBJUldVH9sYph40Oa1GOXQKZ7LLokXiKXtLrsazhgBwTcGgQ0L0qtq +39+y/sdForqujSMZ8KRMKnxCxoHy023QDrLev4yiS8L0rc1bqLonyaDkk+6m+RNy +dNcYyViWMKV9nOiiQKhkHfVqfwlmQZAleGyPYZnHMdYhBVln2S3BwWKSSs9E7HJi +SStbaCQL90up6mBIeGgxXUVninS4t8t3n9KmPNLX5zjNqRpWvyS7dOJhrMKaF7cc +Ik/dNzmYSDHnv7nzSKkiFYelNOW2x/qtD8aWFeGvgUdRapUv712wImPZLdr2wC1I +/hIW +-----END CERTIFICATE----- diff --git a/certs/2037-csr.pem b/certs/2037-csr.pem new file mode 100644 index 0000000..029c310 --- /dev/null +++ b/certs/2037-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIwMzcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCrIHMnLAkAazecEwT5h5HM1fhY7rQzmRIiac4xb+1SfnNPUziuIFh6scl2Fn2a +vjt0eFg2IYHP9tarOzXpjobI6/sA7cZquIcezldzG3R3Y11Hq3EM+tSELUvzLGnD +e3V1iR/cnwpFCC8Ns+G/XL2bwXfZB8JDAlb0CWHYcS++4NblwdvAsffAYdRi9m+P +34fB2l3wfrWbTljv3IVkwhx2PLbIfXOftoJhRmgkL3v5wRtoQbtgXPXxAT4kyVyJ +qR5waPJ83mmasMpTNYfqyVVdGyYEhMIpPl9UR95zYDvUV5qNRk0MTTk5belIx6Ni +PYG/z6SW/KOPpbsmfVHayblRMXWsZ5VTgwL3zDn9zwo05TfAluYwdTqc0MHtoTQP +rzHVIxjr9MgM1mRBnE35tcT7v7SpyO3rpB7wakhcLlz3dmKTJAd7MvPOb9+9ySlY +ruRdmaP5pKasToDqabHvUl8EuNxLxvGZzjFFaqNJdbkBbsq3p7HsDkyxBVaDZSgL +KVQ7IeeQSZNgQbeZfFxMCzskBwOBuu7WdcUogoGoACf/rAraS4dp6CB6E9EUVD7b +3CPSelv6mFiFfPKHPDb7QIaq5n4Q0mI4iwm9nWhcumgFm4THj3cKGWpfOuKGnmus +iS/N+oqa94vNclss8i4D4MAjvbPn/88b/DdWeUceYECB6QIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAEHyCf2viJ/X27ELexYXLztXrt3w11ywKYtD5b65W3630Ojs +8fvlxvP/BN+Yk8yhW2Ad7/TIydhg3Hw4riM649Aav4bSLXCp8Tli+e7NS7kWF7bT +RWcpm06gPAgnrzl8bQXpqzi0p1TWq3UlCDH5j1kCIDKOMF8IBANAqP10XvLR0iKk +OVFIfA9ZhZURJxczOcRZPnKgEQqbpBiKZCEVLLIXDpjpLfEmINL5fcEbwYB2voRq +D5dvuj0iMJaBrGsXtQL8IPy/ghl3iEAM+319OARRFczW09Pwt5P4rrXiac/0Kgtx +9l4PnXKEavbRkIa1S8dKn0i8AkQwasbta4/G5pZPneT9zhG6+G3IqFuxGGV2bgu6 +CziMfSy/SbmKydKfONm4gAmr6Xsv6V8vF9oE0ffDxHBt7IwB1qHHjgCeRYZF4FWh +6/mJc8GsVLdRzk0Q2ceGfwxrX16gntDp+v0L3agkZu5LuUD3Sheif9oFIdpP1sNn ++cD9bSMOYDRzJd6GMytUfmqmKHw30eK8wsrPCaWmfSkbprAa2sT8bb2Fm3iOuj/h +6UPan010Cw9twyi3H2g0hglTz5nlnTSM5PqiC/IH2zccsEC1/NBij4YpSNOOxD8N +HW4cwBUn5+GnSIC6sdV7C7tNZ0dNBmJFkmgfEXWmdhlXeYHUSZHxm9wIY8TW +-----END CERTIFICATE REQUEST----- diff --git a/certs/2037-key.pem b/certs/2037-key.pem new file mode 100644 index 0000000..966b2bc --- /dev/null +++ b/certs/2037-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEAqyBzJywJAGs3nBME+YeRzNX4WO60M5kSImnOMW/tUn5zT1M4 +riBYerHJdhZ9mr47dHhYNiGBz/bWqzs16Y6GyOv7AO3GariHHs5Xcxt0d2NdR6tx +DPrUhC1L8yxpw3t1dYkf3J8KRQgvDbPhv1y9m8F32QfCQwJW9Alh2HEvvuDW5cHb +wLH3wGHUYvZvj9+Hwdpd8H61m05Y79yFZMIcdjy2yH1zn7aCYUZoJC97+cEbaEG7 +YFz18QE+JMlciakecGjyfN5pmrDKUzWH6slVXRsmBITCKT5fVEfec2A71FeajUZN +DE05OW3pSMejYj2Bv8+klvyjj6W7Jn1R2sm5UTF1rGeVU4MC98w5/c8KNOU3wJbm +MHU6nNDB7aE0D68x1SMY6/TIDNZkQZxN+bXE+7+0qcjt66Qe8GpIXC5c93ZikyQH +ezLzzm/fvckpWK7kXZmj+aSmrE6A6mmx71JfBLjcS8bxmc4xRWqjSXW5AW7Kt6ex +7A5MsQVWg2UoCylUOyHnkEmTYEG3mXxcTAs7JAcDgbru1nXFKIKBqAAn/6wK2kuH +aeggehPRFFQ+29wj0npb+phYhXzyhzw2+0CGquZ+ENJiOIsJvZ1oXLpoBZuEx493 +ChlqXzrihp5rrIkvzfqKmveLzXJbLPIuA+DAI72z5//PG/w3VnlHHmBAgekCAwEA +AQKCAgACl8ZG5KrqP7Wi/sLHiR9TbDaMGmnOklYtAU9nflupMVNL82XbdZABo+n6 +iRK0IofCFwS3JUDTRtkv1QDXHhq6tqCh/fhQq6UYeWXnz5WvLWk/acCXwsEvk4Qg +Fh8wIBHCiyZZcGt2ak5UNdKI1L3mu0K2niB6ZXGt1uqNngFsMfnvl0VeIRQw7QqL +yVIdavSiok1kFHdp+ADu+Xdn9Gz7+aWHWidDVz+Ye7meOr31JdDlfoF5T09GrI8l +fYuSZmaYq25pJ/GPr3gRVLFPhGdvtraXwO80Msa8/y3Gr8GYUQ99boBCXHUugpTT +TnsSRP5PSrUiuIc96PPx/FoeJ4pQQ0iMZX2FSlyChRYDaZicihT5uoky0jhvdO3+ +BvowCDAux9wujQO9fCsJqTCaL9uXGp8NSuwodljSJHZvdGKIJONTsK39gnDtXFol +pHfs9x8mxjN34jJ1qtjrhNjHEPnDD+rHJSEOVmXVymFOxPFFMUwpC9aQOe84ZNgN +/6Pma74GGzobMzL9Q9EJwC7ZAl9/SR3vmRwO5LpakbSr+/dlgBn368Uv0Ft8upsr +ZDCM0Enc6aoblSlJSuuQdQfOAHlyVIgLvug57ln2GVppN+hgEGyxth3QjPBlA5t1 +CWTeaS/3NwIgEydTyj4EnzLvLapEgV3J6yPNafyjp0NM57sZkQKCAQEA1U9Bu6If +bEZ/GsvEIRcovRbO0S80JNA8/WI0/pnmn1G8MnbXo4irZTIhI0+hMuZ7DWYnhngU +3qfJJRysLjs5ZuX3fkOWE9tpyEXIvvPCs3X0u0iNZgPeEcjVyWOnUk1kt6DSqSxy +5x0bmOQHP69apf4jitpuJouj9/JOTbT76up58cx1PTRW623541aitwZjh8TvudPS +HoSy9LVHJ04EGzwgpO0KVaO762DeQaSOsKgzQyf3ENWsOGG3n9e6EHzlw7Yg5DxO +aG4JDYwLxSK06C/ZDqhOKJR0S5y8wniN0ZNbOMwfiuUkDJ8gktAqi3KMZyzXKrN/ +5DQ3hoF2G5L3TQKCAQEAzV/9Wj9P9k3nZT2hKOqBR3K3omoRWJlgw0Y1raHkY5tF +h3Vfi7G3kpNc/3/soVj4Q2kVuv8mTYNm3/ZX4K7iC3+Nd3FZR7dAfXLFs/TD2/Ly +tAO/WBH0UCkpkYjTR0RnHNvPwzqXMEAzC3hS52WnJ1KMYQC5VG66Bcyoqq6YvvFm +HkM2jf+HdB1kgORa5kAu79kRmxqAJGaJpbZJeumWorukUgPsMXmgfIJCGM4ejIA1 +5TdNMS4r+ErZQQqvtsEemYgwIr9ZnZvY1NIdUKNr0lSjh+P1wKPqaye3l+njql2y +svYlgOn2l4pTunxuMJRxiPtDH21y5j3+O3wjv6Y/DQKCAQEAnO4VRwyMH6Vxp24X +2dxm7U4VU9Jtg1PsOuIAaPsirz17voiuNrK6ndWWiZrw1ji4ePAZzhUUDYbVNcd1 +aQHLRkeToEHq7Kr0lRG6EbnWGR+DsDE9Tbs0qlLd7a6yD5u+qFXaBfocgqlofz/r +kU/Z2dsxnNr8RMFhHW4Xa5Xl7DsbAehQrHmQJN6hBD7dsNczbFRXpZgPssIfwmaH +dYQxAzRmM8/sVXsDKrT2bsa474CfTh3d53W7oTNK237jdXPdufGJG0C+0pd5c4z/ +r8XL4DIrd1wdPD+Tm3kxacU1WOUXLJ8H6bCQp/R+C2S4mCTq5JEZr2GlimdcHkmq +cbja1QKCAQEAr1HEK6hkkHSMlmZ4Dz+xQNbzYFh/mkzEx65F4IWVPFqujiZqfAwo +E55tA0enL02OEa3BeTKa9gy4Y3QeLJXeLcajc1V1y7zp9q1ljGvkTv0kpvuT+pDJ +KS0aaTyOcAY6p+4VfCmmKvCDIsWCsDqc6PqVD7HYg/VKI+1EBwCpMEdOz4K9LZb3 +gO4ef9Fwr6IW73U0jF2hCnHmC2qDa8PAbgcVDVZ/6PRVRjTES/yZI4PHfncpFFTA +AGOU9usyeSZ/Ar25qdADpoIGJheAIvh+8LyEJVs6zUqgsPzkw3BMg4EdLZznAxe3 +BEJ3m3jhb+Mo0LD96fQ648YEI6+jrNU0eQKCAQApy3qNv/p81JoucGlQbvkW5kOg +npZ+BGkvjuUlWGh9MmZVmNG20WayQCbcjHGLhnzQvLgzpL7JCPGX58jmblsUhh8l +YUPIBJRqQmjPeawsTCY5B2M14TuCJ8m4b0Vk2+D75BW2VMil0r/GAqOe7KBu14YO +Pfk4czaEAXTgIrSnwWj6wsriSpnOpl4gThhT1N4FsysTzpRydrAq7knbK+BURP8s +vBQA9pajk1g3yMsY65hAI3K6OQTKeL3o8UMhyR9GmWpb14MObjm3NFkmFSD2C1+p +QAykOQ8rA/muv5sdsqG2qRuUeG+O7JhNKjOZyV/67YXThPG4VwCX94xzFb4v +-----END RSA PRIVATE KEY----- diff --git a/certs/2047-cert.pem b/certs/2047-cert.pem new file mode 100644 index 0000000..5129cbb --- /dev/null +++ b/certs/2047-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTQy +NjAzWhcNMjkwODE5MTQyNjAzWjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjA0NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAJ5BtZXm+pOmBb+xktSXxb6bQ2b1SkUAAvpXJlZ4CiFhadEhYi7y +BeIstPCQ3vfd462DqZJlugoJyrgSdcSqAP41E2uad9/9bw9y2QGNzG5UpVcO8uA+ +IXQSR6fwUa8XSyNyV8/qQYwGCdjpWP0IIpajI5A8KT8JQoTpxLyDnV+UwaiN++gq +pEVigtWnP1rk0O+WJoItlszuYltGqPuv/p326WiW48MotAzT28/kGcaO3aDD0Xx6 +cAdYbEdyfNcfskGO2cU1cS4vxGtNnJG+1SRzncFiQ+hEM4ZFxA6IKZC+R554mwef +qnOy/r1RMc0tTGOJ/pNBrywUSrp+mWcK3SiXjWLjSk7YNrnwYpO9LJYaaWVU/zf+ +rT2CMNgH9WggqsiQHbYaDCy9xAQhizpr6zEh5AFnHGYJD17QKbDcCKifFZwbi+E3 +R0HuJ+xVmWpba1Uc84mQtDM8dj8cfDURLGUjiwFR/s0Dbvoz/U/OQNg7tshe3W3e +lE05XcAlZsFb56Kk9XDMz0A1Y5xRfTn7Bjn3es6G0Gf5BUA9m1PIxinbLZQ6iIDh +eD9vO2kXwVwt81PGb77YyZPldlHVEYmC5KZWVWyKitNVrnq9LwnnF3OOwJu/5l+W +mQaIUFhD1EBOWRqxWSrX/G1skcdtRyESQzTFHDiJSpM2Xc7v98VLXrCvAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAChvTEeMt0pa6HhrgDN2wGnBcpegOx5BjrSTeUj4 +GDtv8EZkoRGLzBAtqDz5GBZ/VN8VkffUqaAoEYtIb79JGr9/TbszagLsJf+f2ogK +gyPTH6GvtZ5yGZyEp/x++08x9fb+xDbaQqJU04hI/g/ymt/d5d6tQQUwGnrWwia3 +cY+JuErFyNtsYe3R2BwPCu5ubHwo5au7gNtsKHAr9bAhDF7TdZdkLnzglVRUTCgu +gYjb0HZOP33FcEcBvevjAbBOMVvcUM3cD8L1z0WNH+4bCZUzhH5Cct5CXYPW3pS6 +IqQWgkoRRU9AoEHIOHquTDyaDatJHZx61l/iEn0LQDGB4ulGB0bSMyVxZQWUjoyZ +j7l1UvLdDeR0zZGz/KwXMLqZACN6Fd1ossvq3+mATXXd767Isy1xhU+VlBz0ZRof +YscWXcN7P4w2zVyFiP4xqrHwuC0pnF9LoOWMf85/PClpiTkKxmEp5twOk/5qzp9j +p500Zg49NXXRRz+5PNl+Vq+VQNewuHmAbEZqYPNFpgaudpD3W+c7keDa3Zj38CAN +QRR4ilttCrJjBAsLSB42bMcNUxHkLSfHfXaiflscQZhRYlhPC1uZCEomRDhdnwcA +i3wZBi4Xh7pWsQD7WwbWRix+igqXTNSx+QK6+Ra/ZvmtV5q+e3LWROvoUy5PqgQj +LFbb +-----END CERTIFICATE----- diff --git a/certs/2047-csr.pem b/certs/2047-csr.pem new file mode 100644 index 0000000..6e13a16 --- /dev/null +++ b/certs/2047-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIwNDcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCeQbWV5vqTpgW/sZLUl8W+m0Nm9UpFAAL6VyZWeAohYWnRIWIu8gXiLLTwkN73 +3eOtg6mSZboKCcq4EnXEqgD+NRNrmnff/W8PctkBjcxuVKVXDvLgPiF0Eken8FGv +F0sjclfP6kGMBgnY6Vj9CCKWoyOQPCk/CUKE6cS8g51flMGojfvoKqRFYoLVpz9a +5NDvliaCLZbM7mJbRqj7r/6d9uloluPDKLQM09vP5BnGjt2gw9F8enAHWGxHcnzX +H7JBjtnFNXEuL8RrTZyRvtUkc53BYkPoRDOGRcQOiCmQvkeeeJsHn6pzsv69UTHN +LUxjif6TQa8sFEq6fplnCt0ol41i40pO2Da58GKTvSyWGmllVP83/q09gjDYB/Vo +IKrIkB22GgwsvcQEIYs6a+sxIeQBZxxmCQ9e0Cmw3AionxWcG4vhN0dB7ifsVZlq +W2tVHPOJkLQzPHY/HHw1ESxlI4sBUf7NA276M/1PzkDYO7bIXt1t3pRNOV3AJWbB +W+eipPVwzM9ANWOcUX05+wY593rOhtBn+QVAPZtTyMYp2y2UOoiA4Xg/bztpF8Fc +LfNTxm++2MmT5XZR1RGJguSmVlVsiorTVa56vS8J5xdzjsCbv+ZflpkGiFBYQ9RA +TlkasVkq1/xtbJHHbUchEkM0xRw4iUqTNl3O7/fFS16wrwIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBABrE1ECZ/QNQMXtdrurmhtoaqBQXDZ3Wm900bB4hQThBRWDR +fHXEbli+Xfyx7zFfHYOhmAZCHLO2Gw29iOaC7R6wYeT2yaYdvMCu5owOQTytPV0k +oRzHrXvqZhmqlQD8ka9xBhLLtuNA34LwsAR0DaP7O/5I1F00m4SjUhkf82O5zTXx +zHFo3Gpjduh6sd8z8FAu0ZTuhYmuYngQTyg/cAlrQATijX7SQHRp89PULkio+KdP +loqXUQZxUTIOYFy1x73Hr5wyf/nEiXFpbiBEMEMagHOlblJj3PYmjy1IyK6WZieR +VbSv39QfmfPqp4q8m0OtYXkTCLp+GITa/VZ1zp2IqFHn/L9LrVuCEhbJwyZQGXWR +QmORkO7kQYBzBQY0yQp9E2UZlYTCIr0ZFe59iw07y4/6bunSOWUx8IdzNySNkn7f +bWJbfGKpNaMLloEXkiAmA7PS4D8bU3tSPG4HS/U3Sc+6M9k+/qf2QZmD0s407/1l +d6sTmhgCgPVis8oNr5+gQdfBBUfGdlxZsAFt582mmSP30RsfM+Zs++J3L0YmXJIV +hSenYLluVgOOBuDgNiRTzBZyEjQeT9A1AAJDWrpcMtEGJpK4FZfHk/ca4VOL4p4Z +xBg7yeZIz4TrUg0IMxOC5HoLeGUAqsRn4rzncKCNo944KyYu1gLBPPmDsW12 +-----END CERTIFICATE REQUEST----- diff --git a/certs/2047-key.pem b/certs/2047-key.pem new file mode 100644 index 0000000..ca6d893 --- /dev/null +++ b/certs/2047-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAnkG1leb6k6YFv7GS1JfFvptDZvVKRQAC+lcmVngKIWFp0SFi +LvIF4iy08JDe993jrYOpkmW6CgnKuBJ1xKoA/jUTa5p33/1vD3LZAY3MblSlVw7y +4D4hdBJHp/BRrxdLI3JXz+pBjAYJ2OlY/QgilqMjkDwpPwlChOnEvIOdX5TBqI37 +6CqkRWKC1ac/WuTQ75Ymgi2WzO5iW0ao+6/+nfbpaJbjwyi0DNPbz+QZxo7doMPR +fHpwB1hsR3J81x+yQY7ZxTVxLi/Ea02ckb7VJHOdwWJD6EQzhkXEDogpkL5Hnnib +B5+qc7L+vVExzS1MY4n+k0GvLBRKun6ZZwrdKJeNYuNKTtg2ufBik70slhppZVT/ +N/6tPYIw2Af1aCCqyJAdthoMLL3EBCGLOmvrMSHkAWccZgkPXtApsNwIqJ8VnBuL +4TdHQe4n7FWZaltrVRzziZC0Mzx2Pxx8NREsZSOLAVH+zQNu+jP9T85A2Du2yF7d +bd6UTTldwCVmwVvnoqT1cMzPQDVjnFF9OfsGOfd6zobQZ/kFQD2bU8jGKdstlDqI +gOF4P287aRfBXC3zU8ZvvtjJk+V2UdURiYLkplZVbIqK01Wuer0vCecXc47Am7/m +X5aZBohQWEPUQE5ZGrFZKtf8bWyRx21HIRJDNMUcOIlKkzZdzu/3xUtesK8CAwEA +AQKCAgBORlPpO+CObNyFDvB/5D2zZBo3b3V3oWTXq4lT1XW1QvhSrv9gFucgElrA +bfdKg95b8TZLKbOVyXgSCVdkmW16Tog3faRzDmgDLRv2b8tAeu94mvU4QqLLRUtZ +3jyYrJ3Gf4S9WrFm74mpVulj5cUt2qz5ZzhDbHIRSYq8byDEqNAMbYW+NHEhvHLX ++CwW6fwJtKuBUck3vWS6nr1wF4GJYhnaWF95JMXBXnxnW/v/wKQQIyqXNfv5NhwA +Trk+sfe6A0zlBOThIlE1faLGV6wWpnTNtKu/0xPlAtbRFTnx1JuZ3y9W2vs01MC4 +pNNMF26kARoAfcmFtNetXHbFh5MQ/IrEfIJPfR0kqzGMsM0+hWxmDX2BQc+B6H4d +aJTIpWgDJLXCPMrTEyMTn0TW7V/Q/Jq0jwhXU/nF9Qw48kRGlg6++iu5KKZJRilv +POelRJxFyPtpnoidoc3gqGSb1mfdt9ZwthrfttU3GBLJ/R02IwwL4iplPTRaQCOr +1od0v+pOrvfCTSWxdDwFS2gXyI1ZEfLLF0VA1ni8BkEIVAIHTKvNgPqYpZWBpIpd +PhXxCCtnSqnw8SBQvWJsdob5QA2kW1WpTlvsWDDw3BZibNbB6jFnxeOMeIRSTMt1 +DljEVkDEQxOcXYibL/BaahECdg+Z1FAy6lrBmNtYBn7UbY8JOQKCAQEAzzAjz9WI +V2IDEwWIUpebfouA7R1/smkYdxFdAbcVFFu/syPEOHe9hpOYaGnhI+E+WXVteLnm +5JhKZjhyepSlqbqXJWfsYEkG7qeJitnBk+2OcJoLA89OAQlLJaCVDv+QOT/f25Qq +hpp9zH2Blt9Tx7GWyqChaPED310TVJGDzR+7wNY6uN+R6QaS6ekFNjA8Z/nMrUHP +MRIOjWdQ9Jnvq1vvWO4NZnqDQ66jUlAZ6ETrdei7VBphUkIuKa7A6eKPd66h10MO +5YNGFWuKgVoZm5ajf8LyZdhWAKBin4b0AmX9zz6FC9zgNya8krcQ4Cfc9u41YiZU +QfWf+rncZm/FAwKCAQEAw4pvpNgihcEHAbTVweXpKGehTxAo4BpSQ9XWIBc4wWsv +Zc17XaJuFCFu3x8y9e4FCe/YGOXw65wUlsiMKPnQQNqQo4KtZz0kpvrXtH6EybjY +ycxP/pwH9Ffm/Ia5aDDDguOk9/7RgxnsCsxjSrJi+SwI1XISkcm8eoSAafsBJW9D +PkLqAFGXHJBDn0cJkmquYInB5xMwOikFI11+D/Jb+59+OW527B9soBYlDU8Vysqh +OVaYyDDaaKh60dPtEYixQnoOCvUbENe+YYdQZazO0ZCrjAQJ6NK8qu2iBhdWHPtg +pUsyzrbAwHlz42OOZgJbHXqmC0IBHqbN495JViAn5QKCAQBhwnozV7LkYFfJAuRG +7EgvVo231CJrwVEM5YF4DLYCjCQQ18B/UGh59myEX+keb+pmdZT40ObUV9NLFjlW +A4uDYYpt2PJcoDiIJT8t5/+B2CZMlTK7Unag4Iy3rWSH1ihsCuqKhgfmyUCwW0vp +L2ktoWrgIxjmFkrYeudjEOIayG1j2PGOR9dmF3b8rbmKzwnBmclsus+TfMynBefZ +8kR3G4L8+B4Ui5wiNGXVsfv3b4WWdgDl9yiSkq2Ld2yJLyC4vQqaMob13pIUC1Eo +JaZNlq+A2jBbw88YrpS6Zwf9lbhDsGFArrCQ9VMm+wAYdFa7oLxJmoJJOSeKO2Z2 +YyiXAoIBAQCYT3S3CkOZu8khYyI9bkA24MGdPBEavmXlwOKRDIWA42R//5ZgUO09 +cO1TjpG7TjNOkivY+QK4A1NmP8AtCqlUWure8iLvj4jFKA5s4T+9gOYcCbEluZPY +l7+sY6R3q8QeaANPyISZgc+CecG9pUXCoLIg0EH2nRTauersoj86UXgnPyfWJ7d0 +4EpL/qFOExrQx3zp6OBf7SO7cE+JTFapoIpJYenv8mpCJ/2kaD2pQDxk1TcceDEn +5FQGrPSz+61XAot9rX3vmJ0KisPs7rYKNo3o+hxd5ghfe8oAxJym5odZOUHSEjgB +tJi4PgvlGWCvjaFYk4kbvwIQxEyLcXChAoIBABXRQwOlK1xEZiwMbCwH6rxQUFL/ +uuddVPjXWcyzcTrBWruvy06JckBXRLCUzLQwn5MPCrWQmGm8z/Ors8Vgj3BbQPjt +gCjZ51WXnLaYYznKgb5ehzUefp+PdUqNsYrAUElnSoMWYgrCdbfyTLhCcY9YP+QA +9Utq1o/E2/Hhzf1v8+f09sGkVUY7bOWyKUeV6yBiw9JEvEQEoJy1Rpv6E2CZe1Kj +GfQOm8ZCtOerr/jj0Svi6/YO1NW4tEZ3qipyMzy0trKL6fqOFRkelZKp6sKHJ1gr +Efm+vWH4xWzRvfT97nohLigE3/iDUZtSSHAZOvi7l6mOoM9fcHYxrRd6Gsk= +-----END RSA PRIVATE KEY----- diff --git a/certs/2057-cert.pem b/certs/2057-cert.pem new file mode 100644 index 0000000..a57c220 --- /dev/null +++ b/certs/2057-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTQy +NjAzWhcNMjkwODE5MTQyNjAzWjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjA1NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAKpU/CYLdzHPAks2Jp63WmMHV/yXrXwIGJqAfnMOvhTvnFLW55lr +B1vSa5H6UaoSj2E6ZAIpTTX8fQd8u+zHSquOoSHzluIpk5yAU1HOv2KMOChaYZGu +b+4q52MJnXRw1Cdg/DAAFirSKcgOwf+Uti8kLCIwMw2dm4dEKWDML0xBAeXXDagB +lVqzZD7YJ7sQA9A6PmuPuvyA2NJZEK3BmyMc+Ly1jy9/NsUme0STcNploxXjGNwa +Z8uF0Q/WAHDpQNpm0dgfvVszDIvbBH22TWxqKRIOzuAlhUXyLgNo5MvU1+fbPhYi +VC1bAtokbDuwSQTHOA2kRh57D5yC+jfaRDKRRyrg+XHXC2Mr0UDiEw2Awdfv8chd +92+8RiHcHQ/scGueHtED8D9n1/zrmVa7pysVNCPyWTBJbpG8HFjpMmdTTPypIm9K +VNmkPx1GV/QP9rEm9z6WjVfaLoJnmfhmkld3V+A2SyxgrRCaRop2nlKqmY9TiUh6 +wXwIXZcQE6eFYMvhwy55IuAi+DBMxKReKUT3MfgSJZfI3Mz81RWoPK6enlPe1Y8W +AG8ELu6J/WyqnVt2rep0TPnuoSXJT2oJzRNvKixivBxVad0GxEEEz1jOuBlZDk53 +irTyA3QqAOPkE8HCSMbNBQDq0fX9HnbNLEZBJ1rJdKGkpwn7vgrSNfAdAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAG0FuHPulToryEyHFrdECN8e+pxhn2C9HbdW/lwN +sWmQ+bTdindlyc7DYN4zHZYhiAB69x0s913aLefS8GHX99i5ppWksKfw1Hmm8bup +gZWd+ZKfFeu0Uf2IGoz3/ZequIVeBL2QkbfXvE3dtqbvNxrisaLWn+Z2t05U6LMt +qMi/J0ARk9ztylSOmdQa5zIOAsIDmZYpbjHcA4qHIva+/kIsLSA8BsnGSzp/YAfJ +WuXBspuhXDW/R6O1j+O6evmD6S+5DlNs4MQMlqBOWzYqXOHdxr2srNFwzUiI1g1t +/YCNXK1EpBEuKR3tgZuSQM5AiJb2UDMEoz4qC1rvPbwPzGmdwrPZAB0E1HY3PMie ++fhuNRth8V7pxHKzJGBsuXlJUEh/GL6+aBeiiqUW8EIeUvFBxXrnglKBoQKjfgZB +uGpJoulDKs/h+9TymLnexQlLAvyBvjlJRgf9cZVEB3vZk9tke8rNG3btmJFJlTBm +qe+yT4/15Spv1P6BUM/Q7YYoYml4yI9VlX1W7QiROaVgs+v8HCPia2+sD3MnkLBU +tmY5KhiTBO3WKqSjVfIb9C68K1Xh8nkdWX09x41YxF97hJFCd7it1uM8mXhxq9r4 +zVUGh1o5RMFHvD1ZfoIP18umAePsxVy5UprhWo1lPiqdBGuRw9gEg5AapSPenzM/ +yRTM +-----END CERTIFICATE----- diff --git a/certs/2057-csr.pem b/certs/2057-csr.pem new file mode 100644 index 0000000..8b9a60f --- /dev/null +++ b/certs/2057-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIwNTcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCqVPwmC3cxzwJLNiaet1pjB1f8l618CBiagH5zDr4U75xS1ueZawdb0muR+lGq +Eo9hOmQCKU01/H0HfLvsx0qrjqEh85biKZOcgFNRzr9ijDgoWmGRrm/uKudjCZ10 +cNQnYPwwABYq0inIDsH/lLYvJCwiMDMNnZuHRClgzC9MQQHl1w2oAZVas2Q+2Ce7 +EAPQOj5rj7r8gNjSWRCtwZsjHPi8tY8vfzbFJntEk3DaZaMV4xjcGmfLhdEP1gBw +6UDaZtHYH71bMwyL2wR9tk1saikSDs7gJYVF8i4DaOTL1Nfn2z4WIlQtWwLaJGw7 +sEkExzgNpEYeew+cgvo32kQykUcq4Plx1wtjK9FA4hMNgMHX7/HIXfdvvEYh3B0P +7HBrnh7RA/A/Z9f865lWu6crFTQj8lkwSW6RvBxY6TJnU0z8qSJvSlTZpD8dRlf0 +D/axJvc+lo1X2i6CZ5n4ZpJXd1fgNkssYK0QmkaKdp5SqpmPU4lIesF8CF2XEBOn +hWDL4cMueSLgIvgwTMSkXilE9zH4EiWXyNzM/NUVqDyunp5T3tWPFgBvBC7uif1s +qp1bdq3qdEz57qElyU9qCc0TbyosYrwcVWndBsRBBM9YzrgZWQ5Od4q08gN0KgDj +5BPBwkjGzQUA6tH1/R52zSxGQSdayXShpKcJ+74K0jXwHQIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAJqqCD4gnZyfADIXkflz+eNSlXrbSYH+wRfp+3RR7a8ZPiy8 +qWiJcjMcgZ9IhCLBa6upGwt5lSijRP5TzrF8yD9WUAP9iItjT3WlYTDR7J+RT6JW +g+5X8pVAsEbJ3Vdn6bVDYFMwH6koVEquffaLtiq5Zk6l9Ol+542gKf/qe385pghM +0Hk7DOaJasManwTChJEpn/IRbEpGjtzOseIJ3YUPhmzlL4ZysXw9dDw9HB0rxJ/m +4uUB4bVSaV9LSKXJGxxlGUFdhvILOQ+VUoDWCBi+drRrgxyzR94tvUY7c92uVNjd +H+J5STVkS2ShMEiL0tfcx/jr87W+0qKb/1/D7+YYpxPPm/gNFRbJZz0Wt1nn8YxU +HeojdjHYeA8+ugvobdNkVIaESRK/siuDJyekdhYDuh0T9FGyZ4VJ7niVB/pRN35e +3yELI5xDzHM+cOkOEYpcOjWMdN7UCYJGpes2G09X/F6D7vpbS7USnU7jDwnMVKth +BzZXtPX1SImOXIE/TcKDJzPOwtITGPGPoelmZKvMlh9N1e1WlrFK6YpG9Dv7uvyi +QtVgzjwrPYP22dAj+F0WvB1F/tZ3WJQhAFo65jNh2Y3Myu325NZ7hR2ax3TlauDO +JQsNQsEeeUUDdmrfVKMVHc1a6BPfxRU6LLUypxMqDJGF4qZso4qwKwTxKy+l +-----END CERTIFICATE REQUEST----- diff --git a/certs/2057-key.pem b/certs/2057-key.pem new file mode 100644 index 0000000..1782492 --- /dev/null +++ b/certs/2057-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAqlT8Jgt3Mc8CSzYmnrdaYwdX/JetfAgYmoB+cw6+FO+cUtbn +mWsHW9JrkfpRqhKPYTpkAilNNfx9B3y77MdKq46hIfOW4imTnIBTUc6/Yow4KFph +ka5v7irnYwmddHDUJ2D8MAAWKtIpyA7B/5S2LyQsIjAzDZ2bh0QpYMwvTEEB5dcN +qAGVWrNkPtgnuxAD0Do+a4+6/IDY0lkQrcGbIxz4vLWPL382xSZ7RJNw2mWjFeMY +3Bpny4XRD9YAcOlA2mbR2B+9WzMMi9sEfbZNbGopEg7O4CWFRfIuA2jky9TX59s+ +FiJULVsC2iRsO7BJBMc4DaRGHnsPnIL6N9pEMpFHKuD5cdcLYyvRQOITDYDB1+/x +yF33b7xGIdwdD+xwa54e0QPwP2fX/OuZVrunKxU0I/JZMElukbwcWOkyZ1NM/Kki +b0pU2aQ/HUZX9A/2sSb3PpaNV9ougmeZ+GaSV3dX4DZLLGCtEJpGinaeUqqZj1OJ +SHrBfAhdlxATp4Vgy+HDLnki4CL4MEzEpF4pRPcx+BIll8jczPzVFag8rp6eU97V +jxYAbwQu7on9bKqdW3at6nRM+e6hJclPagnNE28qLGK8HFVp3QbEQQTPWM64GVkO +TneKtPIDdCoA4+QTwcJIxs0FAOrR9f0eds0sRkEnWsl0oaSnCfu+CtI18B0CAwEA +AQKCAgEAmifaINCFqtWQXOOAZmrI6hEuZ5Qa1cM6CTK7voQcMjR9hVesOeRsv4Sc +CHzFRigQDc3bzzzz/SUrPwh7yBrCEKxAVsrvxnYceyqEvehgu97twE+0ODXoZWP9 +EFwWXdjzmUQkWYjqhwy39bCtkRNVIysYqkR3IB6BMRXWYR3KvLek8RAF8wSj2He9 +BUd6BcnDucPM1Go7r+Uo1o73ElrDfi7tS1UCZtk6h4mBTJooK/CKffePezyGreLJ +SAzFT2s7X65owrJPHOgBtd2dnezM+47E5uvx/VjX2msJi9p2H6fdU6DP+xZMmtPg +q+8E6axtGV738xi2wUVc5qh/rubiimqnUYILU7w1USyGO85IjRV4RfrRBF+pekS0 +7Ka87wGeXbb2BojgvJupu8JhFQplygLkZXqJwlFyq9W8TxR2LbXG62vJ4R4HVFfb +8dP3cI8ZbBe6itnaVa829WDCw4GCBCGb0idHh651MUAHfNEZ57rhrFGInwEX6Iwt +l1lqcDGxSlvN3Hq3YlpvdOC+DO5rTbN7/zrky3UNY8pbG2HwNEsylQVRnguv+DfF +MgvHiXokQQMXDDVLQDNipES1efRhDlCW6B2VyX/PQmAWNRExEsXpM0QUftOqMhEx +/SQtsFa9Zbo06CsF7a3QImO2zOYEq8mSMJg2QVb2YR+mkzZnph0CggEBAN+PVDrQ +oFnAJ6SHJupBZkWCyrgBVMTQvLlju/ljEUQfxdfDM31V4KgxXJkrjMXOYs52R5+2 +xHtkyB78vHBqKfXIq0BZlVvWND0ceu+AJMRuIR13z1T2/uS/OY2FfR8QLdN6DjBd +dfZXOHJddIIsx9JHTxaMCoCOfJN6sPb7cgJZ+b0GkSyx1NJsTbiQQhl3wcps7dOG +zO1yP2FJjY7pT1/G3jjenwSuGLTyqRoZ993zgy748N3Muqar/OdODyGumPbhWDWd +iFp7cyZKzSTt1cltRtBpnNLp14UJlYlJ/0Xxy6w+hTe1/LSnskXhEj4sgXJXikGt +VZt2xYQgOW7rm2cCggEBAMMMYH+76nFWjU5Yd+ANlJybZYv8hdf+eCXPLmUrSNO4 +ZWzGOY6Ze7Qal+WBJiiTEktVCvrewZyvD+zki9+Fa/C8X916L8zwhSXf9M6b4gh9 +5He8jEEYLoH1mT6Xp6bev6Jj/cQpUnsT9efdf2uRlfFNEh2bc0GfRu47g7D0+5oy +lw9o+MelFCD9AQcuX3plv0/ThHR+WefhuavvBL9OjeaPmruHgf9d3IuTrDqkiztG ++tvuAIoldv6kF5dRCBB7qOHb+5NfTCHOrTXq3r01jOri9rJw+7lDc/tl5CSdX8Vj +e1Rmg+VYgkFe1n91ORnHxuv0PvXEFnjqfA7tQqjHqdsCggEACcUJuUhEuadcFCST +3sjc30zH7yKfwbodhTyGim954bBBxRwSs/d8ydzeXxM4I6zRRJSGrMQf8gSFelUx +Jvh8vPD4CuffTxQdVE5aUP0Ynjzx1YfW16+zk+uHaFfdD+51EjjTRenPreRB4z2S +Sd4LHXVgT2vvSY7wgsFp2mFCqjekYk5XKczbsBZrjxU+zj4diesYuZW6fuXvPyEn +vocToOvf6jxQVrQFAGNaYHmiC2EI6pSWchrwTThW5QTURHSM2r0eTbmEq++ZKKM8 +M9Dw9sx/u7vhzpXJhVbV4hoJvdTDQdO5nqWlVX++mq8rTOxE++o3cIdSpmiaWRvP +ZrmFIQKCAQAX+piOe5K59lMO869hGypPCoe0awolYMJym4Lvqx+b78qAUepXjqT3 +omFUNMl1KYeRPVZJO0OAOMFzdTGA/E0l3nLGrrPbtSIZYuwczms+cgO5eLOheRCW +p5P8bvaMfEwA8dwL1qyuNuj/ZWq51b8iWEBG5YqI4cT9mtF42tVnwppxqY0UNkZA +O/p5YIkaahHYBX/+Nl5lNIn4Cj2CK20kkDkMnv8rXuWzPydoWjxHwFUs3piwYyS6 +7396+dpM9HbxtXK7Tnb0nQ0MWOCjUEcPxXFgxKUdxJ4opQEkQzi38qAB40yJ0JTK +5pbmOooXkkjxTyjCXCYLHYC88QxF5a4LAoIBAG4+j3eKVFGctqVgEcJckLO1nUa1 +A+hcDIQsoQfn5qvN0Z+6wZRxryJzr0c5rLcoBx0Iv8VwoH/6lbTon+Gws4XUm+79 +kHY+xdxNBgUTfAyyArtxDoFoYbm73oKkA//0DdWsvQIZFc/EhFhMawVapegluwj8 +olYLQG5l8D9oVU1djfiNT8svGFdgroeytDSjvQx1jXFL9hjkTFWna9evZgfH6I4f +old5OZlgErHkk2QpwdaxxijAI8xBBVhQ9k/KuhLFffl7gDDdsFMFn7+x8dN+aRUT ++xDL5pT6WrAZJz01j/bB+/ggPWvuLVa71srQJ4mbik79/S1WlgxEwhFEEGE= +-----END RSA PRIVATE KEY----- diff --git a/certs/2067-cert.pem b/certs/2067-cert.pem new file mode 100644 index 0000000..852331c --- /dev/null +++ b/certs/2067-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTQy +NjA3WhcNMjkwODE5MTQyNjA3WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjA2NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBALxrzv/yiuRMgr06tREuXHz920vbofUYuvmahlL4DqSn0D2YMq7c +qexdjO3rVkWFEGQ/1Z9DZRKp72hSZaXJaTLunGj8sBEsj1fU8CIWitaCBT8cBwdM +CSeg/KDGM3GIaM1Su6IcFqBSDU806FwPUBCgF+CLTo40o8zLoZxbgoamPYfFvAKa +qrMELogq1UxwSr5u8KEtK565BGSMmCNXcG6faSb1eGx1t2I6UcskEE1o69hBCu7S +F+mervCG3si5DPvnikXRmbbVY13JIlsXZGDXuHNdby1+k30JTHy8zzV7liA9YiDF +suXDoPoF9exGbRRLsnzPZNKronDYXP6Fc39G5b/r7yIpasxKNsD96rPprVLHM4Py +UzeDVtK+aqCvbwzsdSBWWayptiH9xDfshzzr62YbEFS3f+x5LrTSIUXJlzcrSp6a +yhLfEGsYtUP8OkmVfHt1yFt7cD+cb8fU0Eg7QKNWyeOD67Pk0kEpezPscC5E8qNH +0W2QHCVtIh0HEswA3wiVhlJGfnXm2STmz5hP9yrTVpFPruFYXMbkavjVucASXbHj +IP8mm8TpsSZMxF3QFuIx6XDSr7Rb9uT5jYASDYkc1E3qn7B1wBAu7Qpb0mB62pvs +z91kXoGlI4fKU+I41Ac+SQvTgZACqKe1lE3Db3gENl5rwm8fwe3vGvIPAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAKOX28K5MTLZ34Ua14eU6som0vGEXt86bT0YqhKd +eYHpGy7v6u2p83rovVuroY0P2ZkoDlzNnL3egqnl/Vsm8cVLegRF30baf/EW5/Dk +O3G2aBFKkQf+N5cEJ/w6y/2/WzIAlLOh+6u6OLfWsvH+Hm+SGRT4GHVHIeuOpqtA +jTZ4Yz2wWtgxisKRvS2EAQXwc3UCKUfbB2POdP5708ZGbHYeU1S+pm1Oa3P1a3d6 +ZbLnzXSKuk5kMADS0C5E8rd2a1+A/kzohley55zJXwKyvlgqVhRXd5zXjlbCkyyI ++yeUbh42WZaBdAYEZhuTAaRyHI4E1FRyRg9NE0sl97HLpsCIGjwK/W9JQ4fO29XY +xCqdunSzgvFGRk3G0h9eJh5yOKJZhJK1TcMCGcKSA/Ttu9EPofOllkQUMXhYEVeW +vaJy3WQlknRJlUsTcVc6sHTDwhwXOi7VB7DaJIzuGbp5yWJgTfZ62dMXyFD5XnQN +sgM2VOURwy0QVQwjj5CwyqczLBGW8KcnFORUDMfH+W5gQvKSsArU491QJb7EKd5x +uHXhWKLbs576kNfzBJRITR8QoNQj3H6qIkTMqnEPtFN3k2ozl2nqaH+gXaY/mM1N +vufGMwyzrk3Iuyh7T7JM9UTgKJAGng3/rxm0yc6Z1rWpult0S6ZSOIoynEoSmtPV +WOYG +-----END CERTIFICATE----- diff --git a/certs/2067-csr.pem b/certs/2067-csr.pem new file mode 100644 index 0000000..dd0c3fd --- /dev/null +++ b/certs/2067-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIwNjcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQC8a87/8orkTIK9OrURLlx8/dtL26H1GLr5moZS+A6kp9A9mDKu3KnsXYzt61ZF +hRBkP9WfQ2USqe9oUmWlyWky7pxo/LARLI9X1PAiForWggU/HAcHTAknoPygxjNx +iGjNUruiHBagUg1PNOhcD1AQoBfgi06ONKPMy6GcW4KGpj2HxbwCmqqzBC6IKtVM +cEq+bvChLSueuQRkjJgjV3Bun2km9XhsdbdiOlHLJBBNaOvYQQru0hfpnq7wht7I +uQz754pF0Zm21WNdySJbF2Rg17hzXW8tfpN9CUx8vM81e5YgPWIgxbLlw6D6BfXs +Rm0US7J8z2TSq6Jw2Fz+hXN/RuW/6+8iKWrMSjbA/eqz6a1SxzOD8lM3g1bSvmqg +r28M7HUgVlmsqbYh/cQ37Ic86+tmGxBUt3/seS600iFFyZc3K0qemsoS3xBrGLVD +/DpJlXx7dchbe3A/nG/H1NBIO0CjVsnjg+uz5NJBKXsz7HAuRPKjR9FtkBwlbSId +BxLMAN8IlYZSRn515tkk5s+YT/cq01aRT67hWFzG5Gr41bnAEl2x4yD/JpvE6bEm +TMRd0BbiMelw0q+0W/bk+Y2AEg2JHNRN6p+wdcAQLu0KW9Jgetqb7M/dZF6BpSOH +ylPiONQHPkkL04GQAqintZRNw294BDZea8JvH8Ht7xryDwIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAGP/lH4YUeBqJ1W3HIsCe5q6R8FfTbrVGtV+QV3dK7WSEjkW +bwl/VjzMYRtt/1E7lkfsS3r0KiYV8UKrVJRjo6OxkK0yFnAadSXYCmUSq9AbHMtb +NrHB0RkL7G0ESogv9asn35NJY/kt3auiPPFF0I3hnu/Ceakkl23Bq25O1VNtqD3I +T6uA8wTpgadKCudfJWK4R2Sa57AiCqrVAA4gkPVQprOC0o7jyykLB1o0oh2R1mSg +pkUY1DLs/McWi7rPrhBxkSc5CY50MEtv/FvY04vvPi4gN0hCngyTW7tdiHe1G/H+ +ShvSBWg9y1On1ILeOXnLoqgSsahV4VT295EE1B5myIZPU2vTyd21oS3/9sUDosGh +mAzf9AL2CDw23XI/dcjt4mzbjWDrnRWS+MwByQoKLWA0gjgAn8D7UlreRyQYRTkF +7w/CmrfXMU2E//sTfqbAwMniPm2QpjuHPQqoc88req5dFaF3SS2eaw7ZeEYoLDcn +4DBfcOB0h2nGM3+VzNgKelM2g661QsGbLDpnTIBBlp3rb2LIKW2W/1Sa/i2cRHeg +UUzVzm/nYi3PMT0pmI7ILukRnc13gh7aWVbOJRNJZJAdVyLQxf7Fohjumj4kw2TX +yfDmIVNs7eOJCgXpYSOpcKiBitc9p1vJL/kTlUgFlKHG0Z3sAVYI4zWMR3Mf +-----END CERTIFICATE REQUEST----- diff --git a/certs/2067-key.pem b/certs/2067-key.pem new file mode 100644 index 0000000..e4f7220 --- /dev/null +++ b/certs/2067-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEAvGvO//KK5EyCvTq1ES5cfP3bS9uh9Ri6+ZqGUvgOpKfQPZgy +rtyp7F2M7etWRYUQZD/Vn0NlEqnvaFJlpclpMu6caPywESyPV9TwIhaK1oIFPxwH +B0wJJ6D8oMYzcYhozVK7ohwWoFINTzToXA9QEKAX4ItOjjSjzMuhnFuChqY9h8W8 +ApqqswQuiCrVTHBKvm7woS0rnrkEZIyYI1dwbp9pJvV4bHW3YjpRyyQQTWjr2EEK +7tIX6Z6u8IbeyLkM++eKRdGZttVjXckiWxdkYNe4c11vLX6TfQlMfLzPNXuWID1i +IMWy5cOg+gX17EZtFEuyfM9k0quicNhc/oVzf0blv+vvIilqzEo2wP3qs+mtUscz +g/JTN4NW0r5qoK9vDOx1IFZZrKm2If3EN+yHPOvrZhsQVLd/7HkutNIhRcmXNytK +nprKEt8Qaxi1Q/w6SZV8e3XIW3twP5xvx9TQSDtAo1bJ44Prs+TSQSl7M+xwLkTy +o0fRbZAcJW0iHQcSzADfCJWGUkZ+debZJObPmE/3KtNWkU+u4VhcxuRq+NW5wBJd +seMg/yabxOmxJkzEXdAW4jHpcNKvtFv25PmNgBINiRzUTeqfsHXAEC7tClvSYHra +m+zP3WRegaUjh8pT4jjUBz5JC9OBkAKop7WUTcNveAQ2XmvCbx/B7e8a8g8CAwEA +AQKCAgAR7/V52j4ss7fyicc5Bn/ZilU5KISHj74lCvfkqCbEuBET/Aw/J1Sp4tIK +yE+jOKKx2H3etozFtRXMiaORn9X6+ko7mGquh95xjxz5Mcov15rmQiXNJQjuE95Y +8+Vr1n+bpFemfCQPSSBpPPEt6mtF2efMAZcN5Kb/VRdiijen1+Wdqk5WtSCxACHp +5qH9r+b9sBQKVAGGD7kCVXwaSTWz4kshYVcAhEhb+o9U1m8S330sTizbRXbvT6L5 +1O0akLtSs90u/mAyzqeyAvbZUyXELmUp3mg6HYWu7pawfU0Am25UTWOtGQUJ6JDH +nI+n2aCCwR4R0bCYeaxyL7bSqCOxfVqDb4uCByw/jYv/+ny0RB5XO3BSJn/W4dbS +5Nmiody/0FM0P05md99eOz9chVvaoxs4WZMKi6oCEuK3tGq6Xk4CwXGoM8D5qqlY +QM/m+nTXEZDiO4y2ReBsy4u+ukr0APNIohjs/5Xx6VybUMcfRyQ52ek30YaBMsiO +jq1EF1kCQxY9s6z8tssleLTWH+huEX1Mv/Shvtk31BU6IfBiR2q087aW8hQ7O5tC +8zMMzPnqYKI7mkgVHUzS+Zl2vwnId2AlGAwAYKgexmo5qaivMJSnz3wLMQDR/CY0 +zb9YDD23dlZo7WnKHO6mpTP4ZvjwvQH8cy1NK2nq03wIe6JZWQKCAQEA4Ygtamkc +xtTARe3gjPA2flp7YTvR1t37jxpbW6pqOxTEdzPxzsSd6w0Ag9u8W/u+1G5QIaj2 +vzsvIuYmB18A3EukB8MClCTbDBPJNq+vimqv4OOvFiZqY2j79GQe87VwGbk/BFCx +bU1X+JBaiNu+Mgu/0D/nCdBT3qw/l6fl1Q4VzkoI/f5zKSiDozpgmCHnjJ3cP3I6 +BXVpbqJR/W1zfPBugRhP0Lc/KqHxGvOfGGxw+EsqEo0AyPjkr23SDHFNliWG6nlQ +yRyxXLYa+DOYqtulNN9pHcF45f5E7r1+4f6AO1wGeeY88ErqMu2kIQcfCP873dHj +rlRhHWD2Iu6ydQKCAQEA1eAvvS/J8Ujq6YJM3parLWwP05+9UQFidJjXQBkRlk/K +xfbZU2dbYbq6tM5aypcQVQr03qJ9VJv8HuYD5Hfi+1ALd7X9iu0MWEzQFCgjONMb +jkZU87haRrxFVwaZ+6px4fVLEluwh1YfOUDt6lb+pEvafPFckMtHBZquL0NddAj+ +vRYNq1ywjVGBBXGY5965lpvPcwzvIWYf7XXCh0gwyaAl7tfh0Z2vFe3SuMnBeBlr +KJqtEFCvqciGnoaECAvtgJmTpeXyjwGaq4YeQDBHlNJxaN1XHtKG68KNYjxFu/zD +7onM093iGh/PYhEypYZXjrWaBmXHPFbHlN6cJS258wKCAQEA230xXd9AT01cdnIE +WIWrMxsR+lZCaQ+Os/2drb9TNX6Hmc8m5Ok7GzeDKdCfJxIA7TMSrz+GLCQIQrmj +hwbxinPfBmLGTrDzsXRMHfmrKFWeJ4rOqgrm/Sp+EqGh8eLBX3eGmceCdXKRS+oJ +AiqBlqkSmzSlwEpMZWhTV1/icJANrr8kszSAlSzFuASnX0eX1qUHZYPgbdGPs0kr +7C0p+QzxLpgfjWvZgL8sK+OvERDwfOSB5J3vhqebwBNsGgnmzVpmTCmW8rMG9ciQ +xL9KM/YheSx4W6of5A2qvoITSxPpbluoPdhRtDXkaX4XfsE0dggYFlAfeljKTtI/ +mU2exQKCAQBkfoSv9maDE2od8nXAGTexjhcZrvM7vtTOSIrLuXvEDxYOUuDnCaes +khrsnhGXI8guzYklm2Acg3bB5f5qOdLTl1bsFv1da+jjDKSw8/Mo3jkSbwW3xyXU +Gt7R924fDIWaULHHnIGj9dmSA2pHND1OYb31+0stVfa3MWkrGBIvVZKsslIV9OWY +YXWoYyofuU2m8OtW+frazKuv3idbfZY/BxsL0TBwWBFO0oKzBUn87qSlXZh4FBGW +S3zFvBsJ1ODyDjeMOjHw9CYC9m/8ZTMdQIy9Y1NuTinLWY0pXXy+yhQeX215F8cH +026Ue9Q6Zpd5nOcUnnoxZe09jCP+bC/1AoIBAQCaWO8yNVvgaeG1ESlCRrwsxySE +tJSNOzU3lAwEV8B74hnWGqi5Y6Rx6vaufC2gTXYM8wc6tPtbFvv/OOJi4vj8bN+C +DUI4FiWTpGSKH34YcT7TOfmRh7vzVUTmaRPDnKo7HrmKU1PxOLDTL1c6XPQ6lqNZ +k8XJhVa/kFsF6tZZlyJRsrGRZJxAIBScppzGu4AOzGuUm5n4dcsCFUYsBdPP+TKa +gjn1FcHQ+Vz0HbiYu48wsjDnbsr+6d6MZV+7nsXufXqC4lKnJQ9zM9bURJeA0O96 +w8uI31kgoZQ7woUbKiqIqmL0l4NFAkzvve5Oaxe++3SAQ39sZGZhuhNeWfbl +-----END RSA PRIVATE KEY----- diff --git a/certs/2077-cert.pem b/certs/2077-cert.pem new file mode 100644 index 0000000..0a8bbdb --- /dev/null +++ b/certs/2077-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTQy +NjA1WhcNMjkwODE5MTQyNjA1WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjA3NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBALuqCGsocArKvqZdbbWv4rIWXY/2EffkChaqS11uY2YNVh9OugzX +VVTSUkNh4IyQf/VG6s4crJ8uZh2P3UeVtCHGP+6EX15H8jgGbtbfliuZE6GozRKL +G8U20yhJSBVsOimVgQaM9HuN0RzswpSmRoo8a+EndaOxBlrQg1EEAd8sEwJSqn+G +bw+ri+oXP/xCjJmbmXMdoAFsQRavJQI4AlBvPmjL12YseadsSrNpf1bYeAwz0jbM +scEcqqQ2TgxFvXQKxQdv4zOI19ZBfMfCRP+JzYaFEw414Z9qGE//noHUyznN3lip +nExdc0f0I6sI5ejfh6G1PqcvUFzgqCVS65UvSEEamKywhQp/bbj4wRJoxjT/Vb5m +6Sx7OXXAw0aV1my62Ddu83ETIB90iXUzgU7VdNetqa6vvG6QhZWMJl7zQz5/UBus +fmo+7hfL6j3uB0AgnD8fizMofab1atLPOAK8e30ErGMOmcs8Ckiu8bVupMTdTbm/ +pVSqSpM4dRheWpJ2a0LkAX5dlCN1thABQ80gA4MujQdTXD02uJjvoSCj2udOaqRO +9JE3/wu3NAfAWzm0Mjvz3MRe9xKuqjodgSQocHuw8+6JvgZffyzkbfuZ/jkwtjrc +gnpQIAwbbSFwVAgE9ZCt0Pduq0XM86ACAGCgX9tNF6NBC8i9z24v45GZAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAMeIGUcSEuClQjue6CQGp01H0YpeO51SeBTBbnrf +hyDVYoGQwgYGgwSnoVQLA68yqiRFhfX6vMvrl2gFpTCylZp2unvvVNFMh5Rps/uo +FZpBGEi6x4V4boEW9GEeHky3rD/6zTU0XR+LJMlqLE5QZhNxUNhhtZDcutP5yXWN +dfzvyhvMzDlVmdgEQa1aSXJbItzBW7hFx7kbT1omJMyXNWpqxbGcaqsVxdY/K0lg +fw28SgCWPCJCK53Fw9G7pnd3e65kyC4JTn6DrQ0qcXUZyVXOYX4kcYfK2d8z5tLW +gRsPqLVqAKs3o7rkRu9yad0pP+S/i+if3EKao+msD5cGMMZoau0I1wEJcE2QSzmy +/OyZGSLf8Jf5AU50FsdMByaHaxI6iOmaKkq3FkRrPnT1fkInZny61wO1QouuxKE0 +vC9aKJtJ6HgjLAd0fva86BhU24dyqmQ8cUu1MwJslkxq3XP5ahbIo89uHJPr5dyO +qrVrdl3Jagpy02jPwLtZJ/VmU6+IRZdcoboeNcYmSDLv+lIlACxVcm0PlLHBw6Ai +zmLWwoLf3CXntDvBQ45C9SA8uWSYiq4HM2CEevnFvfVTC89N0HrqcqUWteYBFxRv +TRHlSxBYPL0GHI6c3k7DRVV2izBFzpLXwU+LHrdiSbgbWDm8FVzAVV6Mu1xjjh+m +Gv5s +-----END CERTIFICATE----- diff --git a/certs/2077-csr.pem b/certs/2077-csr.pem new file mode 100644 index 0000000..186ccb0 --- /dev/null +++ b/certs/2077-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIwNzcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQC7qghrKHAKyr6mXW21r+KyFl2P9hH35AoWqktdbmNmDVYfTroM11VU0lJDYeCM +kH/1RurOHKyfLmYdj91HlbQhxj/uhF9eR/I4Bm7W35YrmROhqM0SixvFNtMoSUgV +bDoplYEGjPR7jdEc7MKUpkaKPGvhJ3WjsQZa0INRBAHfLBMCUqp/hm8Pq4vqFz/8 +QoyZm5lzHaABbEEWryUCOAJQbz5oy9dmLHmnbEqzaX9W2HgMM9I2zLHBHKqkNk4M +Rb10CsUHb+MziNfWQXzHwkT/ic2GhRMONeGfahhP/56B1Ms5zd5YqZxMXXNH9COr +COXo34ehtT6nL1Bc4KglUuuVL0hBGpissIUKf224+MESaMY0/1W+Zuksezl1wMNG +ldZsutg3bvNxEyAfdIl1M4FO1XTXramur7xukIWVjCZe80M+f1AbrH5qPu4Xy+o9 +7gdAIJw/H4szKH2m9WrSzzgCvHt9BKxjDpnLPApIrvG1bqTE3U25v6VUqkqTOHUY +XlqSdmtC5AF+XZQjdbYQAUPNIAODLo0HU1w9NriY76Ego9rnTmqkTvSRN/8LtzQH +wFs5tDI789zEXvcSrqo6HYEkKHB7sPPuib4GX38s5G37mf45MLY63IJ6UCAMG20h +cFQIBPWQrdD3bqtFzPOgAgBgoF/bTRejQQvIvc9uL+ORmQIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBACT/i6b1BC86NqmUhYHQVTGZZmBRYNDRZhTLGlpCPx+8l/pB +NDcDKFht5/ZYZbdq4Am5WRCF/fmm9cR9pHizcmuZtWZY3duYd/lhukdeYKof4q12 +U5qOcXRwVs+r0nTUQeFF+HBX3dHOyGWqq//gHTxbAatY3sPnMYMoNCrXDRUvo2tt +izguk43D+7I2CijFLskdFgL7llD5+eyLz79ouCiMMmCz1rc877IDeyT9Zju/9owb +eOMgK+K61f4K/49GPDfvdZ7Ug8ydOJb8LF4GXOQt5mk3T6M1Gmf1s/2rLvTzdkwA +iLxiBTGUpU2Kkedfgmc5uaUQxTFN/9P5nz2Ll/Z6N64vsZE+ZEMBPoS3WXOOkFmo +VjU6H/oDOLlFx6UTOlGXpjPw3WkbzCZIoCzvAg8ZFjPw52KlTbEoX8kH5pn4qn8H +sdiSGY09TVpB8KPic+IDLn9bxS3PN8MbhjBhRE+zVqkvXYxAPWLL5FQl5urpy0hX +tpBg2m+zSITr0btaPcJT/YmsMN2dhAAdmZNESCkRqCVVDX0hQvQ/H+ROZSFf436N +mq5DnztFSpyH1Xlsm7QTggisw/cBSD2a/mkU7OAZEVahzhdUPtfVih3c6vNmO9YZ +Ngf+DU/yHOXJ25/cWf7k/RQzFemUWnUQSC6XNvdbKgV8F1z9rQM2YiPACjF0 +-----END CERTIFICATE REQUEST----- diff --git a/certs/2077-key.pem b/certs/2077-key.pem new file mode 100644 index 0000000..51c731c --- /dev/null +++ b/certs/2077-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEAu6oIayhwCsq+pl1tta/ishZdj/YR9+QKFqpLXW5jZg1WH066 +DNdVVNJSQ2HgjJB/9Ubqzhysny5mHY/dR5W0IcY/7oRfXkfyOAZu1t+WK5kToajN +EosbxTbTKElIFWw6KZWBBoz0e43RHOzClKZGijxr4Sd1o7EGWtCDUQQB3ywTAlKq +f4ZvD6uL6hc//EKMmZuZcx2gAWxBFq8lAjgCUG8+aMvXZix5p2xKs2l/Vth4DDPS +NsyxwRyqpDZODEW9dArFB2/jM4jX1kF8x8JE/4nNhoUTDjXhn2oYT/+egdTLOc3e +WKmcTF1zR/Qjqwjl6N+HobU+py9QXOCoJVLrlS9IQRqYrLCFCn9tuPjBEmjGNP9V +vmbpLHs5dcDDRpXWbLrYN27zcRMgH3SJdTOBTtV0162prq+8bpCFlYwmXvNDPn9Q +G6x+aj7uF8vqPe4HQCCcPx+LMyh9pvVq0s84Arx7fQSsYw6ZyzwKSK7xtW6kxN1N +ub+lVKpKkzh1GF5aknZrQuQBfl2UI3W2EAFDzSADgy6NB1NcPTa4mO+hIKPa505q +pE70kTf/C7c0B8BbObQyO/PcxF73Eq6qOh2BJChwe7Dz7om+Bl9/LORt+5n+OTC2 +OtyCelAgDBttIXBUCAT1kK3Q926rRczzoAIAYKBf200Xo0ELyL3Pbi/jkZkCAwEA +AQKCAgBdUiqpjwxYcYXpGSDLbtGembyhME6zJPVXXAvqRFCtmQgwvWeLpzFJ4uUB +mRSfEeRvxnpRULUO23XwUXBKfsl62ilEpRL/wWtULO7Fb54vxAmdJGIGTKLcqWzL +5dUwwgcSUsQ8y69wGY/ZgGsqnJ0LdQx4hLTdV9S/KF2E1idQIYy6ZP1gOSvVcQs8 +t58cBMQCRvxB4IOG8ZxUeXg/6DZOZWN1nZhZuNguR43GNjoap77a4pIwqg3i6Cx7 +SH37YFrb79cW4a7sG6qpYxt4AsVpBc/sixR0xpqSOaIpdgYOrhD5h8R/9qhA2V/Q +cjmifeRGr5G0+npTjRW7egRjux5m0PU6e+7Ro7oQPqtrEbwMrMYwbZYkxzSiDBJh +VdZNNIPe9geNUaZEGZOZcww/Fq2rXuQkjKyeoPQkf2PkkUx9IrXzIcWb5WnCPRSS +anuxtEhGlFVii6Bj1k5j5RF1HlpaEnag4SNfOYq9P5YdyQE1Ax/vmlx/4r71RgoE +wHV268j+mg2Jz1IQHopmWIFaqEOOkb3UTDQtMpONbZ9Iy+ksLDeBcl5/96dsJpnN +2IikVnkuQaKk3C/U0fN341/T+eZWWq4Ux/oy6c6qGwydTeJP9yXlQRpAlISXK8We +lw6XUGYY1ntanmCPQ+A5vZV8i0E8KiAD0WZJ2KhFDSwHRzei4QKCAQEA622Z0RPL +AUiffxgvmJN0VKObNdukuDM477GnplbUuik9Vnm9i8Et9isrSLsdIAFNXGka6t5U +e+2OEsBsF7cA8eWd+bmPMhPh0Rodpmu7STOzVLek4zwFkHq2+BT7TfFCN+yyOfBu +f43iBsJ1l80bshm3wX3lsrgttEOaki06/AKhSSrHTQbSwePUQ2cpfydzkovtOYQU +4YsTzfQFh46emr4vN1I+flayCXo2L44UA8TcoNnhcgRgtOBvaExWZ1d2J6O9D8/t +TMwCBFi679ApVlKumJNEyRI2S/ZpVrsRiu5YlHWzNZheIN/B76yiLmYXrwYriDgb +ytc+OPIFlvRGNQKCAQEAzA/6jv7kNafwlKBuC94iuvTbxa+veE96idibp9XSUC0K +POaQcCccGwbfCR63knMHVBFJmQLo2wnjpxnbUWSGDqny+M1JQuYE2SuhC3ocJley +15TtrlPdLswrbRKFg6MYFLHU1Sn0zY7pzXS2xYUb6ObXTGMsdWC3oTZxFM0f8GWn +eKkRTXSuZl0du7aUXKPQQ/SPrDrA52sznJs9FaPwG2bLxri8HFBbx74AIjfs/Pjc +lwmwHz3iy1BDu9HKLzVhxMBef1cKbbauA6dUeqDy6idV8Otpdlt7vOz9tc7/ZHeR +1izf3BUcq5r9JlIdCYW1fZRVcG3i74UDAYidyGd6VQKCAQEA0bFkcNJFXdZWofhj +5G1qDz1OMLF7TMnq66v8HG94uHuk85IpnwIosvuOaRCoh2pBgo7nd80hyOQ1SER1 +wsWwpMSVaem6Pqtw1jOBt0p7nV7cWxfbWL6MYjy7Hcpqb+j0xyUfNfYOJbS1Xrnz +zYrWIVNA1aoSXpYnt0kDszFwOSkKiUX+EICEVkhcNtD7KBN2oE/bswAPLTkYIbg4 ++J2ybTf6jDbIDPWhTEm7W64b66N7tBV89XYqwNCqymY8C33ecr4n1p6nyWBoZ4C0 +uIdbWlT4yFNb0BBVpmFLQAINRQa4hTs0rQcSyAslDRphthwe+jjvqzv2nTwMYuJG +0kavBQKCAQASwcU+L5+6bt1mS/jRjnGSzb8FxMhUPrn8wbRNERJr3Df8sRTFulKT +CWam5/PnujsKNyyUq/fLanVKfs3yBVNtNaHnzLbXN11quN/stiSwQY9m0YGnbH4A +NzQmqnUrTGqCPHZbwaeG3YQQJpJGRZ3zIoTXuKX1hBZc8ywhxVkSN8XVCXVVsUv2 +jMiW4IlymnwiQvCR3DSvEOOFmZ9bxd3kJubENWbVE23cRlKs0ocuGZHtMC7IMGAQ +YChZs0bqX/XEqAoHmnCS9R+5pj/VpcWuUD9ODdV705zkGMSZWZWQHo2BKk7JZAdm +nrB2PUX+AhRUnrXbx738VjWYhn46VYihAoIBAQDA7r7PZIO+bBOn2M040dletMFr +ADqeX5b36SZTq+9uApmb/XEdvMH+mjSBJWNiPFtW3EeykvP4oyMFf+ocl488TDn5 +kIyOJtcwLn3qt2SDEkmpe0XWwQZQ75PwcqqH4XEpRWcKciFVjd3nz8nRFDECrYgy +ZglSEGPLyE5XsynmiQlKn7qFLPMWle4p5cbfq3DXH//NpkzLmY7+P84mQz+Mg6Fu +qlIukbwGcKErRQBiGp82R2E8x89sgVJ2q4HLHsnpO0X9A633gKJ3uZ4vNJcJNH3q +YlglfVQUaSsyxi/I6cDUszaL/UVfkFnrJtr0pJoytScjvXVQt2WToYdSNNE7 +-----END RSA PRIVATE KEY----- diff --git a/certs/2087-cert.pem b/certs/2087-cert.pem new file mode 100644 index 0000000..27c468a --- /dev/null +++ b/certs/2087-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTQy +NjE0WhcNMjkwODE5MTQyNjE0WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjA4NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAM0WeTcneEEjGol5tJXtxhQJkxih6PCdNPInASJpzGdxwARI1qEN +jpOHXd5EgmOI5a3LJD6t287O2ZURLwJkgmV6ogX8P6nw1p/HafBzFsuULx1rZj7w +OhlUxnrtBiSEv+OdxGiyQWFM+P6t44dTiXcP8FJ2o+DB8SNqJixtxhFiZnFrNGKW +a/7RSOtuNrgXkHoNx275URGaINDb0kRr2rFEl1T7Omq6XWsAF31EW5ljb7uMLLrm +5r80eV/KZ6OxrmsN7TAgBJBzpd6v3yscDVVeUxABqW0njyrVOoEj9b5c3VyQdwn7 +bEpSn0xLdLJoMza4lz0eaF5q0YuBJwltlfnrSDWALQVXlKBvS3uMLAsojNQf1QNb +KxowXGsce60daYtheM6e0WQrmXgJjX8zsNfRXY4Rq1oyg2NR8KLncCvpkg/XGcFC +7gzQacp6bfKAbKrV4JKnYHc3LZ8mY7A4HSIbo/TJepezsEc/3ilfTbCbm0MBM65r +pBYIv8bD3Tn63uWfCMYiISW9tcSSNt6x8rpBiBFPD8F0UAmKk9yKS5TBNq5qw7bA +Uk6O3lFL3dMYrrPo/h1AnfArsO9Mt/fWuydJH6xnKk7ZdBIj89hnmgoaPmhrV+SV +S5sZBlGkTxEUIdDCUapMm+yrSMypHTziyiTj7nGbYPqotIOKW0Iw1kRJAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBANUoNYUk473CKZYTtGx+8Dkes865+Lbb1fbND5Hl +b7mX6v307ncw9rCju4a+KH0KnOEvKEKgNm/khjvsZVgvAVQENznQv9AUn5dQCIjv +ydrQio9FvbjV/vSnX10ObZ+l2cIYxrzCSdIXiIkETu/AW2rUtqR88YLbYicVUSd+ +9uThIauYNuE2Ix40BIz3kpFCc+XMReJx4y8mH/lGb2zPEQzLrKTQ5smAjJpuYkk2 +EYWjSuRiI0JsRU6TE0nTFKuPOaIm7w33UQjer0woPRBlKEwSFMbkbud1Ljgqo2Ff +ksJxm81oJoodscOsDCGtMq6bM+1dUCxYJQ21vIT6w7SJ+feOjYTcfHJ7ayzDhZtD +EqyBD7csA+nQIyY/mOP6KWS4IYhNFDEW5e7tk8/zb+5vO1G9kktUQGZQ774jZURM +H5uRpWmC5/VHy+oRbeGoYzX0/c2S4IuqKcmqWmsDwB1RX+MPvoBVrAwu9UWwGiMq +NtmVJtm4sTJjAu4PP4SG3cBb8ly8N2Ey80yO2uNAB5uW4Wdi0bsWWHKODijmNz+S +Kj89r5PrPcRSbl8Oz5mYVwVXmNw2sVj/0dJo+Dsmbu43XNglYZ0hHvk8JJ6ZnUJM +ACM45jApZKbwDlkNtLj7gJXX7HlLFWlzVijYcpINcQMA7Oc8Hn/ZDeiSpM3ichcm +sAL0 +-----END CERTIFICATE----- diff --git a/certs/2087-csr.pem b/certs/2087-csr.pem new file mode 100644 index 0000000..908eaf0 --- /dev/null +++ b/certs/2087-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIwODcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDNFnk3J3hBIxqJebSV7cYUCZMYoejwnTTyJwEiacxnccAESNahDY6Th13eRIJj +iOWtyyQ+rdvOztmVES8CZIJleqIF/D+p8Nafx2nwcxbLlC8da2Y+8DoZVMZ67QYk +hL/jncRoskFhTPj+reOHU4l3D/BSdqPgwfEjaiYsbcYRYmZxazRilmv+0Ujrbja4 +F5B6Dcdu+VERmiDQ29JEa9qxRJdU+zpqul1rABd9RFuZY2+7jCy65ua/NHlfymej +sa5rDe0wIASQc6Xer98rHA1VXlMQAaltJ48q1TqBI/W+XN1ckHcJ+2xKUp9MS3Sy +aDM2uJc9HmheatGLgScJbZX560g1gC0FV5Sgb0t7jCwLKIzUH9UDWysaMFxrHHut +HWmLYXjOntFkK5l4CY1/M7DX0V2OEataMoNjUfCi53Ar6ZIP1xnBQu4M0GnKem3y +gGyq1eCSp2B3Ny2fJmOwOB0iG6P0yXqXs7BHP94pX02wm5tDATOua6QWCL/Gw905 ++t7lnwjGIiElvbXEkjbesfK6QYgRTw/BdFAJipPcikuUwTauasO2wFJOjt5RS93T +GK6z6P4dQJ3wK7DvTLf31rsnSR+sZypO2XQSI/PYZ5oKGj5oa1fklUubGQZRpE8R +FCHQwlGqTJvsq0jMqR084sok4+5xm2D6qLSDiltCMNZESQIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAMKXzbmc2SVzlKoeUuo0pl0ZNL0lArSvxSpNMAXTg0z6HAXu +O5BKS/FpnUUfaX1CtCT0iM/UBqqQgeI3KFjjewpp1Vwlwp8XAk/HWZydDqpg5cTm +9RtNzgKSxIclxsj1+GKc/BvyDzr1wuXOIE7NslOPdLS5o8rZektNI+kXYEyfQk46 +IMLtXWlml4DB9a6coRJf6nxSEXCKALnvV0sVDM0wMWcskDU81XGIkUs7G7PxZCtq +4Xgh/KDtC1yBFUWH/fRjFcygFcHWrXyGYpPrfPIvqijhHWks0Na/FWrukxcMGGm4 +EGNL51VLeCsn0tuYrVC/XTupvOiOMZUiVWSvbGsNNDQlw243ts4dkgRfZxtwZm+u +MPk9gTtOWkXgBaEOQuBxk0K2ptEUhMpSDL5h3su8tBLfAh46SzNctgzqtXG4y4fm +tIITY6y2z8scZ+Y6Zy+YHAu2h2Y3xWgodHe3kv61a4W5M021KAuJyzgYamq6IFiN +hCtd0Jki3y3pWtb9+sEiEyGPGruvZf3U1GuSJ7HgNG+oXIlt9xgzkUCsWgcYi7jE +qT4jRZQAll8UhysbfHv9IVCBrWHfrvnWX4UoDGAu3xztqcC+B1OE2MrgmezINHZ0 +1glmnJYH4gQIPq3yOx62vMTlUnmunZZBFH5sKd2qp4LxuWQXvIMOnUr+5cCn +-----END CERTIFICATE REQUEST----- diff --git a/certs/2087-key.pem b/certs/2087-key.pem new file mode 100644 index 0000000..872be2b --- /dev/null +++ b/certs/2087-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEAzRZ5Nyd4QSMaiXm0le3GFAmTGKHo8J008icBImnMZ3HABEjW +oQ2Ok4dd3kSCY4jlrcskPq3bzs7ZlREvAmSCZXqiBfw/qfDWn8dp8HMWy5QvHWtm +PvA6GVTGeu0GJIS/453EaLJBYUz4/q3jh1OJdw/wUnaj4MHxI2omLG3GEWJmcWs0 +YpZr/tFI6242uBeQeg3HbvlREZog0NvSRGvasUSXVPs6arpdawAXfURbmWNvu4ws +uubmvzR5X8pno7Guaw3tMCAEkHOl3q/fKxwNVV5TEAGpbSePKtU6gSP1vlzdXJB3 +CftsSlKfTEt0smgzNriXPR5oXmrRi4EnCW2V+etINYAtBVeUoG9Le4wsCyiM1B/V +A1srGjBcaxx7rR1pi2F4zp7RZCuZeAmNfzOw19FdjhGrWjKDY1HwoudwK+mSD9cZ +wULuDNBpynpt8oBsqtXgkqdgdzctnyZjsDgdIhuj9Ml6l7OwRz/eKV9NsJubQwEz +rmukFgi/xsPdOfre5Z8IxiIhJb21xJI23rHyukGIEU8PwXRQCYqT3IpLlME2rmrD +tsBSTo7eUUvd0xius+j+HUCd8Cuw70y399a7J0kfrGcqTtl0EiPz2GeaCho+aGtX +5JVLmxkGUaRPERQh0MJRqkyb7KtIzKkdPOLKJOPucZtg+qi0g4pbQjDWREkCAwEA +AQKCAgALea1wo5m7803h0ViEZxiFOH/tiemxxOoYfow2s7rHMvsugjDYNBz9Lj7X +V/f/v8IyNkKh6zJ4YOSVza9Wr+8H5JO6SAH77UjlCdBortfgrjrwp3jCHsjxb+fn +KuoEExV1k/dQcGDuI9Nu1KX9hXQUoGSvCIpk4hUvCRp3s/C4OkxHHluBBK+oQ2eU +HMedB1yDJ9A36mVZ2cjqRtJ+F5bWAmOBUslS/XiKqyelT7TcYU74LIC4OIFCw5ni +/T1NUHzU6qOR5Mi8mGv4iNiw3dH1K+Dz7VPgkq0VFXc/kJaIf0O3kTHH8jR9+B+H +slUmQmRTNILp3ZCzb8Cn0KMxiNsyVg6OXJhDzwOYfuugFyatFuVYacvaK0tTuv3W +ZmieObRRsqu9/DelA+C22n2fWAxHMIUWGVMftfiSdhtVd4AkulwH4FxZvVq4P+57 +QfNmGf1ObLap0jclF1Ob8QG3PNaimKYqL+ojXg6YrdnQ6lEWMT0bWf/Rj75PzFLe +MIl2XY/VaEvczjgnDoHGvrzSt2mGb7RPOQC354bH30lc9vdu63m1fWliWf2VM9zf +cnH8VQTeKPh+mqYzo5VgZnaQnLL5TSVU7YDX9kb137f4xcnNXpxO2mPZUrc/Nu9U +Gma5V0E3YEI51WHzrP/OOfK6zFQobxy/0PWizf2sECgDM+ApgQKCAQEA5VyIBqBH +KVV5NyfkccgSWUBcLjAm9IWc0hKiLZC4m+26kyK5IjRxWf4oK8EUPA3XXIMIrEDt +JdNA8bFW9loaT0YYNeaVJLssMb8k4+rteR46KzGxGmM3xoRT8FNAK8WjHOLBd/by +egf+vn/asoqP2FLmdUOlj7E4iO7E+pO2McCSAX8SmGJXnCm4qDXCj9DqcHBoCGdn +fXfTmAnwdvvJL6T/CaJu1MKEDYQ/cs4L17svTUWWWISX/BmIBcRs2qXL/IpsOW4e +93rr0Vkf5LWWFESzASpWkgCchMIJxPyrMM3NkepY+UZwbE++GTSZZA2Tvb475lIQ +lEQi1YnZeQnssQKCAQEA5Og6RlV+WmjLlxMdKEyjUfTDZo9uXgZjBun5yMyczLPq +kTheO8iibctuXB/soYPrP22kJ4wAw8jjJhu47fjNOMlVOFOguW2d523ltv+PcDSC +0QDxRFFHpRxlEYG5qTfFaln1zwNhojzuWNfL1pRRieBe18+sLfyIAVc4JDTbd7Q2 ++8PY85U/dZy2xw8KYntSNZHEaTf1+gIR63ipPhQdL16nsRLGz9nZEJm3a1tmbKO1 +6B57YK13Dsddg8KHnYRtXz+WIOfbVQdPmpdV4kj4oxMWeWrwelomApnv7aU2fLxW +TUN/bbzfYdheg44cQ/VFUI0iY8QF0jlcvTCtWc5XGQKCAQEAgSoR5IFgcdOTts79 +ZGJCiwamotA1L+EKxnb94+ErRYykVHXqgmu8JezuXG2YYpV84bldKfxKUNHeMf4n +tgZZ6KjVu40GErBhnAZD1SKY52txYJ/UV8LmRyKATsfjTIM5b2v3fgKQ3M4h1NAV +rhRAG5fb9s/Irdokt2CXh3Gl2fDTiIoyQ6SmJ+iK+BeGYQ1K6VU0EP+ClXLksytt +wuPakb0+bwONnL2KNj5yqMmGe9ALPF3i5CiPmsYaBv1uO9fAv5CIj/MG92G+6Z9i +SZ9FTFa/4/ke1YwImO7ZJ5kPIyXTDchGoOLdLvHdYT5w35qRx/oYq4UtlwGkCFNg +KDzBkQKCAQEAyaKqmoP6nicLl1NV7sa7YpkJepFDtf1IQ7Hcvn1GbabaK/uMPns4 +YSC+YNYaOhgbJC8vV0qi7dNKC6qF1tG/7JKkx84amNwvKMoMfItXTY5j4TlETVqP +kqiVertb0Ox4sHr35NdkrGWhyo6kVqslvB7xTIb5czSslQnAQVxyKlqLyHA27jH8 +yVw3QNdF3YQl4Vw6uDh8KzKhmFscMbvEDZMCgh85E6Qg6deN0zqa2X3H4eTf50RF +yLXi8QptLVqWgT1gwDGcaaTcAR/nnkGLCxLoTCHgHNbF/qqcxygt++hm2P5pBEBI +QUc30ghfa5lk6lS4A0uLmSfAQkLboGz7GQKCAQBrOEo74Hylkrma+XbmmeaboWFE +nDk4nzbrQelRnfZGbBAjgHfjcfxJtn/b4x4p+bQ+2nsXPyms1C7HcDUsNhfRp6LN +ThyJV78QgYvW7fr8/4C20xXqcrETa+6OFkHOjvsNqwsvGIEngLFygGFdR/xVtYfK +wyKv3gvr320jgxPYyQhRKE+ypRnAy4NkjBIv+1uR47ZrAjp8vHRP1/7ZquODLJRA +zrvXWZlANk9NV581kzxJcZ/sa9Lks+w/bW5vmpqEEVCXDQC5PO2h27Ohv8Kiu0Un +X5sp5YLlcp8g46vY2bNtNzpCbctpetzNWn0pzZdTIrfDEoJ4rGeg2mbj2Kab +-----END RSA PRIVATE KEY----- diff --git a/certs/2097-cert.pem b/certs/2097-cert.pem new file mode 100644 index 0000000..61037c7 --- /dev/null +++ b/certs/2097-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTQy +NjEzWhcNMjkwODE5MTQyNjEzWjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjA5NzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAMBNsF/5J244GG0qzG3yAa6+CCzGkfo8uD/C9yTnqq13aAQ0GhXb +dI60dxaVx26YCT2dGKzveVSo43HmfSsGJGq/st+8j9un9LM9Z89YuWKZWMAO4bJV +VPPULTDs9JPnwq8OXYoNF4EMQEaqvJ3g3NgFU4AsbDdEkpr9PA7zYPy+NK9MMfQu +cCRF7F7M+PpMvn62NXArwyf+FR0vILKJ80viBN+vVeRQ5npKDpD/ijMo+QnyXZTp +BK7+wJpeU1mIyH3klbPHRjQB87jsY/G/6zcrIa01sikpLw8uE+O16VpsBcjYeGsN +zcWhCOTg+GebavQociSQmz+VpmfUflenvFmGmjzQbnEqw87eM1Qhj8yCfMBecO+p +zz4vwZMnCLSQr0Wy+tD+lSTADMwQUNb05olFCgOjxeZBjiGnlx6imIKw70SL+B4z +GJJ2dZaFxH9P9sJ8cr7SRKv6iTuW/fSAxl2GK7pXs+avr4h/i37w3V5qenKUUzW3 +DneSa0NmjbD4NlrDsdSjprUcpIxb8uikGPVHM7/ymr1VGop9X/az+qP53zdggGrr +c1ocyc2YOo+VG+7b+8GOibElatjASTxT06qTnxlPmTvzWJLsLgZjIe7F6Ta4ES7L +BOGUnt+EJSZFznt8mwgEXhpqZ/JCUWJmkKgVM0MKoHJ8vYKensP2dHNLAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAJYY5TaI3T+v5dkagY1IiBDRgP233inPmd8l6xfH +lrn6irGVI8ulDf7BxK1URaV+dbvPUnOTRQmkA8Mq8Jqv4pFIybB4hfZpAjeM8yLT +/dSfXPx7V6rXRJbc3+DysR0+7iRWiww7gDLKmpWwgQET7HifRcuxZC9ghy8nSnEI +TVig7k0XrqPh7cjW1v99KvGaIvCdRFHZqTP2fB6qhP0nc1qsInAEFYZAdcvZMjxy +xfQBsPXrP9IVzQzrxCw00j7vLbYkiZ3Gz/FWCyNL3xAUG+LGR16E70PY68+vg5Bf +icFDQkmlSPeSk3NCsu/fOGZdNVG5wc7dUHj3jH7vRZlnV21ST9DjNXkCrYsQk+rp +QVgMJtbbsPt9gFYhldmGtnDdeq+WkdUqqp/Yjbkp0BuFyk3EORsMLGt057ea9ZNP +hljipx/zioQzbmnfGQlO5U7F/qQN7WqRIzZp/rV7wIfRA8luBOr+gROGCbTuNVVf +mvZc/AQNdBIcvxu8Rdbi3BbNYkg5remsIskHa/PEK+1b7vUMA6cfoElIbVhsVgih +TuxTjnFQLrm2Yl8pQFUeDNXT3t1gaWVDIBuPDev3i9/80EdN/0VfGxbKT9Lqgsa7 +4EZVA959CtSYZjzsIc0jWwRf0DtBTZ5uM+ktrHHTazi9UvTKAUKCLDQFT/bj0EHY +giVJ +-----END CERTIFICATE----- diff --git a/certs/2097-csr.pem b/certs/2097-csr.pem new file mode 100644 index 0000000..8eb0c6f --- /dev/null +++ b/certs/2097-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIwOTcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDATbBf+SduOBhtKsxt8gGuvggsxpH6PLg/wvck56qtd2gENBoV23SOtHcWlcdu +mAk9nRis73lUqONx5n0rBiRqv7LfvI/bp/SzPWfPWLlimVjADuGyVVTz1C0w7PST +58KvDl2KDReBDEBGqryd4NzYBVOALGw3RJKa/TwO82D8vjSvTDH0LnAkRexezPj6 +TL5+tjVwK8Mn/hUdLyCyifNL4gTfr1XkUOZ6Sg6Q/4ozKPkJ8l2U6QSu/sCaXlNZ +iMh95JWzx0Y0AfO47GPxv+s3KyGtNbIpKS8PLhPjtelabAXI2HhrDc3FoQjk4Phn +m2r0KHIkkJs/laZn1H5Xp7xZhpo80G5xKsPO3jNUIY/MgnzAXnDvqc8+L8GTJwi0 +kK9FsvrQ/pUkwAzMEFDW9OaJRQoDo8XmQY4hp5ceopiCsO9Ei/geMxiSdnWWhcR/ +T/bCfHK+0kSr+ok7lv30gMZdhiu6V7Pmr6+If4t+8N1eanpylFM1tw53kmtDZo2w ++DZaw7HUo6a1HKSMW/LopBj1RzO/8pq9VRqKfV/2s/qj+d83YIBq63NaHMnNmDqP +lRvu2/vBjomxJWrYwEk8U9Oqk58ZT5k781iS7C4GYyHuxek2uBEuywThlJ7fhCUm +Rc57fJsIBF4aamfyQlFiZpCoFTNDCqByfL2Cnp7D9nRzSwIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAIcqkzFCW2rlMjSjq0wSJImEnF0mUwAbl7lVXinPu8BAJPRk +Qi8LZQQ6hzPe8NckfWzmdZsgQCk5/IfuuayvPUGjhQm4MI4bd+/D2Wmustfk59kS +4SK/p4yRq9MH5K1Cy61iiZ1zHHj6sbfigAq27NOtphIkuB0QIgZy99Atq0WdLWvZ +exIPzzdVNnwxQZDyK7nufKv+ZfGYDgA2u7zXyfJaaG3E5b4z7VJX6AlJJTaZuXeB +u/IrFTH513oNrAvoNiTEB/V3+C2vlLmstfBrGXMrpvVxhppmHQF8jAiMd7NG9UOU +pC4x0sIZIFGFVcD5PzKhtHeBYkRf0mFthKZ3Ts+GIod24CILaTFPDHYVVgszp9a8 +zq8QHLL+06nCzxAcgYfYBh+Xe9SSqePjsNpJhMGvBuH7O4POMkQbiUiepuTERsnm +ktKy2Thp/QEfQlo+wl+zJl9KPf3sUQ1B8ZVhZPt/Vffw7Z2oKmOkQFUTTxq/ZJp5 +1tCcHuk2l1sDeBE4W5nRCSuoarFAfAgtdz7GzDW3xpQn5j91HKH5BAau0RMmR1WQ +lDHL5hy0VbHj+0+EY1bQHSfz6QgRlZgg/T8TQS2ui4eNsCrSbXAelGg9sBloJK1k +0wt9YaDV3AxhMwGubsuyosb5B9y8uj5NAHBpbDAGuA8uFTserWeP1DAgn6at +-----END CERTIFICATE REQUEST----- diff --git a/certs/2097-key.pem b/certs/2097-key.pem new file mode 100644 index 0000000..2969d86 --- /dev/null +++ b/certs/2097-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEAwE2wX/knbjgYbSrMbfIBrr4ILMaR+jy4P8L3JOeqrXdoBDQa +Fdt0jrR3FpXHbpgJPZ0YrO95VKjjceZ9KwYkar+y37yP26f0sz1nz1i5YplYwA7h +slVU89QtMOz0k+fCrw5dig0XgQxARqq8neDc2AVTgCxsN0SSmv08DvNg/L40r0wx +9C5wJEXsXsz4+ky+frY1cCvDJ/4VHS8gsonzS+IE369V5FDmekoOkP+KMyj5CfJd +lOkErv7Aml5TWYjIfeSVs8dGNAHzuOxj8b/rNyshrTWyKSkvDy4T47XpWmwFyNh4 +aw3NxaEI5OD4Z5tq9ChyJJCbP5WmZ9R+V6e8WYaaPNBucSrDzt4zVCGPzIJ8wF5w +76nPPi/BkycItJCvRbL60P6VJMAMzBBQ1vTmiUUKA6PF5kGOIaeXHqKYgrDvRIv4 +HjMYknZ1loXEf0/2wnxyvtJEq/qJO5b99IDGXYYrulez5q+viH+LfvDdXmp6cpRT +NbcOd5JrQ2aNsPg2WsOx1KOmtRykjFvy6KQY9Uczv/KavVUain1f9rP6o/nfN2CA +autzWhzJzZg6j5Ub7tv7wY6JsSVq2MBJPFPTqpOfGU+ZO/NYkuwuBmMh7sXpNrgR +LssE4ZSe34QlJkXOe3ybCAReGmpn8kJRYmaQqBUzQwqgcny9gp6ew/Z0c0sCAwEA +AQKCAgBMXg3O7zkTcj9xCvAIMXUtmdXRQkIyZ+6bk6dmBoInRSYPlUlOqMoO6efp +Fi4O4124FCz6cFd0oWVBlFDcxyGrKtm0NEPE7Vwl2hrhotBsMY2nJ8HFelG0Suxv +Y4p1OjJ8Jm5LJovQ+baE2cTxxZyuRN82JW4MPLUjy7EQFuLLPBXcD5w+5joujX4i +3694ZwW3eFCcbSShOyvTXSXVASeXWPiqhAzOELqWkdZbCsAtNPZBVviG7Eqp3A1M +wGzFP6avKBmzPU3J1YSeSXIfTSHx1LUY/hv0cKB5nMjVQyaafA+IBT889ExlUWAg +1J6RNo0wzOcXUj308E8XKLHLyZboHj+8O8o0/EbIqIyObFO5NBdGOogaN2UKlMUr +zWlZUNQ0gC9iWgfSIeGnnBiGqDQvKsOv06jzNci4y+2pQh7asjdSmkNLB/j+FtyX +8lP7eXVxw5l05YkZdHiuarMJjRYHkSufwFz4JlODPxkLIZbsO4qAytF1p/irSiED +lLuEgKs3Abm/VZdqrat12fXT7HwcGVbBErbIAHYGCW70mgvB7oeKUQ+O06QRI5So +pXZJxyv1dCjYWS0mbMWWUnQlv/RSHviogHICUyheevpTDplutQLBohCiP/aIMvu6 +uvOolx3KwkGIun0kqSACWF0w7GznmxPt7DaXbuukfckYYh6i4QKCAQEA5/G7QQgS +ZPDjtOL4tpsHFCpfoZeGk7UEOCcWGAdtdDbl1Xt7uEKiE0SwNrIdUQCBhpM1dGhm +0L1MBNILshoHFbSkxmNTOaUuABV46A23dqm5eNeE+rq1wyi1lJYYi68dUHTxtMyl +vKVqA+CN9qmiFPfFFxQPODAWFI7fjf+QhIKEsugmrbHa+Lg+/htqdYA6EdCTZleu +NxLtdrCy6DNTeXIvQc2W6SAFzldUIAD2flk64uv7iqUjY8mNEyQ/8szd8vChxg8K +WdqAqBEUlaY9PkxJcCtcrhsYxfSRsMc5AEruV35xJOinUlQiHK4JZ6x97BFw682o +OLldyECTxSA2wwKCAQEA1D94Gi+dF0VYWd+ppa1xXyE7hNuRLyIilArugUWiDlmX +6KIb6kCvePJFsjvr+a7BnxPsyErrFQYfOYlRB0Yc2jh4w9ne1NHwQfDwC5ER9g2j +UONcUX1XhXnfbXg0Z4LQeiS0kgRiQxc+s2rJXr+XFtOCX54B1NW7bVU44iUF/Y0p +uVrujXKx/1mqxycM2ErcevsVAUa2DAx3tmQOVeqRayUy18yy42QuXIPc5Nkcd9Pz +I/v/XFiMKeUYrzmj3u5ETaK6QYhvcFmkJSPymaQWlW2vwaYoMcxBEiShms3jaG3V +gB1JsmjjG35snpcKIcC75U4xQYBOZFPnDR71cDFY2QKCAQEAx8i95DwRrASZ/nrq +hE9wf3woN0YPUzc+VSfFrhjnvIx017evT32FoVcu+U3eVqE68DHof0ZWGUKUMirC +jDxDEf0xWPjA/Qw8XTIhnLAD8SAsc9wf3N/qJBnynfPTXK4Pb/frIjKMJ7vLX1+S +qH5g7/KjP0e1/E3fFwIhqWwSjTDnIDs65a4m0MnS6Imw31j9q86eyC6KD0IsbGmz +ELL1Gcyyy9lMPa2pkpxCB/cMWrR9NmzRlBC+NPusmmpE8txn6RRAJBtcbRz6aMmd +k3FHm1uWfhm7kPQiGJCa1Uwk2w2v0olE5+fGB/IUF+QIkdZP+IDlZRcV6RYxo4WM +QuWGhQKCAQEAhjhs1wJtMR4lNRB/08nO+/2kCexf75KCk2QmV5GVXcXCjtaVGJo3 +XSC4enHyVD7zKooLHs5hwzXP4S65EwR/knBLzm6kv6jTap/W7TmcRiFxueFNrCq7 +gikD5dIyMZNECznTBtPG3+5/NC6/kS9PeJvgwl7FgbZ3hDh0dG49T45JaHHckY6K +iZRGrxI+yTjuHMdTDS+OSChKPAkiF6rysvMfJ+DG742W0+J/eijiG9To2USuw9Mr +MAM0jPrCamP6xa22Y2LINiA58VK+Q/LEZVKr5qYQnQ0xyStpFuBEgvGSJiZfSHeT +xvs37UJOofGj4OqFs4pUCJYWcvG0/HH4YQKCAQApg+T0rqrwEnZbv3+S3LerbUgo +FYw45eYfKjIv9BxENphuQmlgPrDjYObI8TB9bVA+4N9vtNH3H731i7lZwx4le7nM +xclsLSZjGGtf5M739YS8r9XfmxqW04sgvAzE5uCjs2+k27pbVXk+PvqtjUk3q+IZ +seexIHIr7DY7ZJR6PB4YRwAioYJIBXF/+wLgiAxm+8w501mnFKm/3lYGBTwUUtaq +Fa9v0pIjo6sixnU61ds4RXHPmaJeHg9qymbvXhpUiZn0dtxBHNhfnxGw/FiZFI/L +cTeDqASDbQdvhxHJ60LjoGUmPiLE1mS+uqfBUrPnuRt1NIrzW7ucQNcfkdJd +-----END RSA PRIVATE KEY----- diff --git a/certs/2107-cert.pem b/certs/2107-cert.pem new file mode 100644 index 0000000..ee1e3f2 --- /dev/null +++ b/certs/2107-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTQy +NjA5WhcNMjkwODE5MTQyNjA5WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjEwNzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBALcBV7lMbdGLiRrgfsjuukwGj+jK6WZzG97Y3oNkQt3gFOVXuNgt +Eht6x+gveLGAmHbvl9N1VvcNPiHinPXMPchpIXP75VdCe1WLfiqFm8/IX67FCQ9Q +4IBzllw7ePr16hXB1esC9kkmH183gUvWW9U6mwDABWTseXGkDuPLFgQ7pePiH/cl +7mN8JQtTqB0OfdU43f6V69pdDtVxV+uB48CJUQVTwoMQnmB0xF+9NxmaQT3je26D +LBQYwvtT9HiAayLY9l+arXvkh5yeRDRQMpLMrogx1LUsmrnn7bTJkUmU35wCB8GA +UF5K1r1+/AJvfjVe4B0WM6MTZVzT/mJl+IH2IL3UXdXpNp6jMoBMp4o7X2vVnfTp +n7weXAvmZGnQ0RcrmdDaR5s+14e5gdH3+icQJ6emjh+8cYpV9HNJnisRe3RjpeEm +Aowil1o7vVyxc3jmYA4Sk+tAnWccDqV+i8XP1qm3zezIeSn3Kix9QR37MzdPiHxX +pb5M45RIeuP/pEeJYdrZUd7ZRCTnTxEHVhqdFc7s5pyb50lb9VjN6+YSf3BGhpgu +vmpp9HgFRFdj+VVJeISoWRt3zhVMW4FotDhjzAw3lzMWY134riiBQIu0GDGvmBcU +3dr7IJsT1H3bzk2Y+idkZj6ae2gGOhdo4ffn3VU2JZ/+5rvDelNUiZlfAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBAG7WR0ex4Tptm3AP1Jk7gi2pb58NA1EmIIEFSpsU +9ISXi5ffYId1UF3x4rAnjirpLtHveT7V14/q9yUSUwYhp9YYCgtQ9AJgQVl3wGkC +UcKed0jmQdKx5l23MfUu4jR48h8WTG4GraJHbTmhzbtK+S3LwySQOyudQrOLyIOc +rfTJKlSK5GDH/MUk3i1ZyyXxakXghyldhNlpwOKDJSBBejiMcoI1dmedP+6dF8Cn +SoYtDwXduuIZjBAN5q/LNUjkdg2emke7kQCzT0IHCk8rktL/pyBICNB4kfzd2CWv +vhMfZMArM6b2Twvtj8UwdHFP2AGkciOvxowj7orZPzdBcW5ADMPhgtthQWXtOzmT +py1rH8ta0ck5xUbaBXJepGeXl1yYVwq9Db36jl+oNiSxZZYGxkQRi9+URIvww6zc +aZzkQGOjUOPbG/BrqQxQi32ZTHvBHFth0q4hmN//kB64qRTZTvIDGvfa3GxL4/WP +BBiRy5aJszqiaejA6ekNxUtQZq8hScQ1lRw5SFVT8AFXMXJGkQ88P7BaozWB3Utm +S20dlN/roJSukzpukrIfJidCCdVjXs7XMunVWG22hAm9KQmFqh13xQGBSl6Nb6tR +rsODJUvcktHMwbnypT/DZ1qB4/XzeqhP9IMu+k2lawxTSJv9quS58Z+taztRK7Ww +J4Kr +-----END CERTIFICATE----- diff --git a/certs/2107-csr.pem b/certs/2107-csr.pem new file mode 100644 index 0000000..0a93f60 --- /dev/null +++ b/certs/2107-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIxMDcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQC3AVe5TG3Ri4ka4H7I7rpMBo/oyulmcxve2N6DZELd4BTlV7jYLRIbesfoL3ix +gJh275fTdVb3DT4h4pz1zD3IaSFz++VXQntVi34qhZvPyF+uxQkPUOCAc5ZcO3j6 +9eoVwdXrAvZJJh9fN4FL1lvVOpsAwAVk7HlxpA7jyxYEO6Xj4h/3Je5jfCULU6gd +Dn3VON3+levaXQ7VcVfrgePAiVEFU8KDEJ5gdMRfvTcZmkE943tugywUGML7U/R4 +gGsi2PZfmq175IecnkQ0UDKSzK6IMdS1LJq55+20yZFJlN+cAgfBgFBeSta9fvwC +b341XuAdFjOjE2Vc0/5iZfiB9iC91F3V6TaeozKATKeKO19r1Z306Z+8HlwL5mRp +0NEXK5nQ2kebPteHuYHR9/onECenpo4fvHGKVfRzSZ4rEXt0Y6XhJgKMIpdaO71c +sXN45mAOEpPrQJ1nHA6lfovFz9apt83syHkp9yosfUEd+zM3T4h8V6W+TOOUSHrj +/6RHiWHa2VHe2UQk508RB1YanRXO7Oacm+dJW/VYzevmEn9wRoaYLr5qafR4BURX +Y/lVSXiEqFkbd84VTFuBaLQ4Y8wMN5czFmNd+K4ogUCLtBgxr5gXFN3a+yCbE9R9 +285NmPonZGY+mntoBjoXaOH3591VNiWf/ua7w3pTVImZXwIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBACx5LXyEb+9jpLNvA0xAn1KzBl5BzfTMo0HpPHAlNIZpbJNH +7d69FesCDHvUwSerd015jVmhAGq2tb0l6/RbaFXJqOdKMHzJ6/eO8hDQ6WGmJMtx +FN6Nd6cxYUqpXAYkftO+WMlyeIlCZYLq/DSIu85gmqEGNXqejNYuEN2wEQKANHh7 +bzDHaclqH3735ZVlUpIpoQesLxhnF58v+jetHfI0+A10I81N/fayauBgZGGtLmo+ +VKRyukQL6OdA737zQdrY8x9oYWY1TlNr5tkPQTk0A128oICJxAKbJ+6voamVd/ge +R2Vs0exQzHUcjnTfecTrFQkso0LFAcMua827SJDH1KwcYFlRXpT8vJDssEYOgcE6 +EfMm6LzVopRnT0yvppByXzIVvFVixe2nkxiGiSaeLnsuF3yLynuk7xwCoOyd6/HA +h9AH1lGPmLeNbWshvwblFGoeR/oevFrBrT9epd5GcHodObZCYEn5ShIpmQbu8bN5 +AjCzLUE48I7NIPF77yOr7g72gKgDSeaxO/TmaWYDbI6GiaaBPnMKDKCb1eLd9nMa +oNs6SjK5Jymwpn3CGmYg4yn+vMD8ReCuFGeqnWVBRGb6fzGk9IYVBOQDigoQiKRh +H+AQ52aODt2fgbgOhPUAyyqejEvfLZ0huJkRUJccc3MpqAyIJFc1RigoVXKN +-----END CERTIFICATE REQUEST----- diff --git a/certs/2107-key.pem b/certs/2107-key.pem new file mode 100644 index 0000000..a2abf45 --- /dev/null +++ b/certs/2107-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAtwFXuUxt0YuJGuB+yO66TAaP6MrpZnMb3tjeg2RC3eAU5Ve4 +2C0SG3rH6C94sYCYdu+X03VW9w0+IeKc9cw9yGkhc/vlV0J7VYt+KoWbz8hfrsUJ +D1DggHOWXDt4+vXqFcHV6wL2SSYfXzeBS9Zb1TqbAMAFZOx5caQO48sWBDul4+If +9yXuY3wlC1OoHQ591Tjd/pXr2l0O1XFX64HjwIlRBVPCgxCeYHTEX703GZpBPeN7 +boMsFBjC+1P0eIBrItj2X5qte+SHnJ5ENFAyksyuiDHUtSyauefttMmRSZTfnAIH +wYBQXkrWvX78Am9+NV7gHRYzoxNlXNP+YmX4gfYgvdRd1ek2nqMygEynijtfa9Wd +9OmfvB5cC+ZkadDRFyuZ0NpHmz7Xh7mB0ff6JxAnp6aOH7xxilX0c0meKxF7dGOl +4SYCjCKXWju9XLFzeOZgDhKT60CdZxwOpX6Lxc/WqbfN7Mh5KfcqLH1BHfszN0+I +fFelvkzjlEh64/+kR4lh2tlR3tlEJOdPEQdWGp0VzuzmnJvnSVv1WM3r5hJ/cEaG +mC6+amn0eAVEV2P5VUl4hKhZG3fOFUxbgWi0OGPMDDeXMxZjXfiuKIFAi7QYMa+Y +FxTd2vsgmxPUfdvOTZj6J2RmPpp7aAY6F2jh9+fdVTYln/7mu8N6U1SJmV8CAwEA +AQKCAgBFq5cwDi7I1axutQTPjkMSanUjFQziWfREVJ/xuZvTSFnsLgdLFW2NVKMC +fAAg42on7XMJp+RhzYLX96P117m1sIBx3XYkUEUP/jkcCx2Ubx4uNQkL8ahmfprB +pkqakEB74/2CqPAGTSMoZsMskgEIHnWgRXpIP9bEMscQZeKN3f970DyHJMOq0Dpy +I3kfBsNVB39MStstmLvq+mmUWTDRvfVAZ/DnYM5Kvml8YVa2wokP/KijHAEN7Zdd +g0rRDWK8M4koQITHY+tU7tPcbqOyS4Yuh3oJN1/4YpmWeB59utWeWQ+G1UjDfQ5f +uhZK/xM3UlVT/X3PGbU/L93qrBN9EbHDmf/BJCpjrKEOnHkqiHuzFFgp9nKAepJo +6k+UCaR4sePDBYKjHZfZffn0fCzHuEhStR2v/CU72QV4B5qgN/Ng2wTdFyHQDZNc +VaPUwjNec46zk0goOTYZ41hyFPHcZ9Qt/d42JGjKI72K2o4ZopUnuYARbJoG+88l +8yerlRNJDVsHVyRmmhPiz9DzIHWgZ18N8vv6U6xsmJ19M4aRsurEB9pJKt4YoYsz +rYjWV8sa8AJYJtoSBfnPXEvUt0HuVjxZ52njtAsPCcR7F4VESginpp71UnHApijn +IVklZfBdlJz0DB8/WXfdlaMxSLiPkn4E9xtogjeP5G0hYBlxAQKCAQEA4qX+YtnW +HLxCMk6kfG3lIUKLQfm+5XbV3/nHXgcRef8c7pQP+UreGksCnDa9Sgkb8MfFFd/B +DhqD9WQsfL9ZXuaIci/MecA7Gv0Ed5rp26SAvM1SA/rAeimNGhgXDaCOBNZglelK +ips4jt6GLKXSVbPf34iVatklemSotKc214dgUnOBQf37IYPlw9+OgLt1BDSO8NQW +5cfXBVKgYkzch120pSn2hXB+6jdx/BdIJSdgeumhlbL/7doPipdRS2Uy6Xkb8MkI +TtUyz/xUpvebebg++WiBIIOhiFrMNKk3dDSm516aTmPbLL6aFwQdAiYxtZ1YF7IN +lK7s7N8Bb7/knwKCAQEAzrR10PxyLxDdMzeCnPyF32ESus2pDQplR0fnRxUGfRt1 +uvSWp23irGNnuuaLICYSJn6yjTrDdilN2XCFDNPnXKTL8mM4he/fD+Y+R6G3SwX6 +x5LI14CGwcp66zjtZfDOa6zEUdlD1qg2mVLTcIxQLLPUyzfANycO1ycXtxC9TJHk +cApQIRFNJmU6CB/g6HtSqVKiu0SExWH+XQRMwbBYL3WiPUxJSTD9imk5P7H0gAAp +g5Tl5HlnXRiOh09pr3PxYtIA4Wm5xVTNGkC07W1n/voqvdV/vIDvt5WXRxWzInJb +uGpF+DMR2aUshWA4tD45NLd3wvw++u6BdB2ha69TQQKCAQAKAGE1Y397TSNurOG9 +S+wsh481nhu6bIALni4aDB3NUGCqdoYt7gvXBTBcTF4WAkjlWytrR7BxOuJP1dfQ +uXDsKygiQdG4Ha9+BWRJEuD2/E9iBX11B3+u5F6BpEaAJ3Gc7QjeFKlhbHAWfeNV +3QtnFMTwTEqrqGFrAT4gmrBk2mh5uvcdPmPymqts9VSIgb0sLlWQcwt/oE3wwjCp +pdKldpEeKLfkM46mL0QsZ6qbWR18zwp+XKPGjzTYXM0Nkq2od9uvyG9Ba08OtofV +xl9qA6NjxiTMloJuTfNs73qu+hPTae1NQELPuql6EohlK+JNrV/Ry92ljgKOgVjC +4ajpAoIBACnbYywxopGjUZeoevt9K0LDrn5DXSM14rJffhbnzAuTfvCfzM4Us10D +OCMhwjR9YRmIeHGe36vSy1/nqBmj42rgOChaLTz6COp4Tk5FEg/QIys8rwzsit09 +Okzdlz0YWUR2lL6aR2F1aLD9k7FryGR0+fc4z+SbNSceVHAOpLaXqHGDtRwtG7lV +sD2q7ulE58U/5ZIUWup5YH/Heh+SrRjXMkZFZ2W51O2tRxl92Kv+3Gk3wqHUb7jr +WxlNXHJaARxouCLtPOAXvvy886ZMjE2WrQcJ77blSSWc1ihf3YlxLN+YLZkIBmpT +R0Ou62ycWQsyx76lQ7+egnpX8bMTqsECggEBAN/7pDeotQnS18OgMTkzCMrUIbkR +5BFh8Q2M5d70Yq15CSZr14GeGjUBAz0qJqIMpcZjvAASljnXB38AE6sbxtpzTFzo +d0kaTDZOyL8x5GzudFdOdWGhiNIO4TXVEw/WRXDZlXVo6TkCN/rM4WxgGZjU3XAF +f39Fy3bJsomWhLFdVzNFT//SskjQ43chHcZbJuzWRgVmimQQLFI9nBRncMvpwWtM +9JaWd+V5PXnQBn9GfhDcsYhmxlorifH8MDNuIWhcGGPBMxm+Cd8z8Cpcz+qJA6Om +AI5kEk5SO7WfQGAR+MscdPNQmyta+9WYaAP0kEHLPP1KdJZ5xxvxDvEWZQk= +-----END RSA PRIVATE KEY----- diff --git a/certs/2117-cert.pem b/certs/2117-cert.pem new file mode 100644 index 0000000..be22607 --- /dev/null +++ b/certs/2117-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTQy +NjEyWhcNMjkwODE5MTQyNjEyWjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjExNzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAK0JTDAcrOfTtuM7GHArEUZhpbmWAfi6TPjL2E8dxqpKrSXYbmqS +4IS1tIHVg/mcQjjM6OgQXdiXFn9VnUJ0FqwvPDW9JvF+/bwSVuouv0TvkSDVVAvm +NfZoRvY4HO+B0mRPRXBfwBGP7Kt8foGPz4xVNyx+eWHEa75c3n6HhAk16KTe1XMK +hsW2hcUZvEwiR5EwllhSUnY45Vnr/aa29Mi3S6AVv7ijGsv1ETGQwpL45kF85C3B +VUIfWpp4i+xW8teQgt+u1hVcQc8ASzopf3tHiUE6OBOCj+ceq81Dexi7Ed0h1ZWG +m6pqbfMsatV1NQ+0dfOv8MvRlIGXuNyq3LT2Dp1UJimV/SR7EW788tk+HtvcNHPk +J76G3RXnZvJZ0MBM21kIL0sbUL6M9ggwAdA7nmdG4+oH3dAl7toj6CE6ynbglgjW +O0wBxpiOsKm4el1fEnylpAQLG7SQl4wVwsSByzvzpDaIhZv+Pw1Ko39KOZgtL/rX +s2fRGNy6ETwbYt1qyk3HZh/o4CF92ZRu0+slEAgfPjpULjAsIBCRxAStAKAGsfIG +P8+CiOtqFWSzegQDwlqzLqbkEKf0Fx0XsKRiHxCuzX+PuXnPO5G9yJI9vwm2Y1rV +CF8gAGmG8IIq8bwsI6Fll1kz9RY26t/ygphK3R0BmdB6XAlNNWmhGznpAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBABP4pnQ4s2vd+I+RAQ6bgLYfEh2C/cmb7UVXthHh +WUIsTq3BRzTyy3AH3oyLNI4oY2mz+NrS7v9lpovCidIRD5inrX9yAhL/z0aafpD5 +0cHhtgagA04nz0HID7tu1lzo0nCCeD5vtkRq8/mOLr0P2sUJIiqaqeqz3Y7rKJ/v +WkXXreKKL3bbXq70BcgfI/clk3a6lE5XCoYmm5/jeye5H/oCrneuXZdnDSNQfelu +DpqD6ubr9ju6qbLdcKLz8uurPynWGh9azK7/lA1UAb6BwN6FqCIOeDLDKZcc7k/n +gV2Xf79WOFkQYr0S/js4+2OAOivTfV4a5WofODJtasmS8nOCVl2sIum2SQDYyslD ++xm2qYCOEN57CiQruLip/8gjxdBegeQwJJ0sLxtl8OYikoXayIRaUbSJDxnY5EFW +tpPYSF2XF/tpVthKYs26TNBRFfJ0+0Jg1TwZd5izQx/mPnUI0PLU//Nd+c26E7v/ +a7E4bVpGFwjM60ixisVY0QZvhJ4N2lB6Hjs4UA03XsGZJDm/nUJcE/XVrdEkc3F3 +ls5jrZwLP4fvrWo4BHCNkeeoemAgs1IFl1Ghio9i3gP9hZ4YefBvvBcK4e1ilz23 +PBvCDpQxo3nmiPaHPsN+NM3fpKDkN+35gS3z11WFW+BAg+yGPGMSqKcs+HamX6KY +4lot +-----END CERTIFICATE----- diff --git a/certs/2117-csr.pem b/certs/2117-csr.pem new file mode 100644 index 0000000..fbccf92 --- /dev/null +++ b/certs/2117-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIxMTcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCtCUwwHKzn07bjOxhwKxFGYaW5lgH4ukz4y9hPHcaqSq0l2G5qkuCEtbSB1YP5 +nEI4zOjoEF3YlxZ/VZ1CdBasLzw1vSbxfv28ElbqLr9E75Eg1VQL5jX2aEb2OBzv +gdJkT0VwX8ARj+yrfH6Bj8+MVTcsfnlhxGu+XN5+h4QJNeik3tVzCobFtoXFGbxM +IkeRMJZYUlJ2OOVZ6/2mtvTIt0ugFb+4oxrL9RExkMKS+OZBfOQtwVVCH1qaeIvs +VvLXkILfrtYVXEHPAEs6KX97R4lBOjgTgo/nHqvNQ3sYuxHdIdWVhpuqam3zLGrV +dTUPtHXzr/DL0ZSBl7jcqty09g6dVCYplf0kexFu/PLZPh7b3DRz5Ce+ht0V52by +WdDATNtZCC9LG1C+jPYIMAHQO55nRuPqB93QJe7aI+ghOsp24JYI1jtMAcaYjrCp +uHpdXxJ8paQECxu0kJeMFcLEgcs786Q2iIWb/j8NSqN/SjmYLS/617Nn0RjcuhE8 +G2LdaspNx2Yf6OAhfdmUbtPrJRAIHz46VC4wLCAQkcQErQCgBrHyBj/PgojrahVk +s3oEA8Jasy6m5BCn9BcdF7CkYh8Qrs1/j7l5zzuRvciSPb8JtmNa1QhfIABphvCC +KvG8LCOhZZdZM/UWNurf8oKYSt0dAZnQelwJTTVpoRs56QIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAGgyDxsb60UPGeKzt9+fbD7rW4tr4MnSs5ZLJdNosThPz0xu +lthZd2S/4/p731aL9WeHgd95dLKBR3t+xtwMPw7Tuw99uO4U/owtCEM9Nzx0eE2x +P6jE2C++lJQr0AaQ05uAVSMrcM+tz0QA4FCRTqHZRh5FMhxXeJ4VMWmUMH9vbSBq +e5HuT3DIAyR8In4kye7SRjIA6yI4Nt7/l/tULPfsq5YexssbbLIBuQ6L8FDwFyWY +gVLB75+j6uR379xcI+rMzk1c2KznhvZH2vxPt1VBzkSwLfnWlcSfHMCuG6A6oN8c +hMV+9fmGQm/trmsiWAos1ZpbkeW73XvnrkqC+4Uf+qAebMVHvhI97wdK84AoFGDi +U6QR0nHIkM3qErlywjaEk8XXt1olUJNex3iDtw2vl7lVsSKe2Bgbb38hKLjgv8fp +4COhaJg4YodaqsEB9XGNYUNCCBUKV49nRaxIQr58gQywFl0u1pvuHkd7WR/ZMu+V +Fows3WhZguhsgX+V1an4y5CD5OqFYEti56hR5A3nAxC/W3A8IZr4YPPbQEPZLoaD +zQFR7/hDmB9HLsyG9UC4xbSxVswByfCjsgz1SuKxf4Us2wIS+X3bkYm7gGBrg0r3 +8aNoq5n4FiL16mWuZxXcor6QhcuvOuZk4TDzqMw/iZSyXyQCYEf1wkvoXmjB +-----END CERTIFICATE REQUEST----- diff --git a/certs/2117-key.pem b/certs/2117-key.pem new file mode 100644 index 0000000..fa41d7a --- /dev/null +++ b/certs/2117-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEArQlMMBys59O24zsYcCsRRmGluZYB+LpM+MvYTx3GqkqtJdhu +apLghLW0gdWD+ZxCOMzo6BBd2JcWf1WdQnQWrC88Nb0m8X79vBJW6i6/RO+RINVU +C+Y19mhG9jgc74HSZE9FcF/AEY/sq3x+gY/PjFU3LH55YcRrvlzefoeECTXopN7V +cwqGxbaFxRm8TCJHkTCWWFJSdjjlWev9prb0yLdLoBW/uKMay/URMZDCkvjmQXzk +LcFVQh9amniL7Fby15CC367WFVxBzwBLOil/e0eJQTo4E4KP5x6rzUN7GLsR3SHV +lYabqmpt8yxq1XU1D7R186/wy9GUgZe43KrctPYOnVQmKZX9JHsRbvzy2T4e29w0 +c+QnvobdFedm8lnQwEzbWQgvSxtQvoz2CDAB0DueZ0bj6gfd0CXu2iPoITrKduCW +CNY7TAHGmI6wqbh6XV8SfKWkBAsbtJCXjBXCxIHLO/OkNoiFm/4/DUqjf0o5mC0v ++tezZ9EY3LoRPBti3WrKTcdmH+jgIX3ZlG7T6yUQCB8+OlQuMCwgEJHEBK0AoAax +8gY/z4KI62oVZLN6BAPCWrMupuQQp/QXHRewpGIfEK7Nf4+5ec87kb3Ikj2/CbZj +WtUIXyAAaYbwgirxvCwjoWWXWTP1Fjbq3/KCmErdHQGZ0HpcCU01aaEbOekCAwEA +AQKCAgB5kxTCoQMjBu9yi+zJspi6mJT15d2QwmSeUaqzO7p/n2Q0OPKrUnMJCxm+ +NyQ41n74pY/mrMkjClS2NpL9Q89CPxXQtAuOlaj04PXMJ/gfGSsgpIIesiqr6+wf +xqEd7lrCO6gQIlYygKrKeffwU/iBIsZXLq1d8cG5yEpTICe2yPeiDyZtY7H5bBpk +t4ZC/7rE2hxoBb8GbUdHfLWE0vr9ozsxSNahhYeoUZE4//qVhOdSj8tKEpIymRDx +g0zcSuLobhJl0tN7woxCQnSYctus5EAdYihQHOW6fyQ6XfU5FQaiFcmY+zCX9Zs2 +xbhyLZ2QYTyWcMGAksoCm3U5JZtXKMMyE4AC8jtXifftSukcw84hVe3n1MsW6Tpi +kPMADBQC17AqvmsTDT4xm6Ed4wpOhQRL8MYIJNEU0AqmvEm2frO3cF4gwsIjb03b +kMr//5FqVQxY95fH2mpRHMw7jG+rSX2LEHUivoGaHyrxmL/KVpN7n5xj1+PfLH87 +B7DlWGpR9NpzaSozU/LLIvRf7nj6oOH4dW1FCrSgHFe2ui65N533L0T1xjcLf6DY +FApa9FCQUykynohYk8WVNWRpi1wP2YVO5eefYTub/nYoRT+2+LhqMd03lnlP+nNx +J5V+dV31eotb2lbv9s7VGCWBDftxZotfUqOC2kxk+o6L2e7tYQKCAQEA5ZVBMClt +n7wVRBgh8puddYxwVBLUUSQVhnewXQOAmusJrfQDLyQWW7s/B9OZCi/LxAtVEfxc +5mTvOSL5mRQm2yO/nYJYGAvqY9nQgoJ5j7WE4SlbTQh3dJFGV/QDSCDBWGTDgKGh +o0gx7sCjRSCLKjbobYHIRSfPr6QZpnR4Uy/ub6neG7vwNIijFDq7cdYnkMoyEYhs +VbLBrmuyNZ1Tpq3vB2NFCeJPn6oTXZ58X8RD9wsOC58yM55FSBY/82BIGac9jMu8 +X3pUjUpYiOOrsxG3U5sZ0jj91NCVqVWnejhdCuGodzRVH2CNiYkrVZ7wWccevZzX +PxG/tNPwtNmvdQKCAQEAwPJd5MBPM9qB29TvC05OeE7JOQhiQiv4JaZSzuh4Y5im +wU/0X2ZD25Yr8sF80AAcBYTmWJvYjGCprZBXCR5lLvg97XXpg2GSpSJZdl3itca2 +2nP0b3+FPLIbXXKHlmhWhySB9M4DkWjSE9MM1Q6VfIvi+wB+oINCjew7BtNX/sZA +UscrO7qSz2IeKkmfztonYDV2B86tDDSKmz0KkLzIikfNFsSt4UNN1Z1GZFDXMDsc +mOZeZC7eBZj/U5Wt9r/HyXTxSBwhXUNlvPRVMn4RYctzODtdOO8UJjIyvbYKbo/W +FOCTevEQQejDZJdfLMU8rHyO+8ChwcsqE+tCuYOmJQKCAQEAu9Ra2v5p88+7TlS4 +IXbzYiKeHAqzrhbpjXQK1G5zH0vARZNnr3/E0xPkw5B4mv7zpNboqKhhkRVvKr3U +m0sDZzJeKI1laXcGMt8XWk9JCSwnJNfjHKkaokHg3UCEFtTFmn4F/Q0/4wjD4WO1 +sG6prMXzbvRJV1r07exCGA8eCmEioDTHxMUEBtbrJTfP95iQEkN6pyGIEK0JDJyL +1pV6xNl0wASVjTqcjjJlWai6dNdsC4f928BJIDYS1KFvfLx/AI31K2XcHflFh7sV +qBksdnq+FCbG/1klQqHMcBflx3apmKd6Xtxv8BXcdnPFAm3gknL4UYUqDS2GPHlR +a4TVqQKCAQBRMe0XRWJPJOW+19WcgWB+OlFtgbyvsgcj+OEiFywKZYPPF9Fzj/qA +Xqqx5oCam2EvZWT15udy836T/ojR2ouj/204D4Wr9xSaD2FscUflTPFH7sHvZc9w +4lantXmfbtry1gcmOMfBmkXFd+wPgKqhldB35hZjf7kzNjUEw01ldpI9A3mLEhGT +2ettyjvI9X7aesTnti6WU0n81+wpSnht0JdavHubrxIDEcM8ldRohIedRFx2dk6S +NndD+loR21S8z0x2FvhnYeRfZsavj+PKrq4W/MxXGCz3gepecUvkiP0DHhqSAv3f +bo9DNnwjwACvaV9WTBMGFXPom/khTmhNAoIBAQCrcu2UJNfqEwNfL9ixQai9AiXn ++87gv0n/jjBThzqwUEqE//KTajmTzYq8LrzFAGmPAoGgBCAhmwftFnaHTKhTdHRw +5uvRLZ+QyXLinPg5rfol6RUER8OxBO//r3Oh5kTSf4U9JpfMWTZrrpw+0ZRrB4tG +Ct5MaCn4kSr+5oQAsX+J4xf93/JU0XFAWzFg0tGnhss5YdN46sYza3c2uf8mfCwM +QLntiVWWgzIZ0LxfA2E02DMDZbb/BEJtyvwzU0aFZbQOcgAl21VSfWtPFJNlJSIP +koYtDzKlMB+yTAoqzvfWLrtXe4K/DL9JBPcsroggmrpbZcohuBIA8gBH9SoM +-----END RSA PRIVATE KEY----- diff --git a/certs/2127-cert.pem b/certs/2127-cert.pem new file mode 100644 index 0000000..b7c12d4 --- /dev/null +++ b/certs/2127-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTQy +NjA4WhcNMjkwODE5MTQyNjA4WjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjEyNzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAL6q4VIMMcQtveFixhoJZHQ7hvgF5h6tEdH18qse218RwXy2uQu2 +hMYtnWC87QPDZ8larLJKq1TMLuI/cKTV/4QoQ0xfSCueDpw1IEbNWq9qP01wYfNM +WellW1OW2DlG2U+IUDAO/HbN1PRPmt7KXYNutzmmPxCtw0Wh8E9p+bGWRrczNPZx +ZIGzkoi+yb/wbYFB+iduCQ29t6mySJphnLLmeyjvKkb36IMDJMLAQh6IpZh5aQiZ +gUKX6n5Jg2BIGbx8zFCGvzdiwOqC1aWoMfVWzfrbYijFTE983VwUStBeYF8jwKSB +yXV45UZzgO8KCDB5sLCj7nDpa8b2ZN5srkc6UZbjaj0Fi1jgDLAx+Wic2qgoCkfc +Sq/WrkzSVIcTl6XUNJiJuN9Ll9OZ50nRN6wQV4la5JcPfGxK2bKQjN52/7SIQjyt +Rd8U6qpdofjVJrWL8fvTdUO14xddaNrR1N2LZs5WuIj3L1axqfoODODvgW8lhRp6 +5O5r6m08n2mWznD4N7R8zjKNGI8Q898jeoAYyzGkvd9UMgvLgPCLREUBp13oDr34 +lygE90fzcf4cLnqzZb8J4EgZvsIwBf0VjvncsBsKTV9guKeA+mgqyEmhy21W9NOt +gkUR1HwuUXO6lRECi20GN+ODcLKjJuYc74Z94k61nOCyD2KDAjjsLRyZAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBADdDvjxJ9IJijbwfHaqXsbwRw3mHd6c9LHLoxLKP +36QlRdjuF2pLnzvdTY30YEVt8LCC1SAGCO1/I9V6YCGDIQI0EkJQGawSzspzb2al +gTD1wvvmCKA9JT4rMvpr0FkjUylz2s8kCq63U3UeqFz3zmAtL5geYJdaEUoF2kAV +TgPwPdDv3FeGYYhpCRhqXn0AUyMM0scM1PVt0eywezb/Cz7OBhO9pFLih8ybSpyf +4kJ3zj3pS9EDNcton3DE6qQR3++75O5H8sIoTlrHg+yKMuboiVNHJO4g6U38gdcw +JkiqZ/4VamXkuf0mw8aae3udv4sZIT51J0jIAhDs0K702AAFc6Z8NDoKkgCzT8QH +M6sfw9m6RR+TAWI7tjkVPxXpOaTDaG1hFBqrkGRTaXCrEdyZu8dMmiX2tfhx2e/M +06yo/iIXCWaQRKNgw13ERNtPV0woMbpMvr7nmEIE2P9yqMLZfKKrnpcRDAxA+WdM +XFCFWkjYIDNmJXr5oEf/tjx+ESdKxaA/m+8QaIFjgfLNfb6yM8yQhaoY0B36J3i3 +LdvlASL08wKphPNLnYEgZxQ1q0zBahoPUMmpy3j47f75PCXfUJWnIxZ90wgFHhPY +NnjwnI3ldJTGLYexMuHRli+zmzrVFoNGueffc2+Tx/Zzc8SBajKjVvM21Sl1ckR2 +EFgU +-----END CERTIFICATE----- diff --git a/certs/2127-csr.pem b/certs/2127-csr.pem new file mode 100644 index 0000000..4cef8c7 --- /dev/null +++ b/certs/2127-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIxMjcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQC+quFSDDHELb3hYsYaCWR0O4b4BeYerRHR9fKrHttfEcF8trkLtoTGLZ1gvO0D +w2fJWqyySqtUzC7iP3Ck1f+EKENMX0grng6cNSBGzVqvaj9NcGHzTFnpZVtTltg5 +RtlPiFAwDvx2zdT0T5reyl2Dbrc5pj8QrcNFofBPafmxlka3MzT2cWSBs5KIvsm/ +8G2BQfonbgkNvbepskiaYZyy5nso7ypG9+iDAyTCwEIeiKWYeWkImYFCl+p+SYNg +SBm8fMxQhr83YsDqgtWlqDH1Vs3622IoxUxPfN1cFErQXmBfI8Ckgcl1eOVGc4Dv +CggwebCwo+5w6WvG9mTebK5HOlGW42o9BYtY4AywMflonNqoKApH3Eqv1q5M0lSH +E5el1DSYibjfS5fTmedJ0TesEFeJWuSXD3xsStmykIzedv+0iEI8rUXfFOqqXaH4 +1Sa1i/H703VDteMXXWja0dTdi2bOVriI9y9Wsan6Dgzg74FvJYUaeuTua+ptPJ9p +ls5w+De0fM4yjRiPEPPfI3qAGMsxpL3fVDILy4Dwi0RFAadd6A69+JcoBPdH83H+ +HC56s2W/CeBIGb7CMAX9FY753LAbCk1fYLingPpoKshJocttVvTTrYJFEdR8LlFz +upURAottBjfjg3CyoybmHO+GfeJOtZzgsg9igwI47C0cmQIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAFpw7tbBxVl1QnV2BHPSIqjnaWLpypbqLLwZPXYLcbjxJZtQ +R/DjgqNovYDaq7Ot1nApqI2+mkO3T+WPpx5GUR3kzLq1fXApCQ5gFCIKbIwT96Ag +f58bIsekC32yTZOV+4fb/buFReCML9STtIbTYS+gTvvuQQ1VF8mJU7dT0UWScukH +MjvsxjMBxrBm/jqEjRws6ZQ7ioWRXwcaBwBqLQaxrY7n9hJP4L6SCYKBAroI7Qej +Li3LOWDhWiL4SASlePpt1S6ogQG0rluptitpQhhdRVFM9gLQ3GJDVlAk/MauNKR4 +V264kMOgt3wKs4ZTv+N1EmC36Qxcv4Mr1+QydnQnzf28DkdQD/89oPDhfA7OGTSW +FeD0nabOc7xJmh0hI0vSKr7EmdluYyFkdYzflkYfazJu7PU1itFCq1H90PGAXI60 +GtUDN8KsxAV+xVEIpwoko6+jwZHnol7QII8+r6xZTwfftS0CoVEPEpaKOvZ5GQRC +KPGBBHIS8fjcEN17IkjqP6jMln5A09hiiKT8h7lIh2IWFIiLKLDMPdcrrYIOdubh +0oz+S/vG+9bAHNuUgjozEGsZ63aR/VcS5yfFc8uBC6CDNHx9WFXEvrPZpNVtsuQ2 +/a+is6Zfh0ApiqwKIx/x+U7C07YojL8n1rvccpolv1Uh6nw6763w4j9CNREe +-----END CERTIFICATE REQUEST----- diff --git a/certs/2127-key.pem b/certs/2127-key.pem new file mode 100644 index 0000000..bc94708 --- /dev/null +++ b/certs/2127-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAvqrhUgwxxC294WLGGglkdDuG+AXmHq0R0fXyqx7bXxHBfLa5 +C7aExi2dYLztA8NnyVqsskqrVMwu4j9wpNX/hChDTF9IK54OnDUgRs1ar2o/TXBh +80xZ6WVbU5bYOUbZT4hQMA78ds3U9E+a3spdg263OaY/EK3DRaHwT2n5sZZGtzM0 +9nFkgbOSiL7Jv/BtgUH6J24JDb23qbJImmGcsuZ7KO8qRvfogwMkwsBCHoilmHlp +CJmBQpfqfkmDYEgZvHzMUIa/N2LA6oLVpagx9VbN+ttiKMVMT3zdXBRK0F5gXyPA +pIHJdXjlRnOA7woIMHmwsKPucOlrxvZk3myuRzpRluNqPQWLWOAMsDH5aJzaqCgK +R9xKr9auTNJUhxOXpdQ0mIm430uX05nnSdE3rBBXiVrklw98bErZspCM3nb/tIhC +PK1F3xTqql2h+NUmtYvx+9N1Q7XjF11o2tHU3Ytmzla4iPcvVrGp+g4M4O+BbyWF +Gnrk7mvqbTyfaZbOcPg3tHzOMo0YjxDz3yN6gBjLMaS931QyC8uA8ItERQGnXegO +vfiXKAT3R/Nx/hwuerNlvwngSBm+wjAF/RWO+dywGwpNX2C4p4D6aCrISaHLbVb0 +062CRRHUfC5Rc7qVEQKLbQY344NwsqMm5hzvhn3iTrWc4LIPYoMCOOwtHJkCAwEA +AQKCAgEAnifsgzxuQ4aVzNE79fj4hJmkGTP7cFKrR3g19M/BtBhsYODImfiqJiFM +PCQ6jjaWbqVyPupFOC+ubCmnbHO+YYdsW3tlyBhxkg1XWqOYp40AOWIRPdmFc16J +5MppTQmB1MEDkvm7XWjbTlSB6HAAJbe+8GkAQvt/0NDFH3qOjkpTGj+1nP7uGdA0 +qo1nmHj8vI1XzUEu7WEDahXit3xkmNkqLAhHD1swWQxQf+MudVlv0wxSnbmHSQ/u +iRa9jS4BeyIh8GH1VyHpWB1yzti3qAR7E6zKvXr7E6xFic2jSTgfxItJjqvBylmg +BVJmDuJJbLxkXgF9FdfpeL6FaSLJZAlreLrVSopfZwyzpbUQ/a2Upoh0WGpGuliP +baVAKR8NH6AbUA5zThwx4FEHW7xaTVlMKUPUenAePkWYqI7H1d/c5rTKHDqbmZDv +nAlNmnzvTXqlAvEMdkFztvDQMbApYlm8RUYApwXtvvOGu0lG+cs+1/0OOXaAXO3g +6JiPgDxGq/Tvr9TH4EzgA1BpdQgHd9YTiCKIOhqx4JpBtZCdpPuO0RkpXuhfTFva +2gRFausnbuEWPLux/B5OhdDcw0hiqDXNUH3cWp0O49GiUcB7hK45njLDvJIDqlK0 +qKjZYOjbgQhVaxmVJby2z2tSe15ZWfFvBZYMadrMf6kpnmzB10kCggEBAN1HXP7z +ce9CuNyI4VbSLMhxS7Kc/ohKPk0ux3/r20n1zNB22VczHQkpFfvlUTCpVeR8XNRs +gWj7LtsYVfLdYfmlEAXnrsMh0pmGpBF2M6tg+beiR4Scbxvd8yGQx+dDnPZbDz5C +RnfQoETROHUsBtGDhIjBEur68D7K/eamKQdZZHaEAAkRHslCDY18N6P3wtX5dK+1 +iOQZ0gESLlVZYvbYZRE8xmUdVIiYGFjqpC6nqXLdn6XUOzZS8bVjErnVS3jNU2R0 +vrMgwEz69zifOAFa2iBCevF186HYE5A7hZrPP11i3C7B/mSHS9Qw+5mK5P3BVuof +6zWRSrx7fljaVG8CggEBANyV4XF+hPDYlk/11YCG0456k84bG3egPdpC8OeKMtdJ +pEjxWWVFg3995HRGy/64bbgUKWOVsdArG35b2aM/+FLOyXV0x5bTszZggclcfgO0 +Vgk/4ipmm6sMcFwYtangjWSYUeXiw39zfD35HSS4fUeNUHjj6H8+kBfxE1lwazLB +8tMdpfIWSFznQqARORbaCd85KPKVBDYdin7z3AjAOELxWIxnVRBTEPHLRX75Kpar +RCdGoNikjZRJA1Tii4w/uGPqlhenSskbUCsH6ULx60HxsGsLS+1CArBdeiNRP39b +iI8/0Bv/JG53RPyOJqLUAFu9vatTEQxPGkN2yRZec3cCggEBAL9bboWgO+BgQAOf +b9eoLEgvCfptoAR2yAfxM19htSLxqOyCSxQIxMxeNn++4QaG+ht8nL6rEwKZbfzU +v8cmQgsk/oVMxSpEfp57/DiJksdbNrjiYpzAt6lOuGpHjUhmhT/aoYUCxXPp/B9n +Gz7hEwhuhtfIuDZzSf3Th9zFxudvG90N7AXrQ0diktvPF0L6CQkIECu/fqFb3utE +MMNoaJf1rPlKKHva8HarqSqDx/X80iHenKhIr+gbtKFbCx+f4AOY9MwD1cKMySAJ +THAv6LvrOIT7WNylV0qX1Ns/ThwBq9dzndvlsbx38FCRB5PRtJPpdeNENSD/A7WZ +yjrGnIsCggEBALdRtF8+9zq1tQ3Uz0+WPUE+q5FxQ72CJYU7drvmRWRX5jlcop+g +Sq1ssazUnXoeScjesJr7cCABg0LbEJ80bapcAl8j4y981oZNY+81d+CaQZpERjBY +v+xCVSqkumzomnlMgVucvj4wesOCQW8gB7WsQoGFXtZI5zWOezcsT1qKhsRe8mej +jxXud5dRWPGd2PBzr40SvMJAgLYK8gUvwlIYAzAEPFRpxD4+YY4pgvRedzBw6QHC +l4rxttwXvkObPSGEdqJHvMYvdcudMoUZShuuwZ/kboBKCLQLq5KoVi4Aoxfxv4FU +5DEN2/5MIN3XdEjKAlPcn+Fr5/bDRFDbw/cCggEALCPTApdDXQO2w7sSX17U///N +XykR8Mw7nQyBmEQHzEf+rMQgldG15awmvpSi8Sw8v9KOWpM2EGyNYMeOM/NmeRFI +NIKL2govucmXSbS6mYwBkrmBIH8zTAWO+iikwMEZQNvMyiEdNh0uAifFhRh6ZOpq +EJLukdr7g2WMiVU5y2ClvnCY8GqznJgfM+Hhw7p7tLw4jIo9WnIK4WsxJo8tp66R +sAKqyzAdoKV9dwFaFMdftOv4wJAFWPqXO3ndYUY7J5EO2Go7PUrlpvQAl3swXv2s +nG8tPOf8iRd4xtOjjjpCG1de7g+XPLsAM0uV61yyUneZ2QReFJsXSWoOss5Ssw== +-----END RSA PRIVATE KEY----- diff --git a/certs/2137-cert.pem b/certs/2137-cert.pem new file mode 100644 index 0000000..eca9901 --- /dev/null +++ b/certs/2137-cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFPzCCAycCAgH0MA0GCSqGSIb3DQEBCwUAMGYxCzAJBgNVBAYTAlVTMREwDwYD +VQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1v +YmlsZTEMMAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwHhcNMTkwODIyMTQy +NjExWhcNMjkwODE5MTQyNjExWjBkMQswCQYDVQQGEwJVUzERMA8GA1UECAwISWxs +aW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNhZmVtb2JpbGUxDDAK +BgNVBAsMA1BLSTENMAsGA1UEAwwEMjEzNzCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAN+VLzXKmm5cgMZzcctDe+OiSeXB0ta4s8jL93SoqqDEvsrFX+6C +9ZgRaDrAt1YBemrNjbxeyqeEO+UHpznhc4kqt6dgen46vsL+omEmon9bWYP+ev/f +6Rbms+5aMgZ/D5awAU6ZN8XEDck2zX3A5YCja3Rz5B8Y2H/Bj4v8OYKXBFEbrtFM +SSYO/Os0S7QRVp/8plHmVyx3LQ7EWFtnutQ999fj+lOMo1VWWa5JC9f+lcPywcuK +CSD+slM4rHiVG+VGoEpmdurhjnDQKmBbE+4WOZLRRth34AP6eEcQDwiIqVIFvGQb +DzIvTe//prTl4WspW+n9I7bkoNsjkm9qbNJzS7imkTi34AEDRi6LKYxJPsW5HCda +9nXIs/EtJFKGGVcuGMo3NjpQB0pvh5RNla5b0yN1gtD4T63gZAtlVhf59KCmSJrJ +Moc+ICv4MzfhoakYHbAiZ1J/Wn5XkmXJiBfkfJvhFaCnfcmFTYBlJAvfEABNt+3/ +okCpdRFKv/wpI9pxuFcmGPEfxGOhauLTH5AN//X13EP9ElfjH/y9HN869cTOhxKB +H3HzaANVlfkbIVCRw8WeQO1eJJemkOeO0ya3UHFH+GlhZiuqM/m9tygN4ne2eivM +pHtc1DAbfbFTnyrAJBjvKhj7gdKUB9Gh5WEJ6haZ3z/r2sXElEPqZiQzAgMBAAEw +DQYJKoZIhvcNAQELBQADggIBALoZn27LNemFh7Fj1CaHTr3bfISxs8Ahp1gWBBci +F09yr5hzGMestWS4vEwNkBi8RDN6/1kwt19G7OAK2GY7XhlqnqlUI/BRgNZ2Awtm +yK5SN15VpjBh8bQ5zTrx/GK6I9CXWM39OE+eGkje9OPi5wYghAiYLDZbxF85FC9y +3GTfXBT5W6ZE1q2IWsMXhZhqkp4z6rAWP4F1YoWWfCa9KFa0ap6Q2/MVkWOGJqIe +E72MRGxg4pI4WdB7NSHRorQLlX9TGfQxry/sNJsKO8KMv9dbKKArAxgf4RpwQOGE +owtLAaR2X6hYUs216dUCV1wtypqM0XV6TH993wmknmtBxavB0yhG64bHQ8FTogUg +VB5+U0gXgOVIr+f30HLr8oQ4jcwuD8gIUmJUGw4S89j6u3ZKkMxaoscfhfTRBmKM +rCEsTfnu+EhKz0h7ub7DPZ1qIqVHmET8gpIeiOjc2rwQ7DEd58Mu7ZHDBAKNZrrb +t0xJhm/Y61cjaqHAawHCRhGpbcZoewl7SCKEcZBkuwCdNmyo8cOO+KpNy0tNMxUy +146dPtFlNTah9RLMQWRlSrJH2S2jIX2sSf6A9yMGSod5E5VZViVSHA+uhxLD+YFp +FAQOvmaO0V2pEcWliXYoKDO+IBHFf4MLpJBLKb7ZdKkdrdBW5GD4Ui7gTTzyfIBa +JSgA +-----END CERTIFICATE----- diff --git a/certs/2137-csr.pem b/certs/2137-csr.pem new file mode 100644 index 0000000..f2e944e --- /dev/null +++ b/certs/2137-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqTCCApECAQAwZDELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDTALBgNVBAMMBDIxMzcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDflS81yppuXIDGc3HLQ3vjoknlwdLWuLPIy/d0qKqgxL7KxV/ugvWYEWg6wLdW +AXpqzY28XsqnhDvlB6c54XOJKrenYHp+Or7C/qJhJqJ/W1mD/nr/3+kW5rPuWjIG +fw+WsAFOmTfFxA3JNs19wOWAo2t0c+QfGNh/wY+L/DmClwRRG67RTEkmDvzrNEu0 +EVaf/KZR5lcsdy0OxFhbZ7rUPffX4/pTjKNVVlmuSQvX/pXD8sHLigkg/rJTOKx4 +lRvlRqBKZnbq4Y5w0CpgWxPuFjmS0UbYd+AD+nhHEA8IiKlSBbxkGw8yL03v/6a0 +5eFrKVvp/SO25KDbI5JvamzSc0u4ppE4t+ABA0YuiymMST7FuRwnWvZ1yLPxLSRS +hhlXLhjKNzY6UAdKb4eUTZWuW9MjdYLQ+E+t4GQLZVYX+fSgpkiayTKHPiAr+DM3 +4aGpGB2wImdSf1p+V5JlyYgX5Hyb4RWgp33JhU2AZSQL3xAATbft/6JAqXURSr/8 +KSPacbhXJhjxH8RjoWri0x+QDf/19dxD/RJX4x/8vRzfOvXEzocSgR9x82gDVZX5 +GyFQkcPFnkDtXiSXppDnjtMmt1BxR/hpYWYrqjP5vbcoDeJ3tnorzKR7XNQwG32x +U58qwCQY7yoY+4HSlAfRoeVhCeoWmd8/69rFxJRD6mYkMwIDAQABoAAwDQYJKoZI +hvcNAQELBQADggIBAMkzwd4XGY/18QTgdaC/uhLspkRfM4pMuN8I88xZa7XHLU+X +8jweEGSt8/1iIdyzkVZFQ58rX7rNeqa8uP88F2sJ493HfaUoz+za8DBv6tVZe+MY +ICSCRH7QwmV01WE4k2tE8EawwlLat03a47Xpv2CkspKRsrd+k6oPXMVzMIieIHK4 +7M/3NpqBLGLaDRGKdzibD9236KDDLqks5MBsurqQESBnNgzmNFXSGM3zXOUb6NAO +y6CFheEUvjUaXgo43oHcst+SadiwFesz0VM+AUPaMU3sZiCFf313pFyb52F8dPlm +AQCju3jmT5TCDK7/DM87I7vrY+ymWQsQA+dCARxTs+wSO0VRriga6AHe/W3NCz3n +LgE3PGnb8BCQYcNlIvyQUOChlvbJOhZm70/yCKrqNF9/2J8fOsRKar41khPtPjba +XUnl+sjpSTY4qIWkpjN/C5sRGAnq3KFI9KCjU8Av838lu0TVSEFEhSUy0CG9a+Lq +pWnYD8bAUvSbPq3gr7F0opRVYcD1DXSZ/D79B8CY5U1BbR6EkbNWxcNsX+DFDfJn +VLqoWXEELHrzolZPH+hFMb219VsZZ5Ic4YnQ99LDYKPqwGrC/KCVjoC0yPf+Azji +gZv3be1sBVkZp/Gnnhc50O9x6m5v7/epWlQ16dSWyu3oomGKGCLzeRRNN5uM +-----END CERTIFICATE REQUEST----- diff --git a/certs/2137-key.pem b/certs/2137-key.pem new file mode 100644 index 0000000..61799b0 --- /dev/null +++ b/certs/2137-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEA35UvNcqablyAxnNxy0N746JJ5cHS1rizyMv3dKiqoMS+ysVf +7oL1mBFoOsC3VgF6as2NvF7Kp4Q75QenOeFziSq3p2B6fjq+wv6iYSaif1tZg/56 +/9/pFuaz7loyBn8PlrABTpk3xcQNyTbNfcDlgKNrdHPkHxjYf8GPi/w5gpcEURuu +0UxJJg786zRLtBFWn/ymUeZXLHctDsRYW2e61D331+P6U4yjVVZZrkkL1/6Vw/LB +y4oJIP6yUziseJUb5UagSmZ26uGOcNAqYFsT7hY5ktFG2HfgA/p4RxAPCIipUgW8 +ZBsPMi9N7/+mtOXhaylb6f0jtuSg2yOSb2ps0nNLuKaROLfgAQNGLospjEk+xbkc +J1r2dciz8S0kUoYZVy4Yyjc2OlAHSm+HlE2VrlvTI3WC0PhPreBkC2VWF/n0oKZI +mskyhz4gK/gzN+GhqRgdsCJnUn9afleSZcmIF+R8m+EVoKd9yYVNgGUkC98QAE23 +7f+iQKl1EUq//Ckj2nG4VyYY8R/EY6Fq4tMfkA3/9fXcQ/0SV+Mf/L0c3zr1xM6H +EoEfcfNoA1WV+RshUJHDxZ5A7V4kl6aQ547TJrdQcUf4aWFmK6oz+b23KA3id7Z6 +K8yke1zUMBt9sVOfKsAkGO8qGPuB0pQH0aHlYQnqFpnfP+vaxcSUQ+pmJDMCAwEA +AQKCAgEA3stwYe/kd7jh8d80M9Kpb6pWbQb5rFIdhSgLDErOzKmBXdnUwH3rcX9X +F8TWbHPIowj2BhGHa+pPLOi1cO4CDVtt6vIu3f53/SN0d87h+nry9p7tvnBHezSl +dAyY8PRIemYkx0fS1dWJz0o29urzR36RI1ggqARAKP6epmXOgR0vhgtJ5vJXqf8h +dNeF4IeuhHpk2hPoJj0TvzVUvrDc8YZWpOFen0bzs6P6dbwAe1oLr1kGWGbStfhX +hqpg4z/irlP0gm8cbO4a3LvynlXjxEqNUIoOSMMbjZtXo6iS8nQMFdn1YuO7/sw4 +o8FjQ7wXJovuNXq0zhmBWR1XXIL2r9qu7U8zTYX+mQyLowGB/LUpeiXw1qTryqJP +TOxQPiUSt6j5QbIhSOSqHrm6U33zGWYPyCurMYSREvze1D8A4JLd/G6cMwRJrUh0 +RM5hiP+73M25SZ+P8eOVqjC6z/7tyTTxztFC1JDL2BkZ5HDkc0FcWNKVKZWaSmBQ +aAFXeGnaySf28CatZLWvqZJKPfhDIFxh5H16e0CdVGLurB9llLEyMim5t50HZIC8 +pEkCWK8UliVDqn5g54LmTTXL+9h6EqZ5lnJA5km9wljR9mEJMtqZARS+cJhdwrWV +SjR4pqjfz6SdwrMOBIOVWROave8qgaMw9YJoKQJx9v2nxWCP64ECggEBAPJ0lnST +VToZ2JnltdiuXyGxLlDP80IRsCsTcQ5O1BBNljOz/rXtE2Zd9hPY87SZusI/S3f6 +EF1YQKUYKa7YZS7Do8ZVYl1baXiYZG3G1SDEHBuMSQnKH7MfBx9DqpdssW42eTqX +VL5xAbw4V0CUQ0Wuj5PGl6c08YPFjy5hHIhRKeoiO9IvYbTq4DEM9naWlDO0XjCF +CH7VR6RBp78njLwi1cNJOnS+QbCNlNc/kzg2llsWQNnqfUmXAVYDKKuLKdn/Xjax +JiAl3dZcqpMxjGNSMBbZ6eVncZUESv4fcjw/jKEmWLjI86jsHJToCp4vcvuvKYbS +cmJ7JU3wmOYdhBMCggEBAOwSsbbOmki0W2AFYU5SMh7dmfsxMT6SL9z7fKIWQC6G +3FlLI8k2y2V9kabnKCqCGseeBug8QLBH/A2rEh4ltCisanfRCBPrbnPi4B/cTezi +PKjQEAuN5ZlYMUENlfDlB3o0py5+1pIAKY36EUJRoJuj3jlj2xDnLKgX45IvPxVC +GZ0/eWDLlxqtHEm9Z+MCtJbCqeA8bK1UypAAKlWQU6sZ02B2h6Nj2yA8L0vodWty +HqELRT03pIXdlBJwvzEX+pq9BSDp9uQAemVNsFLQOtHBoklVNSL2VzADg7QWzcYK +Er9Yalps0DyKCtpo+Tzs5KIRJteVtR7U7msOf/dFo2ECggEBAO1cdm9qTeWzp/oC +iSS4kSnK7CzxaJUl+/Iv9l6rjbDoREQZ0yMIFhYBpweHPg9w8QV6McgjaCH6ZE88 +eJJUB7rgjVV+Ae6jr34As1FFdyG83Eeb72VGHAKgPbi95iSYpJvheI2D2dMXjztV +bRYsEDAH1Ug3BAEOM+NtZd9h8y0BSKePHEGJYX5c818R8bfncu+rhQq7MrX410pX +fIIHliAZemzVJAVmvai68xxHgTlnN4u1HYg5qK6CxywNq6NFepORDgs9IrYWXDeg +QN4Zg/c4Xxv/+pw7yVa5/TEMWCnjjSm3AOTm1qRpgxHEmaCDk24S7fSv0ovXQ44q +HYYrH0ECggEABq+A2OyA8g4piE6estkhEj60XajG/D6nnFqC7RQ0PR0UoHLAULJ8 +kCM+PLvPJ2UH3R9ckrciHdvsB3cQzEnFEGHRohMJZ4cDWcTTFBPpIQxHK4C485rR +JcaZnn4EAQ57Z7qWAXsWGIxooNy0IGyvX7kEUhvB2Hiziw8iIsGzx6ZXk1x404Tw +gpDkfDIg/wzUkHBy3ybW7RG5qtpWWJX9yJqyoci5jqcFTaRmsn+i06gntefbziAF +SMU9rEgFIh7LuhYgTw5RL6PT04qfs7ix8b7KGcmP962CSpnO4QrESRd/8GtQl779 +JrnCFO1kIZWT5AMYVoKm3nipR97hQN94AQKCAQA9wKGPuyVhON1XmjI2SZQZOAPx +UNpgQaqHOlLwjSxUnrZefLrIMNecbcUDguAkP0X6I/WLSeE6LO7Lwes1sGha5Yke +P1yNyHFdhKSA0fhpXp94uMVDgT+ijQIflDlVr6i0HTjUAQEttWY1eGDuANbNhGX6 +N2iyZj+uyVy6oTtRxMelJ4/snQgcUvJ3XUoVSwmZXdOTwVVu2ReiaWozTKLwmrPi +dgqJNhaii419qAFsHGTcks90UugGXgcsBCUPMJOfNIKFNKCliuLf5jqNagM0SISf +j8KWL6FLyyTFuxeh17e6HrghDV4YWNG+fNvlhobqYwlfLZwqC4Z6wxhESPzK +-----END RSA PRIVATE KEY----- diff --git a/certs/ca1-cert.pem b/certs/ca1-cert.pem new file mode 100644 index 0000000..4ef2f28 --- /dev/null +++ b/certs/ca1-cert.pem @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFlTCCA32gAwIBAgIBATANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJVUzER +MA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNh +ZmVtb2JpbGUxDDAKBgNVBAsMA1BLSTENMAsGA1UEAwwEUm9vdDAeFw0xOTA4MDkx +NTMxMDNaFw0yOTA4MDYxNTMxMDNaMGYxCzAJBgNVBAYTAlVTMREwDwYDVQQIDAhJ +bGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1vYmlsZTEM +MAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDcKxPXHTPJQwCE3G6PEC1tHPw15iqD166f8GIzSKmpxptK ++yf5nc0GAQOb5XKOcXC3aTIe0N6/ul9USFg00+3qqH98J3eeeCZ3HeghyDHlQtlS +pVyTPUJHWwSBhJfJnIDe+hjVM1neQE+3N5mWS8axhxkzqpJESRalzNHgdBvSJrbU +7sgRVhI8ww6wpOmDk1DwH75fymDEGRwSm8o3LWnsD/h33blRoeGpyZCtpTu617R2 +4hBX90hFgqo/3fqRoLzqWzliepk+jMOFzKBtHKzCvrv3vzgH2Dze1ttJWPzNzz+O +TYq4cInsxyfeSPJCdFhWqh7mPFju4kBMCxqAUKYUT3EmCuXD87sMYrxNHBdHauEM +rPSH8rGb0IqNpN+WkdQE44E+xrxEQt4Q1rfhGIo3GI4iCiOUvYvTTVwFXdwE6QzN +InBpu7gJGcG7JMakk9UKXK8+bOb7i+QL1nMhfL/UOTWbFRYZ2rlrkkCO2UorOnwW +kL9J3QNfNR+07hIrUTdDhv6m7n7Bp2gsWGbU9i7zihsW/2tsgFuuOHEiDxKPD2lp +XDOCXHoPlLDIArykVF4qwmZDEQpPSpHvQS4cftkmb2jdfRj16VXWSBMllkdA4VIZ +hg5Wva58zaPW/aaDqeQymZTAXBWdvbU0S1E/NU5w8K1DmX9vRpe4nmvfHjQ4BQID +AQABo1AwTjAdBgNVHQ4EFgQU9Lj/xKP6tLgPBN7GV9cu6ZQJRJ4wHwYDVR0jBBgw +FoAUma0tHGH1VEaE31J2rodLAeYKhz0wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B +AQsFAAOCAgEAkY9yMQgtsOIa8yc9i6IleQYRawimZjzYt2/bkIecQFVFC9/Ma8YD +G6evZNSrwK6EpNXQD0+39q2xW2DbzPvR1rmLnx9c0lGci0o0K/30FeNhtYCN73G4 +vxHwSimf/yS3l+OtBpr4k2CAU/YKpuhiIwkruEBOVuKY/goBsS0yaq+tnOpDUy3e +L9Tgy7VIs/dCkPfPrBSOyoPog3OAfxfB1miox3odmfor1smr1VVj+yIIeks83VtR +3GUjBU5SEtWcX5gnaq9iyy/mymO7HZK/Lkm1owQk88vSUI8jOqx6NRdb71m6WezJ +1Wm741TxoDsxANpUFPpoHJ3WIadRV0MqAJjPsgvKwZquCKIK3YX4I+LFYwjunxrR +TehhJmuf0XzqoCnSmkHxJaX0gWsuRddIi5sjkNpd8mzRZghJMkHPkL8oYTQ6a7/L +cLmqaYoKgDIRxbAu1oWyRpRTNFuIgdgNYhXxxHRNalXRp1Wr3YiE//zZohLFHFKf +VDEiBk0VG3lmfTO6o7iaNSdyINS6tMs2+Ekh0F79fng/QdhAIeBKb3PFT2gj+yam +YpWIPfrNf31oav0KeclBaFVeKScdq3S93JP9QyXjiHZTFgnoGnH9Oe3wA6CuTXMJ +8KCoFwxqU4NrnJwNfAUtl6DsGqEkly/21RzUPg9vYMti/wRAMmeP0y0= +-----END CERTIFICATE----- diff --git a/certs/ca1-csr.pem b/certs/ca1-csr.pem new file mode 100644 index 0000000..6e20b2b --- /dev/null +++ b/certs/ca1-csr.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEqzCCApMCAQAwZjELMAkGA1UEBhMCVVMxETAPBgNVBAgMCElsbGlub2lzMRAw +DgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZlbW9iaWxlMQwwCgYDVQQLDANQ +S0kxDzANBgNVBAMMBkxldmVsMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC +ggIBANwrE9cdM8lDAITcbo8QLW0c/DXmKoPXrp/wYjNIqanGm0r7J/mdzQYBA5vl +co5xcLdpMh7Q3r+6X1RIWDTT7eqof3wnd554Jncd6CHIMeVC2VKlXJM9QkdbBIGE +l8mcgN76GNUzWd5AT7c3mZZLxrGHGTOqkkRJFqXM0eB0G9ImttTuyBFWEjzDDrCk +6YOTUPAfvl/KYMQZHBKbyjctaewP+HfduVGh4anJkK2lO7rXtHbiEFf3SEWCqj/d ++pGgvOpbOWJ6mT6Mw4XMoG0crMK+u/e/OAfYPN7W20lY/M3PP45NirhwiezHJ95I +8kJ0WFaqHuY8WO7iQEwLGoBQphRPcSYK5cPzuwxivE0cF0dq4Qys9IfysZvQio2k +35aR1ATjgT7GvERC3hDWt+EYijcYjiIKI5S9i9NNXAVd3ATpDM0icGm7uAkZwbsk +xqST1Qpcrz5s5vuL5AvWcyF8v9Q5NZsVFhnauWuSQI7ZSis6fBaQv0ndA181H7Tu +EitRN0OG/qbufsGnaCxYZtT2LvOKGxb/a2yAW644cSIPEo8PaWlcM4Jceg+UsMgC +vKRUXirCZkMRCk9Kke9BLhx+2SZvaN19GPXpVdZIEyWWR0DhUhmGDla9rnzNo9b9 +poOp5DKZlMBcFZ29tTRLUT81TnDwrUOZf29Gl7iea98eNDgFAgMBAAGgADANBgkq +hkiG9w0BAQsFAAOCAgEAJO3bFAIk2PGPxeRAe/QWli4GIuOg9CGie3rx1aI5bw2x +9STVvbAs/oXiges6RrjevdW2ki5lLFxyqhwFFfC/YpcebVcCt+HZx+sSreHvAoFk +AY+/C/qELTX+CP3bGwyz3nXreLKvGMd0gCnsG20DDG1vHFJwxrY7NmSh6a+cBKxG +ps0/ABOwhxQwo9EnnYCkSgEk3FnG5iHu4Ym5bX+9wGNo1AeIxETxfRcjztzfIAel +EVDWV/NlF0mZo638EmpY9x+cCk9W6NtjfJKI7YWr/XKt1gpyU5bfmiag9p8LdzjK +UwbGT9iq9o66tf1+bVdeplmquRefBsSvCLCUvPB/2O5schORRmQ7idyCQ2oajnOa +jwlYglE3eW9ZBVKMtZY3UioG21XWvUn12n65halQkQUzptlrmRSyh5QFdmSM6a7z +6pV3fiPrbPyydH1EADUueNI00bMdl62ZRXcRLa/64A8XEJFxQiYkjYU0HtiBEhJo +O03mQSPR9OeGK1dfAM0dmwunStM803FLWONYAPmJp2Gvq9oO9VFPGNXSCNO5ECMi +BhqOCB1PqCPpURt49lJU9m3aKnHzV8usfIEsZCp6MXpmlMy7ge/GIBa69DQbLLVZ +Gw5y+oxs+GBbWdeqg7pJJNztdiaxMamDW/yhgsAKpwi3nzwOAKDaLm/luX3pt9s= +-----END CERTIFICATE REQUEST----- diff --git a/certs/ca1-key.pem b/certs/ca1-key.pem new file mode 100644 index 0000000..aafa254 --- /dev/null +++ b/certs/ca1-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEA3CsT1x0zyUMAhNxujxAtbRz8NeYqg9eun/BiM0ipqcabSvsn ++Z3NBgEDm+VyjnFwt2kyHtDev7pfVEhYNNPt6qh/fCd3nngmdx3oIcgx5ULZUqVc +kz1CR1sEgYSXyZyA3voY1TNZ3kBPtzeZlkvGsYcZM6qSREkWpczR4HQb0ia21O7I +EVYSPMMOsKTpg5NQ8B++X8pgxBkcEpvKNy1p7A/4d925UaHhqcmQraU7ute0duIQ +V/dIRYKqP936kaC86ls5YnqZPozDhcygbRyswr679784B9g83tbbSVj8zc8/jk2K +uHCJ7Mcn3kjyQnRYVqoe5jxY7uJATAsagFCmFE9xJgrlw/O7DGK8TRwXR2rhDKz0 +h/Kxm9CKjaTflpHUBOOBPsa8RELeENa34RiKNxiOIgojlL2L001cBV3cBOkMzSJw +abu4CRnBuyTGpJPVClyvPmzm+4vkC9ZzIXy/1Dk1mxUWGdq5a5JAjtlKKzp8FpC/ +Sd0DXzUftO4SK1E3Q4b+pu5+wadoLFhm1PYu84obFv9rbIBbrjhxIg8Sjw9paVwz +glx6D5SwyAK8pFReKsJmQxEKT0qR70EuHH7ZJm9o3X0Y9elV1kgTJZZHQOFSGYYO +Vr2ufM2j1v2mg6nkMpmUwFwVnb21NEtRPzVOcPCtQ5l/b0aXuJ5r3x40OAUCAwEA +AQKCAgEAis5F1es9SPgLDbiDo4KJgS8y+zA/QZvrJj7BSp/XB4iFQ4KQs1j/d3eQ +NOs1jASNEbUqui7pIGt5yoNJyRSL/NN6fGXNjoUlixe50AKNIoNAzFAgy1tlu+Lw +Nk/H+n3G6c03dsLHN83H9DUDibQActA/3Uj+qjqCIsm80AujtpxdzGU2kWd4XAKF +8mwmJKPt9VWuCmpnE3rZLgo2NQ9WplNzTO7m9UZgJVFE+5Ue0S9JQWJI94yZbelx +OI7UeJekQwR8a0/r6XmJk4Ns6R2Y9baWfx15T8jOp5dB7T5DM+Yjpa3RdXLOIg91 +XTkUMz1yrEDY9kK5tvHBo6+kZ51w9lUyW/Ohga6jj7bdj1JeqWMSf6HYJc8E0u/4 +TwHY7wfMp6HJLQrIrKZPNb+T3z7QlU7ONdMRLQrcqaBJA9/FLbKok7f6pCPMvdXX +K9Zq9MCTISaHB+IUqdKMxHbgCaB9P5+yIrIdk6DI+kQcgVwjq7g1ei/rW17tL/j8 +2VBaJ8SuSlYSS2ChctyTHsO05LBhM3lddDg/8u6VDorzfwxL5jjXmuo/WI/9J6IR +GdxjYH2mbYBGzXehK3OeYSzVV4waQFhYBrcCP00hfUXdhqJVsjo+QA2ciHtpUtl1 +XAoexE+uLa0G+KOnM7DJ1aGrYNASNtp7QGIugLIBKHcT94Ng0kECggEBAPwaE7Ft +GAuQFd0U6vZNoG7dvOv90kzdo+LSkkacQHIqI4Zo3LLEuSoopUtbmHbC48FZAwF6 +BUJ2eXjCiDBJ0/J95zi1IDQw/hg9nY9Vov93panO3cAIxoZJuhAxQnKS5UK2zJBV +ENonh3/aIY8Kutgi4Ex/IxSfznIRSPgvIs5d3vxzYfqm2AURyxmdyKCkd04ieCgK +ioqx0DyejDOhcmaULSENSF4pU90njZCJP5HZtf54CwOQ9X8g3x51+7cz4zV+yFad +kXebKRwFVYZIbe3no++NKj4xxW7Q1ixrqej1U09UtJzsdAwO99ptv3q0Sd23I1Ea +d6IAhlJygrHALr0CggEBAN+SmCFaTcEAmyF1h8tEOFQIJv7P4ErxgrLAU+5BP8oQ +UEdqy45sZojw7LXkIPY90G0bSwQ1IJ/dIHN4MQa0RY8iqq1hvn3rIgnZdYrkJH1n +W6R9FJiEd5H1ugcpcbEynttrxUkDEnRw3EuoR5crR1Gf6qGmTPW221vdmLloAfzo +McuCf9tdXKdYAdx78dIHUfNGl3IAPrId0lXfb4GVdB2QU5pKh3hsw//Zc9wniqwL +qsntHiBkZu/5MXliMHVz5C2hxUExScGjaiyYIDAjLYJ8xbz9U1vTOJk5mN3aHk09 +v9UbhGnFRwmbyYxa0/VrTmnTmPTkyEEDCdlMdMCqRukCggEBAKi4dxeWsLIEY22L +81iWSVoJksfKHvYMnANQ9E7HgiYl55KsGZCXMmlxvHZ7vcU116HuBaH2XRDHI7Lb +VrQipPO0qYv9RKlJZLUqf4mPQcCB/eBwr143QU5ch2cQ4Ky3fTIyDyRFmjq2m+vI +PA90menPJZhsujiyX0NeKBzZxwygLH1+Z0OOaCK0bt4dCEni6Gnljc8WhvQd3wTD +A4gGc/8NCksFjbpfJF5te0QRZvcg4rmE87IWUQcdI9ZKFgXddyG1UTUOzW1j7ZZw +R3XQganoDoJjUrM/MihhIgWmpJdhoLkGMr6XTW9IkT6hlrXzdUAqsjs0YH6OpVcG +hkuaGG0CggEAEg535PGzJ+xRmyEv53XKCtdhtuC5H7RjtuYboTl52mr44Nu6NvWA +Tn0O0R3sn5acd8NliqBz0xV74neJlh4HJClLmZc0WF0eMadze9UzMUGgwCct+6dv +NMWg0aVCPmp1NAl/NIdf/TGESUP9DDN9nhUJUSbqPkoXa1L5W7gPuQpTwzj19JSU +wBs2g0UrYagfsUM5RgbJCX+pFjBmhBO6/gxDBEoSqOI37jj0x4oWBBEpKQfSkBEr +0yPQIBqTCVljy1+uW7aMW2xETfe3WcvtiAVlvv7Ctb7Yal+hfgF4wwpCrQZ86kH5 +m8gOPhyz07Vn7todF2JG3iFNsVQgddMKyQKCAQARc7geR0PaYRHQziuf5qBaJEFh +M7JMd3u1CfhDAu8+N9nXlxdManc7Rje/WgLgCpF10Ey1yhq0LGREdnjVLfL3odHh +EEnwhwnU7h3cUXvtxnyOSSibb0DoBXTefMK2HgCruPoIsXPjwcU+aqy9U0p43Wk1 +iRKK/UY3U3pHErI9SGfv5qx8DYekMOe0xYq3FIrMqzeZQTl7cYimPho+KNW7nHnR +Snrd4o3sZyhyizBcNXzkLOk41oIxiWFwWtXDLchciTm+6d2MdK5yfLIY0r+f3OEC +3qgn5AHtyUDVH+o8nqqkNbbTaIbC7QJ6Vp5zsi5q+eW/0YrsqzPnHp56tIYA +-----END RSA PRIVATE KEY----- diff --git a/certs/chain.crt b/certs/chain.crt new file mode 100644 index 0000000..72cc929 --- /dev/null +++ b/certs/chain.crt @@ -0,0 +1,64 @@ +-----BEGIN CERTIFICATE----- +MIIFmzCCA4OgAwIBAgIJAOlaLX+/IPleMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV +BAYTAlVTMREwDwYDVQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEG +A1UECgwKU2FmZW1vYmlsZTEMMAoGA1UECwwDUEtJMQ0wCwYDVQQDDARSb290MB4X +DTE5MDgwOTE1MzEwMloXDTI5MDgwNjE1MzEwMlowZDELMAkGA1UEBhMCVVMxETAP +BgNVBAgMCElsbGlub2lzMRAwDgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZl +bW9iaWxlMQwwCgYDVQQLDANQS0kxDTALBgNVBAMMBFJvb3QwggIiMA0GCSqGSIb3 +DQEBAQUAA4ICDwAwggIKAoICAQDcc2W4WOuANzkjghCNTUpfkqc+yP2zLphA0Usz +zAcdP7NwOL3BTUuMX4zq3AAJIekzwGsmhOnP2hGzbPFuUubi1B5Ut2cu+25Xg3ou +cymyXOOqIhYibWE6eUUfvChLZ6oCs/U1fkcweqhxHzo91BbFxnUQGAEmfemdxhgT +2HzwILfOGQBIAk+SlcdWeik2uIaC7D8f8b28g2KwY36Rg+XjUBZNoV/tZtPereMd +41PqCLW0bAjioUw1zlg5dsuOtFuqGts4Pho8nbojzBDBgLrvOIkOSpFWmpyA14Gm +4dsa1AYBzu/qK6/yOQJ1tIv3GMfKeQCUXEeThGsUoufMLBoM1b/Yheo91w2JPiVw +raZjIHT9selYaz6gkpDPN0xuQwhTJu91SlpA6ypDsW6byhjGZgZTuUvWd5e5p4Mn +TBJxkq/Q9Kc3DcwCsUpMTJ7IvIqwHz8MO/7rUkblEuuIeri2gZdC3jqgSjsKlqKx +4OvWG337CxpCCSfgxukuQdQSQdtzdIKwkH9m4rTgLdP1TAD+9GlGeuBo9q8UH0/n +83wYhSEUMzFW8OhyzhNunj1KcTWG+BhYdxByDoCQu3I+OokxAS51i9yWtuzqsH+l +7VzK1CTWrecDiBEXS4PB1K1FgOQeJxzOXE5s60j2+MM1NartG1EU0RvJJJ2JOSUP +i/jgIwIDAQABo1AwTjAdBgNVHQ4EFgQUma0tHGH1VEaE31J2rodLAeYKhz0wHwYD +VR0jBBgwFoAUma0tHGH1VEaE31J2rodLAeYKhz0wDAYDVR0TBAUwAwEB/zANBgkq +hkiG9w0BAQsFAAOCAgEAv92Dc24BEF/1CLBz/xi+/Zlr2KIIV9elj/OFN5Ev5lYM +fvDJpim5B69GLhrz8iPhEQhWeQPiMRhZwi/2dp4uOrzAK3LJUyJHtjn3N4zRS1zp +qUCwRChQdcl1cE9nGWjEiw6toxFt9qJ5acHV5rZ5YYrTXcjtco4pzXp6aWypmpBS +cYJ5OaJejxks+tjY2J0E2ygcJRWDas2MJAgn94Uob8uS4SoUgyIXBIAOTsotleth ++X+mgYbg5e8IOn0jKu3llOhITNKm1JCQBibUbS8SwGO6FXouN0DnTg5SogJqaNfu +3+m4NrqIB9pDt7Lztsd63j0Cvltodc3kUU8FVrKvPIr0zNd9Dvf9krJUpeK+jnbG +aNr+zzkOz3sgnmod32n1y6vbo61qleu9wrh4VHj7F3I8G83ru80fNnyPXxH9KUtN +Q9//aQShcBCTSmF6g9/H53w7r0BFqlTnNi/UOy/IZL9RSPdzvIazdJoq1j6kTyMz +ZbO9SbalF2ExBImlOYoMwWJANXoMnKciekfLHVgsPoI35mP7vpLCnkMJzYI+2F+6 +pZ8QqWmyQdS5uC/e8dUEtms1hkc+bLPzM+ksL7luoXO5AkfpHuE+7xFaScFJImQe +nNwPJwvbQ5aIUJNhUkfbmk9f4+8wYg9AF9UjQepN3fBut+jQND43xv+3qSkGsvI= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFlTCCA32gAwIBAgIBATANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJVUzER +MA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xEzARBgNVBAoMClNh +ZmVtb2JpbGUxDDAKBgNVBAsMA1BLSTENMAsGA1UEAwwEUm9vdDAeFw0xOTA4MDkx +NTMxMDNaFw0yOTA4MDYxNTMxMDNaMGYxCzAJBgNVBAYTAlVTMREwDwYDVQQIDAhJ +bGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEGA1UECgwKU2FmZW1vYmlsZTEM +MAoGA1UECwwDUEtJMQ8wDQYDVQQDDAZMZXZlbDEwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDcKxPXHTPJQwCE3G6PEC1tHPw15iqD166f8GIzSKmpxptK ++yf5nc0GAQOb5XKOcXC3aTIe0N6/ul9USFg00+3qqH98J3eeeCZ3HeghyDHlQtlS +pVyTPUJHWwSBhJfJnIDe+hjVM1neQE+3N5mWS8axhxkzqpJESRalzNHgdBvSJrbU +7sgRVhI8ww6wpOmDk1DwH75fymDEGRwSm8o3LWnsD/h33blRoeGpyZCtpTu617R2 +4hBX90hFgqo/3fqRoLzqWzliepk+jMOFzKBtHKzCvrv3vzgH2Dze1ttJWPzNzz+O +TYq4cInsxyfeSPJCdFhWqh7mPFju4kBMCxqAUKYUT3EmCuXD87sMYrxNHBdHauEM +rPSH8rGb0IqNpN+WkdQE44E+xrxEQt4Q1rfhGIo3GI4iCiOUvYvTTVwFXdwE6QzN +InBpu7gJGcG7JMakk9UKXK8+bOb7i+QL1nMhfL/UOTWbFRYZ2rlrkkCO2UorOnwW +kL9J3QNfNR+07hIrUTdDhv6m7n7Bp2gsWGbU9i7zihsW/2tsgFuuOHEiDxKPD2lp +XDOCXHoPlLDIArykVF4qwmZDEQpPSpHvQS4cftkmb2jdfRj16VXWSBMllkdA4VIZ +hg5Wva58zaPW/aaDqeQymZTAXBWdvbU0S1E/NU5w8K1DmX9vRpe4nmvfHjQ4BQID +AQABo1AwTjAdBgNVHQ4EFgQU9Lj/xKP6tLgPBN7GV9cu6ZQJRJ4wHwYDVR0jBBgw +FoAUma0tHGH1VEaE31J2rodLAeYKhz0wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B +AQsFAAOCAgEAkY9yMQgtsOIa8yc9i6IleQYRawimZjzYt2/bkIecQFVFC9/Ma8YD +G6evZNSrwK6EpNXQD0+39q2xW2DbzPvR1rmLnx9c0lGci0o0K/30FeNhtYCN73G4 +vxHwSimf/yS3l+OtBpr4k2CAU/YKpuhiIwkruEBOVuKY/goBsS0yaq+tnOpDUy3e +L9Tgy7VIs/dCkPfPrBSOyoPog3OAfxfB1miox3odmfor1smr1VVj+yIIeks83VtR +3GUjBU5SEtWcX5gnaq9iyy/mymO7HZK/Lkm1owQk88vSUI8jOqx6NRdb71m6WezJ +1Wm741TxoDsxANpUFPpoHJ3WIadRV0MqAJjPsgvKwZquCKIK3YX4I+LFYwjunxrR +TehhJmuf0XzqoCnSmkHxJaX0gWsuRddIi5sjkNpd8mzRZghJMkHPkL8oYTQ6a7/L +cLmqaYoKgDIRxbAu1oWyRpRTNFuIgdgNYhXxxHRNalXRp1Wr3YiE//zZohLFHFKf +VDEiBk0VG3lmfTO6o7iaNSdyINS6tMs2+Ekh0F79fng/QdhAIeBKb3PFT2gj+yam +YpWIPfrNf31oav0KeclBaFVeKScdq3S93JP9QyXjiHZTFgnoGnH9Oe3wA6CuTXMJ +8KCoFwxqU4NrnJwNfAUtl6DsGqEkly/21RzUPg9vYMti/wRAMmeP0y0= +-----END CERTIFICATE----- diff --git a/certs/root-cert.pem b/certs/root-cert.pem new file mode 100644 index 0000000..4caaf18 --- /dev/null +++ b/certs/root-cert.pem @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFmzCCA4OgAwIBAgIJAOlaLX+/IPleMA0GCSqGSIb3DQEBCwUAMGQxCzAJBgNV +BAYTAlVTMREwDwYDVQQIDAhJbGxpbm9pczEQMA4GA1UEBwwHQ2hpY2FnbzETMBEG +A1UECgwKU2FmZW1vYmlsZTEMMAoGA1UECwwDUEtJMQ0wCwYDVQQDDARSb290MB4X +DTE5MDgwOTE1MzEwMloXDTI5MDgwNjE1MzEwMlowZDELMAkGA1UEBhMCVVMxETAP +BgNVBAgMCElsbGlub2lzMRAwDgYDVQQHDAdDaGljYWdvMRMwEQYDVQQKDApTYWZl +bW9iaWxlMQwwCgYDVQQLDANQS0kxDTALBgNVBAMMBFJvb3QwggIiMA0GCSqGSIb3 +DQEBAQUAA4ICDwAwggIKAoICAQDcc2W4WOuANzkjghCNTUpfkqc+yP2zLphA0Usz +zAcdP7NwOL3BTUuMX4zq3AAJIekzwGsmhOnP2hGzbPFuUubi1B5Ut2cu+25Xg3ou +cymyXOOqIhYibWE6eUUfvChLZ6oCs/U1fkcweqhxHzo91BbFxnUQGAEmfemdxhgT +2HzwILfOGQBIAk+SlcdWeik2uIaC7D8f8b28g2KwY36Rg+XjUBZNoV/tZtPereMd +41PqCLW0bAjioUw1zlg5dsuOtFuqGts4Pho8nbojzBDBgLrvOIkOSpFWmpyA14Gm +4dsa1AYBzu/qK6/yOQJ1tIv3GMfKeQCUXEeThGsUoufMLBoM1b/Yheo91w2JPiVw +raZjIHT9selYaz6gkpDPN0xuQwhTJu91SlpA6ypDsW6byhjGZgZTuUvWd5e5p4Mn +TBJxkq/Q9Kc3DcwCsUpMTJ7IvIqwHz8MO/7rUkblEuuIeri2gZdC3jqgSjsKlqKx +4OvWG337CxpCCSfgxukuQdQSQdtzdIKwkH9m4rTgLdP1TAD+9GlGeuBo9q8UH0/n +83wYhSEUMzFW8OhyzhNunj1KcTWG+BhYdxByDoCQu3I+OokxAS51i9yWtuzqsH+l +7VzK1CTWrecDiBEXS4PB1K1FgOQeJxzOXE5s60j2+MM1NartG1EU0RvJJJ2JOSUP +i/jgIwIDAQABo1AwTjAdBgNVHQ4EFgQUma0tHGH1VEaE31J2rodLAeYKhz0wHwYD +VR0jBBgwFoAUma0tHGH1VEaE31J2rodLAeYKhz0wDAYDVR0TBAUwAwEB/zANBgkq +hkiG9w0BAQsFAAOCAgEAv92Dc24BEF/1CLBz/xi+/Zlr2KIIV9elj/OFN5Ev5lYM +fvDJpim5B69GLhrz8iPhEQhWeQPiMRhZwi/2dp4uOrzAK3LJUyJHtjn3N4zRS1zp +qUCwRChQdcl1cE9nGWjEiw6toxFt9qJ5acHV5rZ5YYrTXcjtco4pzXp6aWypmpBS +cYJ5OaJejxks+tjY2J0E2ygcJRWDas2MJAgn94Uob8uS4SoUgyIXBIAOTsotleth ++X+mgYbg5e8IOn0jKu3llOhITNKm1JCQBibUbS8SwGO6FXouN0DnTg5SogJqaNfu +3+m4NrqIB9pDt7Lztsd63j0Cvltodc3kUU8FVrKvPIr0zNd9Dvf9krJUpeK+jnbG +aNr+zzkOz3sgnmod32n1y6vbo61qleu9wrh4VHj7F3I8G83ru80fNnyPXxH9KUtN +Q9//aQShcBCTSmF6g9/H53w7r0BFqlTnNi/UOy/IZL9RSPdzvIazdJoq1j6kTyMz +ZbO9SbalF2ExBImlOYoMwWJANXoMnKciekfLHVgsPoI35mP7vpLCnkMJzYI+2F+6 +pZ8QqWmyQdS5uC/e8dUEtms1hkc+bLPzM+ksL7luoXO5AkfpHuE+7xFaScFJImQe +nNwPJwvbQ5aIUJNhUkfbmk9f4+8wYg9AF9UjQepN3fBut+jQND43xv+3qSkGsvI= +-----END CERTIFICATE----- diff --git a/certs/root-key.pem b/certs/root-key.pem new file mode 100644 index 0000000..2634ac6 --- /dev/null +++ b/certs/root-key.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEA3HNluFjrgDc5I4IQjU1KX5KnPsj9sy6YQNFLM8wHHT+zcDi9 +wU1LjF+M6twACSHpM8BrJoTpz9oRs2zxblLm4tQeVLdnLvtuV4N6LnMpslzjqiIW +Im1hOnlFH7woS2eqArP1NX5HMHqocR86PdQWxcZ1EBgBJn3pncYYE9h88CC3zhkA +SAJPkpXHVnopNriGguw/H/G9vINisGN+kYPl41AWTaFf7WbT3q3jHeNT6gi1tGwI +4qFMNc5YOXbLjrRbqhrbOD4aPJ26I8wQwYC67ziJDkqRVpqcgNeBpuHbGtQGAc7v +6iuv8jkCdbSL9xjHynkAlFxHk4RrFKLnzCwaDNW/2IXqPdcNiT4lcK2mYyB0/bHp +WGs+oJKQzzdMbkMIUybvdUpaQOsqQ7Fum8oYxmYGU7lL1neXuaeDJ0wScZKv0PSn +Nw3MArFKTEyeyLyKsB8/DDv+61JG5RLriHq4toGXQt46oEo7CpaiseDr1ht9+wsa +Qgkn4MbpLkHUEkHbc3SCsJB/ZuK04C3T9UwA/vRpRnrgaPavFB9P5/N8GIUhFDMx +VvDocs4Tbp49SnE1hvgYWHcQcg6AkLtyPjqJMQEudYvclrbs6rB/pe1cytQk1q3n +A4gRF0uDwdStRYDkHicczlxObOtI9vjDNTWq7RtRFNEbySSdiTklD4v44CMCAwEA +AQKCAgEAnjRSc5GcsE7xOoJEzqMBFMVyMKSdLNHrgdixV2K8WEk2xPpzcx29cefA +gWuQuv0TFoioXORVx0yAF3u/Z6Um/PGtMq7L5fOapEM+k8chzVbMK3R63goRFJ2i +9btaT4L9hyMOfm05OZlM+KGocmaaUSSzLfGMIcuKtCdNcDCUuN9CCS33/bVq1Y+X +ln/kw9h478wLISmjOH4xfNRqKJO3jwISf3OoG/8HXW785p4Vwoatn+VIGxwWTSbg +OZz/SFI21kSfviUTPx0SUE5KWBPCE5tHAHKTCsu6NNxztweu7fnqtbGEi1D+253+ +HeqL57Bo8O0VdWMkGsGU9yJRpzyfE/HLIbBxOnsLq2nioDHoC66MDRsEKWeNPX8K +fjfOOd4sRVhZzYl0+uqiUMgVO/99QU9FATJoIf79ZmGQ7hltGkVokcnagN9gUGHG +5JO/3vV4D33QOXuet4GhwErhy69EUQDQCHyILImobWE9Axuuh3gI9f0jt81Qu24/ +b/v4E0yMLmB65iVPz18EEu3Lw2xQnVQAl69nbwzytq/uaxxlDGN9Ezru2ExdG98E +DuUPirOpBrrVZQWwtTbXLcgIKCaaHAEcLpT0SfOAU+JpVBqWaTOOVH7V1TDEtyeN +ZkKEq7aT4ln1W/Q/eXXOjlZ1LXhInZnPkznsFGdLvNRlUxqH2EECggEBAPVgv5W9 +lnq7XPRGLtYbOYVTeOBwZqSss3J5eWj4GEW5GpArtpVSkwjkUOddimD+HSIrU7wG +2+2INuWs8K9AdKniHwlM3jfk9rBMAiy7JKk+mHyGGjmYsx97Bgm80nCheiu7Reez +lHR8V3P9eefCp6jqZGjEiXqolBPTY+EfrIeFuiFj7GENqbasoyYOjcc+0fK57o96 +jafwsnYtVSLLQAmR1H1IQ73fr6mLgjeRWzu2gh6LDq9sYV873TPy1+koARJTGDg8 +KLaIgAcSH5XWr2T/+Mf8VSK/EbfRLTSzF4veAbMbDLcN975/D1XsbOcXHKmEfNCE +GDmG09k9dWwveVUCggEBAOX+aLFd7jp0BAXdonye5sW4HtdjPCxtwbAYC/wobwD6 +M9E//WTZrA6d7xMwcQ2FxvAgwZfCXSEqFmE27Z5e1dYFLOuXQFpnKDWkmJ8aXK0l +fA/CnbquDSybLXp5h2WqX0YiTlLLn524ITUjj+LxsCznB/K1lGinZnvPpkKztGNg +8UxG1ca66YzxtxOJC2u95kPA9YIcffeZ091GIg/150jz2Ck0sdv1bVZCb/Ghs+Is +tMsduib5DIG9eC6XIW/OH0gJIcBMhlgfZsV8YbMKl+sIFViZ4jjDgAByoAi66yRF +rnh+WXpBH5Skm5+CrQ/L0wtEOj3+mLuJeF4bjcIbE5cCggEACHBxZmcE2+fBxKz9 +Q2PgUJOUXrO+8/70lQVUhaWywAMjxL2cI/qZD/86QRrYfYl/2wL+eEMMIVlD+hY+ +mOhwmr8qLhm0sttvGJUkpgExu5hpii7ajAySbIzAomkaG8GSABsKxnNIsdDs+RJI +tQ3e0lJtbaUEzXEq1pu4na+HMYoJ4sgbAyODKMM7QT3S5n1knyKB7/FZGeOPX70j +ZnTzGOEpG732hntBAWXI7rxTFPSr+PzzXlkt6CaY7wZ1IpG7p7Ov6482H0EGljer +Wm3tzl13YvlsvCsyIs5Q7bUTJD5YdJ6Di3Axix23m07sV+5VkAb8e/dvFdtrQdd5 +SGVBmQKCAQEAg45Ndj8DWJ4p+uz214/Q8wHJamyR69vwMXjfyiGatRVo9GVE3R4B +Y+8E5JYN5K1DyPEDq3n66VB4sqzHqJIYgK4/Lpc6sTtWbbCzuDZNEqFhYGZy8GhE +kuJEVk0TnJyimKxg3s0ohP/gxtOLp0WV/2k7S6J/vIkcfu+c64R9R2cZPwc5ms4p +b3yHuv3l8YATKWhDRmRjzXBJFsXaEAUZgcoxOAizP90X6IJiI/XZviLSW2iqpUZJ +2CB3kTbTYm+lxv+qNaPQKLH1iDsIa3BAy6i5BRAorU1ud1MZpUS94eaV0Mh9CAge +N1kcx1XpBiMRmd0x72olFQiiODpMkN4KCwKCAQEA87DN9kcGr6fdzrxMjqIr8EZt +xeNbXOT2kM1IPyd2diPAvVhciaMsxRkKpYDyPXYapnMmqxoUAJxe0g0MorIT65N1 +PozaF80UopusIEqXgowcKHt+oGGr1gU4571djT98L3mM6Sga1NkNlb0k2kN4xiEn +T6ypeLb6bJJFXT6AixJ+19GgLDX4y9TbiVHdnGcwkgSEjsykP3uJz6DLV7Qa5JNW +6t0HYc5SzMyOGIDocpvmNic43pb4X9CjtVKf60lB3TWxakNqVCA3NdXqmPGnN5wl +YFcx8nyfJx4IUe2TczV1L31jzCBpbxMzUZ8swcBuBC7SRnW+9UMDTXazv5rF0A== +-----END RSA PRIVATE KEY----- diff --git a/config/default.toml b/config/default.toml new file mode 100644 index 0000000..2b08016 --- /dev/null +++ b/config/default.toml @@ -0,0 +1,111 @@ +[mumble] +port = '5668' +host = 'prestage.linx.safemobile.com' + +[hub] +address = 'https://hub.prestage.linx.safemobile.com/' + +[api] +port = '' +host = 'prestage.linx.safemobile.com/api' +use_secure = true +accept_untrusted_certs = true + +[settings] +stay_only_connected = false + +[assets] +#ids = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] +# ids = [51] +# ids = [15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44, +# 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, +# 108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205 +# ] +# ids = [1957] +# ids = [1949, 1950] +ids = [1947,1957,1967] + +# ids = [1947,1957,1967,1977,1987,1997,2007,2017,2027,2037,2047,2057,2067,2077,2087,2097,2107,2117,2127,2137] + +# ids = [1947,1957,1967,1977,1987,1997,2007,2017,2027,2037] # colinde 0-10 +# ids = [2047,2057,2067,2077,2087,2097,2107,2117,2127,2137] # colinde 11-20 + +# audio-test-100 1947 colinde +# audio-test-110 1957 colinde2 +# audio-test-120 1967 colinde3 +# audio-test-130 1977 colinde4 +# audio-test-140 1987 colinde5 +# audio-test-150 1997 colinde6 +# audio-test-160 2007 colinde7 +# audio-test-170 2017 colinde8 +# audio-test-180 2027 colinde9 +# audio-test-190 2037 colinde10 + +# audio-test-200 2047 colinde11 +# audio-test-210 2057 colinde12 +# audio-test-220 2067 colinde13 +# audio-test-230 2077 colinde14 +# audio-test-240 2087 colinde15 +# audio-test-250 2097 colinde16 +# audio-test-260 2107 colinde17 +# audio-test-270 2117 colinde18 +# audio-test-280 2127 colinde19 +# audio-test-290 2137 colinde20 + +[sounds] +sound = 'sound.mp3' +# sound = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +sounds_total_number = 20 +custom1947 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom1957 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom1967 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom1977 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom1987 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom1997 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2007 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2017 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2027 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2037 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2047 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2057 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2067 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2077 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2087 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2097 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2107 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2117 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2127 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom2137 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom1 = 'sample1.mp3' +# custom1949 = 'sound.mp3' +# custom1950 = 'sound.mp3' +custom15 = 'sample1.mp3' +custom16 = 'sample1.mp3' +custom17 = 'sample1.mp3' +custom18 = 'sample2.mp3' +custom19 = 'sample2.mp3' +custom20 = 'sample2.mp3' +custom21 = 'sample3.mp3' +custom22 = 'sample3.mp3' +custom23 = 'sample3.mp3' +custom24 = 'sample4.mp3' +custom25 = 'sample4.mp3' +custom26 = 'sample4.mp3' +custom27 = 'sample5.mp3' +custom28 = 'sample5.mp3' +custom29 = 'sample5.mp3' +custom30 = 'sample6.mp3' +custom31 = 'sample6.mp3' +custom32 = 'sample6.mp3' +custom33 = 'sample7.mp3' +custom34 = 'sample7.mp3' +custom35 = 'sample7.mp3' +custom36 = 'sample8.mp3' +custom37 = 'sample8.mp3' +custom38 = 'sample8.mp3' +custom39 = 'sample9.mp3' +custom40 = 'sample9.mp3' +custom41 = 'sample9.mp3' +custom42 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom43 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' +custom44 = 'Dre - Dr. - Still D.R.E (feat Snoop Dogg).mp3' \ No newline at end of file diff --git a/createCA.sh b/createCA.sh new file mode 100755 index 0000000..d91a9bf --- /dev/null +++ b/createCA.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +DAYS=$((10*365)) +LEVELS=1 +DN="/C=US/ST=Illinois/L=Chicago/O=Safemobile/OU=PKI" +CERTS_PATH=certs +CHAIN="$CERTS_PATH/chain.crt" + +# OPENSSL_CNF="/etc/pki/tls/openssl.cnf" +OPENSSL_CNF="/etc/ssl/openssl.cnf" + +mkdir -p $CERTS_PATH + +#generate root key pair +openssl genrsa -out "$CERTS_PATH/root-key.pem" 4096 + +#generate root self-signed cert +openssl req -new -x509 -days $DAYS -key "$CERTS_PATH/root-key.pem" -subj "$DN/CN=Root" -out "$CERTS_PATH/root-cert.pem" +cat "$CERTS_PATH/root-cert.pem" > $CHAIN + + +for i in `seq 1 $LEVELS`; do + echo "Level $i" + if [ "$i" -eq 1 ]; then + SIGNER_CERT="$CERTS_PATH/root-cert.pem" + SIGNER_KEY="$CERTS_PATH/root-key.pem" + else + SIGNER_CERT="$CERTS_PATH/ca$((i-1))-cert.pem" + SIGNER_KEY="$CERTS_PATH/ca$((i-1))-key.pem" + fi + + #generate key pair + openssl genrsa -out "$CERTS_PATH/ca$i-key.pem" 4096 + + #generate signing request + openssl req -new -key "$CERTS_PATH/ca$i-key.pem" -subj "$DN/CN=Level$i" -out "$CERTS_PATH/ca$i-csr.pem" + +echo "-------------" +echo ">>>>>>>>>>>>>>>>>"$SIGNER_CERT +echo ">>>>>>>>>>>>>>>>>"$SIGNER_KEY + + #sign new cert + openssl x509 -req -days $DAYS -in "$CERTS_PATH/ca$i-csr.pem" -CA $SIGNER_CERT -CAkey $SIGNER_KEY \ + -set_serial $i -out "$CERTS_PATH/ca$i-cert.pem" -extfile $OPENSSL_CNF -extensions v3_ca + cat "$CERTS_PATH/ca$i-cert.pem" >> $CHAIN +echo "-------------" + +done diff --git a/createCerts.sh b/createCerts.sh new file mode 100755 index 0000000..b32add9 --- /dev/null +++ b/createCerts.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +if test "$#" -ne 1; then + echo "Error: Wrong parameters --> You must provide the certificate name." + echo "Please use: ./createCerts.sh 18" + + exit 1 +fi + +DAYS=$((10*365)) +DN="/C=US/ST=Illinois/L=Chicago/O=Safemobile/OU=PKI" +ID=$1 +CERTS_PATH=certs + +#generate key pair +openssl genrsa -out "$CERTS_PATH/$ID-key.pem" 4096 + +#generate signing request +openssl req -new -key "$CERTS_PATH/$ID-key.pem" -subj "$DN/CN=$ID" -out "$CERTS_PATH/$ID-csr.pem" + +#sign new cert +openssl x509 -req -days $DAYS -in "$CERTS_PATH/$ID-csr.pem" -CA "$CERTS_PATH/ca1-cert.pem" \ + -CAkey "$CERTS_PATH/ca1-key.pem" -set_serial 500 -out "$CERTS_PATH/$ID-cert.pem" \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..525236a --- /dev/null +++ b/index.js @@ -0,0 +1,17 @@ + +const config = require('config'); +const Simulator = require('./src/simulator'); + +// Read configs. +let configs = { + mumble: config.get('mumble'), + hub: config.get('hub'), + api: config.get('api'), + assets: config.get('assets'), + sounds: config.get('sounds'), + settings: config.get('settings'), +} + +// Start simulation. +console.log('Starting simulation...'); +var simulator = new Simulator(configs); \ No newline at end of file diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 120000 index 0000000..217f379 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1 @@ +../json5/lib/cli.js \ No newline at end of file diff --git a/node_modules/.bin/pbjs b/node_modules/.bin/pbjs new file mode 120000 index 0000000..a96b24a --- /dev/null +++ b/node_modules/.bin/pbjs @@ -0,0 +1 @@ +../protobufjs/bin/pbjs \ No newline at end of file diff --git a/node_modules/.bin/sshpk-conv b/node_modules/.bin/sshpk-conv new file mode 120000 index 0000000..a2a295c --- /dev/null +++ b/node_modules/.bin/sshpk-conv @@ -0,0 +1 @@ +../sshpk/bin/sshpk-conv \ No newline at end of file diff --git a/node_modules/.bin/sshpk-sign b/node_modules/.bin/sshpk-sign new file mode 120000 index 0000000..766b9b3 --- /dev/null +++ b/node_modules/.bin/sshpk-sign @@ -0,0 +1 @@ +../sshpk/bin/sshpk-sign \ No newline at end of file diff --git a/node_modules/.bin/sshpk-verify b/node_modules/.bin/sshpk-verify new file mode 120000 index 0000000..bfd7e3a --- /dev/null +++ b/node_modules/.bin/sshpk-verify @@ -0,0 +1 @@ +../sshpk/bin/sshpk-verify \ No newline at end of file diff --git a/node_modules/.bin/throttleproxy b/node_modules/.bin/throttleproxy new file mode 120000 index 0000000..2ec6e30 --- /dev/null +++ b/node_modules/.bin/throttleproxy @@ -0,0 +1 @@ +../stream-throttle/bin/throttleproxy.js \ No newline at end of file diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid new file mode 120000 index 0000000..b3e45bc --- /dev/null +++ b/node_modules/.bin/uuid @@ -0,0 +1 @@ +../uuid/bin/uuid \ No newline at end of file diff --git a/node_modules/.bin/window-size b/node_modules/.bin/window-size new file mode 120000 index 0000000..e84c8ec --- /dev/null +++ b/node_modules/.bin/window-size @@ -0,0 +1 @@ +../window-size/cli.js \ No newline at end of file diff --git a/node_modules/after/.npmignore b/node_modules/after/.npmignore new file mode 100644 index 0000000..6c78602 --- /dev/null +++ b/node_modules/after/.npmignore @@ -0,0 +1,2 @@ +node_modules +.monitor diff --git a/node_modules/after/.travis.yml b/node_modules/after/.travis.yml new file mode 100644 index 0000000..afd72d0 --- /dev/null +++ b/node_modules/after/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - 0.6 + - 0.8 + - 0.9 + - 0.10 + - 0.12 + - 4.2.4 + - 5.4.1 + - iojs-1 + - iojs-2 + - iojs-3 diff --git a/node_modules/after/LICENCE b/node_modules/after/LICENCE new file mode 100644 index 0000000..7c35130 --- /dev/null +++ b/node_modules/after/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Raynos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/after/README.md b/node_modules/after/README.md new file mode 100644 index 0000000..fc69096 --- /dev/null +++ b/node_modules/after/README.md @@ -0,0 +1,115 @@ +# After [![Build Status][1]][2] + +Invoke callback after n calls + +## Status: production ready + +## Example + +```js +var after = require("after") +var db = require("./db") // some db. + +var updateUser = function (req, res) { + // use after to run two tasks in parallel, + // namely get request body and get session + // then run updateUser with the results + var next = after(2, updateUser) + var results = {} + + getJSONBody(req, res, function (err, body) { + if (err) return next(err) + + results.body = body + next(null, results) + }) + + getSessionUser(req, res, function (err, user) { + if (err) return next(err) + + results.user = user + next(null, results) + }) + + // now do the thing! + function updateUser(err, result) { + if (err) { + res.statusCode = 500 + return res.end("Unexpected Error") + } + + if (!result.user || result.user.role !== "admin") { + res.statusCode = 403 + return res.end("Permission Denied") + } + + db.put("users:" + req.params.userId, result.body, function (err) { + if (err) { + res.statusCode = 500 + return res.end("Unexpected Error") + } + + res.statusCode = 200 + res.end("Ok") + }) + } +} +``` + +## Naive Example + +```js +var after = require("after") + , next = after(3, logItWorks) + +next() +next() +next() // it works + +function logItWorks() { + console.log("it works!") +} +``` + +## Example with error handling + +```js +var after = require("after") + , next = after(3, logError) + +next() +next(new Error("oops")) // logs oops +next() // does nothing + +// This callback is only called once. +// If there is an error the callback gets called immediately +// this avoids the situation where errors get lost. +function logError(err) { + console.log(err) +} +``` + +## Installation + +`npm install after` + +## Tests + +`npm test` + +## Contributors + + - Raynos + - defunctzombie + +## MIT Licenced + + [1]: https://secure.travis-ci.org/Raynos/after.png + [2]: http://travis-ci.org/Raynos/after + [3]: http://raynos.org/blog/2/Flow-control-in-node.js + [4]: http://stackoverflow.com/questions/6852059/determining-the-end-of-asynchronous-operations-javascript/6852307#6852307 + [5]: http://stackoverflow.com/questions/6869872/in-javascript-what-are-best-practices-for-executing-multiple-asynchronous-functi/6870031#6870031 + [6]: http://stackoverflow.com/questions/6864397/javascript-performance-long-running-tasks/6889419#6889419 + [7]: http://stackoverflow.com/questions/6597493/synchronous-database-queries-with-node-js/6620091#6620091 + [8]: http://github.com/Raynos/iterators + [9]: http://github.com/Raynos/composite diff --git a/node_modules/after/index.js b/node_modules/after/index.js new file mode 100644 index 0000000..ec24879 --- /dev/null +++ b/node_modules/after/index.js @@ -0,0 +1,28 @@ +module.exports = after + +function after(count, callback, err_cb) { + var bail = false + err_cb = err_cb || noop + proxy.count = count + + return (count === 0) ? callback() : proxy + + function proxy(err, result) { + if (proxy.count <= 0) { + throw new Error('after called too many times') + } + --proxy.count + + // after first error, rest are passed to err_cb + if (err) { + bail = true + callback(err) + // future error callbacks will go to error handler + callback = err_cb + } else if (proxy.count === 0 && !bail) { + callback(null, result) + } + } +} + +function noop() {} diff --git a/node_modules/after/package.json b/node_modules/after/package.json new file mode 100644 index 0000000..1849ff9 --- /dev/null +++ b/node_modules/after/package.json @@ -0,0 +1,63 @@ +{ + "_from": "after@0.8.2", + "_id": "after@0.8.2", + "_inBundle": false, + "_integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", + "_location": "/after", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "after@0.8.2", + "name": "after", + "escapedName": "after", + "rawSpec": "0.8.2", + "saveSpec": null, + "fetchSpec": "0.8.2" + }, + "_requiredBy": [ + "/engine.io-parser" + ], + "_resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "_shasum": "fedb394f9f0e02aa9768e702bda23b505fae7e1f", + "_spec": "after@0.8.2", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/engine.io-parser", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/after/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Raynos", + "email": "raynos2@gmail.com", + "url": "http://raynos.org" + } + ], + "deprecated": false, + "description": "after - tiny flow control", + "devDependencies": { + "mocha": "~1.8.1" + }, + "homepage": "https://github.com/Raynos/after#readme", + "keywords": [ + "flowcontrol", + "after", + "flow", + "control", + "arch" + ], + "license": "MIT", + "name": "after", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/after.git" + }, + "scripts": { + "test": "mocha --ui tdd --reporter spec test/*.js" + }, + "version": "0.8.2" +} diff --git a/node_modules/after/test/after-test.js b/node_modules/after/test/after-test.js new file mode 100644 index 0000000..0d63f4c --- /dev/null +++ b/node_modules/after/test/after-test.js @@ -0,0 +1,120 @@ +/*global suite, test*/ + +var assert = require("assert") + , after = require("../") + +test("exists", function () { + assert(typeof after === "function", "after is not a function") +}) + +test("after when called with 0 invokes", function (done) { + after(0, done) +}); + +test("after 1", function (done) { + var next = after(1, done) + next() +}) + +test("after 5", function (done) { + var next = after(5, done) + , i = 5 + + while (i--) { + next() + } +}) + +test("manipulate count", function (done) { + var next = after(1, done) + , i = 5 + + next.count = i + while (i--) { + next() + } +}) + +test("after terminates on error", function (done) { + var next = after(2, function(err) { + assert.equal(err.message, 'test'); + done(); + }) + next(new Error('test')) + next(new Error('test2')) +}) + +test('gee', function(done) { + done = after(2, done) + + function cb(err) { + assert.equal(err.message, 1); + done() + } + + var next = after(3, cb, function(err) { + assert.equal(err.message, 2) + done() + }); + + next() + next(new Error(1)) + next(new Error(2)) +}) + +test('eee', function(done) { + done = after(3, done) + + function cb(err) { + assert.equal(err.message, 1); + done() + } + + var next = after(3, cb, function(err) { + assert.equal(err.message, 2) + done() + }); + + next(new Error(1)) + next(new Error(2)) + next(new Error(2)) +}) + +test('gge', function(done) { + function cb(err) { + assert.equal(err.message, 1); + done() + } + + var next = after(3, cb, function(err) { + // should not happen + assert.ok(false); + }); + + next() + next() + next(new Error(1)) +}) + +test('egg', function(done) { + function cb(err) { + assert.equal(err.message, 1); + done() + } + + var next = after(3, cb, function(err) { + // should not happen + assert.ok(false); + }); + + next(new Error(1)) + next() + next() +}) + +test('throws on too many calls', function(done) { + var next = after(1, done); + next() + assert.throws(next, /after called too many times/); +}); + diff --git a/node_modules/ajv/.tonic_example.js b/node_modules/ajv/.tonic_example.js new file mode 100644 index 0000000..aa11812 --- /dev/null +++ b/node_modules/ajv/.tonic_example.js @@ -0,0 +1,20 @@ +var Ajv = require('ajv'); +var ajv = new Ajv({allErrors: true}); + +var schema = { + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "number", "maximum": 3 } + } +}; + +var validate = ajv.compile(schema); + +test({"foo": "abc", "bar": 2}); +test({"foo": 2, "bar": 4}); + +function test(data) { + var valid = validate(data); + if (valid) console.log('Valid!'); + else console.log('Invalid: ' + ajv.errorsText(validate.errors)); +} \ No newline at end of file diff --git a/node_modules/ajv/LICENSE b/node_modules/ajv/LICENSE new file mode 100644 index 0000000..96ee719 --- /dev/null +++ b/node_modules/ajv/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/ajv/README.md b/node_modules/ajv/README.md new file mode 100644 index 0000000..cafbd71 --- /dev/null +++ b/node_modules/ajv/README.md @@ -0,0 +1,1359 @@ +Ajv logo + +# Ajv: Another JSON Schema Validator + +The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/07. + +[![Build Status](https://travis-ci.org/epoberezkin/ajv.svg?branch=master)](https://travis-ci.org/epoberezkin/ajv) +[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) +[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) +[![Coverage Status](https://coveralls.io/repos/epoberezkin/ajv/badge.svg?branch=master&service=github)](https://coveralls.io/github/epoberezkin/ajv?branch=master) +[![Greenkeeper badge](https://badges.greenkeeper.io/epoberezkin/ajv.svg)](https://greenkeeper.io/) +[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) + + +## Using version 6 + +[JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html) is published. + +[Ajv version 6.0.0](https://github.com/epoberezkin/ajv/releases/tag/v6.0.0) that supports draft-07 is released. It may require either migrating your schemas or updating your code (to continue using draft-04 and v5 schemas, draft-06 schemas will be supported without changes). + +__Please note__: To use Ajv with draft-06 schemas you need to explicitly add the meta-schema to the validator instance: + +```javascript +ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')); +``` + +To use Ajv with draft-04 schemas in addition to explicitly adding meta-schema you also need to use option schemaId: + +```javascript +var ajv = new Ajv({schemaId: 'id'}); +// If you want to use both draft-04 and draft-06/07 schemas: +// var ajv = new Ajv({schemaId: 'auto'}); +ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); +``` + + +## Contents + +- [Performance](#performance) +- [Features](#features) +- [Getting started](#getting-started) +- [Frequently Asked Questions](https://github.com/epoberezkin/ajv/blob/master/FAQ.md) +- [Using in browser](#using-in-browser) +- [Command line interface](#command-line-interface) +- Validation + - [Keywords](#validation-keywords) + - [Annotation keywords](#annotation-keywords) + - [Formats](#formats) + - [Combining schemas with $ref](#ref) + - [$data reference](#data-reference) + - NEW: [$merge and $patch keywords](#merge-and-patch-keywords) + - [Defining custom keywords](#defining-custom-keywords) + - [Asynchronous schema compilation](#asynchronous-schema-compilation) + - [Asynchronous validation](#asynchronous-validation) +- [Security considerations](#security-considerations) + - [Security contact](#security-contact) + - [Untrusted schemas](#untrusted-schemas) + - [Circular references in objects](#circular-references-in-javascript-objects) + - [Trusted schemas](#security-risks-of-trusted-schemas) +- Modifying data during validation + - [Filtering data](#filtering-data) + - [Assigning defaults](#assigning-defaults) + - [Coercing data types](#coercing-data-types) +- API + - [Methods](#api) + - [Options](#options) + - [Validation errors](#validation-errors) +- [Plugins](#plugins) +- [Related packages](#related-packages) +- [Some packages using Ajv](#some-packages-using-ajv) +- [Tests, Contributing, History, Support, License](#tests) + + +## Performance + +Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. + +Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: + +- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place +- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster +- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) +- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) + + +Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): + +[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|z-schema|jsck|skeemas|json-schema-library|tv4&chd=t:100,98,72.1,66.8,50.1,15.1,6.1,3.8,1.2,0.7,0.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) + + +## Features + +- Ajv implements full JSON Schema [draft-06/07](http://json-schema.org/) and draft-04 standards: + - all validation keywords (see [JSON Schema validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md)) + - full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available) + - support of circular references between schemas + - correct string lengths for strings with unicode pairs (can be turned off) + - [formats](#formats) defined by JSON Schema draft-07 standard and custom formats (can be turned off) + - [validates schemas against meta-schema](#api-validateschema) +- supports [browsers](#using-in-browser) and Node.js 0.10-8.x +- [asynchronous loading](#asynchronous-schema-compilation) of referenced schemas during compilation +- "All errors" validation mode with [option allErrors](#options) +- [error messages with parameters](#validation-errors) describing error reasons to allow creating custom error messages +- i18n error messages support with [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) package +- [filtering data](#filtering-data) from additional properties +- [assigning defaults](#assigning-defaults) to missing properties and items +- [coercing data](#coercing-data-types) to the types specified in `type` keywords +- [custom keywords](#defining-custom-keywords) +- draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else` +- draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail). +- keywords `switch`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) package +- [$data reference](#data-reference) to use values from the validated data as values for the schema keywords +- [asynchronous validation](#asynchronous-validation) of custom formats and keywords + +Currently Ajv is the only validator that passes all the tests from [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) (according to [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark), apart from the test that requires that `1.0` is not an integer that is impossible to satisfy in JavaScript). + + +## Install + +``` +npm install ajv +``` + + +## Getting started + +Try it in the Node.js REPL: https://tonicdev.com/npm/ajv + + +The fastest validation call: + +```javascript +var Ajv = require('ajv'); +var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true} +var validate = ajv.compile(schema); +var valid = validate(data); +if (!valid) console.log(validate.errors); +``` + +or with less code + +```javascript +// ... +var valid = ajv.validate(schema, data); +if (!valid) console.log(ajv.errors); +// ... +``` + +or + +```javascript +// ... +var valid = ajv.addSchema(schema, 'mySchema') + .validate('mySchema', data); +if (!valid) console.log(ajv.errorsText()); +// ... +``` + +See [API](#api) and [Options](#options) for more details. + +Ajv compiles schemas to functions and caches them in all cases (using schema serialized with [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) or a custom function as a key), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again. + +The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call). + +__Please note__: every time a validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](#validation-errors) + + +## Using in browser + +You can require Ajv directly from the code you browserify - in this case Ajv will be a part of your bundle. + +If you need to use Ajv in several bundles you can create a separate UMD bundle using `npm run bundle` script (thanks to [siddo420](https://github.com/siddo420)). + +Then you need to load Ajv in the browser: +```html + +``` + +This bundle can be used with different module systems; it creates global `Ajv` if no module system is found. + +The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv). + +Ajv is tested with these browsers: + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin) + +__Please note__: some frameworks, e.g. Dojo, may redefine global require in such way that is not compatible with CommonJS module format. In such case Ajv bundle has to be loaded before the framework and then you can use global Ajv (see issue [#234](https://github.com/epoberezkin/ajv/issues/234)). + + +## Command line interface + +CLI is available as a separate npm package [ajv-cli](https://github.com/jessedc/ajv-cli). It supports: + +- compiling JSON Schemas to test their validity +- BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/epoberezkin/ajv-pack)) +- migrate schemas to draft-07 (using [json-schema-migrate](https://github.com/epoberezkin/json-schema-migrate)) +- validating data file(s) against JSON Schema +- testing expected validity of data against JSON Schema +- referenced schemas +- custom meta-schemas +- files in JSON and JavaScript format +- all Ajv options +- reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format + + +## Validation keywords + +Ajv supports all validation keywords from draft-07 of JSON Schema standard: + +- [type](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#type) +- [for numbers](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf +- [for strings](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format +- [for arrays](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems, [contains](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#contains) +- [for objects](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minProperties, required, properties, patternProperties, additionalProperties, dependencies, [propertyNames](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#propertynames) +- [for all types](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, [const](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#const) +- [compound keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#compound-keywords) - not, oneOf, anyOf, allOf, [if/then/else](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#ifthenelse) + +With [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) package Ajv also supports validation keywords from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON Schema standard: + +- [patternRequired](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#patternrequired-proposed) - like `required` but with patterns that some property should match. +- [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-proposed) - setting limits for date, time, etc. + +See [JSON Schema validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md) for more details. + + +## Annotation keywords + +JSON Schema specification defines several annotation keywords that describe schema itself but do not perform any validation. + +- `title` and `description`: information about the data represented by that schema +- `$comment` (NEW in draft-07): information for developers. With option `$comment` Ajv logs or passes the comment string to the user-supplied function. See [Options](#options). +- `default`: a default value of the data instance, see [Assigning defaults](#assigning-defaults). +- `examples` (NEW in draft-06): an array of data instances. Ajv does not check the validity of these instances against the schema. +- `readOnly` and `writeOnly` (NEW in draft-07): marks data-instance as read-only or write-only in relation to the source of the data (database, api, etc.). +- `contentEncoding`: [RFC 2045](https://tools.ietf.org/html/rfc2045#section-6.1 ), e.g., "base64". +- `contentMediaType`: [RFC 2046](https://tools.ietf.org/html/rfc2046), e.g., "image/png". + +__Please note__: Ajv does not implement validation of the keywords `examples`, `contentEncoding` and `contentMediaType` but it reserves them. If you want to create a plugin that implements some of them, it should remove these keywords from the instance. + + +## Formats + +The following formats are supported for string validation with "format" keyword: + +- _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6). +- _time_: time with optional time-zone. +- _date-time_: date-time from the same source (time-zone is mandatory). `date`, `time` and `date-time` validate ranges in `full` mode and only regexp in `fast` mode (see [options](#options)). +- _uri_: full URI. +- _uri-reference_: URI reference, including full and relative URIs. +- _uri-template_: URI template according to [RFC6570](https://tools.ietf.org/html/rfc6570) +- _url_ (deprecated): [URL record](https://url.spec.whatwg.org/#concept-url). +- _email_: email address. +- _hostname_: host name according to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5). +- _ipv4_: IP address v4. +- _ipv6_: IP address v6. +- _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor. +- _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122). +- _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901). +- _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00). + +__Please note__: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. Ajv does not implement these formats. If you create Ajv plugin that implements them please make a PR to mention this plugin here. + +There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `uri-reference`, `email`, and `hostname`. See [Options](#options) for details. + +You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. + +The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can whitelist specific format(s) to be ignored. See [Options](#options) for details. + +You can find regular expressions used for format validation and the sources that were used in [formats.js](https://github.com/epoberezkin/ajv/blob/master/lib/compile/formats.js). + + +## Combining schemas with $ref + +You can structure your validation logic across multiple schema files and have schemas reference each other using `$ref` keyword. + +Example: + +```javascript +var schema = { + "$id": "http://example.com/schemas/schema.json", + "type": "object", + "properties": { + "foo": { "$ref": "defs.json#/definitions/int" }, + "bar": { "$ref": "defs.json#/definitions/str" } + } +}; + +var defsSchema = { + "$id": "http://example.com/schemas/defs.json", + "definitions": { + "int": { "type": "integer" }, + "str": { "type": "string" } + } +}; +``` + +Now to compile your schema you can either pass all schemas to Ajv instance: + +```javascript +var ajv = new Ajv({schemas: [schema, defsSchema]}); +var validate = ajv.getSchema('http://example.com/schemas/schema.json'); +``` + +or use `addSchema` method: + +```javascript +var ajv = new Ajv; +var validate = ajv.addSchema(defsSchema) + .compile(schema); +``` + +See [Options](#options) and [addSchema](#api) method. + +__Please note__: +- `$ref` is resolved as the uri-reference using schema $id as the base URI (see the example). +- References can be recursive (and mutually recursive) to implement the schemas for different data structures (such as linked lists, trees, graphs, etc.). +- You don't have to host your schema files at the URIs that you use as schema $id. These URIs are only used to identify the schemas, and according to JSON Schema specification validators should not expect to be able to download the schemas from these URIs. +- The actual location of the schema file in the file system is not used. +- You can pass the identifier of the schema as the second parameter of `addSchema` method or as a property name in `schemas` option. This identifier can be used instead of (or in addition to) schema $id. +- You cannot have the same $id (or the schema identifier) used for more than one schema - the exception will be thrown. +- You can implement dynamic resolution of the referenced schemas using `compileAsync` method. In this way you can store schemas in any system (files, web, database, etc.) and reference them without explicitly adding to Ajv instance. See [Asynchronous schema compilation](#asynchronous-schema-compilation). + + +## $data reference + +With `$data` option you can use values from the validated data as the values for the schema keywords. See [proposal](https://github.com/json-schema/json-schema/wiki/$data-(v5-proposal)) for more information about how it works. + +`$data` reference is supported in the keywords: const, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems. + +The value of "$data" should be a [JSON-pointer](https://tools.ietf.org/html/rfc6901) to the data (the root is always the top level data object, even if the $data reference is inside a referenced subschema) or a [relative JSON-pointer](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) (it is relative to the current point in data; if the $data reference is inside a referenced subschema it cannot point to the data outside of the root level for this subschema). + +Examples. + +This schema requires that the value in property `smaller` is less or equal than the value in the property larger: + +```javascript +var ajv = new Ajv({$data: true}); + +var schema = { + "properties": { + "smaller": { + "type": "number", + "maximum": { "$data": "1/larger" } + }, + "larger": { "type": "number" } + } +}; + +var validData = { + smaller: 5, + larger: 7 +}; + +ajv.validate(schema, validData); // true +``` + +This schema requires that the properties have the same format as their field names: + +```javascript +var schema = { + "additionalProperties": { + "type": "string", + "format": { "$data": "0#" } + } +}; + +var validData = { + 'date-time': '1963-06-19T08:30:06.283185Z', + email: 'joe.bloggs@example.com' +} +``` + +`$data` reference is resolved safely - it won't throw even if some property is undefined. If `$data` resolves to `undefined` the validation succeeds (with the exclusion of `const` keyword). If `$data` resolves to incorrect type (e.g. not "number" for maximum keyword) the validation fails. + + +## $merge and $patch keywords + +With the package [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON Schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902). + +To add keywords `$merge` and `$patch` to Ajv instance use this code: + +```javascript +require('ajv-merge-patch')(ajv); +``` + +Examples. + +Using `$merge`: + +```json +{ + "$merge": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": { + "properties": { "q": { "type": "number" } } + } + } +} +``` + +Using `$patch`: + +```json +{ + "$patch": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": [ + { "op": "add", "path": "/properties/q", "value": { "type": "number" } } + ] + } +} +``` + +The schemas above are equivalent to this schema: + +```json +{ + "type": "object", + "properties": { + "p": { "type": "string" }, + "q": { "type": "number" } + }, + "additionalProperties": false +} +``` + +The properties `source` and `with` in the keywords `$merge` and `$patch` can use absolute or relative `$ref` to point to other schemas previously added to the Ajv instance or to the fragments of the current schema. + +See the package [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) for more information. + + +## Defining custom keywords + +The advantages of using custom keywords are: + +- allow creating validation scenarios that cannot be expressed using JSON Schema +- simplify your schemas +- help bringing a bigger part of the validation logic to your schemas +- make your schemas more expressive, less verbose and closer to your application domain +- implement custom data processors that modify your data (`modifying` option MUST be used in keyword definition) and/or create side effects while the data is being validated + +If a keyword is used only for side-effects and its validation result is pre-defined, use option `valid: true/false` in keyword definition to simplify both generated code (no error handling in case of `valid: true`) and your keyword functions (no need to return any validation result). + +The concerns you have to be aware of when extending JSON Schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas. + +You can define custom keywords with [addKeyword](#api-addkeyword) method. Keywords are defined on the `ajv` instance level - new instances will not have previously defined keywords. + +Ajv allows defining keywords with: +- validation function +- compilation function +- macro function +- inline compilation function that should return code (as string) that will be inlined in the currently compiled schema. + +Example. `range` and `exclusiveRange` keywords using compiled schema: + +```javascript +ajv.addKeyword('range', { + type: 'number', + compile: function (sch, parentSchema) { + var min = sch[0]; + var max = sch[1]; + + return parentSchema.exclusiveRange === true + ? function (data) { return data > min && data < max; } + : function (data) { return data >= min && data <= max; } + } +}); + +var schema = { "range": [2, 4], "exclusiveRange": true }; +var validate = ajv.compile(schema); +console.log(validate(2.01)); // true +console.log(validate(3.99)); // true +console.log(validate(2)); // false +console.log(validate(4)); // false +``` + +Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords. + +See [Defining custom keywords](https://github.com/epoberezkin/ajv/blob/master/CUSTOM.md) for more details. + + +## Asynchronous schema compilation + +During asynchronous compilation remote references are loaded using supplied function. See `compileAsync` [method](#api-compileAsync) and `loadSchema` [option](#options). + +Example: + +```javascript +var ajv = new Ajv({ loadSchema: loadSchema }); + +ajv.compileAsync(schema).then(function (validate) { + var valid = validate(data); + // ... +}); + +function loadSchema(uri) { + return request.json(uri).then(function (res) { + if (res.statusCode >= 400) + throw new Error('Loading error: ' + res.statusCode); + return res.body; + }); +} +``` + +__Please note__: [Option](#options) `missingRefs` should NOT be set to `"ignore"` or `"fail"` for asynchronous compilation to work. + + +## Asynchronous validation + +Example in Node.js REPL: https://tonicdev.com/esp/ajv-asynchronous-validation + +You can define custom formats and keywords that perform validation asynchronously by accessing database or some other service. You should add `async: true` in the keyword or format definition (see [addFormat](#api-addformat), [addKeyword](#api-addkeyword) and [Defining custom keywords](#defining-custom-keywords)). + +If your schema uses asynchronous formats/keywords or refers to some schema that contains them it should have `"$async": true` keyword so that Ajv can compile it correctly. If asynchronous format/keyword or reference to asynchronous schema is used in the schema without `$async` keyword Ajv will throw an exception during schema compilation. + +__Please note__: all asynchronous subschemas that are referenced from the current or other schemas should have `"$async": true` keyword as well, otherwise the schema compilation will fail. + +Validation function for an asynchronous custom format/keyword should return a promise that resolves with `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function). + +Ajv compiles asynchronous schemas to [es7 async functions](http://tc39.github.io/ecmascript-asyncawait/) that can optionally be transpiled with [nodent](https://github.com/MatAtBread/nodent). Async functions are supported in Node.js 7+ and all modern browsers. You can also supply any other transpiler as a function via `processCode` option. See [Options](#options). + +The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both synchronous and asynchronous schemas. + +Validation result will be a promise that resolves with validated data or rejects with an exception `Ajv.ValidationError` that contains the array of validation errors in `errors` property. + + +Example: + +```javascript +var ajv = new Ajv; +// require('ajv-async')(ajv); + +ajv.addKeyword('idExists', { + async: true, + type: 'number', + validate: checkIdExists +}); + + +function checkIdExists(schema, data) { + return knex(schema.table) + .select('id') + .where('id', data) + .then(function (rows) { + return !!rows.length; // true if record is found + }); +} + +var schema = { + "$async": true, + "properties": { + "userId": { + "type": "integer", + "idExists": { "table": "users" } + }, + "postId": { + "type": "integer", + "idExists": { "table": "posts" } + } + } +}; + +var validate = ajv.compile(schema); + +validate({ userId: 1, postId: 19 }) +.then(function (data) { + console.log('Data is valid', data); // { userId: 1, postId: 19 } +}) +.catch(function (err) { + if (!(err instanceof Ajv.ValidationError)) throw err; + // data is invalid + console.log('Validation errors:', err.errors); +}); +``` + +### Using transpilers with asynchronous validation functions. + +[ajv-async](https://github.com/epoberezkin/ajv-async) uses [nodent](https://github.com/MatAtBread/nodent) to transpile async functions. To use another transpiler you should separately install it (or load its bundle in the browser). + + +#### Using nodent + +```javascript +var ajv = new Ajv; +require('ajv-async')(ajv); +// in the browser if you want to load ajv-async bundle separately you can: +// window.ajvAsync(ajv); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + + +#### Using other transpilers + +```javascript +var ajv = new Ajv({ processCode: transpileFunc }); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + +See [Options](#options). + + +## Security considerations + +JSON Schema, if properly used, can replace data sanitisation. It doesn't replace other API security considerations. It also introduces additional security aspects to consider. + + +##### Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. + + +##### Untrusted schemas + +Ajv treats JSON schemas as trusted as your application code. This security model is based on the most common use case, when the schemas are static and bundled together with the application. + +If your schemas are received from untrusted sources (or generated from untrusted data) there are several scenarios you need to prevent: +- compiling schemas can cause stack overflow (if they are too deep) +- compiling schemas can be slow (e.g. [#557](https://github.com/epoberezkin/ajv/issues/557)) +- validating certain data can be slow + +It is difficult to predict all the scenarios, but at the very least it may help to limit the size of untrusted schemas (e.g. limit JSON string length) and also the maximum schema object depth (that can be high for relatively small JSON strings). You also may want to mitigate slow regular expressions in `pattern` and `patternProperties` keywords. + +Regardless the measures you take, using untrusted schemas increases security risks. + + +##### Circular references in JavaScript objects + +Ajv does not support schemas and validated data that have circular references in objects. See [issue #802](https://github.com/epoberezkin/ajv/issues/802). + +An attempt to compile such schemas or validate such data would cause stack overflow (or will not complete in case of asynchronous validation). Depending on the parser you use, untrusted data can lead to circular references. + + +##### Security risks of trusted schemas + +Some keywords in JSON Schemas can lead to very slow validation for certain data. These keywords include (but may be not limited to): + +- `pattern` and `format` for large strings - use `maxLength` to mitigate +- `uniqueItems` for large non-scalar arrays - use `maxItems` to mitigate +- `patternProperties` for large property names - use `propertyNames` to mitigate + +__Please note__: The suggestions above to prevent slow validation would only work if you do NOT use `allErrors: true` in production code (using it would continue validation after validation errors). + +You can validate your JSON schemas against [this meta-schema](https://github.com/epoberezkin/ajv/blob/master/lib/refs/json-schema-secure.json) to check that these recommendations are followed: + +```javascript +const isSchemaSecure = ajv.compile(require('ajv/lib/refs/json-schema-secure.json')); + +const schema1 = {format: 'email'}; +isSchemaSecure(schema1); // false + +const schema2 = {format: 'email', maxLength: 256}; +isSchemaSecure(schema2); // true +``` + +__Please note__: following all these recommendation is not a guarantee that validation of untrusted data is safe - it can still lead to some undesirable results. + + +## Filtering data + +With [option `removeAdditional`](#options) (added by [andyscott](https://github.com/andyscott)) you can filter data during the validation. + +This option modifies original data. + +Example: + +```javascript +var ajv = new Ajv({ removeAdditional: true }); +var schema = { + "additionalProperties": false, + "properties": { + "foo": { "type": "number" }, + "bar": { + "additionalProperties": { "type": "number" }, + "properties": { + "baz": { "type": "string" } + } + } + } +} + +var data = { + "foo": 0, + "additional1": 1, // will be removed; `additionalProperties` == false + "bar": { + "baz": "abc", + "additional2": 2 // will NOT be removed; `additionalProperties` != false + }, +} + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 0, "bar": { "baz": "abc", "additional2": 2 } +``` + +If `removeAdditional` option in the example above were `"all"` then both `additional1` and `additional2` properties would have been removed. + +If the option were `"failing"` then property `additional1` would have been removed regardless of its value and property `additional2` would have been removed only if its value were failing the schema in the inner `additionalProperties` (so in the example above it would have stayed because it passes the schema, but any non-number would have been removed). + +__Please note__: If you use `removeAdditional` option with `additionalProperties` keyword inside `anyOf`/`oneOf` keywords your validation can fail with this schema, for example: + +```json +{ + "type": "object", + "oneOf": [ + { + "properties": { + "foo": { "type": "string" } + }, + "required": [ "foo" ], + "additionalProperties": false + }, + { + "properties": { + "bar": { "type": "integer" } + }, + "required": [ "bar" ], + "additionalProperties": false + } + ] +} +``` + +The intention of the schema above is to allow objects with either the string property "foo" or the integer property "bar", but not with both and not with any other properties. + +With the option `removeAdditional: true` the validation will pass for the object `{ "foo": "abc"}` but will fail for the object `{"bar": 1}`. It happens because while the first subschema in `oneOf` is validated, the property `bar` is removed because it is an additional property according to the standard (because it is not included in `properties` keyword in the same schema). + +While this behaviour is unexpected (issues [#129](https://github.com/epoberezkin/ajv/issues/129), [#134](https://github.com/epoberezkin/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way: + +```json +{ + "type": "object", + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "integer" } + }, + "additionalProperties": false, + "oneOf": [ + { "required": [ "foo" ] }, + { "required": [ "bar" ] } + ] +} +``` + +The schema above is also more efficient - it will compile into a faster function. + + +## Assigning defaults + +With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items. + +With the option value `"empty"` properties and items equal to `null` or `""` (empty string) will be considered missing and assigned defaults. + +This option modifies original data. + +__Please note__: the default value is inserted in the generated validation code as a literal, so the value inserted in the data will be the deep clone of the default in the schema. + + +Example 1 (`default` in `properties`): + +```javascript +var ajv = new Ajv({ useDefaults: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "string", "default": "baz" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": 1 }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": "baz" } +``` + +Example 2 (`default` in `items`): + +```javascript +var schema = { + "type": "array", + "items": [ + { "type": "number" }, + { "type": "string", "default": "foo" } + ] +} + +var data = [ 1 ]; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // [ 1, "foo" ] +``` + +`default` keywords in other cases are ignored: + +- not in `properties` or `items` subschemas +- in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/epoberezkin/ajv/issues/42)) +- in `if` subschema of `switch` keyword +- in schemas generated by custom macro keywords + +The [`strictDefaults` option](#options) customizes Ajv's behavior for the defaults that Ajv ignores (`true` raises an error, and `"log"` outputs a warning). + + +## Coercing data types + +When you are validating user inputs all your data properties are usually strings. The option `coerceTypes` allows you to have your data types coerced to the types specified in your schema `type` keywords, both to pass the validation and to use the correctly typed data afterwards. + +This option modifies original data. + +__Please note__: if you pass a scalar value to the validating function its type will be coerced and it will pass the validation, but the value of the variable you pass won't be updated because scalars are passed by value. + + +Example 1: + +```javascript +var ajv = new Ajv({ coerceTypes: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "boolean" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": "1", "bar": "false" }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": false } +``` + +Example 2 (array coercions): + +```javascript +var ajv = new Ajv({ coerceTypes: 'array' }); +var schema = { + "properties": { + "foo": { "type": "array", "items": { "type": "number" } }, + "bar": { "type": "boolean" } + } +}; + +var data = { "foo": "1", "bar": ["false"] }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": [1], "bar": false } +``` + +The coercion rules, as you can see from the example, are different from JavaScript both to validate user input as expected and to have the coercion reversible (to correctly validate cases where different types are defined in subschemas of "anyOf" and other compound keywords). + +See [Coercion rules](https://github.com/epoberezkin/ajv/blob/master/COERCION.md) for details. + + +## API + +##### new Ajv(Object options) -> Object + +Create Ajv instance. + + +##### .compile(Object schema) -> Function<Object data> + +Generate validating function and cache the compiled schema for future use. + +Validating function returns a boolean value. This function has properties `errors` and `schema`. Errors encountered during the last validation are assigned to `errors` property (it is assigned `null` if there was no errors). `schema` property contains the reference to the original schema. + +The schema passed to this method will be validated against meta-schema unless `validateSchema` option is false. If schema is invalid, an error will be thrown. See [options](#options). + + +##### .compileAsync(Object schema [, Boolean meta] [, Function callback]) -> Promise + +Asynchronous version of `compile` method that loads missing remote schemas using asynchronous function in `options.loadSchema`. This function returns a Promise that resolves to a validation function. An optional callback passed to `compileAsync` will be called with 2 parameters: error (or null) and validating function. The returned promise will reject (and the callback will be called with an error) when: + +- missing schema can't be loaded (`loadSchema` returns a Promise that rejects). +- a schema containing a missing reference is loaded, but the reference cannot be resolved. +- schema (or some loaded/referenced schema) is invalid. + +The function compiles schema and loads the first missing schema (or meta-schema) until all missing schemas are loaded. + +You can asynchronously compile meta-schema by passing `true` as the second parameter. + +See example in [Asynchronous compilation](#asynchronous-schema-compilation). + + +##### .validate(Object schema|String key|String ref, data) -> Boolean + +Validate data using passed schema (it will be compiled and cached). + +Instead of the schema you can use the key that was previously passed to `addSchema`, the schema id if it was present in the schema or any previously resolved reference. + +Validation errors will be available in the `errors` property of Ajv instance (`null` if there were no errors). + +__Please note__: every time this method is called the errors are overwritten so you need to copy them to another variable if you want to use them later. + +If the schema is asynchronous (has `$async` keyword on the top level) this method returns a Promise. See [Asynchronous validation](#asynchronous-validation). + + +##### .addSchema(Array<Object>|Object schema [, String key]) -> Ajv + +Add schema(s) to validator instance. This method does not compile schemas (but it still validates them). Because of that dependencies can be added in any order and circular dependencies are supported. It also prevents unnecessary compilation of schemas that are containers for other schemas but not used as a whole. + +Array of schemas can be passed (schemas should have ids), the second parameter will be ignored. + +Key can be passed that can be used to reference the schema and will be used as the schema id if there is no id inside the schema. If the key is not passed, the schema id will be used as the key. + + +Once the schema is added, it (and all the references inside it) can be referenced in other schemas and used to validate data. + +Although `addSchema` does not compile schemas, explicit compilation is not required - the schema will be compiled when it is used first time. + +By default the schema is validated against meta-schema before it is added, and if the schema does not pass validation the exception is thrown. This behaviour is controlled by `validateSchema` option. + +__Please note__: Ajv uses the [method chaining syntax](https://en.wikipedia.org/wiki/Method_chaining) for all methods with the prefix `add*` and `remove*`. +This allows you to do nice things like the following. + +```javascript +var validate = new Ajv().addSchema(schema).addFormat(name, regex).getSchema(uri); +``` + +##### .addMetaSchema(Array<Object>|Object schema [, String key]) -> Ajv + +Adds meta schema(s) that can be used to validate other schemas. That function should be used instead of `addSchema` because there may be instance options that would compile a meta schema incorrectly (at the moment it is `removeAdditional` option). + +There is no need to explicitly add draft-07 meta schema (http://json-schema.org/draft-07/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`. + + +##### .validateSchema(Object schema) -> Boolean + +Validates schema. This method should be used to validate schemas rather than `validate` due to the inconsistency of `uri` format in JSON Schema standard. + +By default this method is called automatically when the schema is added, so you rarely need to use it directly. + +If schema doesn't have `$schema` property, it is validated against draft 6 meta-schema (option `meta` should not be false). + +If schema has `$schema` property, then the schema with this id (that should be previously added) is used to validate passed schema. + +Errors will be available at `ajv.errors`. + + +##### .getSchema(String key) -> Function<Object data> + +Retrieve compiled schema previously added with `addSchema` by the key passed to `addSchema` or by its full reference (id). The returned validating function has `schema` property with the reference to the original schema. + + +##### .removeSchema([Object schema|String key|String ref|RegExp pattern]) -> Ajv + +Remove added/cached schema. Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references. + +Schema can be removed using: +- key passed to `addSchema` +- it's full reference (id) +- RegExp that should match schema id or key (meta-schemas won't be removed) +- actual schema object that will be stable-stringified to remove schema from cache + +If no parameter is passed all schemas but meta-schemas will be removed and the cache will be cleared. + + +##### .addFormat(String name, String|RegExp|Function|Object format) -> Ajv + +Add custom format to validate strings or numbers. It can also be used to replace pre-defined formats for Ajv instance. + +Strings are converted to RegExp. + +Function should return validation result as `true` or `false`. + +If object is passed it should have properties `validate`, `compare` and `async`: + +- _validate_: a string, RegExp or a function as described above. +- _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (defined in [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) package). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal. +- _async_: an optional `true` value if `validate` is an asynchronous function; in this case it should return a promise that resolves with a value `true` or `false`. +- _type_: an optional type of data that the format applies to. It can be `"string"` (default) or `"number"` (see https://github.com/epoberezkin/ajv/issues/291#issuecomment-259923858). If the type of data is different, the validation will pass. + +Custom formats can be also added via `formats` option. + + +##### .addKeyword(String keyword, Object definition) -> Ajv + +Add custom validation keyword to Ajv instance. + +Keyword should be different from all standard JSON Schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance. + +Keyword must start with a letter, `_` or `$`, and may continue with letters, numbers, `_`, `$`, or `-`. +It is recommended to use an application-specific prefix for keywords to avoid current and future name collisions. + +Example Keywords: +- `"xyz-example"`: valid, and uses prefix for the xyz project to avoid name collisions. +- `"example"`: valid, but not recommended as it could collide with future versions of JSON Schema etc. +- `"3-example"`: invalid as numbers are not allowed to be the first character in a keyword + +Keyword definition is an object with the following properties: + +- _type_: optional string or array of strings with data type(s) that the keyword applies to. If not present, the keyword will apply to all types. +- _validate_: validating function +- _compile_: compiling function +- _macro_: macro function +- _inline_: compiling function that returns code (as string) +- _schema_: an optional `false` value used with "validate" keyword to not pass schema +- _metaSchema_: an optional meta-schema for keyword schema +- _dependencies_: an optional list of properties that must be present in the parent schema - it will be checked during schema compilation +- _modifying_: `true` MUST be passed if keyword modifies data +- _statements_: `true` can be passed in case inline keyword generates statements (as opposed to expression) +- _valid_: pass `true`/`false` to pre-define validation result, the result returned from validation function will be ignored. This option cannot be used with macro keywords. +- _$data_: an optional `true` value to support [$data reference](#data-reference) as the value of custom keyword. The reference will be resolved at validation time. If the keyword has meta-schema it would be extended to allow $data and it will be used to validate the resolved value. Supporting $data reference requires that keyword has validating function (as the only option or in addition to compile, macro or inline function). +- _async_: an optional `true` value if the validation function is asynchronous (whether it is compiled or passed in _validate_ property); in this case it should return a promise that resolves with a value `true` or `false`. This option is ignored in case of "macro" and "inline" keywords. +- _errors_: an optional boolean or string `"full"` indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation. + +_compile_, _macro_ and _inline_ are mutually exclusive, only one should be used at a time. _validate_ can be used separately or in addition to them to support $data reference. + +__Please note__: If the keyword is validating data type that is different from the type(s) in its definition, the validation function will not be called (and expanded macro will not be used), so there is no need to check for data type inside validation function or inside schema returned by macro function (unless you want to enforce a specific type and for some reason do not want to use a separate `type` keyword for that). In the same way as standard keywords work, if the keyword does not apply to the data type being validated, the validation of this keyword will succeed. + +See [Defining custom keywords](#defining-custom-keywords) for more details. + + +##### .getKeyword(String keyword) -> Object|Boolean + +Returns custom keyword definition, `true` for pre-defined keywords and `false` if the keyword is unknown. + + +##### .removeKeyword(String keyword) -> Ajv + +Removes custom or pre-defined keyword so you can redefine them. + +While this method can be used to extend pre-defined keywords, it can also be used to completely change their meaning - it may lead to unexpected results. + +__Please note__: schemas compiled before the keyword is removed will continue to work without changes. To recompile schemas use `removeSchema` method and compile them again. + + +##### .errorsText([Array<Object> errors [, Object options]]) -> String + +Returns the text with all errors in a String. + +Options can have properties `separator` (string used to separate errors, ", " by default) and `dataVar` (the variable name that dataPaths are prefixed with, "data" by default). + + +## Options + +Defaults: + +```javascript +{ + // validation and reporting options: + $data: false, + allErrors: false, + verbose: false, + $comment: false, // NEW in Ajv version 6.0 + jsonPointers: false, + uniqueItems: true, + unicode: true, + nullable: false, + format: 'fast', + formats: {}, + unknownFormats: true, + schemas: {}, + logger: undefined, + // referenced schema options: + schemaId: '$id', + missingRefs: true, + extendRefs: 'ignore', // recommended 'fail' + loadSchema: undefined, // function(uri: string): Promise {} + // options to modify validated data: + removeAdditional: false, + useDefaults: false, + coerceTypes: false, + // strict mode options + strictDefaults: false, + strictKeywords: false, + // asynchronous validation options: + transpile: undefined, // requires ajv-async package + // advanced options: + meta: true, + validateSchema: true, + addUsedSchema: true, + inlineRefs: true, + passContext: false, + loopRequired: Infinity, + ownProperties: false, + multipleOfPrecision: false, + errorDataPath: 'object', // deprecated + messages: true, + sourceCode: false, + processCode: undefined, // function (str: string): string {} + cache: new Cache, + serialize: undefined +} +``` + +##### Validation and reporting options + +- _$data_: support [$data references](#data-reference). Draft 6 meta-schema that is added by default will be extended to allow them. If you want to use another meta-schema you need to use $dataMetaSchema method to add support for $data reference. See [API](#api). +- _allErrors_: check all rules collecting all errors. Default is to return after the first error. +- _verbose_: include the reference to the part of the schema (`schema` and `parentSchema`) and validated data in errors (false by default). +- _$comment_ (NEW in Ajv version 6.0): log or pass the value of `$comment` keyword to a function. Option values: + - `false` (default): ignore $comment keyword. + - `true`: log the keyword value to console. + - function: pass the keyword value, its schema path and root schema to the specified function +- _jsonPointers_: set `dataPath` property of errors using [JSON Pointers](https://tools.ietf.org/html/rfc6901) instead of JavaScript property access notation. +- _uniqueItems_: validate `uniqueItems` keyword (true by default). +- _unicode_: calculate correct length of strings with unicode pairs (true by default). Pass `false` to use `.length` of strings that is faster, but gives "incorrect" lengths of strings with unicode pairs - each unicode pair is counted as two characters. +- _nullable_: support keyword "nullable" from [Open API 3 specification](https://swagger.io/docs/specification/data-models/data-types/). +- _format_: formats validation mode. Option values: + - `"fast"` (default) - simplified and fast validation (see [Formats](#formats) for details of which formats are available and affected by this option). + - `"full"` - more restrictive and slow validation. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode. + - `false` - ignore all format keywords. +- _formats_: an object with custom formats. Keys and values will be passed to `addFormat` method. +- _unknownFormats_: handling of unknown formats. Option values: + - `true` (default) - if an unknown format is encountered the exception is thrown during schema compilation. If `format` keyword value is [$data reference](#data-reference) and it is unknown the validation will fail. + - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if another unknown format is used. If `format` keyword value is [$data reference](#data-reference) and it is not in this array the validation will fail. + - `"ignore"` - to log warning during schema compilation and always pass validation (the default behaviour in versions before 5.0.0). This option is not recommended, as it allows to mistype format name and it won't be validated without any error message. This behaviour is required by JSON Schema specification. +- _schemas_: an array or object of schemas that will be added to the instance. In case you pass the array the schemas must have IDs in them. When the object is passed the method `addSchema(value, key)` will be called for each schema in this object. +- _logger_: sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. Option values: + - custom logger - it should have methods `log`, `warn` and `error`. If any of these methods is missing an exception will be thrown. + - `false` - logging is disabled. + + +##### Referenced schema options + +- _schemaId_: this option defines which keywords are used as schema URI. Option value: + - `"$id"` (default) - only use `$id` keyword as schema URI (as specified in JSON Schema draft-06/07), ignore `id` keyword (if it is present a warning will be logged). + - `"id"` - only use `id` keyword as schema URI (as specified in JSON Schema draft-04), ignore `$id` keyword (if it is present a warning will be logged). + - `"auto"` - use both `$id` and `id` keywords as schema URI. If both are present (in the same schema object) and different the exception will be thrown during schema compilation. +- _missingRefs_: handling of missing referenced schemas. Option values: + - `true` (default) - if the reference cannot be resolved during compilation the exception is thrown. The thrown error has properties `missingRef` (with hash fragment) and `missingSchema` (without it). Both properties are resolved relative to the current base id (usually schema id, unless it was substituted). + - `"ignore"` - to log error during compilation and always pass validation. + - `"fail"` - to log error and successfully compile schema but fail validation if this rule is checked. +- _extendRefs_: validation of other keywords when `$ref` is present in the schema. Option values: + - `"ignore"` (default) - when `$ref` is used other keywords are ignored (as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3) standard). A warning will be logged during the schema compilation. + - `"fail"` (recommended) - if other validation keywords are used together with `$ref` the exception will be thrown when the schema is compiled. This option is recommended to make sure schema has no keywords that are ignored, which can be confusing. + - `true` - validate all keywords in the schemas with `$ref` (the default behaviour in versions before 5.0.0). +- _loadSchema_: asynchronous function that will be used to load remote schemas when `compileAsync` [method](#api-compileAsync) is used and some reference is missing (option `missingRefs` should NOT be 'fail' or 'ignore'). This function should accept remote schema uri as a parameter and return a Promise that resolves to a schema. See example in [Asynchronous compilation](#asynchronous-schema-compilation). + + +##### Options to modify validated data + +- _removeAdditional_: remove additional properties - see example in [Filtering data](#filtering-data). This option is not used if schema is added with `addMetaSchema` method. Option values: + - `false` (default) - not to remove additional properties + - `"all"` - all additional properties are removed, regardless of `additionalProperties` keyword in schema (and no validation is made for them). + - `true` - only additional properties with `additionalProperties` keyword equal to `false` are removed. + - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema). +- _useDefaults_: replace missing or undefined properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: + - `false` (default) - do not use defaults + - `true` - insert defaults by value (object literal is used). + - `"empty"` - in addition to missing or undefined, use defaults for properties and items that are equal to `null` or `""` (an empty string). + - `"shared"` (deprecated) - insert defaults by reference. If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. +- _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/epoberezkin/ajv/blob/master/COERCION.md). Option values: + - `false` (default) - no type coercion. + - `true` - coerce scalar data types. + - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema). + + +##### Strict mode options + +- _strictDefaults_: report ignored `default` keywords in schemas. Option values: + - `false` (default) - ignored defaults are not reported + - `true` - if an ignored default is present, throw an error + - `"log"` - if an ignored default is present, log warning +- _strictKeywords_: report unknown keywords in schemas. Option values: + - `false` (default) - unknown keywords are not reported + - `true` - if an unknown keyword is present, throw an error + - `"log"` - if an unknown keyword is present, log warning + + +##### Asynchronous validation options + +- _transpile_: Requires [ajv-async](https://github.com/epoberezkin/ajv-async) package. It determines whether Ajv transpiles compiled asynchronous validation function. Option values: + - `undefined` (default) - transpile with [nodent](https://github.com/MatAtBread/nodent) if async functions are not supported. + - `true` - always transpile with nodent. + - `false` - do not transpile; if async functions are not supported an exception will be thrown. + + +##### Advanced options + +- _meta_: add [meta-schema](http://json-schema.org/documentation.html) so it can be used by other schemas (true by default). If an object is passed, it will be used as the default meta-schema for schemas that have no `$schema` keyword. This default meta-schema MUST have `$schema` keyword. +- _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can be http://json-schema.org/draft-07/schema or absent (draft-07 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values: + - `true` (default) - if the validation fails, throw the exception. + - `"log"` - if the validation fails, log error. + - `false` - skip schema validation. +- _addUsedSchema_: by default methods `compile` and `validate` add schemas to the instance if they have `$id` (or `id`) property that doesn't start with "#". If `$id` is present and it is not unique the exception will be thrown. Set this option to `false` to skip adding schemas to the instance and the `$id` uniqueness check when these methods are used. This option does not affect `addSchema` method. +- _inlineRefs_: Affects compilation of referenced schemas. Option values: + - `true` (default) - the referenced schemas that don't have refs in them are inlined, regardless of their size - that substantially improves performance at the cost of the bigger size of compiled schema functions. + - `false` - to not inline referenced schemas (they will be compiled as separate functions). + - integer number - to limit the maximum number of keywords of the schema that will be inlined. +- _passContext_: pass validation context to custom keyword functions. If this option is `true` and you pass some context to the compiled validation function with `validate.call(context, data)`, the `context` will be available as `this` in your custom keywords. By default `this` is Ajv instance. +- _loopRequired_: by default `required` keyword is compiled into a single expression (or a sequence of statements in `allErrors` mode). In case of a very large number of properties in this keyword it may result in a very big validation function. Pass integer to set the number of properties above which `required` keyword will be validated in a loop - smaller validation function size but also worse performance. +- _ownProperties_: by default Ajv iterates over all enumerable object properties; when this option is `true` only own enumerable object properties (i.e. found directly on the object rather than on its prototype) are iterated. Contributed by @mbroadst. +- _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/epoberezkin/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations). +- _errorDataPath_ (deprecated): set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`. +- _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/epoberezkin/ajv-i18n)). +- _sourceCode_: add `sourceCode` property to validating function (for debugging; this code can be different from the result of toString call). +- _processCode_: an optional function to process generated code before it is passed to Function constructor. It can be used to either beautify (the validating function is generated without line-breaks) or to transpile code. Starting from version 5.0.0 this option replaced options: + - `beautify` that formatted the generated function using [js-beautify](https://github.com/beautify-web/js-beautify). If you want to beautify the generated code pass `require('js-beautify').js_beautify`. + - `transpile` that transpiled asynchronous validation function. You can still use `transpile` option with [ajv-async](https://github.com/epoberezkin/ajv-async) package. See [Asynchronous validation](#asynchronous-validation) for more information. +- _cache_: an optional instance of cache to store compiled schemas using stable-stringified schema as a key. For example, set-associative cache [sacjs](https://github.com/epoberezkin/sacjs) can be used. If not passed then a simple hash is used which is good enough for the common use case (a limited number of statically defined schemas). Cache should have methods `put(key, value)`, `get(key)`, `del(key)` and `clear()`. +- _serialize_: an optional function to serialize schema to cache key. Pass `false` to use schema itself as a key (e.g., if WeakMap used as a cache). By default [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used. + + +## Validation errors + +In case of validation failure, Ajv assigns the array of errors to `errors` property of validation function (or to `errors` property of Ajv instance when `validate` or `validateSchema` methods were called). In case of [asynchronous validation](#asynchronous-validation), the returned promise is rejected with exception `Ajv.ValidationError` that has `errors` property. + + +### Error objects + +Each error is an object with the following properties: + +- _keyword_: validation keyword. +- _dataPath_: the path to the part of the data that was validated. By default `dataPath` uses JavaScript property access notation (e.g., `".prop[1].subProp"`). When the option `jsonPointers` is true (see [Options](#options)) `dataPath` will be set using JSON pointer standard (e.g., `"/prop/1/subProp"`). +- _schemaPath_: the path (JSON-pointer as a URI fragment) to the schema of the keyword that failed validation. +- _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) package). See below for parameters set by all keywords. +- _message_: the standard error message (can be excluded with option `messages` set to false). +- _schema_: the schema of the keyword (added with `verbose` option). +- _parentSchema_: the schema containing the keyword (added with `verbose` option) +- _data_: the data validated by the keyword (added with `verbose` option). + +__Please note__: `propertyNames` keyword schema validation errors have an additional property `propertyName`, `dataPath` points to the object. After schema validation for each property name, if it is invalid an additional error is added with the property `keyword` equal to `"propertyNames"`. + + +### Error parameters + +Properties of `params` object in errors depend on the keyword that failed validation. + +- `maxItems`, `minItems`, `maxLength`, `minLength`, `maxProperties`, `minProperties` - property `limit` (number, the schema of the keyword). +- `additionalItems` - property `limit` (the maximum number of allowed items in case when `items` keyword is an array of schemas and `additionalItems` is false). +- `additionalProperties` - property `additionalProperty` (the property not used in `properties` and `patternProperties` keywords). +- `dependencies` - properties: + - `property` (dependent property), + - `missingProperty` (required missing dependency - only the first one is reported currently) + - `deps` (required dependencies, comma separated list as a string), + - `depsCount` (the number of required dependencies). +- `format` - property `format` (the schema of the keyword). +- `maximum`, `minimum` - properties: + - `limit` (number, the schema of the keyword), + - `exclusive` (boolean, the schema of `exclusiveMaximum` or `exclusiveMinimum`), + - `comparison` (string, comparison operation to compare the data to the limit, with the data on the left and the limit on the right; can be "<", "<=", ">", ">=") +- `multipleOf` - property `multipleOf` (the schema of the keyword) +- `pattern` - property `pattern` (the schema of the keyword) +- `required` - property `missingProperty` (required property that is missing). +- `propertyNames` - property `propertyName` (an invalid property name). +- `patternRequired` (in ajv-keywords) - property `missingPattern` (required pattern that did not match any property). +- `type` - property `type` (required type(s), a string, can be a comma-separated list) +- `uniqueItems` - properties `i` and `j` (indices of duplicate items). +- `const` - property `allowedValue` pointing to the value (the schema of the keyword). +- `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword). +- `$ref` - property `ref` with the referenced schema URI. +- `oneOf` - property `passingSchemas` (array of indices of passing schemas, null if no schema passes). +- custom keywords (in case keyword definition doesn't create errors) - property `keyword` (the keyword name). + + +## Plugins + +Ajv can be extended with plugins that add custom keywords, formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions: + +- it exports a function +- this function accepts ajv instance as the first parameter and returns the same instance to allow chaining +- this function can accept an optional configuration as the second parameter + +If you have published a useful plugin please submit a PR to add it to the next section. + + +## Related packages + +- [ajv-async](https://github.com/epoberezkin/ajv-async) - plugin to configure async validation mode +- [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - plugin to validate mongodb's bsonType formats +- [ajv-cli](https://github.com/jessedc/ajv-cli) - command line interface +- [ajv-errors](https://github.com/epoberezkin/ajv-errors) - plugin for custom error messages +- [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) - internationalised error messages +- [ajv-istanbul](https://github.com/epoberezkin/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas +- [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) - plugin with custom validation keywords (select, typeof, etc.) +- [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) - plugin with keywords $merge and $patch +- [ajv-pack](https://github.com/epoberezkin/ajv-pack) - produces a compact module exporting validation functions + + +## Some packages using Ajv + +- [webpack](https://github.com/webpack/webpack) - a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser +- [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services +- [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition +- [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator +- [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org +- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON Schema http://jsonschemalint.com +- [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for Node.js +- [table](https://github.com/gajus/table) - formats data into a string table +- [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser +- [restbase](https://github.com/wikimedia/restbase) - distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content +- [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation +- [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation +- [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages +- [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema +- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON Schema with expect in mocha tests +- [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON Schema +- [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file +- [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app +- [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter +- [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages +- [ESLint](https://github.com/eslint/eslint) - the pluggable linting utility for JavaScript and JSX + + +## Tests + +``` +npm install +git submodule update --init +npm test +``` + +## Contributing + +All validation functions are generated using doT templates in [dot](https://github.com/epoberezkin/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency. + +`npm run build` - compiles templates to [dotjs](https://github.com/epoberezkin/ajv/tree/master/lib/dotjs) folder. + +`npm run watch` - automatically compiles templates when files in dot folder change + +Please see [Contributing guidelines](https://github.com/epoberezkin/ajv/blob/master/CONTRIBUTING.md) + + +## Changes history + +See https://github.com/epoberezkin/ajv/releases + +__Please note__: [Changes in version 6.0.0](https://github.com/epoberezkin/ajv/releases/tag/v6.0.0). + +[Version 5.0.0](https://github.com/epoberezkin/ajv/releases/tag/5.0.0). + +[Version 4.0.0](https://github.com/epoberezkin/ajv/releases/tag/4.0.0). + +[Version 3.0.0](https://github.com/epoberezkin/ajv/releases/tag/3.0.0). + +[Version 2.0.0](https://github.com/epoberezkin/ajv/releases/tag/2.0.0). + + +## Open-source software support + +Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. + + +## License + +[MIT](https://github.com/epoberezkin/ajv/blob/master/LICENSE) diff --git a/node_modules/ajv/dist/ajv.bundle.js b/node_modules/ajv/dist/ajv.bundle.js new file mode 100644 index 0000000..a6afe99 --- /dev/null +++ b/node_modules/ajv/dist/ajv.bundle.js @@ -0,0 +1,7172 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Ajv = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; +// For the source: https://gist.github.com/dperini/729294 +// For test cases: https://mathiasbynens.be/demo/url-regex +// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. +// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; +var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; +var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; +var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; +var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; +var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; + + +module.exports = formats; + +function formats(mode) { + mode = mode == 'full' ? 'full' : 'fast'; + return util.copy(formats[mode]); +} + + +formats.fast = { + // date: http://tools.ietf.org/html/rfc3339#section-5.6 + date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 + time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, + 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js + uri: /^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i, + 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, + 'uri-template': URITEMPLATE, + url: URL, + // email (sources from jsen validator): + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') + email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, + hostname: HOSTNAME, + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + // uuid: http://tools.ietf.org/html/rfc4122 + uuid: UUID, + // JSON-pointer: https://tools.ietf.org/html/rfc6901 + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +formats.full = { + date: date, + time: time, + 'date-time': date_time, + uri: uri, + 'uri-reference': URIREF, + 'uri-template': URITEMPLATE, + url: URL, + email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: hostname, + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + uuid: UUID, + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +function isLeapYear(year) { + // https://tools.ietf.org/html/rfc3339#appendix-C + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} + + +function date(str) { + // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 + var matches = str.match(DATE); + if (!matches) return false; + + var year = +matches[1]; + var month = +matches[2]; + var day = +matches[3]; + + return month >= 1 && month <= 12 && day >= 1 && + day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return ((hour <= 23 && minute <= 59 && second <= 59) || + (hour == 23 && minute == 59 && second == 60)) && + (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +function hostname(str) { + // https://tools.ietf.org/html/rfc1034#section-3.5 + // https://tools.ietf.org/html/rfc1123#section-2 + return str.length <= 255 && HOSTNAME.test(str); +} + + +var NOT_URI_FRAGMENT = /\/|:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +var Z_ANCHOR = /[^\\]\\Z/; +function regex(str) { + if (Z_ANCHOR.test(str)) return false; + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} + +},{"./util":10}],5:[function(require,module,exports){ +'use strict'; + +var resolve = require('./resolve') + , util = require('./util') + , errorClasses = require('./error_classes') + , stableStringify = require('fast-json-stable-stringify'); + +var validateGenerator = require('../dotjs/validate'); + +/** + * Functions below are used inside compiled validations function + */ + +var ucs2length = util.ucs2length; +var equal = require('fast-deep-equal'); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = errorClasses.Validation; + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = []; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (opts.sourceCode) cv.source = v.source; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + /* @this {*} - custom context, see passContext option */ + function callValidate() { + /* jshint validthis: true */ + var validate = compilation.validate; + var result = validate.apply(this, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + MissingRefError: errorClasses.MissingRef, + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + logger: self.logger, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.processCode) sourceCode = opts.processCode(sourceCode); + // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); + var validate; + try { + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'equal', + 'ucs2length', + 'ValidationError', + sourceCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + self.logger.error('Error compiling schema, function code:', sourceCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (opts.sourceCode === true) { + validate.source = { + code: sourceCode, + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (v === undefined) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); + } + } + + if (v === undefined) { + removeLocalRef(ref); + } else { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); + } + } + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function removeLocalRef(ref) { + delete refs[ref]; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' || typeof refVal == 'boolean' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && !!refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; + } + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; + } + } + + function useCustomRule(rule, schema, parentSchema, it) { + if (self._opts.validateSchema !== false) { + var deps = rule.definition.dependencies; + if (deps && !deps.every(function(keyword) { + return Object.prototype.hasOwnProperty.call(parentSchema, keyword); + })) + throw new Error('parent schema must have all required keywords: ' + deps.join(',')); + + var validateSchema = rule.definition.validateSchema; + if (validateSchema) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') self.logger.error(message); + else throw new Error(message); + } + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); + } else { + validate = rule.definition.validate; + if (!validate) return; + } + + if (validate === undefined) + throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; + } +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; + +},{}],10:[function(require,module,exports){ +'use strict'; + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + equal: require('fast-deep-equal'), + ucs2length: require('./ucs2length'), + varOccurences: varOccurences, + varReplace: varReplace, + cleanUpCode: cleanUpCode, + finalCleanUpCode: finalCleanUpCode, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + schemaUnknownRules: schemaUnknownRules, + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + unescapeJsonPointer: unescapeJsonPointer, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i', + $notOp = $isMax ? '>' : '<', + $errorKeyword = undefined; + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $exclType = 'exclType' + $lvl, + $exclIsNumber = 'exclIsNumber' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; '; + if ($schema === undefined) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } + } else { + var $exclIsNumber = typeof $schemaExcl == 'number', + $opStr = $op; + if ($exclIsNumber && $isData) { + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; + } else { + if ($exclIsNumber && $schema === undefined) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaExcl; + $notOp += '='; + } else { + if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $notOp += '='; + } else { + $exclusive = false; + $opStr += '='; + } + } + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; + } + } + $errorKeyword = $errorKeyword || $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],14:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],15:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitLength(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],16:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitProperties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],17:[function(require,module,exports){ +'use strict'; +module.exports = function generate_allOf(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],18:[function(require,module,exports){ +'use strict'; +module.exports = function generate_anyOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $noEmptySchema = $schema.every(function($sch) { + return (it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all)); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + out = it.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],19:[function(require,module,exports){ +'use strict'; +module.exports = function generate_comment(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $comment = it.util.toQuotedString($schema); + if (it.opts.$comment === true) { + out += ' console.log(' + ($comment) + ');'; + } else if (typeof it.opts.$comment == 'function') { + out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; + } + return out; +} + +},{}],20:[function(require,module,exports){ +'use strict'; +module.exports = function generate_const(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],21:[function(require,module,exports){ +'use strict'; +module.exports = function generate_contains(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId, + $nonEmptySchema = (it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all)); + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($nonEmptySchema) { + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (' + ($nextValid) + ') break; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; + } else { + out += ' if (' + ($data) + '.length == 0) {'; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should contain a valid item\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + if ($nonEmptySchema) { + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + } + if (it.opts.allErrors) { + out += ' } '; + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],22:[function(require,module,exports){ +'use strict'; +module.exports = function generate_custom(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition, + $closingBraces = ''; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + if (!$ruleValidate) return; + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($isData && $rDef.$data) { + $closingBraces += '}'; + out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; + if ($validateSchema) { + $closingBraces += '}'; + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; + } + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += 'await '; + } + out += '' + (def_callRuleValidate) + '; '; + } else { + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } + } + } + if ($rDef.modifying) { + out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + out += '' + ($closingBraces); + if ($rDef.valid) { + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; + } + out += ') { '; + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],24:[function(require,module,exports){ +'use strict'; +module.exports = function generate_enum(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $i = 'i' + $lvl, + $vSchema = 'schema' + $lvl; + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ';'; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to one of the allowed values\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],25:[function(require,module,exports){ +'use strict'; +module.exports = function generate_format(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + if (it.opts.format === false) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $unknownFormats = it.opts.unknownFormats, + $allowUnknown = Array.isArray($unknownFormats); + if ($isData) { + var $format = 'format' + $lvl, + $isObject = 'isObject' + $lvl, + $formatType = 'formatType' + $lvl; + out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { '; + if (it.async) { + out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; + } + out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' ('; + if ($unknownFormats != 'ignore') { + out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; + if ($allowUnknown) { + out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; + } + out += ') || '; + } + out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; + if (it.async) { + out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; + } else { + out += ' ' + ($format) + '(' + ($data) + ') '; + } + out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; + } else { + var $format = it.formats[$schema]; + if (!$format) { + if ($unknownFormats == 'ignore') { + it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else { + throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); + } + } + var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; + var $formatType = $isObject && $format.type || 'string'; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + if ($formatType != $ruleType) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + if ($async) { + if (!it.async) throw new Error('async format in sync schema'); + var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; + out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { '; + } else { + out += ' if (! '; + var $formatRef = 'formats' + it.util.getProperty($schema); + if ($isObject) $formatRef += '.validate'; + if (typeof $format == 'function') { + out += ' ' + ($formatRef) + '(' + ($data) + ') '; + } else { + out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; + } + out += ') { '; + } + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match format "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],26:[function(require,module,exports){ +'use strict'; +module.exports = function generate_if(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + var $thenSch = it.schema['then'], + $elseSch = it.schema['else'], + $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? typeof $thenSch == 'object' && Object.keys($thenSch).length > 0 : it.util.schemaHasRules($thenSch, it.RULES.all)), + $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? typeof $elseSch == 'object' && Object.keys($elseSch).length > 0 : it.util.schemaHasRules($elseSch, it.RULES.all)), + $currentBaseId = $it.baseId; + if ($thenPresent || $elsePresent) { + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + if ($thenPresent) { + out += ' if (' + ($nextValid) + ') { '; + $it.schema = it.schema['then']; + $it.schemaPath = it.schemaPath + '.then'; + $it.errSchemaPath = it.errSchemaPath + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'then\'; '; + } else { + $ifClause = '\'then\''; + } + out += ' } '; + if ($elsePresent) { + out += ' else { '; + } + } else { + out += ' if (!' + ($nextValid) + ') { '; + } + if ($elsePresent) { + $it.schema = it.schema['else']; + $it.schemaPath = it.schemaPath + '.else'; + $it.errSchemaPath = it.errSchemaPath + '/else'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'else\'; '; + } else { + $ifClause = '\'else\''; + } + out += ' } '; + } + out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + out = it.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],27:[function(require,module,exports){ +'use strict'; + +//all requires must be explicit because browserify won't work with dynamic requires +module.exports = { + '$ref': require('./ref'), + allOf: require('./allOf'), + anyOf: require('./anyOf'), + '$comment': require('./comment'), + const: require('./const'), + contains: require('./contains'), + dependencies: require('./dependencies'), + 'enum': require('./enum'), + format: require('./format'), + 'if': require('./if'), + items: require('./items'), + maximum: require('./_limit'), + minimum: require('./_limit'), + maxItems: require('./_limitItems'), + minItems: require('./_limitItems'), + maxLength: require('./_limitLength'), + minLength: require('./_limitLength'), + maxProperties: require('./_limitProperties'), + minProperties: require('./_limitProperties'), + multipleOf: require('./multipleOf'), + not: require('./not'), + oneOf: require('./oneOf'), + pattern: require('./pattern'), + properties: require('./properties'), + propertyNames: require('./propertyNames'), + required: require('./required'), + uniqueItems: require('./uniqueItems'), + validate: require('./validate') +}; + +},{"./_limit":13,"./_limitItems":14,"./_limitLength":15,"./_limitProperties":16,"./allOf":17,"./anyOf":18,"./comment":19,"./const":20,"./contains":21,"./dependencies":23,"./enum":24,"./format":25,"./if":26,"./items":28,"./multipleOf":29,"./not":30,"./oneOf":31,"./pattern":32,"./properties":33,"./propertyNames":34,"./ref":35,"./required":36,"./uniqueItems":37,"./validate":38}],28:[function(require,module,exports){ +'use strict'; +module.exports = function generate_items(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId; + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if (Array.isArray($schema)) { + var $additionalItems = it.schema.additionalItems; + if ($additionalItems === false) { + out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0 : it.util.schemaHasRules($additionalItems, it.RULES.all))) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' }'; + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],29:[function(require,module,exports){ +'use strict'; +module.exports = function generate_multipleOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],30:[function(require,module,exports){ +'use strict'; +module.exports = function generate_not(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if ($breakOnError) { + out += ' if (false) { '; + } + } + return out; +} + +},{}],31:[function(require,module,exports){ +'use strict'; +module.exports = function generate_oneOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $prevValid = 'prevValid' + $lvl, + $passingSchemas = 'passingSchemas' + $lvl; + out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} + +},{}],32:[function(require,module,exports){ +'use strict'; +module.exports = function generate_pattern(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match pattern "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],33:[function(require,module,exports){ +'use strict'; +module.exports = function generate_properties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl; + var $schemaKeys = Object.keys($schema || {}), + $pProperties = it.schema.patternProperties || {}, + $pPropertyKeys = Object.keys($pProperties), + $aProperties = it.schema.additionalProperties, + $someProperties = $schemaKeys.length || $pPropertyKeys.length, + $noAdditional = $aProperties === false, + $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, + $removeAdditional = it.opts.removeAdditional, + $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + var $required = it.schema.required; + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); + out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined;'; + } + if ($checkAdditional) { + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + if ($someProperties) { + out += ' var isAdditional' + ($lvl) + ' = !(false '; + if ($schemaKeys.length) { + if ($schemaKeys.length > 8) { + out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is an invalid additional property'; + } else { + out += 'should NOT have additional properties'; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ' ) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($pPropertyKeys.length) { + var arr4 = $pPropertyKeys; + if (arr4) { + var $pProperty, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $pProperty = arr4[i4 += 1]; + var $sch = $pProperties[$pProperty]; + if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],34:[function(require,module,exports){ +'use strict'; +module.exports = function generate_propertyNames(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;'; + if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $i = 'i' + $lvl, + $invalidName = '\' + ' + $key + ' + \'', + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined; '; + } + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' var startErrs' + ($lvl) + ' = errors; '; + var $passData = $key; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' 0 : it.util.schemaHasRules($propertySch, it.RULES.all)))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired, + $ownProperties = it.opts.ownProperties; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += '; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var $propertyKey, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $propertyKey = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty($propertyKey), + $useData = $data + $prop; + out += ' ( ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $prop = it.util.getProperty($propertyKey), + $missingProperty = it.util.escapeQuotes($propertyKey), + $useData = $data + $prop; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} + +},{}],37:[function(require,module,exports){ +'use strict'; +module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { '; + var $itemType = it.schema.items && it.schema.items.type, + $typeIsArray = Array.isArray($itemType); + if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) { + out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } '; + } else { + out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; '; + var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); + out += ' if (' + (it.util[$method]($itemType, 'item', true)) + ') continue; '; + if ($typeIsArray) { + out += ' if (typeof item == \'string\') item = \'"\' + item; '; + } + out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } '; + } + out += ' } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],38:[function(require,module,exports){ +'use strict'; +module.exports = function generate_validate(it, $keyword, $ruleType) { + var out = ''; + var $async = it.schema.$async === true, + $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), + $id = it.self._getId(it.schema); + if (it.opts.strictKeywords) { + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); + if ($unknownKwd) { + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); + else throw new Error($keywordsMsg); + } + } + if (it.isTop) { + out += ' var validate = '; + if ($async) { + it.async = true; + out += 'async '; + } + out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; + if ($id && (it.opts.sourceCode || it.opts.processCode)) { + out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; + } + } + if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { + var $keyword = 'false schema'; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + if (it.schema === false) { + if (it.isTop) { + $breakOnError = true; + } else { + out += ' var ' + ($valid) + ' = false; '; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'boolean schema is false\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } else { + if (it.isTop) { + if ($async) { + out += ' return data; '; + } else { + out += ' validate.errors = null; return true; '; + } + } else { + out += ' var ' + ($valid) + ' = true; '; + } + } + if (it.isTop) { + out += ' }; return validate; '; + } + return out; + } + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); + it.baseId = it.baseId || it.rootId; + delete it.isTop; + it.dataPathArr = [undefined]; + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored in the schema root'; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + out += ' var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data; '; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if ($id) it.baseId = it.resolve.url(it.baseId, $id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = ''; + var $errorKeyword; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } + if (it.schema.$ref && $refKeywords) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); + } else if (it.opts.extendRefs !== true) { + $refKeywords = false; + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } + } + if (it.schema.$comment && it.opts.$comment) { + out += ' ' + (it.RULES.all.$comment.code(it, '$comment')); + } + if ($typeSchema) { + if (it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + } + var $rulesGroup = it.RULES.types[$typeSchema]; + if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + if ($coerceToTypes) { + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; + } + out += ' var ' + ($coerced) + ' = undefined; '; + var $bracesCoercion = ''; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($i) { + out += ' if (' + ($coerced) + ' === undefined) { '; + $bracesCoercion += '}'; + } + if (it.opts.coerceTypes == 'array' && $type != 'array') { + out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; + } + if ($type == 'string') { + out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' } '; + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; + } + if (it.opts.useDefaults) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); + if ($code) { + out += ' ' + ($code) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return data; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }; return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + out = it.util.cleanUpCode(out); + if ($top) { + out = it.util.finalCleanUpCode(out, $async); + } + + function $shouldUseGroup($rulesGroup) { + var rules = $rulesGroup.rules; + for (var i = 0; i < rules.length; i++) + if ($shouldUseRule(rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); + } + + function $ruleImplementsSomeKeyword($rule) { + var impl = $rule.implements; + for (var i = 0; i < impl.length; i++) + if (it.schema[impl[i]] !== undefined) return true; + } + return out; +} + +},{}],39:[function(require,module,exports){ +'use strict'; + +var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; +var customRuleCode = require('./dotjs/custom'); +var definitionSchema = require('./definition_schema'); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword, + validate: validateKeyword +}; + + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + * @return {Ajv} this for method chaining + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + this.validateKeyword(definition, true); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + for (var i=0; i 1) { + sets[0] = sets[0].slice(0, -1); + var xl = sets.length - 1; + for (var x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } else { + return sets[0]; + } +} +function subexp(str) { + return "(?:" + str + ")"; +} +function typeOf(o) { + return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); +} +function toUpperCase(str) { + return str.toUpperCase(); +} +function toArray(obj) { + return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; +} +function assign(target, source) { + var obj = target; + if (source) { + for (var key in source) { + obj[key] = source[key]; + } + } + return obj; +} + +function buildExps(isIRI) { + var ALPHA$$ = "[A-Za-z]", + CR$ = "[\\x0D]", + DIGIT$$ = "[0-9]", + DQUOTE$$ = "[\\x22]", + HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), + //case-insensitive + LF$$ = "[\\x0A]", + SP$$ = "[\\x20]", + PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), + //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", + SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", + RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), + UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", + //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", + //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), + SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), + USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), + DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), + DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), + //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), + H16$ = subexp(HEXDIG$$ + "{1,4}"), + LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), + IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), + // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), + // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), + //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), + //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), + //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), + //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), + //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), + //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), + //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), + ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), + //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), + //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), + //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), + IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), + //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), + HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), + PORT$ = subexp(DIGIT$$ + "*"), + AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), + PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), + SEGMENT$ = subexp(PCHAR$ + "*"), + SEGMENT_NZ$ = subexp(PCHAR$ + "+"), + SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), + PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), + PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), + //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), + //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), + //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", + PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), + FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), + HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), + RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), + ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), + GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", + SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +var URI_PROTOCOL = buildExps(false); + +var IRI_PROTOCOL = buildExps(true); + +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); + + + + + + + + + + + + + +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } +}; + +/** Highest positive signed 32-bit float value */ + +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' + +/** Regular expressions */ +var regexPunycode = /^xn--/; +var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error$1(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + var result = []; + var length = array.length; + while (length--) { + result[length] = fn(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +var ucs2encode = function ucs2encode(array) { + return String.fromCodePoint.apply(String, toConsumableArray(array)); +}; + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +var basicToDigit = function basicToDigit(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +var digitToBasic = function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +var adapt = function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +var decode = function decode(input) { + // Don't use UCS-2. + var output = []; + var inputLength = input.length; + var i = 0; + var n = initialN; + var bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + var basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (var j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error$1('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + var oldi = i; + for (var w = 1, k = base;; /* no condition */k += base) { + + if (index >= inputLength) { + error$1('invalid-input'); + } + + var digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error$1('overflow'); + } + + i += digit * w; + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (digit < t) { + break; + } + + var baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error$1('overflow'); + } + + w *= baseMinusT; + } + + var out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error$1('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + } + + return String.fromCodePoint.apply(String, output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +var encode = function encode(input) { + var output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + var inputLength = input.length; + + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + + // Handle the basic code points. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _currentValue2 = _step.value; + + if (_currentValue2 < 0x80) { + output.push(stringFromCharCode(_currentValue2)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var basicLength = output.length; + var handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + var m = maxInt; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var currentValue = _step2.value; + + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error$1('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _currentValue = _step3.value; + + if (_currentValue < n && ++delta > maxInt) { + error$1('overflow'); + } + if (_currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base;; /* no condition */k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) { + break; + } + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + ++delta; + ++n; + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +var toUnicode = function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +var toASCII = function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +var SCHEMES = {}; +function pctEncChar(chr) { + var c = chr.charCodeAt(0); + var e = void 0; + if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); + return e; +} +function pctDecChars(str) { + var newStr = ""; + var i = 0; + var il = str.length; + while (i < il) { + var c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } else if (c >= 194 && c < 224) { + if (il - i >= 6) { + var c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); + } else { + newStr += str.substr(i, 6); + } + i += 6; + } else if (c >= 224) { + if (il - i >= 9) { + var _c = parseInt(str.substr(i + 4, 2), 16); + var c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); + } else { + newStr += str.substr(i, 9); + } + i += 9; + } else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(protocol.UNRESERVED) ? str : decStr; + } + if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} + +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + var matches = host.match(protocol.IPV4ADDRESS) || []; + + var _matches = slicedToArray(matches, 2), + address = _matches[1]; + + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + var matches = host.match(protocol.IPV6ADDRESS) || []; + + var _matches2 = slicedToArray(matches, 3), + address = _matches2[1], + zone = _matches2[2]; + + if (address) { + var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), + _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), + last = _address$toLowerCase$2[0], + first = _address$toLowerCase$2[1]; + + var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + var lastFields = last.split(":").map(_stripLeadingZeros); + var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + var fieldCount = isLastFieldIPv4Address ? 7 : 8; + var lastFieldsStart = lastFields.length - fieldCount; + var fields = Array(fieldCount); + for (var x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + var allZeroFields = fields.reduce(function (acc, field, index) { + if (!field || field === "0") { + var lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } else { + acc.push({ index: index, length: 1 }); + } + } + return acc; + }, []); + var longestZeroFields = allZeroFields.sort(function (a, b) { + return b.length - a.length; + })[0]; + var newHost = void 0; + if (longestZeroFields && longestZeroFields.length > 1) { + var newFirst = fields.slice(0, longestZeroFields.index); + var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } else { + return host; + } +} +var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; +function parse(uriString) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var components = {}; + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + var matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } else { + //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; + components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; + components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; + //fix port number + if (isNaN(components.port)) { + components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } else if (components.scheme === undefined) { + components.reference = "relative"; + } else if (components.fragment === undefined) { + components.reference = "absolute"; + } else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} + +function _recomposeAuthority(components, options) { + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { + return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; + })); + } + if (typeof components.port === "number") { + uriTokens.push(":"); + uriTokens.push(components.port.toString(10)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} + +var RDS1 = /^\.\.?\//; +var RDS2 = /^\/\.(\/|$)/; +var RDS3 = /^\/\.\.(\/|$)/; +var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +function removeDotSegments(input) { + var output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + var im = input.match(RDS5); + if (im) { + var s = im[0]; + input = input.slice(s.length); + output.push(s); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} + +function serialize(components) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) {} + //TODO: normalize IPv6 address as per RFC 5952 + + //if host component is a domain name + else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { + //convert IDN via punycode + try { + components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + var authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + var s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} + +function resolveComponents(base, relative) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var skipNormalization = arguments[3]; + + var target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } else { + target.query = base.query; + } + } else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } else if (!base.path) { + target.path = relative.path; + } else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} + +function resolve(baseURI, relativeURI, options) { + var schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} + +function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} + +function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} + +function escapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); +} + +function unescapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); +} + +var handler = { + scheme: "http", + domainHost: true, + parse: function parse(components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function serialize(components, options) { + //normalize the default port + if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; + +var handler$1 = { + scheme: "https", + domainHost: handler.domainHost, + parse: handler.parse, + serialize: handler.serialize +}; + +var O = {}; +var isIRI = true; +//RFC 3986 +var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +var UNRESERVED = new RegExp(UNRESERVED$$, "g"); +var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +var NOT_HFVALUE = NOT_HFNAME; +function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(UNRESERVED) ? str : decStr; +} +var handler$2 = { + scheme: "mailto", + parse: function parse$$1(components, options) { + var mailtoComponents = components; + var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + var unknownHeaders = false; + var headers = {}; + var hfields = mailtoComponents.query.split("&"); + for (var x = 0, xl = hfields.length; x < xl; ++x) { + var hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + var toAddrs = hfield[1].split(","); + for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { + to.push(toAddrs[_x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { + var addr = to[_x2].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[_x2] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function serialize$$1(mailtoComponents, options) { + var components = mailtoComponents; + var to = toArray(mailtoComponents.to); + if (to) { + for (var x = 0, xl = to.length; x < xl; ++x) { + var toAddr = String(to[x]); + var atIdx = toAddr.lastIndexOf("@"); + var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + var domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); + } catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + var headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) headers["body"] = mailtoComponents.body; + var fields = []; + for (var name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; + +var URN_PARSE = /^([^\:]+)\:(.*)/; +//RFC 2141 +var handler$3 = { + scheme: "urn", + parse: function parse$$1(components, options) { + var matches = components.path && components.path.match(URN_PARSE); + var urnComponents = components; + if (matches) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = matches[1].toLowerCase(); + var nss = matches[2]; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function serialize$$1(urnComponents, options) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = urnComponents.nid; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + var uriComponents = urnComponents; + var nss = urnComponents.nss; + uriComponents.path = (nid || options.nid) + ":" + nss; + return uriComponents; + } +}; + +var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +//RFC 4122 +var handler$4 = { + scheme: "urn:uuid", + parse: function parse(urnComponents, options) { + var uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function serialize(uuidComponents, options) { + var urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } +}; + +SCHEMES[handler.scheme] = handler; +SCHEMES[handler$1.scheme] = handler$1; +SCHEMES[handler$2.scheme] = handler$2; +SCHEMES[handler$3.scheme] = handler$3; +SCHEMES[handler$4.scheme] = handler$4; + +exports.SCHEMES = SCHEMES; +exports.pctEncChar = pctEncChar; +exports.pctDecChars = pctDecChars; +exports.parse = parse; +exports.removeDotSegments = removeDotSegments; +exports.serialize = serialize; +exports.resolveComponents = resolveComponents; +exports.resolve = resolve; +exports.normalize = normalize; +exports.equal = equal; +exports.escapeComponent = escapeComponent; +exports.unescapeComponent = unescapeComponent; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + + +},{}],"ajv":[function(require,module,exports){ +'use strict'; + +var compileSchema = require('./compile') + , resolve = require('./compile/resolve') + , Cache = require('./cache') + , SchemaObject = require('./compile/schema_obj') + , stableStringify = require('fast-json-stable-stringify') + , formats = require('./compile/formats') + , rules = require('./compile/rules') + , $dataMetaSchema = require('./data') + , util = require('./compile/util'); + +module.exports = Ajv; + +Ajv.prototype.validate = validate; +Ajv.prototype.compile = compile; +Ajv.prototype.addSchema = addSchema; +Ajv.prototype.addMetaSchema = addMetaSchema; +Ajv.prototype.validateSchema = validateSchema; +Ajv.prototype.getSchema = getSchema; +Ajv.prototype.removeSchema = removeSchema; +Ajv.prototype.addFormat = addFormat; +Ajv.prototype.errorsText = errorsText; + +Ajv.prototype._addSchema = _addSchema; +Ajv.prototype._compile = _compile; + +Ajv.prototype.compileAsync = require('./compile/async'); +var customKeyword = require('./keyword'); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.prototype.validateKeyword = customKeyword.validate; + +var errorClasses = require('./compile/error_classes'); +Ajv.ValidationError = errorClasses.Validation; +Ajv.MissingRefError = errorClasses.MissingRef; +Ajv.$dataMetaSchema = $dataMetaSchema; + +var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ]; +var META_SUPPORT_DATA = ['/properties']; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + opts = this._opts = util.copy(opts) || {}; + setLogger(this); + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + this._getId = chooseGetId(opts); + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + if (opts.serialize === undefined) opts.serialize = stableStringify; + this._metaOpts = getMetaSchemaOptions(this); + + if (opts.formats) addInitialFormats(this); + addDefaultMetaSchema(this); + if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); + if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}}); + addInitialSchemas(this); +} + + + +/** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize. + * @this Ajv + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ +function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = this.getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); + } else { + var schemaObj = this._addSchema(schemaKeyRef); + v = schemaObj.validate || this._compile(schemaObj); + } + + var valid = v(data); + if (v.$async !== true) this.errors = v.errors; + return valid; +} + + +/** + * Create validating function for passed schema. + * @this Ajv + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ +function compile(schema, _meta) { + var schemaObj = this._addSchema(schema, undefined, _meta); + return schemaObj.validate || this._compile(schemaObj); +} + + +/** + * Adds schema to the instance. + * @this Ajv + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + * @return {Ajv} this for method chaining + */ +function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ +function errorsText(errors, options) { + errors = errors || this.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,f=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return a.copy(m[e="full"==e?"full":"fast"])}function v(e){var r=e.match(o);if(!r)return!1;var t,a=+r[2],s=+r[3];return 1<=a&&a<=12&&1<=s&&s<=(2!=a||((t=+r[1])%4!=0||t%100==0&&t%400!=0)?i[a]:29)}function y(e,r){var t=e.match(n);if(!t)return!1;var a=t[1],s=t[2],o=t[3];return(a<=23&&s<=59&&o<=59||23==a&&59==s&&60==o)&&(!r||t[5])}(r.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":f,"relative-json-pointer":p},m.full={date:v,time:y,"date-time":function(e){var r=e.split(g);return 2==r.length&&v(r[0])&&y(r[1],!0)},uri:function(e){return P.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&s.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":f,"relative-json-pointer":p};var g=/t|\s/i;var P=/\/|:/;var E=/[^\\]\\Z/;function w(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){"use strict";var $=e("./resolve"),D=e("./util"),j=e("./error_classes"),O=e("fast-json-stable-stringify"),I=e("../dotjs/validate"),A=D.ucs2length,C=e("fast-deep-equal"),k=j.Validation;function L(e,r,t){var a=s.call(this,e,r,t);return 0<=a?{index:a,compiling:!0}:{index:a=this._compilations.length,compiling:!(this._compilations[a]={schema:e,root:r,baseId:t})}}function z(e,r,t){var a=s.call(this,e,r,t);0<=a&&this._compilations.splice(a,1)}function s(e,r,t){for(var a=0;a",g=f?">":"<",P=void 0;if(v){var E=e.util.getData(m.$data,i,e.dataPathArr),w="exclusive"+o,b="exclType"+o,S="exclIsNumber"+o,_="' + "+(R="op"+o)+" + '";s+=" var schemaExcl"+o+" = "+E+"; ";var F;P=p;(F=F||[]).push(s+=" var "+w+"; var "+b+" = typeof "+(E="schemaExcl"+o)+"; if ("+b+" != 'boolean' && "+b+" != 'undefined' && "+b+" != 'number') { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(P||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var x=s;s=F.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+b+" == 'number' ? ( ("+w+" = "+a+" === undefined || "+E+" "+y+"= "+a+") ? "+h+" "+g+"= "+E+" : "+h+" "+g+" "+a+" ) : ( ("+w+" = "+E+" === true) ? "+h+" "+g+"= "+a+" : "+h+" "+g+" "+a+" ) || "+h+" !== "+h+") { var op"+o+" = "+w+" ? '"+y+"' : '"+y+"='; ",void 0===n&&(c=e.errSchemaPath+"/"+(P=p),a=E,d=v)}else{_=y;if((S="number"==typeof m)&&d){var R="'"+_+"'";s+=" if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" ( "+a+" === undefined || "+m+" "+y+"= "+a+" ? "+h+" "+g+"= "+m+" : "+h+" "+g+" "+a+" ) || "+h+" !== "+h+") { "}else{S&&void 0===n?(w=!0,c=e.errSchemaPath+"/"+(P=p),a=m,g+="="):(S&&(a=Math[f?"min":"max"](m,n)),m===(!S||a)?(w=!0,c=e.errSchemaPath+"/"+(P=p),g+="="):(w=!1,_+="="));R="'"+_+"'";s+=" if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+h+" "+g+" "+a+" || "+h+" !== "+h+") { "}}P=P||r,(F=F||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(P||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+R+", limit: "+a+", exclusive: "+w+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+_+" ",s+=d?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";x=s;return s=F.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { "),s}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;a=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || ");var f=r,p=p||[];p.push(s+=" "+h+".length "+("maxItems"==r?">":"<")+" "+a+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==r?"more":"fewer",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;a=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=!1===e.opts.unicode?" "+h+".length ":" ucs2length("+h+") ";var f=r,p=p||[];p.push(s+=" "+("maxLength"==r?">":"<")+" "+a+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==r?"longer":"shorter",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;a=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || ");var f=r,p=p||[];p.push(s+=" Object.keys("+h+").length "+("maxProperties"==r?">":"<")+" "+a+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==r?"more":"fewer",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.schema[r],o=e.schemaPath+e.util.getProperty(r),i=e.errSchemaPath+"/"+r,n=!e.opts.allErrors,l=e.util.copy(e),c="";l.level++;var u="valid"+l.level,h=l.baseId,d=!0,f=s;if(f)for(var p,m=-1,v=f.length-1;m "+x+") { ";var $=u+"["+x+"]";f.schema=F,f.schemaPath=n+"["+x+"]",f.errSchemaPath=l+"/"+x,f.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0),f.dataPathArr[y]=x;var D=e.validate(f);f.baseId=P,e.util.varOccurences(D,g)<2?a+=" "+e.util.varReplace(D,g,$)+" ":a+=" var "+g+" = "+$+"; "+D+" ",a+=" } ",c&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof E&&(e.opts.strictKeywords?"object"==typeof E&&0 "+i.length+") { for (var "+v+" = "+i.length+"; "+v+" < "+u+".length; "+v+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);$=u+"["+v+"]";f.dataPathArr[y]=v;D=e.validate(f);f.baseId=P,e.util.varOccurences(D,g)<2?a+=" "+e.util.varReplace(D,g,$)+" ":a+=" var "+g+" = "+$+"; "+D+" ",c&&(a+=" if (!"+m+") break; "),a+=" } } ",c&&(a+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof i&&0 1e-"+e.opts.multipleOfPrecision+" ":" division"+o+" !== parseInt(division"+o+") ",s+=" ) ",d&&(s+=" ) ");var f=f||[];f.push(s+=" ) { "),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=d?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var p=s;return s=f.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},{}],30:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h="errs__"+s,d=e.util.copy(e);d.level++;var f="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof i&&0 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(0<=p.indexOf("object")||0<=p.indexOf("array")))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+d+" = false; break outer; } } } ";else s+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ",s+=" if ("+e.util["checkDataType"+(m?"s":"")](p,"item",!0)+") continue; ",m&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ";s+=" } ",f&&(s+=" } ");var v=v||[];v.push(s+=" if (!"+d+") { "),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var y=s;s=v.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+y+"]); ":" validate.errors = ["+y+"]; return false; ":" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { ")}else u&&(s+=" if (true) { ");return s}},{}],38:[function(e,r,t){"use strict";r.exports=function(a,e,r){var t="",s=!0===a.schema.$async,o=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),i=a.self._getId(a.schema);if(a.opts.strictKeywords){var n=a.util.schemaUnknownRules(a.schema,a.RULES.keywords);if(n){var l="unknown keyword: "+n;if("log"!==a.opts.strictKeywords)throw new Error(l);a.logger.warn(l)}}if(a.isTop&&(t+=" var validate = ",s&&(a.async=!0,t+="async "),t+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",i&&(a.opts.sourceCode||a.opts.processCode)&&(t+=" /*# sourceURL="+i+" */ ")),"boolean"==typeof a.schema||!o&&!a.schema.$ref){var c=a.level,u=a.dataLevel,h=a.schema[e="false schema"],d=a.schemaPath+a.util.getProperty(e),f=a.errSchemaPath+"/"+e,p=!a.opts.allErrors,m="data"+(u||""),v="valid"+c;if(!1===a.schema){a.isTop?p=!0:t+=" var "+v+" = false; ",(G=G||[]).push(t),t="",!1!==a.createErrors?(t+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(f)+" , params: {} ",!1!==a.opts.messages&&(t+=" , message: 'boolean schema is false' "),a.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+m+" "),t+=" } "):t+=" {} ";var y=t;t=G.pop(),t+=!a.compositeRule&&p?a.async?" throw new ValidationError(["+y+"]); ":" validate.errors = ["+y+"]; return false; ":" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else t+=a.isTop?s?" return data; ":" validate.errors = null; return true; ":" var "+v+" = true; ";return a.isTop&&(t+=" }; return validate; "),t}if(a.isTop){var g=a.isTop;c=a.level=0,u=a.dataLevel=0,m="data";if(a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[void 0],void 0!==a.schema.default&&a.opts.useDefaults&&a.opts.strictDefaults){var P="default is ignored in the schema root";if("log"!==a.opts.strictDefaults)throw new Error(P);a.logger.warn(P)}t+=" var vErrors = null; ",t+=" var errors = 0; ",t+=" if (rootData === undefined) rootData = data; "}else{c=a.level,m="data"+((u=a.dataLevel)||"");if(i&&(a.baseId=a.resolve.url(a.baseId,i)),s&&!a.async)throw new Error("async schema in sync schema");t+=" var errs_"+c+" = errors;"}v="valid"+c,p=!a.opts.allErrors;var E="",w="",b=a.schema.type,S=Array.isArray(b);if(b&&a.opts.nullable&&!0===a.schema.nullable&&(S?-1==b.indexOf("null")&&(b=b.concat("null")):"null"!=b&&(b=[b,"null"],S=!0)),S&&1==b.length&&(b=b[0],S=!1),a.schema.$ref&&o){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(o=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(t+=" "+a.RULES.all.$comment.code(a,"$comment")),b){if(a.opts.coerceTypes)var _=a.util.coerceToTypes(a.opts.coerceTypes,b);var F=a.RULES.types[b];if(_||S||!0===F||F&&!Y(F)){d=a.schemaPath+".type",f=a.errSchemaPath+"/type",d=a.schemaPath+".type",f=a.errSchemaPath+"/type";if(t+=" if ("+a.util[S?"checkDataTypes":"checkDataType"](b,m,!0)+") { ",_){var x="dataType"+c,R="coerced"+c;t+=" var "+x+" = typeof "+m+"; ","array"==a.opts.coerceTypes&&(t+=" if ("+x+" == 'object' && Array.isArray("+m+")) "+x+" = 'array'; "),t+=" var "+R+" = undefined; ";var $="",D=_;if(D)for(var j,O=-1,I=D.length-1;O= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=Math.floor,z=String.fromCharCode;function T(e){throw new RangeError(i[e])}function n(e,r){var t=e.split("@"),a="";return 1>1,e+=L(e/r);455L((A-s)/h))&&T("overflow"),s+=f*h;var p=d<=i?1:i+26<=d?26:d-i;if(fL(A/m)&&T("overflow"),h*=m}var v=t.length+1;i=Q(s-u,v,0==u),L(s/v)>A-o&&T("overflow"),o+=L(s/v),s%=v,t.splice(s++,0,o)}return String.fromCodePoint.apply(String,t)},c=function(e){var r=[],t=(e=q(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var c,u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var h=c.value;h<128&&r.push(z(h))}}catch(e){n=!0,l=e}finally{try{!i&&u.return&&u.return()}finally{if(n)throw l}}var d=r.length,f=d;for(d&&r.push("-");fL((A-s)/w)&&T("overflow"),s+=(p-a)*w,a=p;var b=!0,S=!1,_=void 0;try{for(var F,x=e[Symbol.iterator]();!(b=(F=x.next()).done);b=!0){var R=F.value;if(RA&&T("overflow"),R==a){for(var $=s,D=36;;D+=36){var j=D<=o?1:o+26<=D?26:D-o;if($>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function f(e){for(var r="",t=0,a=e.length;tA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(K,"g"),G=new RegExp(B,"g"),Y=new RegExp(C("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',J),"g"),W=new RegExp(C("[^]",K,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),X=W;function ee(e){var r=f(e);return r.match(Z)?r:e}var re={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n); + + message: string; + errors: Array; + ajv: true; + validation: true; + } + + class MissingRefError extends Error { + constructor(baseId: string, ref: string, message?: string); + static message: (baseId: string, ref: string) => string; + + message: string; + missingRef: string; + missingSchema: string; + } +} + +declare namespace ajv { + type ValidationError = AjvErrors.ValidationError; + + type MissingRefError = AjvErrors.MissingRefError; + + interface Ajv { + /** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key, [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize by default). + * @param {string|object|Boolean} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ + validate(schemaKeyRef: object | string | boolean, data: any): boolean | PromiseLike; + /** + * Create validating function for passed schema. + * @param {object|Boolean} schema schema object + * @return {Function} validating function + */ + compile(schema: object | boolean): ValidateFunction; + /** + * Creates validating function for passed schema with asynchronous loading of missing schemas. + * `loadSchema` option should be a function that accepts schema uri and node-style callback. + * @this Ajv + * @param {object|Boolean} schema schema object + * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped + * @param {Function} callback optional node-style callback, it is always called with 2 parameters: error (or null) and validating function. + * @return {PromiseLike} validating function + */ + compileAsync(schema: object | boolean, meta?: Boolean, callback?: (err: Error, validate: ValidateFunction) => any): PromiseLike; + /** + * Adds schema to the instance. + * @param {object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {string} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @return {Ajv} this for method chaining + */ + addSchema(schema: Array | object, key?: string): Ajv; + /** + * Add schema that will be used to validate other schemas + * options in META_IGNORE_OPTIONS are alway set to false + * @param {object} schema schema object + * @param {string} key optional schema key + * @return {Ajv} this for method chaining + */ + addMetaSchema(schema: object, key?: string): Ajv; + /** + * Validate schema + * @param {object|Boolean} schema schema to validate + * @return {Boolean} true if schema is valid + */ + validateSchema(schema: object | boolean): boolean; + /** + * Get compiled schema from the instance by `key` or `ref`. + * @param {string} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id). + * @return {Function} schema validating function (with property `schema`). + */ + getSchema(keyRef: string): ValidateFunction; + /** + * Remove cached schema(s). + * If no parameter is passed all schemas but meta-schemas are removed. + * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + * Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + * @param {string|object|RegExp|Boolean} schemaKeyRef key, ref, pattern to match key/ref or schema object + * @return {Ajv} this for method chaining + */ + removeSchema(schemaKeyRef?: object | string | RegExp | boolean): Ajv; + /** + * Add custom format + * @param {string} name format name + * @param {string|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid) + * @return {Ajv} this for method chaining + */ + addFormat(name: string, format: FormatValidator | FormatDefinition): Ajv; + /** + * Define custom keyword + * @this Ajv + * @param {string} keyword custom keyword, should be a valid identifier, should be different from all standard, custom and macro keywords. + * @param {object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + * @return {Ajv} this for method chaining + */ + addKeyword(keyword: string, definition: KeywordDefinition): Ajv; + /** + * Get keyword definition + * @this Ajv + * @param {string} keyword pre-defined or custom keyword. + * @return {object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise. + */ + getKeyword(keyword: string): object | boolean; + /** + * Remove keyword + * @this Ajv + * @param {string} keyword pre-defined or custom keyword. + * @return {Ajv} this for method chaining + */ + removeKeyword(keyword: string): Ajv; + /** + * Validate keyword + * @this Ajv + * @param {object} definition keyword definition object + * @param {boolean} throwError true to throw exception if definition is invalid + * @return {boolean} validation result + */ + validateKeyword(definition: KeywordDefinition, throwError: boolean): boolean; + /** + * Convert array of error message objects to string + * @param {Array} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {object} options optional options with properties `separator` and `dataVar`. + * @return {string} human readable string with all errors descriptions + */ + errorsText(errors?: Array | null, options?: ErrorsTextOptions): string; + errors?: Array | null; + } + + interface CustomLogger { + log(...args: any[]): any; + warn(...args: any[]): any; + error(...args: any[]): any; + } + + interface ValidateFunction { + ( + data: any, + dataPath?: string, + parentData?: object | Array, + parentDataProperty?: string | number, + rootData?: object | Array + ): boolean | PromiseLike; + schema?: object | boolean; + errors?: null | Array; + refs?: object; + refVal?: Array; + root?: ValidateFunction | object; + $async?: true; + source?: object; + } + + interface Options { + $data?: boolean; + allErrors?: boolean; + verbose?: boolean; + jsonPointers?: boolean; + uniqueItems?: boolean; + unicode?: boolean; + format?: string; + formats?: object; + unknownFormats?: true | string[] | 'ignore'; + schemas?: Array | object; + schemaId?: '$id' | 'id' | 'auto'; + missingRefs?: true | 'ignore' | 'fail'; + extendRefs?: true | 'ignore' | 'fail'; + loadSchema?: (uri: string, cb?: (err: Error, schema: object) => void) => PromiseLike; + removeAdditional?: boolean | 'all' | 'failing'; + useDefaults?: boolean | 'empty' | 'shared'; + coerceTypes?: boolean | 'array'; + strictDefaults?: boolean | 'log'; + strictKeywords?: boolean | 'log'; + async?: boolean | string; + transpile?: string | ((code: string) => string); + meta?: boolean | object; + validateSchema?: boolean | 'log'; + addUsedSchema?: boolean; + inlineRefs?: boolean | number; + passContext?: boolean; + loopRequired?: number; + ownProperties?: boolean; + multipleOfPrecision?: boolean | number; + errorDataPath?: string, + messages?: boolean; + sourceCode?: boolean; + processCode?: (code: string) => string; + cache?: object; + logger?: CustomLogger | false; + nullable?: boolean; + serialize?: ((schema: object | boolean) => any) | false; + } + + type FormatValidator = string | RegExp | ((data: string) => boolean | PromiseLike); + type NumberFormatValidator = ((data: number) => boolean | PromiseLike); + + interface NumberFormatDefinition { + type: "number", + validate: NumberFormatValidator; + compare?: (data1: number, data2: number) => number; + async?: boolean; + } + + interface StringFormatDefinition { + type?: "string", + validate: FormatValidator; + compare?: (data1: string, data2: string) => number; + async?: boolean; + } + + type FormatDefinition = NumberFormatDefinition | StringFormatDefinition; + + interface KeywordDefinition { + type?: string | Array; + async?: boolean; + $data?: boolean; + errors?: boolean | string; + metaSchema?: object; + // schema: false makes validate not to expect schema (ValidateFunction) + schema?: boolean; + statements?: boolean; + dependencies?: Array; + modifying?: boolean; + valid?: boolean; + // one and only one of the following properties should be present + validate?: SchemaValidateFunction | ValidateFunction; + compile?: (schema: any, parentSchema: object, it: CompilationContext) => ValidateFunction; + macro?: (schema: any, parentSchema: object, it: CompilationContext) => object | boolean; + inline?: (it: CompilationContext, keyword: string, schema: any, parentSchema: object) => string; + } + + interface CompilationContext { + level: number; + dataLevel: number; + schema: any; + schemaPath: string; + baseId: string; + async: boolean; + opts: Options; + formats: { + [index: string]: FormatDefinition | undefined; + }; + compositeRule: boolean; + validate: (schema: object) => boolean; + util: { + copy(obj: any, target?: any): any; + toHash(source: string[]): { [index: string]: true | undefined }; + equal(obj: any, target: any): boolean; + getProperty(str: string): string; + schemaHasRules(schema: object, rules: any): string; + escapeQuotes(str: string): string; + toQuotedString(str: string): string; + getData(jsonPointer: string, dataLevel: number, paths: string[]): string; + escapeJsonPointer(str: string): string; + unescapeJsonPointer(str: string): string; + escapeFragment(str: string): string; + unescapeFragment(str: string): string; + }; + self: Ajv; + } + + interface SchemaValidateFunction { + ( + schema: any, + data: any, + parentSchema?: object, + dataPath?: string, + parentData?: object | Array, + parentDataProperty?: string | number, + rootData?: object | Array + ): boolean | PromiseLike; + errors?: Array; + } + + interface ErrorsTextOptions { + separator?: string; + dataVar?: string; + } + + interface ErrorObject { + keyword: string; + dataPath: string; + schemaPath: string; + params: ErrorParameters; + // Added to validation errors of propertyNames keyword schema + propertyName?: string; + // Excluded if messages set to false. + message?: string; + // These are added with the `verbose` option. + schema?: any; + parentSchema?: object; + data?: any; + } + + type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams | + DependenciesParams | FormatParams | ComparisonParams | + MultipleOfParams | PatternParams | RequiredParams | + TypeParams | UniqueItemsParams | CustomParams | + PatternRequiredParams | PropertyNamesParams | + IfParams | SwitchParams | NoParams | EnumParams; + + interface RefParams { + ref: string; + } + + interface LimitParams { + limit: number; + } + + interface AdditionalPropertiesParams { + additionalProperty: string; + } + + interface DependenciesParams { + property: string; + missingProperty: string; + depsCount: number; + deps: string; + } + + interface FormatParams { + format: string + } + + interface ComparisonParams { + comparison: string; + limit: number | string; + exclusive: boolean; + } + + interface MultipleOfParams { + multipleOf: number; + } + + interface PatternParams { + pattern: string; + } + + interface RequiredParams { + missingProperty: string; + } + + interface TypeParams { + type: string; + } + + interface UniqueItemsParams { + i: number; + j: number; + } + + interface CustomParams { + keyword: string; + } + + interface PatternRequiredParams { + missingPattern: string; + } + + interface PropertyNamesParams { + propertyName: string; + } + + interface IfParams { + failingKeyword: string; + } + + interface SwitchParams { + caseIndex: number; + } + + interface NoParams { } + + interface EnumParams { + allowedValues: Array; + } +} + +export = ajv; diff --git a/node_modules/ajv/lib/ajv.js b/node_modules/ajv/lib/ajv.js new file mode 100644 index 0000000..611b938 --- /dev/null +++ b/node_modules/ajv/lib/ajv.js @@ -0,0 +1,497 @@ +'use strict'; + +var compileSchema = require('./compile') + , resolve = require('./compile/resolve') + , Cache = require('./cache') + , SchemaObject = require('./compile/schema_obj') + , stableStringify = require('fast-json-stable-stringify') + , formats = require('./compile/formats') + , rules = require('./compile/rules') + , $dataMetaSchema = require('./data') + , util = require('./compile/util'); + +module.exports = Ajv; + +Ajv.prototype.validate = validate; +Ajv.prototype.compile = compile; +Ajv.prototype.addSchema = addSchema; +Ajv.prototype.addMetaSchema = addMetaSchema; +Ajv.prototype.validateSchema = validateSchema; +Ajv.prototype.getSchema = getSchema; +Ajv.prototype.removeSchema = removeSchema; +Ajv.prototype.addFormat = addFormat; +Ajv.prototype.errorsText = errorsText; + +Ajv.prototype._addSchema = _addSchema; +Ajv.prototype._compile = _compile; + +Ajv.prototype.compileAsync = require('./compile/async'); +var customKeyword = require('./keyword'); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.prototype.validateKeyword = customKeyword.validate; + +var errorClasses = require('./compile/error_classes'); +Ajv.ValidationError = errorClasses.Validation; +Ajv.MissingRefError = errorClasses.MissingRef; +Ajv.$dataMetaSchema = $dataMetaSchema; + +var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ]; +var META_SUPPORT_DATA = ['/properties']; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + opts = this._opts = util.copy(opts) || {}; + setLogger(this); + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + this._getId = chooseGetId(opts); + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + if (opts.serialize === undefined) opts.serialize = stableStringify; + this._metaOpts = getMetaSchemaOptions(this); + + if (opts.formats) addInitialFormats(this); + addDefaultMetaSchema(this); + if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); + if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}}); + addInitialSchemas(this); +} + + + +/** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize. + * @this Ajv + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ +function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = this.getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); + } else { + var schemaObj = this._addSchema(schemaKeyRef); + v = schemaObj.validate || this._compile(schemaObj); + } + + var valid = v(data); + if (v.$async !== true) this.errors = v.errors; + return valid; +} + + +/** + * Create validating function for passed schema. + * @this Ajv + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ +function compile(schema, _meta) { + var schemaObj = this._addSchema(schema, undefined, _meta); + return schemaObj.validate || this._compile(schemaObj); +} + + +/** + * Adds schema to the instance. + * @this Ajv + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + * @return {Ajv} this for method chaining + */ +function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ +function errorsText(errors, options) { + errors = errors || this.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; +// For the source: https://gist.github.com/dperini/729294 +// For test cases: https://mathiasbynens.be/demo/url-regex +// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. +// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; +var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; +var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; +var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; +var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; +var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; + + +module.exports = formats; + +function formats(mode) { + mode = mode == 'full' ? 'full' : 'fast'; + return util.copy(formats[mode]); +} + + +formats.fast = { + // date: http://tools.ietf.org/html/rfc3339#section-5.6 + date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 + time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, + 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js + uri: /^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i, + 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, + 'uri-template': URITEMPLATE, + url: URL, + // email (sources from jsen validator): + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') + email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, + hostname: HOSTNAME, + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + // uuid: http://tools.ietf.org/html/rfc4122 + uuid: UUID, + // JSON-pointer: https://tools.ietf.org/html/rfc6901 + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +formats.full = { + date: date, + time: time, + 'date-time': date_time, + uri: uri, + 'uri-reference': URIREF, + 'uri-template': URITEMPLATE, + url: URL, + email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: hostname, + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex: regex, + uuid: UUID, + 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, + 'relative-json-pointer': RELATIVE_JSON_POINTER +}; + + +function isLeapYear(year) { + // https://tools.ietf.org/html/rfc3339#appendix-C + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} + + +function date(str) { + // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 + var matches = str.match(DATE); + if (!matches) return false; + + var year = +matches[1]; + var month = +matches[2]; + var day = +matches[3]; + + return month >= 1 && month <= 12 && day >= 1 && + day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return ((hour <= 23 && minute <= 59 && second <= 59) || + (hour == 23 && minute == 59 && second == 60)) && + (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +function hostname(str) { + // https://tools.ietf.org/html/rfc1034#section-3.5 + // https://tools.ietf.org/html/rfc1123#section-2 + return str.length <= 255 && HOSTNAME.test(str); +} + + +var NOT_URI_FRAGMENT = /\/|:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +var Z_ANCHOR = /[^\\]\\Z/; +function regex(str) { + if (Z_ANCHOR.test(str)) return false; + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} diff --git a/node_modules/ajv/lib/compile/index.js b/node_modules/ajv/lib/compile/index.js new file mode 100644 index 0000000..f4d3f0d --- /dev/null +++ b/node_modules/ajv/lib/compile/index.js @@ -0,0 +1,387 @@ +'use strict'; + +var resolve = require('./resolve') + , util = require('./util') + , errorClasses = require('./error_classes') + , stableStringify = require('fast-json-stable-stringify'); + +var validateGenerator = require('../dotjs/validate'); + +/** + * Functions below are used inside compiled validations function + */ + +var ucs2length = util.ucs2length; +var equal = require('fast-deep-equal'); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = errorClasses.Validation; + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = []; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (opts.sourceCode) cv.source = v.source; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + /* @this {*} - custom context, see passContext option */ + function callValidate() { + /* jshint validthis: true */ + var validate = compilation.validate; + var result = validate.apply(this, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + MissingRefError: errorClasses.MissingRef, + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + logger: self.logger, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.processCode) sourceCode = opts.processCode(sourceCode); + // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); + var validate; + try { + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'equal', + 'ucs2length', + 'ValidationError', + sourceCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + self.logger.error('Error compiling schema, function code:', sourceCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (opts.sourceCode === true) { + validate.source = { + code: sourceCode, + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (v === undefined) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); + } + } + + if (v === undefined) { + removeLocalRef(ref); + } else { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); + } + } + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function removeLocalRef(ref) { + delete refs[ref]; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' || typeof refVal == 'boolean' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && !!refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; + } + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; + } + } + + function useCustomRule(rule, schema, parentSchema, it) { + if (self._opts.validateSchema !== false) { + var deps = rule.definition.dependencies; + if (deps && !deps.every(function(keyword) { + return Object.prototype.hasOwnProperty.call(parentSchema, keyword); + })) + throw new Error('parent schema must have all required keywords: ' + deps.join(',')); + + var validateSchema = rule.definition.validateSchema; + if (validateSchema) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') self.logger.error(message); + else throw new Error(message); + } + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); + } else { + validate = rule.definition.validate; + if (!validate) return; + } + + if (validate === undefined) + throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; + } +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; diff --git a/node_modules/ajv/lib/compile/util.js b/node_modules/ajv/lib/compile/util.js new file mode 100644 index 0000000..0efa001 --- /dev/null +++ b/node_modules/ajv/lib/compile/util.js @@ -0,0 +1,274 @@ +'use strict'; + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + equal: require('fast-deep-equal'), + ucs2length: require('./ucs2length'), + varOccurences: varOccurences, + varReplace: varReplace, + cleanUpCode: cleanUpCode, + finalCleanUpCode: finalCleanUpCode, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + schemaUnknownRules: schemaUnknownRules, + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + unescapeJsonPointer: unescapeJsonPointer, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i' + , $notOp = $isMax ? '>' : '<' + , $errorKeyword = undefined; +}} + +{{? $isDataExcl }} + {{ + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) + , $exclusive = 'exclusive' + $lvl + , $exclType = 'exclType' + $lvl + , $exclIsNumber = 'exclIsNumber' + $lvl + , $opExpr = 'op' + $lvl + , $opStr = '\' + ' + $opExpr + ' + \''; + }} + var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; + {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} + + var {{=$exclusive}}; + var {{=$exclType}} = typeof {{=$schemaValueExcl}}; + if ({{=$exclType}} != 'boolean' && {{=$exclType}} != 'undefined' && {{=$exclType}} != 'number') { + {{ var $errorKeyword = $exclusiveKeyword; }} + {{# def.error:'_exclusiveLimit' }} + } else if ({{# def.$dataNotType:'number' }} + {{=$exclType}} == 'number' + ? ( + ({{=$exclusive}} = {{=$schemaValue}} === undefined || {{=$schemaValueExcl}} {{=$op}}= {{=$schemaValue}}) + ? {{=$data}} {{=$notOp}}= {{=$schemaValueExcl}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}} + ) + : ( + ({{=$exclusive}} = {{=$schemaValueExcl}} === true) + ? {{=$data}} {{=$notOp}}= {{=$schemaValue}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}} + ) + || {{=$data}} !== {{=$data}}) { + var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}='; + {{ + if ($schema === undefined) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } + }} +{{??}} + {{ + var $exclIsNumber = typeof $schemaExcl == 'number' + , $opStr = $op; /*used in error*/ + }} + + {{? $exclIsNumber && $isData }} + {{ var $opExpr = '\'' + $opStr + '\''; /*used in error*/ }} + if ({{# def.$dataNotType:'number' }} + ( {{=$schemaValue}} === undefined + || {{=$schemaExcl}} {{=$op}}= {{=$schemaValue}} + ? {{=$data}} {{=$notOp}}= {{=$schemaExcl}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}} ) + || {{=$data}} !== {{=$data}}) { + {{??}} + {{ + if ($exclIsNumber && $schema === undefined) { + {{# def.setExclusiveLimit }} + $schemaValue = $schemaExcl; + $notOp += '='; + } else { + if ($exclIsNumber) + $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); + + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + {{# def.setExclusiveLimit }} + $notOp += '='; + } else { + $exclusive = false; + $opStr += '='; + } + } + + var $opExpr = '\'' + $opStr + '\''; /*used in error*/ + }} + + if ({{# def.$dataNotType:'number' }} + {{=$data}} {{=$notOp}} {{=$schemaValue}} + || {{=$data}} !== {{=$data}}) { + {{?}} +{{?}} + {{ $errorKeyword = $errorKeyword || $keyword; }} + {{# def.error:'_limit' }} + } {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/_limitItems.jst b/node_modules/ajv/lib/dot/_limitItems.jst new file mode 100644 index 0000000..a3e078e --- /dev/null +++ b/node_modules/ajv/lib/dot/_limitItems.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitItems' }} +} {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/_limitLength.jst b/node_modules/ajv/lib/dot/_limitLength.jst new file mode 100644 index 0000000..cfc8dbb --- /dev/null +++ b/node_modules/ajv/lib/dot/_limitLength.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $op = $keyword == 'maxLength' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} {{# def.strLength }} {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitLength' }} +} {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/_limitProperties.jst b/node_modules/ajv/lib/dot/_limitProperties.jst new file mode 100644 index 0000000..da7ea77 --- /dev/null +++ b/node_modules/ajv/lib/dot/_limitProperties.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitProperties' }} +} {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/allOf.jst b/node_modules/ajv/lib/dot/allOf.jst new file mode 100644 index 0000000..4c28363 --- /dev/null +++ b/node_modules/ajv/lib/dot/allOf.jst @@ -0,0 +1,34 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $currentBaseId = $it.baseId + , $allSchemasEmpty = true; +}} + +{{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{ + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + + {{# def.ifResultValid }} + {{?}} +{{~}} + +{{? $breakOnError }} + {{? $allSchemasEmpty }} + if (true) { + {{??}} + {{= $closingBraces.slice(0,-1) }} + {{?}} +{{?}} + +{{# def.cleanUp }} diff --git a/node_modules/ajv/lib/dot/anyOf.jst b/node_modules/ajv/lib/dot/anyOf.jst new file mode 100644 index 0000000..086cf2b --- /dev/null +++ b/node_modules/ajv/lib/dot/anyOf.jst @@ -0,0 +1,48 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $noEmptySchema = $schema.every(function($sch) { + return {{# def.nonEmptySchema:$sch }}; + }); +}} +{{? $noEmptySchema }} + {{ var $currentBaseId = $it.baseId; }} + var {{=$errs}} = errors; + var {{=$valid}} = false; + + {{# def.setCompositeRule }} + + {{~ $schema:$sch:$i }} + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + + {{=$valid}} = {{=$valid}} || {{=$nextValid}}; + + if (!{{=$valid}}) { + {{ $closingBraces += '}'; }} + {{~}} + + {{# def.resetCompositeRule }} + + {{= $closingBraces }} + + if (!{{=$valid}}) { + {{# def.extraError:'anyOf' }} + } else { + {{# def.resetErrors }} + {{? it.opts.allErrors }} } {{?}} + + {{# def.cleanUp }} +{{??}} + {{? $breakOnError }} + if (true) { + {{?}} +{{?}} diff --git a/node_modules/ajv/lib/dot/coerce.def b/node_modules/ajv/lib/dot/coerce.def new file mode 100644 index 0000000..86e0e18 --- /dev/null +++ b/node_modules/ajv/lib/dot/coerce.def @@ -0,0 +1,61 @@ +{{## def.coerceType: + {{ + var $dataType = 'dataType' + $lvl + , $coerced = 'coerced' + $lvl; + }} + var {{=$dataType}} = typeof {{=$data}}; + {{? it.opts.coerceTypes == 'array'}} + if ({{=$dataType}} == 'object' && Array.isArray({{=$data}})) {{=$dataType}} = 'array'; + {{?}} + + var {{=$coerced}} = undefined; + + {{ var $bracesCoercion = ''; }} + {{~ $coerceToTypes:$type:$i }} + {{? $i }} + if ({{=$coerced}} === undefined) { + {{ $bracesCoercion += '}'; }} + {{?}} + + {{? it.opts.coerceTypes == 'array' && $type != 'array' }} + if ({{=$dataType}} == 'array' && {{=$data}}.length == 1) { + {{=$coerced}} = {{=$data}} = {{=$data}}[0]; + {{=$dataType}} = typeof {{=$data}}; + /*if ({{=$dataType}} == 'object' && Array.isArray({{=$data}})) {{=$dataType}} = 'array';*/ + } + {{?}} + + {{? $type == 'string' }} + if ({{=$dataType}} == 'number' || {{=$dataType}} == 'boolean') + {{=$coerced}} = '' + {{=$data}}; + else if ({{=$data}} === null) {{=$coerced}} = ''; + {{?? $type == 'number' || $type == 'integer' }} + if ({{=$dataType}} == 'boolean' || {{=$data}} === null + || ({{=$dataType}} == 'string' && {{=$data}} && {{=$data}} == +{{=$data}} + {{? $type == 'integer' }} && !({{=$data}} % 1){{?}})) + {{=$coerced}} = +{{=$data}}; + {{?? $type == 'boolean' }} + if ({{=$data}} === 'false' || {{=$data}} === 0 || {{=$data}} === null) + {{=$coerced}} = false; + else if ({{=$data}} === 'true' || {{=$data}} === 1) + {{=$coerced}} = true; + {{?? $type == 'null' }} + if ({{=$data}} === '' || {{=$data}} === 0 || {{=$data}} === false) + {{=$coerced}} = null; + {{?? it.opts.coerceTypes == 'array' && $type == 'array' }} + if ({{=$dataType}} == 'string' || {{=$dataType}} == 'number' || {{=$dataType}} == 'boolean' || {{=$data}} == null) + {{=$coerced}} = [{{=$data}}]; + {{?}} + {{~}} + + {{= $bracesCoercion }} + + if ({{=$coerced}} === undefined) { + {{# def.error:'type' }} + } else { + {{# def.setParentData }} + {{=$data}} = {{=$coerced}}; + {{? !$dataLvl }}if ({{=$parentData}} !== undefined){{?}} + {{=$parentData}}[{{=$parentDataProperty}}] = {{=$coerced}}; + } +#}} diff --git a/node_modules/ajv/lib/dot/comment.jst b/node_modules/ajv/lib/dot/comment.jst new file mode 100644 index 0000000..f959150 --- /dev/null +++ b/node_modules/ajv/lib/dot/comment.jst @@ -0,0 +1,9 @@ +{{# def.definitions }} +{{# def.setupKeyword }} + +{{ var $comment = it.util.toQuotedString($schema); }} +{{? it.opts.$comment === true }} + console.log({{=$comment}}); +{{?? typeof it.opts.$comment == 'function' }} + self._opts.$comment({{=$comment}}, {{=it.util.toQuotedString($errSchemaPath)}}, validate.root.schema); +{{?}} diff --git a/node_modules/ajv/lib/dot/const.jst b/node_modules/ajv/lib/dot/const.jst new file mode 100644 index 0000000..2aa2298 --- /dev/null +++ b/node_modules/ajv/lib/dot/const.jst @@ -0,0 +1,11 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{? !$isData }} + var schema{{=$lvl}} = validate.schema{{=$schemaPath}}; +{{?}} +var {{=$valid}} = equal({{=$data}}, schema{{=$lvl}}); +{{# def.checkError:'const' }} +{{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/contains.jst b/node_modules/ajv/lib/dot/contains.jst new file mode 100644 index 0000000..925d2c8 --- /dev/null +++ b/node_modules/ajv/lib/dot/contains.jst @@ -0,0 +1,57 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{ + var $idx = 'i' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $currentBaseId = it.baseId + , $nonEmptySchema = {{# def.nonEmptySchema:$schema }}; +}} + +var {{=$errs}} = errors; +var {{=$valid}}; + +{{? $nonEmptySchema }} + {{# def.setCompositeRule }} + + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + var {{=$nextValid}} = false; + + for (var {{=$idx}} = 0; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + if ({{=$nextValid}}) break; + } + + {{# def.resetCompositeRule }} + {{= $closingBraces }} + + if (!{{=$nextValid}}) { +{{??}} + if ({{=$data}}.length == 0) { +{{?}} + + {{# def.error:'contains' }} + } else { + {{? $nonEmptySchema }} + {{# def.resetErrors }} + {{?}} + {{? it.opts.allErrors }} } {{?}} + +{{# def.cleanUp }} diff --git a/node_modules/ajv/lib/dot/custom.jst b/node_modules/ajv/lib/dot/custom.jst new file mode 100644 index 0000000..d30588f --- /dev/null +++ b/node_modules/ajv/lib/dot/custom.jst @@ -0,0 +1,191 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $rule = this + , $definition = 'definition' + $lvl + , $rDef = $rule.definition + , $closingBraces = ''; + var $validate = $rDef.validate; + var $compile, $inline, $macro, $ruleValidate, $validateCode; +}} + +{{? $isData && $rDef.$data }} + {{ + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + }} + var {{=$definition}} = RULES.custom['{{=$keyword}}'].definition; + var {{=$validateCode}} = {{=$definition}}.validate; +{{??}} + {{ + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + if (!$ruleValidate) return; + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + }} +{{?}} + +{{ + var $ruleErrs = $validateCode + '.errors' + , $i = 'i' + $lvl + , $ruleErr = 'ruleErr' + $lvl + , $asyncKeyword = $rDef.async; + + if ($asyncKeyword && !it.async) + throw new Error('async keyword in sync schema'); +}} + + +{{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}} +var {{=$errs}} = errors; +var {{=$valid}}; + +{{## def.callRuleValidate: + {{=$validateCode}}.call( + {{? it.opts.passContext }}this{{??}}self{{?}} + {{? $compile || $rDef.schema === false }} + , {{=$data}} + {{??}} + , {{=$schemaValue}} + , {{=$data}} + , validate.schema{{=it.schemaPath}} + {{?}} + , {{# def.dataPath }} + {{# def.passParentData }} + , rootData + ) +#}} + +{{## def.extendErrors:_inline: + for (var {{=$i}}={{=$errs}}; {{=$i}} 0 + : it.util.schemaHasRules(_schema, it.RULES.all)) +#}} + + +{{## def.strLength: + {{? it.opts.unicode === false }} + {{=$data}}.length + {{??}} + ucs2length({{=$data}}) + {{?}} +#}} + + +{{## def.willOptimize: + it.util.varOccurences($code, $nextData) < 2 +#}} + + +{{## def.generateSubschemaCode: + {{ + var $code = it.validate($it); + $it.baseId = $currentBaseId; + }} +#}} + + +{{## def.insertSubschemaCode: + {{= it.validate($it) }} + {{ $it.baseId = $currentBaseId; }} +#}} + + +{{## def._optimizeValidate: + it.util.varReplace($code, $nextData, $passData) +#}} + + +{{## def.optimizeValidate: + {{? {{# def.willOptimize}} }} + {{= {{# def._optimizeValidate }} }} + {{??}} + var {{=$nextData}} = {{=$passData}}; + {{= $code }} + {{?}} +#}} + + +{{## def.cleanUp: {{ out = it.util.cleanUpCode(out); }} #}} + + +{{## def.finalCleanUp: {{ out = it.util.finalCleanUpCode(out, $async); }} #}} + + +{{## def.$data: + {{ + var $isData = it.opts.$data && $schema && $schema.$data + , $schemaValue; + }} + {{? $isData }} + var schema{{=$lvl}} = {{= it.util.getData($schema.$data, $dataLvl, it.dataPathArr) }}; + {{ $schemaValue = 'schema' + $lvl; }} + {{??}} + {{ $schemaValue = $schema; }} + {{?}} +#}} + + +{{## def.$dataNotType:_type: + {{?$isData}} ({{=$schemaValue}} !== undefined && typeof {{=$schemaValue}} != _type) || {{?}} +#}} + + +{{## def.check$dataIsArray: + if (schema{{=$lvl}} === undefined) {{=$valid}} = true; + else if (!Array.isArray(schema{{=$lvl}})) {{=$valid}} = false; + else { +#}} + + +{{## def.beginDefOut: + {{ + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + }} +#}} + + +{{## def.storeDefOut:_variable: + {{ + var _variable = out; + out = $$outStack.pop(); + }} +#}} + + +{{## def.dataPath:(dataPath || ''){{? it.errorPath != '""'}} + {{= it.errorPath }}{{?}}#}} + +{{## def.setParentData: + {{ + var $parentData = $dataLvl ? 'data' + (($dataLvl-1)||'') : 'parentData' + , $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + }} +#}} + +{{## def.passParentData: + {{# def.setParentData }} + , {{= $parentData }} + , {{= $parentDataProperty }} +#}} + + +{{## def.iterateProperties: + {{? $ownProperties }} + {{=$dataProperties}} = {{=$dataProperties}} || Object.keys({{=$data}}); + for (var {{=$idx}}=0; {{=$idx}}<{{=$dataProperties}}.length; {{=$idx}}++) { + var {{=$key}} = {{=$dataProperties}}[{{=$idx}}]; + {{??}} + for (var {{=$key}} in {{=$data}}) { + {{?}} +#}} + + +{{## def.noPropertyInData: + {{=$useData}} === undefined + {{? $ownProperties }} + || !{{# def.isOwnProperty }} + {{?}} +#}} + + +{{## def.isOwnProperty: + Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($propertyKey)}}') +#}} diff --git a/node_modules/ajv/lib/dot/dependencies.jst b/node_modules/ajv/lib/dot/dependencies.jst new file mode 100644 index 0000000..c41f334 --- /dev/null +++ b/node_modules/ajv/lib/dot/dependencies.jst @@ -0,0 +1,80 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.missing }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.propertyInData: + {{=$data}}{{= it.util.getProperty($property) }} !== undefined + {{? $ownProperties }} + && Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($property)}}') + {{?}} +#}} + + +{{ + var $schemaDeps = {} + , $propertyDeps = {} + , $ownProperties = it.opts.ownProperties; + + for ($property in $schema) { + var $sch = $schema[$property]; + var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; + $deps[$property] = $sch; + } +}} + +var {{=$errs}} = errors; + +{{ var $currentErrorPath = it.errorPath; }} + +var missing{{=$lvl}}; +{{ for (var $property in $propertyDeps) { }} + {{ $deps = $propertyDeps[$property]; }} + {{? $deps.length }} + if ({{# def.propertyInData }} + {{? $breakOnError }} + && ({{# def.checkMissingProperty:$deps }})) { + {{# def.errorMissingProperty:'dependencies' }} + {{??}} + ) { + {{~ $deps:$propertyKey }} + {{# def.allErrorsMissingProperty:'dependencies' }} + {{~}} + {{?}} + } {{# def.elseIfValid }} + {{?}} +{{ } }} + +{{ + it.errorPath = $currentErrorPath; + var $currentBaseId = $it.baseId; +}} + + +{{ for (var $property in $schemaDeps) { }} + {{ var $sch = $schemaDeps[$property]; }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{=$nextValid}} = true; + + if ({{# def.propertyInData }}) { + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + }} + + {{# def.insertSubschemaCode }} + } + + {{# def.ifResultValid }} + {{?}} +{{ } }} + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} + +{{# def.cleanUp }} diff --git a/node_modules/ajv/lib/dot/enum.jst b/node_modules/ajv/lib/dot/enum.jst new file mode 100644 index 0000000..357c2e8 --- /dev/null +++ b/node_modules/ajv/lib/dot/enum.jst @@ -0,0 +1,30 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $i = 'i' + $lvl + , $vSchema = 'schema' + $lvl; +}} + +{{? !$isData }} + var {{=$vSchema}} = validate.schema{{=$schemaPath}}; +{{?}} +var {{=$valid}}; + +{{?$isData}}{{# def.check$dataIsArray }}{{?}} + +{{=$valid}} = false; + +for (var {{=$i}}=0; {{=$i}}<{{=$vSchema}}.length; {{=$i}}++) + if (equal({{=$data}}, {{=$vSchema}}[{{=$i}}])) { + {{=$valid}} = true; + break; + } + +{{? $isData }} } {{?}} + +{{# def.checkError:'enum' }} + +{{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/errors.def b/node_modules/ajv/lib/dot/errors.def new file mode 100644 index 0000000..5c5752c --- /dev/null +++ b/node_modules/ajv/lib/dot/errors.def @@ -0,0 +1,194 @@ +{{# def.definitions }} + +{{## def._error:_rule: + {{ 'istanbul ignore else'; }} + {{? it.createErrors !== false }} + { + keyword: '{{= $errorKeyword || _rule }}' + , dataPath: (dataPath || '') + {{= it.errorPath }} + , schemaPath: {{=it.util.toQuotedString($errSchemaPath)}} + , params: {{# def._errorParams[_rule] }} + {{? it.opts.messages !== false }} + , message: {{# def._errorMessages[_rule] }} + {{?}} + {{? it.opts.verbose }} + , schema: {{# def._errorSchemas[_rule] }} + , parentSchema: validate.schema{{=it.schemaPath}} + , data: {{=$data}} + {{?}} + } + {{??}} + {} + {{?}} +#}} + + +{{## def._addError:_rule: + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; +#}} + + +{{## def.addError:_rule: + var err = {{# def._error:_rule }}; + {{# def._addError:_rule }} +#}} + + +{{## def.error:_rule: + {{# def.beginDefOut}} + {{# def._error:_rule }} + {{# def.storeDefOut:__err }} + + {{? !it.compositeRule && $breakOnError }} + {{ 'istanbul ignore if'; }} + {{? it.async }} + throw new ValidationError([{{=__err}}]); + {{??}} + validate.errors = [{{=__err}}]; + return false; + {{?}} + {{??}} + var err = {{=__err}}; + {{# def._addError:_rule }} + {{?}} +#}} + + +{{## def.extraError:_rule: + {{# def.addError:_rule}} + {{? !it.compositeRule && $breakOnError }} + {{ 'istanbul ignore if'; }} + {{? it.async }} + throw new ValidationError(vErrors); + {{??}} + validate.errors = vErrors; + return false; + {{?}} + {{?}} +#}} + + +{{## def.checkError:_rule: + if (!{{=$valid}}) { + {{# def.error:_rule }} + } +#}} + + +{{## def.resetErrors: + errors = {{=$errs}}; + if (vErrors !== null) { + if ({{=$errs}}) vErrors.length = {{=$errs}}; + else vErrors = null; + } +#}} + + +{{## def.concatSchema:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=$schema}}{{?}}#}} +{{## def.appendSchema:{{?$isData}}' + {{=$schemaValue}}{{??}}{{=$schemaValue}}'{{?}}#}} +{{## def.concatSchemaEQ:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=it.util.escapeQuotes($schema)}}{{?}}#}} + +{{## def._errorMessages = { + 'false schema': "'boolean schema is false'", + $ref: "'can\\\'t resolve reference {{=it.util.escapeQuotes($schema)}}'", + additionalItems: "'should NOT have more than {{=$schema.length}} items'", + additionalProperties: "'{{? it.opts._errorDataPathProperty }}is an invalid additional property{{??}}should NOT have additional properties{{?}}'", + anyOf: "'should match some schema in anyOf'", + const: "'should be equal to constant'", + contains: "'should contain a valid item'", + dependencies: "'should have {{? $deps.length == 1 }}property {{= it.util.escapeQuotes($deps[0]) }}{{??}}properties {{= it.util.escapeQuotes($deps.join(\", \")) }}{{?}} when property {{= it.util.escapeQuotes($property) }} is present'", + 'enum': "'should be equal to one of the allowed values'", + format: "'should match format \"{{#def.concatSchemaEQ}}\"'", + 'if': "'should match \"' + {{=$ifClause}} + '\" schema'", + _limit: "'should be {{=$opStr}} {{#def.appendSchema}}", + _exclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'", + _limitItems: "'should NOT have {{?$keyword=='maxItems'}}more{{??}}fewer{{?}} than {{#def.concatSchema}} items'", + _limitLength: "'should NOT be {{?$keyword=='maxLength'}}longer{{??}}shorter{{?}} than {{#def.concatSchema}} characters'", + _limitProperties:"'should NOT have {{?$keyword=='maxProperties'}}more{{??}}fewer{{?}} than {{#def.concatSchema}} properties'", + multipleOf: "'should be multiple of {{#def.appendSchema}}", + not: "'should NOT be valid'", + oneOf: "'should match exactly one schema in oneOf'", + pattern: "'should match pattern \"{{#def.concatSchemaEQ}}\"'", + propertyNames: "'property name \\'{{=$invalidName}}\\' is invalid'", + required: "'{{? it.opts._errorDataPathProperty }}is a required property{{??}}should have required property \\'{{=$missingProperty}}\\'{{?}}'", + type: "'should be {{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}'", + uniqueItems: "'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)'", + custom: "'should pass \"{{=$rule.keyword}}\" keyword validation'", + patternRequired: "'should have property matching pattern \\'{{=$missingPattern}}\\''", + switch: "'should pass \"switch\" keyword validation'", + _formatLimit: "'should be {{=$opStr}} \"{{#def.concatSchemaEQ}}\"'", + _formatExclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'" +} #}} + + +{{## def.schemaRefOrVal: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=$schema}}{{?}} #}} +{{## def.schemaRefOrQS: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}} + +{{## def._errorSchemas = { + 'false schema': "false", + $ref: "{{=it.util.toQuotedString($schema)}}", + additionalItems: "false", + additionalProperties: "false", + anyOf: "validate.schema{{=$schemaPath}}", + const: "validate.schema{{=$schemaPath}}", + contains: "validate.schema{{=$schemaPath}}", + dependencies: "validate.schema{{=$schemaPath}}", + 'enum': "validate.schema{{=$schemaPath}}", + format: "{{#def.schemaRefOrQS}}", + 'if': "validate.schema{{=$schemaPath}}", + _limit: "{{#def.schemaRefOrVal}}", + _exclusiveLimit: "validate.schema{{=$schemaPath}}", + _limitItems: "{{#def.schemaRefOrVal}}", + _limitLength: "{{#def.schemaRefOrVal}}", + _limitProperties:"{{#def.schemaRefOrVal}}", + multipleOf: "{{#def.schemaRefOrVal}}", + not: "validate.schema{{=$schemaPath}}", + oneOf: "validate.schema{{=$schemaPath}}", + pattern: "{{#def.schemaRefOrQS}}", + propertyNames: "validate.schema{{=$schemaPath}}", + required: "validate.schema{{=$schemaPath}}", + type: "validate.schema{{=$schemaPath}}", + uniqueItems: "{{#def.schemaRefOrVal}}", + custom: "validate.schema{{=$schemaPath}}", + patternRequired: "validate.schema{{=$schemaPath}}", + switch: "validate.schema{{=$schemaPath}}", + _formatLimit: "{{#def.schemaRefOrQS}}", + _formatExclusiveLimit: "validate.schema{{=$schemaPath}}" +} #}} + + +{{## def.schemaValueQS: {{?$isData}}{{=$schemaValue}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}} + +{{## def._errorParams = { + 'false schema': "{}", + $ref: "{ ref: '{{=it.util.escapeQuotes($schema)}}' }", + additionalItems: "{ limit: {{=$schema.length}} }", + additionalProperties: "{ additionalProperty: '{{=$additionalProperty}}' }", + anyOf: "{}", + const: "{ allowedValue: schema{{=$lvl}} }", + contains: "{}", + dependencies: "{ property: '{{= it.util.escapeQuotes($property) }}', missingProperty: '{{=$missingProperty}}', depsCount: {{=$deps.length}}, deps: '{{= it.util.escapeQuotes($deps.length==1 ? $deps[0] : $deps.join(\", \")) }}' }", + 'enum': "{ allowedValues: schema{{=$lvl}} }", + format: "{ format: {{#def.schemaValueQS}} }", + 'if': "{ failingKeyword: {{=$ifClause}} }", + _limit: "{ comparison: {{=$opExpr}}, limit: {{=$schemaValue}}, exclusive: {{=$exclusive}} }", + _exclusiveLimit: "{}", + _limitItems: "{ limit: {{=$schemaValue}} }", + _limitLength: "{ limit: {{=$schemaValue}} }", + _limitProperties:"{ limit: {{=$schemaValue}} }", + multipleOf: "{ multipleOf: {{=$schemaValue}} }", + not: "{}", + oneOf: "{ passingSchemas: {{=$passingSchemas}} }", + pattern: "{ pattern: {{#def.schemaValueQS}} }", + propertyNames: "{ propertyName: '{{=$invalidName}}' }", + required: "{ missingProperty: '{{=$missingProperty}}' }", + type: "{ type: '{{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}' }", + uniqueItems: "{ i: i, j: j }", + custom: "{ keyword: '{{=$rule.keyword}}' }", + patternRequired: "{ missingPattern: '{{=$missingPattern}}' }", + switch: "{ caseIndex: {{=$caseIndex}} }", + _formatLimit: "{ comparison: {{=$opExpr}}, limit: {{#def.schemaValueQS}}, exclusive: {{=$exclusive}} }", + _formatExclusiveLimit: "{}" +} #}} diff --git a/node_modules/ajv/lib/dot/format.jst b/node_modules/ajv/lib/dot/format.jst new file mode 100644 index 0000000..37f14da --- /dev/null +++ b/node_modules/ajv/lib/dot/format.jst @@ -0,0 +1,106 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} + +{{## def.skipFormat: + {{? $breakOnError }} if (true) { {{?}} + {{ return out; }} +#}} + +{{? it.opts.format === false }}{{# def.skipFormat }}{{?}} + + +{{# def.$data }} + + +{{## def.$dataCheckFormat: + {{# def.$dataNotType:'string' }} + ({{? $unknownFormats != 'ignore' }} + ({{=$schemaValue}} && !{{=$format}} + {{? $allowUnknown }} + && self._opts.unknownFormats.indexOf({{=$schemaValue}}) == -1 + {{?}}) || + {{?}} + ({{=$format}} && {{=$formatType}} == '{{=$ruleType}}' + && !(typeof {{=$format}} == 'function' + ? {{? it.async}} + (async{{=$lvl}} ? await {{=$format}}({{=$data}}) : {{=$format}}({{=$data}})) + {{??}} + {{=$format}}({{=$data}}) + {{?}} + : {{=$format}}.test({{=$data}})))) +#}} + +{{## def.checkFormat: + {{ + var $formatRef = 'formats' + it.util.getProperty($schema); + if ($isObject) $formatRef += '.validate'; + }} + {{? typeof $format == 'function' }} + {{=$formatRef}}({{=$data}}) + {{??}} + {{=$formatRef}}.test({{=$data}}) + {{?}} +#}} + + +{{ + var $unknownFormats = it.opts.unknownFormats + , $allowUnknown = Array.isArray($unknownFormats); +}} + +{{? $isData }} + {{ + var $format = 'format' + $lvl + , $isObject = 'isObject' + $lvl + , $formatType = 'formatType' + $lvl; + }} + var {{=$format}} = formats[{{=$schemaValue}}]; + var {{=$isObject}} = typeof {{=$format}} == 'object' + && !({{=$format}} instanceof RegExp) + && {{=$format}}.validate; + var {{=$formatType}} = {{=$isObject}} && {{=$format}}.type || 'string'; + if ({{=$isObject}}) { + {{? it.async}} + var async{{=$lvl}} = {{=$format}}.async; + {{?}} + {{=$format}} = {{=$format}}.validate; + } + if ({{# def.$dataCheckFormat }}) { +{{??}} + {{ var $format = it.formats[$schema]; }} + {{? !$format }} + {{? $unknownFormats == 'ignore' }} + {{ it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); }} + {{# def.skipFormat }} + {{?? $allowUnknown && $unknownFormats.indexOf($schema) >= 0 }} + {{# def.skipFormat }} + {{??}} + {{ throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); }} + {{?}} + {{?}} + {{ + var $isObject = typeof $format == 'object' + && !($format instanceof RegExp) + && $format.validate; + var $formatType = $isObject && $format.type || 'string'; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + }} + {{? $formatType != $ruleType }} + {{# def.skipFormat }} + {{?}} + {{? $async }} + {{ + if (!it.async) throw new Error('async format in sync schema'); + var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; + }} + if (!(await {{=$formatRef}}({{=$data}}))) { + {{??}} + if (!{{# def.checkFormat }}) { + {{?}} +{{?}} + {{# def.error:'format' }} + } {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/if.jst b/node_modules/ajv/lib/dot/if.jst new file mode 100644 index 0000000..7ccc9b7 --- /dev/null +++ b/node_modules/ajv/lib/dot/if.jst @@ -0,0 +1,75 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateIfClause:_clause: + {{ + $it.schema = it.schema['_clause']; + $it.schemaPath = it.schemaPath + '._clause'; + $it.errSchemaPath = it.errSchemaPath + '/_clause'; + }} + {{# def.insertSubschemaCode }} + {{=$valid}} = {{=$nextValid}}; + {{? $thenPresent && $elsePresent }} + {{ $ifClause = 'ifClause' + $lvl; }} + var {{=$ifClause}} = '_clause'; + {{??}} + {{ $ifClause = '\'_clause\''; }} + {{?}} +#}} + +{{ + var $thenSch = it.schema['then'] + , $elseSch = it.schema['else'] + , $thenPresent = $thenSch !== undefined && {{# def.nonEmptySchema:$thenSch }} + , $elsePresent = $elseSch !== undefined && {{# def.nonEmptySchema:$elseSch }} + , $currentBaseId = $it.baseId; +}} + +{{? $thenPresent || $elsePresent }} + {{ + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + var {{=$errs}} = errors; + var {{=$valid}} = true; + + {{# def.setCompositeRule }} + {{# def.insertSubschemaCode }} + {{ $it.createErrors = true; }} + {{# def.resetErrors }} + {{# def.resetCompositeRule }} + + {{? $thenPresent }} + if ({{=$nextValid}}) { + {{# def.validateIfClause:then }} + } + {{? $elsePresent }} + else { + {{?}} + {{??}} + if (!{{=$nextValid}}) { + {{?}} + + {{? $elsePresent }} + {{# def.validateIfClause:else }} + } + {{?}} + + if (!{{=$valid}}) { + {{# def.extraError:'if' }} + } + {{? $breakOnError }} else { {{?}} + + {{# def.cleanUp }} +{{??}} + {{? $breakOnError }} + if (true) { + {{?}} +{{?}} + diff --git a/node_modules/ajv/lib/dot/items.jst b/node_modules/ajv/lib/dot/items.jst new file mode 100644 index 0000000..8c0f5ac --- /dev/null +++ b/node_modules/ajv/lib/dot/items.jst @@ -0,0 +1,100 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateItems:startFrom: + for (var {{=$idx}} = {{=startFrom}}; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + {{? $breakOnError }} + if (!{{=$nextValid}}) break; + {{?}} + } +#}} + +{{ + var $idx = 'i' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $currentBaseId = it.baseId; +}} + +var {{=$errs}} = errors; +var {{=$valid}}; + +{{? Array.isArray($schema) }} + {{ /* 'items' is an array of schemas */}} + {{ var $additionalItems = it.schema.additionalItems; }} + {{? $additionalItems === false }} + {{=$valid}} = {{=$data}}.length <= {{= $schema.length }}; + {{ + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalItems'; + }} + {{# def.checkError:'additionalItems' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{# def.elseIfValid}} + {{?}} + + {{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{=$nextValid}} = true; + + if ({{=$data}}.length > {{=$i}}) { + {{ + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + } + + {{# def.ifResultValid }} + {{?}} + {{~}} + + {{? typeof $additionalItems == 'object' && {{# def.nonEmptySchema:$additionalItems }} }} + {{ + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + }} + {{=$nextValid}} = true; + + if ({{=$data}}.length > {{= $schema.length }}) { + {{# def.validateItems: $schema.length }} + } + + {{# def.ifResultValid }} + {{?}} + +{{?? {{# def.nonEmptySchema:$schema }} }} + {{ /* 'items' is a single schema */}} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + {{# def.validateItems: 0 }} +{{?}} + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} + +{{# def.cleanUp }} diff --git a/node_modules/ajv/lib/dot/missing.def b/node_modules/ajv/lib/dot/missing.def new file mode 100644 index 0000000..a73b9f9 --- /dev/null +++ b/node_modules/ajv/lib/dot/missing.def @@ -0,0 +1,39 @@ +{{## def.checkMissingProperty:_properties: + {{~ _properties:$propertyKey:$i }} + {{?$i}} || {{?}} + {{ + var $prop = it.util.getProperty($propertyKey) + , $useData = $data + $prop; + }} + ( ({{# def.noPropertyInData }}) && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) }}) ) + {{~}} +#}} + + +{{## def.errorMissingProperty:_error: + {{ + var $propertyPath = 'missing' + $lvl + , $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers + ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) + : $currentErrorPath + ' + ' + $propertyPath; + } + }} + {{# def.error:_error }} +#}} + + +{{## def.allErrorsMissingProperty:_error: + {{ + var $prop = it.util.getProperty($propertyKey) + , $missingProperty = it.util.escapeQuotes($propertyKey) + , $useData = $data + $prop; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + }} + if ({{# def.noPropertyInData }}) { + {{# def.addError:_error }} + } +#}} diff --git a/node_modules/ajv/lib/dot/multipleOf.jst b/node_modules/ajv/lib/dot/multipleOf.jst new file mode 100644 index 0000000..5f8dd33 --- /dev/null +++ b/node_modules/ajv/lib/dot/multipleOf.jst @@ -0,0 +1,20 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +var division{{=$lvl}}; +if ({{?$isData}} + {{=$schemaValue}} !== undefined && ( + typeof {{=$schemaValue}} != 'number' || + {{?}} + (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}}, + {{? it.opts.multipleOfPrecision }} + Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}} + {{??}} + division{{=$lvl}} !== parseInt(division{{=$lvl}}) + {{?}} + ) + {{?$isData}} ) {{?}} ) { + {{# def.error:'multipleOf' }} +} {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/not.jst b/node_modules/ajv/lib/dot/not.jst new file mode 100644 index 0000000..e03185a --- /dev/null +++ b/node_modules/ajv/lib/dot/not.jst @@ -0,0 +1,43 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{? {{# def.nonEmptySchema:$schema }} }} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + var {{=$errs}} = errors; + + {{# def.setCompositeRule }} + + {{ + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + }} + {{= it.validate($it) }} + {{ + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + }} + + {{# def.resetCompositeRule }} + + if ({{=$nextValid}}) { + {{# def.error:'not' }} + } else { + {{# def.resetErrors }} + {{? it.opts.allErrors }} } {{?}} +{{??}} + {{# def.addError:'not' }} + {{? $breakOnError}} + if (false) { + {{?}} +{{?}} diff --git a/node_modules/ajv/lib/dot/oneOf.jst b/node_modules/ajv/lib/dot/oneOf.jst new file mode 100644 index 0000000..bcce2c6 --- /dev/null +++ b/node_modules/ajv/lib/dot/oneOf.jst @@ -0,0 +1,54 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $currentBaseId = $it.baseId + , $prevValid = 'prevValid' + $lvl + , $passingSchemas = 'passingSchemas' + $lvl; +}} + +var {{=$errs}} = errors + , {{=$prevValid}} = false + , {{=$valid}} = false + , {{=$passingSchemas}} = null; + +{{# def.setCompositeRule }} + +{{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + {{??}} + var {{=$nextValid}} = true; + {{?}} + + {{? $i }} + if ({{=$nextValid}} && {{=$prevValid}}) { + {{=$valid}} = false; + {{=$passingSchemas}} = [{{=$passingSchemas}}, {{=$i}}]; + } else { + {{ $closingBraces += '}'; }} + {{?}} + + if ({{=$nextValid}}) { + {{=$valid}} = {{=$prevValid}} = true; + {{=$passingSchemas}} = {{=$i}}; + } +{{~}} + +{{# def.resetCompositeRule }} + +{{= $closingBraces }} + +if (!{{=$valid}}) { + {{# def.extraError:'oneOf' }} +} else { + {{# def.resetErrors }} +{{? it.opts.allErrors }} } {{?}} diff --git a/node_modules/ajv/lib/dot/pattern.jst b/node_modules/ajv/lib/dot/pattern.jst new file mode 100644 index 0000000..3a37ef6 --- /dev/null +++ b/node_modules/ajv/lib/dot/pattern.jst @@ -0,0 +1,14 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $regexp = $isData + ? '(new RegExp(' + $schemaValue + '))' + : it.usePattern($schema); +}} + +if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) { + {{# def.error:'pattern' }} +} {{? $breakOnError }} else { {{?}} diff --git a/node_modules/ajv/lib/dot/properties.jst b/node_modules/ajv/lib/dot/properties.jst new file mode 100644 index 0000000..862067e --- /dev/null +++ b/node_modules/ajv/lib/dot/properties.jst @@ -0,0 +1,244 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateAdditional: + {{ /* additionalProperties is schema */ + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty + ? it.errorPath + : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} +#}} + + +{{ + var $key = 'key' + $lvl + , $idx = 'idx' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $dataProperties = 'dataProperties' + $lvl; + + var $schemaKeys = Object.keys($schema || {}) + , $pProperties = it.schema.patternProperties || {} + , $pPropertyKeys = Object.keys($pProperties) + , $aProperties = it.schema.additionalProperties + , $someProperties = $schemaKeys.length || $pPropertyKeys.length + , $noAdditional = $aProperties === false + , $additionalIsSchema = typeof $aProperties == 'object' + && Object.keys($aProperties).length + , $removeAdditional = it.opts.removeAdditional + , $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional + , $ownProperties = it.opts.ownProperties + , $currentBaseId = it.baseId; + + var $required = it.schema.required; + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) + var $requiredHash = it.util.toHash($required); +}} + + +var {{=$errs}} = errors; +var {{=$nextValid}} = true; +{{? $ownProperties }} + var {{=$dataProperties}} = undefined; +{{?}} + +{{? $checkAdditional }} + {{# def.iterateProperties }} + {{? $someProperties }} + var isAdditional{{=$lvl}} = !(false + {{? $schemaKeys.length }} + {{? $schemaKeys.length > 8 }} + || validate.schema{{=$schemaPath}}.hasOwnProperty({{=$key}}) + {{??}} + {{~ $schemaKeys:$propertyKey }} + || {{=$key}} == {{= it.util.toQuotedString($propertyKey) }} + {{~}} + {{?}} + {{?}} + {{? $pPropertyKeys.length }} + {{~ $pPropertyKeys:$pProperty:$i }} + || {{= it.usePattern($pProperty) }}.test({{=$key}}) + {{~}} + {{?}} + ); + + if (isAdditional{{=$lvl}}) { + {{?}} + {{? $removeAdditional == 'all' }} + delete {{=$data}}[{{=$key}}]; + {{??}} + {{ + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + }} + {{? $noAdditional }} + {{? $removeAdditional }} + delete {{=$data}}[{{=$key}}]; + {{??}} + {{=$nextValid}} = false; + {{ + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + }} + {{# def.error:'additionalProperties' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{? $breakOnError }} break; {{?}} + {{?}} + {{?? $additionalIsSchema }} + {{? $removeAdditional == 'failing' }} + var {{=$errs}} = errors; + {{# def.setCompositeRule }} + + {{# def.validateAdditional }} + + if (!{{=$nextValid}}) { + errors = {{=$errs}}; + if (validate.errors !== null) { + if (errors) validate.errors.length = errors; + else validate.errors = null; + } + delete {{=$data}}[{{=$key}}]; + } + + {{# def.resetCompositeRule }} + {{??}} + {{# def.validateAdditional }} + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + {{?}} + {{?}} + {{ it.errorPath = $currentErrorPath; }} + {{?}} + {{? $someProperties }} + } + {{?}} + } + + {{# def.ifResultValid }} +{{?}} + +{{ var $useDefaults = it.opts.useDefaults && !it.compositeRule; }} + +{{? $schemaKeys.length }} + {{~ $schemaKeys:$propertyKey }} + {{ var $sch = $schema[$propertyKey]; }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + var $prop = it.util.getProperty($propertyKey) + , $passData = $data + $prop + , $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + }} + + {{# def.generateSubschemaCode }} + + {{? {{# def.willOptimize }} }} + {{ + $code = {{# def._optimizeValidate }}; + var $useData = $passData; + }} + {{??}} + {{ var $useData = $nextData; }} + var {{=$nextData}} = {{=$passData}}; + {{?}} + + {{? $hasDefault }} + {{= $code }} + {{??}} + {{? $requiredHash && $requiredHash[$propertyKey] }} + if ({{# def.noPropertyInData }}) { + {{=$nextValid}} = false; + {{ + var $currentErrorPath = it.errorPath + , $currErrSchemaPath = $errSchemaPath + , $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + }} + {{# def.error:'required' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{ it.errorPath = $currentErrorPath; }} + } else { + {{??}} + {{? $breakOnError }} + if ({{# def.noPropertyInData }}) { + {{=$nextValid}} = true; + } else { + {{??}} + if ({{=$useData}} !== undefined + {{? $ownProperties }} + && {{# def.isOwnProperty }} + {{?}} + ) { + {{?}} + {{?}} + + {{= $code }} + } + {{?}} {{ /* $hasDefault */ }} + {{?}} {{ /* def.nonEmptySchema */ }} + + {{# def.ifResultValid }} + {{~}} +{{?}} + +{{? $pPropertyKeys.length }} + {{~ $pPropertyKeys:$pProperty }} + {{ var $sch = $pProperties[$pProperty]; }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + + it.util.escapeFragment($pProperty); + }} + + {{# def.iterateProperties }} + if ({{= it.usePattern($pProperty) }}.test({{=$key}})) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + } + {{? $breakOnError }} else {{=$nextValid}} = true; {{?}} + } + + {{# def.ifResultValid }} + {{?}} {{ /* def.nonEmptySchema */ }} + {{~}} +{{?}} + + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} + +{{# def.cleanUp }} diff --git a/node_modules/ajv/lib/dot/propertyNames.jst b/node_modules/ajv/lib/dot/propertyNames.jst new file mode 100644 index 0000000..ee52b21 --- /dev/null +++ b/node_modules/ajv/lib/dot/propertyNames.jst @@ -0,0 +1,54 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +var {{=$errs}} = errors; + +{{? {{# def.nonEmptySchema:$schema }} }} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + {{ + var $key = 'key' + $lvl + , $idx = 'idx' + $lvl + , $i = 'i' + $lvl + , $invalidName = '\' + ' + $key + ' + \'' + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt + , $dataProperties = 'dataProperties' + $lvl + , $ownProperties = it.opts.ownProperties + , $currentBaseId = it.baseId; + }} + + {{? $ownProperties }} + var {{=$dataProperties}} = undefined; + {{?}} + {{# def.iterateProperties }} + var startErrs{{=$lvl}} = errors; + + {{ var $passData = $key; }} + {{# def.setCompositeRule }} + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + {{# def.resetCompositeRule }} + + if (!{{=$nextValid}}) { + for (var {{=$i}}=startErrs{{=$lvl}}; {{=$i}}= it.opts.loopRequired + , $ownProperties = it.opts.ownProperties; + }} + + {{? $breakOnError }} + var missing{{=$lvl}}; + {{? $loopRequired }} + {{# def.setupLoop }} + var {{=$valid}} = true; + + {{?$isData}}{{# def.check$dataIsArray }}{{?}} + + for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { + {{=$valid}} = {{=$data}}[{{=$vSchema}}[{{=$i}}]] !== undefined + {{? $ownProperties }} + && {{# def.isRequiredOwnProperty }} + {{?}}; + if (!{{=$valid}}) break; + } + + {{? $isData }} } {{?}} + + {{# def.checkError:'required' }} + else { + {{??}} + if ({{# def.checkMissingProperty:$required }}) { + {{# def.errorMissingProperty:'required' }} + } else { + {{?}} + {{??}} + {{? $loopRequired }} + {{# def.setupLoop }} + {{? $isData }} + if ({{=$vSchema}} && !Array.isArray({{=$vSchema}})) { + {{# def.addError:'required' }} + } else if ({{=$vSchema}} !== undefined) { + {{?}} + + for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { + if ({{=$data}}[{{=$vSchema}}[{{=$i}}]] === undefined + {{? $ownProperties }} + || !{{# def.isRequiredOwnProperty }} + {{?}}) { + {{# def.addError:'required' }} + } + } + + {{? $isData }} } {{?}} + {{??}} + {{~ $required:$propertyKey }} + {{# def.allErrorsMissingProperty:'required' }} + {{~}} + {{?}} + {{?}} + + {{ it.errorPath = $currentErrorPath; }} + +{{?? $breakOnError }} + if (true) { +{{?}} diff --git a/node_modules/ajv/lib/dot/uniqueItems.jst b/node_modules/ajv/lib/dot/uniqueItems.jst new file mode 100644 index 0000000..22f82f9 --- /dev/null +++ b/node_modules/ajv/lib/dot/uniqueItems.jst @@ -0,0 +1,62 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + + +{{? ($schema || $isData) && it.opts.uniqueItems !== false }} + {{? $isData }} + var {{=$valid}}; + if ({{=$schemaValue}} === false || {{=$schemaValue}} === undefined) + {{=$valid}} = true; + else if (typeof {{=$schemaValue}} != 'boolean') + {{=$valid}} = false; + else { + {{?}} + + var i = {{=$data}}.length + , {{=$valid}} = true + , j; + if (i > 1) { + {{ + var $itemType = it.schema.items && it.schema.items.type + , $typeIsArray = Array.isArray($itemType); + }} + {{? !$itemType || $itemType == 'object' || $itemType == 'array' || + ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0)) }} + outer: + for (;i--;) { + for (j = i; j--;) { + if (equal({{=$data}}[i], {{=$data}}[j])) { + {{=$valid}} = false; + break outer; + } + } + } + {{??}} + var itemIndices = {}, item; + for (;i--;) { + var item = {{=$data}}[i]; + {{ var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); }} + if ({{= it.util[$method]($itemType, 'item', true) }}) continue; + {{? $typeIsArray}} + if (typeof item == 'string') item = '"' + item; + {{?}} + if (typeof itemIndices[item] == 'number') { + {{=$valid}} = false; + j = itemIndices[item]; + break; + } + itemIndices[item] = i; + } + {{?}} + } + + {{? $isData }} } {{?}} + + if (!{{=$valid}}) { + {{# def.error:'uniqueItems' }} + } {{? $breakOnError }} else { {{?}} +{{??}} + {{? $breakOnError }} if (true) { {{?}} +{{?}} diff --git a/node_modules/ajv/lib/dot/validate.jst b/node_modules/ajv/lib/dot/validate.jst new file mode 100644 index 0000000..f8a1edf --- /dev/null +++ b/node_modules/ajv/lib/dot/validate.jst @@ -0,0 +1,282 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.defaults }} +{{# def.coerce }} + +{{ /** + * schema compilation (render) time: + * it = { schema, RULES, _validate, opts } + * it.validate - this template function, + * it is used recursively to generate code for subschemas + * + * runtime: + * "validate" is a variable name to which this function will be assigned + * validateRef etc. are defined in the parent scope in index.js + */ }} + +{{ + var $async = it.schema.$async === true + , $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref') + , $id = it.self._getId(it.schema); +}} + +{{ + if (it.opts.strictKeywords) { + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); + if ($unknownKwd) { + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); + else throw new Error($keywordsMsg); + } + } +}} + +{{? it.isTop }} + var validate = {{?$async}}{{it.async = true;}}async {{?}}function(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + {{? $id && (it.opts.sourceCode || it.opts.processCode) }} + {{= '/\*# sourceURL=' + $id + ' */' }} + {{?}} +{{?}} + +{{? typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref) }} + {{ var $keyword = 'false schema'; }} + {{# def.setupKeyword }} + {{? it.schema === false}} + {{? it.isTop}} + {{ $breakOnError = true; }} + {{??}} + var {{=$valid}} = false; + {{?}} + {{# def.error:'false schema' }} + {{??}} + {{? it.isTop}} + {{? $async }} + return data; + {{??}} + validate.errors = null; + return true; + {{?}} + {{??}} + var {{=$valid}} = true; + {{?}} + {{?}} + + {{? it.isTop}} + }; + return validate; + {{?}} + + {{ return out; }} +{{?}} + + +{{? it.isTop }} + {{ + var $top = it.isTop + , $lvl = it.level = 0 + , $dataLvl = it.dataLevel = 0 + , $data = 'data'; + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); + it.baseId = it.baseId || it.rootId; + delete it.isTop; + + it.dataPathArr = [undefined]; + + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored in the schema root'; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + }} + + var vErrors = null; {{ /* don't edit, used in replace */ }} + var errors = 0; {{ /* don't edit, used in replace */ }} + if (rootData === undefined) rootData = data; {{ /* don't edit, used in replace */ }} +{{??}} + {{ + var $lvl = it.level + , $dataLvl = it.dataLevel + , $data = 'data' + ($dataLvl || ''); + + if ($id) it.baseId = it.resolve.url(it.baseId, $id); + + if ($async && !it.async) throw new Error('async schema in sync schema'); + }} + + var errs_{{=$lvl}} = errors; +{{?}} + +{{ + var $valid = 'valid' + $lvl + , $breakOnError = !it.opts.allErrors + , $closingBraces1 = '' + , $closingBraces2 = ''; + + var $errorKeyword; + var $typeSchema = it.schema.type + , $typeIsArray = Array.isArray($typeSchema); + + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) + $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } + + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } +}} + +{{## def.checkType: + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type' + , $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + }} + + if ({{= it.util[$method]($typeSchema, $data, true) }}) { +#}} + +{{? it.schema.$ref && $refKeywords }} + {{? it.opts.extendRefs == 'fail' }} + {{ throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); }} + {{?? it.opts.extendRefs !== true }} + {{ + $refKeywords = false; + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + }} + {{?}} +{{?}} + +{{? it.schema.$comment && it.opts.$comment }} + {{= it.RULES.all.$comment.code(it, '$comment') }} +{{?}} + +{{? $typeSchema }} + {{? it.opts.coerceTypes }} + {{ var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); }} + {{?}} + + {{ var $rulesGroup = it.RULES.types[$typeSchema]; }} + {{? $coerceToTypes || $typeIsArray || $rulesGroup === true || + ($rulesGroup && !$shouldUseGroup($rulesGroup)) }} + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type'; + }} + {{# def.checkType }} + {{? $coerceToTypes }} + {{# def.coerceType }} + {{??}} + {{# def.error:'type' }} + {{?}} + } + {{?}} +{{?}} + + +{{? it.schema.$ref && !$refKeywords }} + {{= it.RULES.all.$ref.code(it, '$ref') }} + {{? $breakOnError }} + } + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { + {{ $closingBraces2 += '}'; }} + {{?}} +{{??}} + {{~ it.RULES:$rulesGroup }} + {{? $shouldUseGroup($rulesGroup) }} + {{? $rulesGroup.type }} + if ({{= it.util.checkDataType($rulesGroup.type, $data) }}) { + {{?}} + {{? it.opts.useDefaults }} + {{? $rulesGroup.type == 'object' && it.schema.properties }} + {{# def.defaultProperties }} + {{?? $rulesGroup.type == 'array' && Array.isArray(it.schema.items) }} + {{# def.defaultItems }} + {{?}} + {{?}} + {{~ $rulesGroup.rules:$rule }} + {{? $shouldUseRule($rule) }} + {{ var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); }} + {{? $code }} + {{= $code }} + {{? $breakOnError }} + {{ $closingBraces1 += '}'; }} + {{?}} + {{?}} + {{?}} + {{~}} + {{? $breakOnError }} + {{= $closingBraces1 }} + {{ $closingBraces1 = ''; }} + {{?}} + {{? $rulesGroup.type }} + } + {{? $typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes }} + else { + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type'; + }} + {{# def.error:'type' }} + } + {{?}} + {{?}} + + {{? $breakOnError }} + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { + {{ $closingBraces2 += '}'; }} + {{?}} + {{?}} + {{~}} +{{?}} + +{{? $breakOnError }} {{= $closingBraces2 }} {{?}} + +{{? $top }} + {{? $async }} + if (errors === 0) return data; {{ /* don't edit, used in replace */ }} + else throw new ValidationError(vErrors); {{ /* don't edit, used in replace */ }} + {{??}} + validate.errors = vErrors; {{ /* don't edit, used in replace */ }} + return errors === 0; {{ /* don't edit, used in replace */ }} + {{?}} + }; + + return validate; +{{??}} + var {{=$valid}} = errors === errs_{{=$lvl}}; +{{?}} + +{{# def.cleanUp }} + +{{? $top }} + {{# def.finalCleanUp }} +{{?}} + +{{ + function $shouldUseGroup($rulesGroup) { + var rules = $rulesGroup.rules; + for (var i=0; i < rules.length; i++) + if ($shouldUseRule(rules[i])) + return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || + ($rule.implements && $ruleImplementsSomeKeyword($rule)); + } + + function $ruleImplementsSomeKeyword($rule) { + var impl = $rule.implements; + for (var i=0; i < impl.length; i++) + if (it.schema[impl[i]] !== undefined) + return true; + } +}} diff --git a/node_modules/ajv/lib/dotjs/README.md b/node_modules/ajv/lib/dotjs/README.md new file mode 100644 index 0000000..4d99484 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/README.md @@ -0,0 +1,3 @@ +These files are compiled dot templates from dot folder. + +Do NOT edit them directly, edit the templates and run `npm run build` from main ajv folder. diff --git a/node_modules/ajv/lib/dotjs/_limit.js b/node_modules/ajv/lib/dotjs/_limit.js new file mode 100644 index 0000000..f02a760 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/_limit.js @@ -0,0 +1,157 @@ +'use strict'; +module.exports = function generate__limit(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $isMax = $keyword == 'maximum', + $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $notOp = $isMax ? '>' : '<', + $errorKeyword = undefined; + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $exclType = 'exclType' + $lvl, + $exclIsNumber = 'exclIsNumber' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; '; + if ($schema === undefined) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } + } else { + var $exclIsNumber = typeof $schemaExcl == 'number', + $opStr = $op; + if ($exclIsNumber && $isData) { + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; + } else { + if ($exclIsNumber && $schema === undefined) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaExcl; + $notOp += '='; + } else { + if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $notOp += '='; + } else { + $exclusive = false; + $opStr += '='; + } + } + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; + } + } + $errorKeyword = $errorKeyword || $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/_limitItems.js b/node_modules/ajv/lib/dotjs/_limitItems.js new file mode 100644 index 0000000..a27d118 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/_limitItems.js @@ -0,0 +1,77 @@ +'use strict'; +module.exports = function generate__limitItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/_limitLength.js b/node_modules/ajv/lib/dotjs/_limitLength.js new file mode 100644 index 0000000..789f374 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/_limitLength.js @@ -0,0 +1,82 @@ +'use strict'; +module.exports = function generate__limitLength(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/_limitProperties.js b/node_modules/ajv/lib/dotjs/_limitProperties.js new file mode 100644 index 0000000..11dc939 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/_limitProperties.js @@ -0,0 +1,77 @@ +'use strict'; +module.exports = function generate__limitProperties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'fewer'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/allOf.js b/node_modules/ajv/lib/dotjs/allOf.js new file mode 100644 index 0000000..4bad914 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/allOf.js @@ -0,0 +1,43 @@ +'use strict'; +module.exports = function generate_allOf(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/node_modules/ajv/lib/dotjs/anyOf.js b/node_modules/ajv/lib/dotjs/anyOf.js new file mode 100644 index 0000000..01551d5 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/anyOf.js @@ -0,0 +1,74 @@ +'use strict'; +module.exports = function generate_anyOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $noEmptySchema = $schema.every(function($sch) { + return (it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all)); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + out = it.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/comment.js b/node_modules/ajv/lib/dotjs/comment.js new file mode 100644 index 0000000..dd66bb8 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/comment.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = function generate_comment(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $comment = it.util.toQuotedString($schema); + if (it.opts.$comment === true) { + out += ' console.log(' + ($comment) + ');'; + } else if (typeof it.opts.$comment == 'function') { + out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/const.js b/node_modules/ajv/lib/dotjs/const.js new file mode 100644 index 0000000..15b7c61 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/const.js @@ -0,0 +1,56 @@ +'use strict'; +module.exports = function generate_const(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/contains.js b/node_modules/ajv/lib/dotjs/contains.js new file mode 100644 index 0000000..cd4dfab --- /dev/null +++ b/node_modules/ajv/lib/dotjs/contains.js @@ -0,0 +1,82 @@ +'use strict'; +module.exports = function generate_contains(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId, + $nonEmptySchema = (it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all)); + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($nonEmptySchema) { + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (' + ($nextValid) + ') break; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; + } else { + out += ' if (' + ($data) + '.length == 0) {'; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should contain a valid item\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + if ($nonEmptySchema) { + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + } + if (it.opts.allErrors) { + out += ' } '; + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/node_modules/ajv/lib/dotjs/custom.js b/node_modules/ajv/lib/dotjs/custom.js new file mode 100644 index 0000000..f3e641e --- /dev/null +++ b/node_modules/ajv/lib/dotjs/custom.js @@ -0,0 +1,228 @@ +'use strict'; +module.exports = function generate_custom(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition, + $closingBraces = ''; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + if (!$ruleValidate) return; + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($isData && $rDef.$data) { + $closingBraces += '}'; + out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; + if ($validateSchema) { + $closingBraces += '}'; + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; + } + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += 'await '; + } + out += '' + (def_callRuleValidate) + '; '; + } else { + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } + } + } + if ($rDef.modifying) { + out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + out += '' + ($closingBraces); + if ($rDef.valid) { + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; + } + out += ') { '; + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/node_modules/ajv/lib/dotjs/enum.js b/node_modules/ajv/lib/dotjs/enum.js new file mode 100644 index 0000000..90580b9 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/enum.js @@ -0,0 +1,66 @@ +'use strict'; +module.exports = function generate_enum(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $i = 'i' + $lvl, + $vSchema = 'schema' + $lvl; + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ';'; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to one of the allowed values\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/format.js b/node_modules/ajv/lib/dotjs/format.js new file mode 100644 index 0000000..cd9a569 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/format.js @@ -0,0 +1,150 @@ +'use strict'; +module.exports = function generate_format(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + if (it.opts.format === false) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $unknownFormats = it.opts.unknownFormats, + $allowUnknown = Array.isArray($unknownFormats); + if ($isData) { + var $format = 'format' + $lvl, + $isObject = 'isObject' + $lvl, + $formatType = 'formatType' + $lvl; + out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { '; + if (it.async) { + out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; + } + out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' ('; + if ($unknownFormats != 'ignore') { + out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; + if ($allowUnknown) { + out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; + } + out += ') || '; + } + out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; + if (it.async) { + out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; + } else { + out += ' ' + ($format) + '(' + ($data) + ') '; + } + out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; + } else { + var $format = it.formats[$schema]; + if (!$format) { + if ($unknownFormats == 'ignore') { + it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } else { + throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); + } + } + var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; + var $formatType = $isObject && $format.type || 'string'; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + if ($formatType != $ruleType) { + if ($breakOnError) { + out += ' if (true) { '; + } + return out; + } + if ($async) { + if (!it.async) throw new Error('async format in sync schema'); + var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; + out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { '; + } else { + out += ' if (! '; + var $formatRef = 'formats' + it.util.getProperty($schema); + if ($isObject) $formatRef += '.validate'; + if (typeof $format == 'function') { + out += ' ' + ($formatRef) + '(' + ($data) + ') '; + } else { + out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; + } + out += ') { '; + } + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match format "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/if.js b/node_modules/ajv/lib/dotjs/if.js new file mode 100644 index 0000000..019f61a --- /dev/null +++ b/node_modules/ajv/lib/dotjs/if.js @@ -0,0 +1,104 @@ +'use strict'; +module.exports = function generate_if(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + var $thenSch = it.schema['then'], + $elseSch = it.schema['else'], + $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? typeof $thenSch == 'object' && Object.keys($thenSch).length > 0 : it.util.schemaHasRules($thenSch, it.RULES.all)), + $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? typeof $elseSch == 'object' && Object.keys($elseSch).length > 0 : it.util.schemaHasRules($elseSch, it.RULES.all)), + $currentBaseId = $it.baseId; + if ($thenPresent || $elsePresent) { + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + if ($thenPresent) { + out += ' if (' + ($nextValid) + ') { '; + $it.schema = it.schema['then']; + $it.schemaPath = it.schemaPath + '.then'; + $it.errSchemaPath = it.errSchemaPath + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'then\'; '; + } else { + $ifClause = '\'then\''; + } + out += ' } '; + if ($elsePresent) { + out += ' else { '; + } + } else { + out += ' if (!' + ($nextValid) + ') { '; + } + if ($elsePresent) { + $it.schema = it.schema['else']; + $it.schemaPath = it.schemaPath + '.else'; + $it.errSchemaPath = it.errSchemaPath + '/else'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'else\'; '; + } else { + $ifClause = '\'else\''; + } + out += ' } '; + } + out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + out = it.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/index.js b/node_modules/ajv/lib/dotjs/index.js new file mode 100644 index 0000000..2fb1b00 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/index.js @@ -0,0 +1,33 @@ +'use strict'; + +//all requires must be explicit because browserify won't work with dynamic requires +module.exports = { + '$ref': require('./ref'), + allOf: require('./allOf'), + anyOf: require('./anyOf'), + '$comment': require('./comment'), + const: require('./const'), + contains: require('./contains'), + dependencies: require('./dependencies'), + 'enum': require('./enum'), + format: require('./format'), + 'if': require('./if'), + items: require('./items'), + maximum: require('./_limit'), + minimum: require('./_limit'), + maxItems: require('./_limitItems'), + minItems: require('./_limitItems'), + maxLength: require('./_limitLength'), + minLength: require('./_limitLength'), + maxProperties: require('./_limitProperties'), + minProperties: require('./_limitProperties'), + multipleOf: require('./multipleOf'), + not: require('./not'), + oneOf: require('./oneOf'), + pattern: require('./pattern'), + properties: require('./properties'), + propertyNames: require('./propertyNames'), + required: require('./required'), + uniqueItems: require('./uniqueItems'), + validate: require('./validate') +}; diff --git a/node_modules/ajv/lib/dotjs/items.js b/node_modules/ajv/lib/dotjs/items.js new file mode 100644 index 0000000..d5532f0 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/items.js @@ -0,0 +1,141 @@ +'use strict'; +module.exports = function generate_items(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $idx = 'i' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $currentBaseId = it.baseId; + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if (Array.isArray($schema)) { + var $additionalItems = it.schema.additionalItems; + if ($additionalItems === false) { + out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0 : it.util.schemaHasRules($additionalItems, it.RULES.all))) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' }'; + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/node_modules/ajv/lib/dotjs/multipleOf.js b/node_modules/ajv/lib/dotjs/multipleOf.js new file mode 100644 index 0000000..af087d2 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/multipleOf.js @@ -0,0 +1,77 @@ +'use strict'; +module.exports = function generate_multipleOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/not.js b/node_modules/ajv/lib/dotjs/not.js new file mode 100644 index 0000000..6aea659 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/not.js @@ -0,0 +1,84 @@ +'use strict'; +module.exports = function generate_not(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if ($breakOnError) { + out += ' if (false) { '; + } + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/oneOf.js b/node_modules/ajv/lib/dotjs/oneOf.js new file mode 100644 index 0000000..30988d5 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/oneOf.js @@ -0,0 +1,73 @@ +'use strict'; +module.exports = function generate_oneOf(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $prevValid = 'prevValid' + $lvl, + $passingSchemas = 'passingSchemas' + $lvl; + out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/pattern.js b/node_modules/ajv/lib/dotjs/pattern.js new file mode 100644 index 0000000..1d74d6b --- /dev/null +++ b/node_modules/ajv/lib/dotjs/pattern.js @@ -0,0 +1,75 @@ +'use strict'; +module.exports = function generate_pattern(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match pattern "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/properties.js b/node_modules/ajv/lib/dotjs/properties.js new file mode 100644 index 0000000..34a82c6 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/properties.js @@ -0,0 +1,330 @@ +'use strict'; +module.exports = function generate_properties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl; + var $schemaKeys = Object.keys($schema || {}), + $pProperties = it.schema.patternProperties || {}, + $pPropertyKeys = Object.keys($pProperties), + $aProperties = it.schema.additionalProperties, + $someProperties = $schemaKeys.length || $pPropertyKeys.length, + $noAdditional = $aProperties === false, + $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, + $removeAdditional = it.opts.removeAdditional, + $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + var $required = it.schema.required; + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); + out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined;'; + } + if ($checkAdditional) { + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + if ($someProperties) { + out += ' var isAdditional' + ($lvl) + ' = !(false '; + if ($schemaKeys.length) { + if ($schemaKeys.length > 8) { + out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is an invalid additional property'; + } else { + out += 'should NOT have additional properties'; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ' ) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($pPropertyKeys.length) { + var arr4 = $pPropertyKeys; + if (arr4) { + var $pProperty, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $pProperty = arr4[i4 += 1]; + var $sch = $pProperties[$pProperty]; + if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/node_modules/ajv/lib/dotjs/propertyNames.js b/node_modules/ajv/lib/dotjs/propertyNames.js new file mode 100644 index 0000000..b2bf295 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/propertyNames.js @@ -0,0 +1,82 @@ +'use strict'; +module.exports = function generate_propertyNames(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;'; + if ((it.opts.strictKeywords ? typeof $schema == 'object' && Object.keys($schema).length > 0 : it.util.schemaHasRules($schema, it.RULES.all))) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + var $key = 'key' + $lvl, + $idx = 'idx' + $lvl, + $i = 'i' + $lvl, + $invalidName = '\' + ' + $key + ' + \'', + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt, + $dataProperties = 'dataProperties' + $lvl, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + if ($ownProperties) { + out += ' var ' + ($dataProperties) + ' = undefined; '; + } + if ($ownProperties) { + out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; + } else { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + } + out += ' var startErrs' + ($lvl) + ' = errors; '; + var $passData = $key; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' 0 : it.util.schemaHasRules($propertySch, it.RULES.all)))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired, + $ownProperties = it.opts.ownProperties; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += '; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var $propertyKey, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $propertyKey = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty($propertyKey), + $useData = $data + $prop; + out += ' ( ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $prop = it.util.getProperty($propertyKey), + $missingProperty = it.util.escapeQuotes($propertyKey), + $useData = $data + $prop; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/uniqueItems.js b/node_modules/ajv/lib/dotjs/uniqueItems.js new file mode 100644 index 0000000..c4f6536 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/uniqueItems.js @@ -0,0 +1,86 @@ +'use strict'; +module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { '; + var $itemType = it.schema.items && it.schema.items.type, + $typeIsArray = Array.isArray($itemType); + if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) { + out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } '; + } else { + out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; '; + var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); + out += ' if (' + (it.util[$method]($itemType, 'item', true)) + ') continue; '; + if ($typeIsArray) { + out += ' if (typeof item == \'string\') item = \'"\' + item; '; + } + out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } '; + } + out += ' } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/node_modules/ajv/lib/dotjs/validate.js b/node_modules/ajv/lib/dotjs/validate.js new file mode 100644 index 0000000..cd0efc8 --- /dev/null +++ b/node_modules/ajv/lib/dotjs/validate.js @@ -0,0 +1,494 @@ +'use strict'; +module.exports = function generate_validate(it, $keyword, $ruleType) { + var out = ''; + var $async = it.schema.$async === true, + $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), + $id = it.self._getId(it.schema); + if (it.opts.strictKeywords) { + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); + if ($unknownKwd) { + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); + else throw new Error($keywordsMsg); + } + } + if (it.isTop) { + out += ' var validate = '; + if ($async) { + it.async = true; + out += 'async '; + } + out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; + if ($id && (it.opts.sourceCode || it.opts.processCode)) { + out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; + } + } + if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { + var $keyword = 'false schema'; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + if (it.schema === false) { + if (it.isTop) { + $breakOnError = true; + } else { + out += ' var ' + ($valid) + ' = false; '; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'boolean schema is false\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } else { + if (it.isTop) { + if ($async) { + out += ' return data; '; + } else { + out += ' validate.errors = null; return true; '; + } + } else { + out += ' var ' + ($valid) + ' = true; '; + } + } + if (it.isTop) { + out += ' }; return validate; '; + } + return out; + } + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); + it.baseId = it.baseId || it.rootId; + delete it.isTop; + it.dataPathArr = [undefined]; + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored in the schema root'; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + out += ' var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data; '; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if ($id) it.baseId = it.resolve.url(it.baseId, $id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = ''; + var $errorKeyword; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } + if (it.schema.$ref && $refKeywords) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); + } else if (it.opts.extendRefs !== true) { + $refKeywords = false; + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } + } + if (it.schema.$comment && it.opts.$comment) { + out += ' ' + (it.RULES.all.$comment.code(it, '$comment')); + } + if ($typeSchema) { + if (it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + } + var $rulesGroup = it.RULES.types[$typeSchema]; + if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + if ($coerceToTypes) { + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; + } + out += ' var ' + ($coerced) + ' = undefined; '; + var $bracesCoercion = ''; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($i) { + out += ' if (' + ($coerced) + ' === undefined) { '; + $bracesCoercion += '}'; + } + if (it.opts.coerceTypes == 'array' && $type != 'array') { + out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; + } + if ($type == 'string') { + out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' } '; + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; + } + if (it.opts.useDefaults) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } + } else { + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); + if ($code) { + out += ' ' + ($code) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return data; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }; return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + out = it.util.cleanUpCode(out); + if ($top) { + out = it.util.finalCleanUpCode(out, $async); + } + + function $shouldUseGroup($rulesGroup) { + var rules = $rulesGroup.rules; + for (var i = 0; i < rules.length; i++) + if ($shouldUseRule(rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); + } + + function $ruleImplementsSomeKeyword($rule) { + var impl = $rule.implements; + for (var i = 0; i < impl.length; i++) + if (it.schema[impl[i]] !== undefined) return true; + } + return out; +} diff --git a/node_modules/ajv/lib/keyword.js b/node_modules/ajv/lib/keyword.js new file mode 100644 index 0000000..5fec19a --- /dev/null +++ b/node_modules/ajv/lib/keyword.js @@ -0,0 +1,146 @@ +'use strict'; + +var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; +var customRuleCode = require('./dotjs/custom'); +var definitionSchema = require('./definition_schema'); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword, + validate: validateKeyword +}; + + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + * @return {Ajv} this for method chaining + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + this.validateKeyword(definition, true); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + for (var i=0; i ../ajv-dist/bower.json + cd ../ajv-dist + + if [[ `git status --porcelain` ]]; then + echo "Changes detected. Updating master branch..." + git add -A + git commit -m "updated by travis build #$TRAVIS_BUILD_NUMBER" + git push --quiet origin master > /dev/null 2>&1 + fi + + echo "Publishing tag..." + + git tag $TRAVIS_TAG + git push --tags > /dev/null 2>&1 + + echo "Done" +fi diff --git a/node_modules/ajv/scripts/travis-gh-pages b/node_modules/ajv/scripts/travis-gh-pages new file mode 100755 index 0000000..46ded16 --- /dev/null +++ b/node_modules/ajv/scripts/travis-gh-pages @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -e + +if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" && $TRAVIS_JOB_NUMBER =~ ".3" ]]; then + git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE '\.md$|^LICENSE$|travis-gh-pages$' && { + rm -rf ../gh-pages + git clone -b gh-pages --single-branch https://${GITHUB_TOKEN}@github.com/epoberezkin/ajv.git ../gh-pages + mkdir -p ../gh-pages/_source + cp *.md ../gh-pages/_source + cp LICENSE ../gh-pages/_source + currentDir=$(pwd) + cd ../gh-pages + $currentDir/node_modules/.bin/gh-pages-generator + # remove logo from README + sed -i -E "s/]+ajv_logo[^>]+>//" index.md + git config user.email "$GIT_USER_EMAIL" + git config user.name "$GIT_USER_NAME" + git add . + git commit -am "updated by travis build #$TRAVIS_BUILD_NUMBER" + git push --quiet origin gh-pages > /dev/null 2>&1 + } +fi diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..b9574ed --- /dev/null +++ b/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; +}; diff --git a/node_modules/ansi-regex/license b/node_modules/ansi-regex/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/ansi-regex/package.json b/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..7908002 --- /dev/null +++ b/node_modules/ansi-regex/package.json @@ -0,0 +1,108 @@ +{ + "_from": "ansi-regex@^2.0.0", + "_id": "ansi-regex@2.1.1", + "_inBundle": false, + "_integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "_location": "/ansi-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-regex@^2.0.0", + "name": "ansi-regex", + "escapedName": "ansi-regex", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/strip-ansi" + ], + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df", + "_spec": "ansi-regex@^2.0.0", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "0.17.0", + "xo": "0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-regex#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + }, + { + "name": "JD Ballard", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" + } + ], + "name": "ansi-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava --verbose", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "2.1.1", + "xo": { + "rules": { + "guard-for-in": 0, + "no-loop-func": 0 + } + } +} diff --git a/node_modules/ansi-regex/readme.md b/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..6a928ed --- /dev/null +++ b/node_modules/ansi-regex/readme.md @@ -0,0 +1,39 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js new file mode 100644 index 0000000..90a871c --- /dev/null +++ b/node_modules/ansi-styles/index.js @@ -0,0 +1,165 @@ +'use strict'; +const colorConvert = require('color-convert'); + +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Fix humans + styles.color.grey = styles.color.gray; + + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + + for (const styleName of Object.keys(group)) { + const style = group[styleName]; + + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } + + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if (key === 'ansi16') { + key = 'ansi'; + } + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json new file mode 100644 index 0000000..0422e06 --- /dev/null +++ b/node_modules/ansi-styles/package.json @@ -0,0 +1,88 @@ +{ + "_from": "ansi-styles@^3.2.1", + "_id": "ansi-styles@3.2.1", + "_inBundle": false, + "_integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "_location": "/ansi-styles", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-styles@^3.2.1", + "name": "ansi-styles", + "escapedName": "ansi-styles", + "rawSpec": "^3.2.1", + "saveSpec": null, + "fetchSpec": "^3.2.1" + }, + "_requiredBy": [ + "/chalk" + ], + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "_shasum": "41fbb20243e50b12be0f04b8dedbf07520ce841d", + "_spec": "ansi-styles@^3.2.1", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "ava": { + "require": "babel-polyfill" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "bundleDependencies": false, + "dependencies": { + "color-convert": "^1.9.0" + }, + "deprecated": false, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "ava": "*", + "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-styles#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "ansi-styles", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "scripts": { + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor", + "test": "xo && ava" + }, + "version": "3.2.1" +} diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md new file mode 100644 index 0000000..3158e2d --- /dev/null +++ b/node_modules/ansi-styles/readme.md @@ -0,0 +1,147 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + + +## Install + +``` +$ npm install ansi-styles +``` + + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` ("bright black") +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/arraybuffer.slice/.npmignore b/node_modules/arraybuffer.slice/.npmignore new file mode 100644 index 0000000..cfbee8d --- /dev/null +++ b/node_modules/arraybuffer.slice/.npmignore @@ -0,0 +1,17 @@ +lib-cov +lcov.info +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results +build +.grunt + +node_modules diff --git a/node_modules/arraybuffer.slice/LICENCE b/node_modules/arraybuffer.slice/LICENCE new file mode 100644 index 0000000..35fa375 --- /dev/null +++ b/node_modules/arraybuffer.slice/LICENCE @@ -0,0 +1,18 @@ +Copyright (C) 2013 Rase- + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/arraybuffer.slice/Makefile b/node_modules/arraybuffer.slice/Makefile new file mode 100644 index 0000000..849887f --- /dev/null +++ b/node_modules/arraybuffer.slice/Makefile @@ -0,0 +1,8 @@ + +REPORTER = dot + +test: + @./node_modules/.bin/mocha \ + --reporter $(REPORTER) + +.PHONY: test diff --git a/node_modules/arraybuffer.slice/README.md b/node_modules/arraybuffer.slice/README.md new file mode 100644 index 0000000..15e465e --- /dev/null +++ b/node_modules/arraybuffer.slice/README.md @@ -0,0 +1,17 @@ +# How to +```javascript +var sliceBuffer = require('arraybuffer.slice'); +var ab = (new Int8Array(5)).buffer; +var sliced = sliceBuffer(ab, 1, 3); +sliced = sliceBuffer(ab, 1); +``` + +# Licence (MIT) +Copyright (C) 2013 Rase- + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/arraybuffer.slice/index.js b/node_modules/arraybuffer.slice/index.js new file mode 100644 index 0000000..11ac556 --- /dev/null +++ b/node_modules/arraybuffer.slice/index.js @@ -0,0 +1,29 @@ +/** + * An abstraction for slicing an arraybuffer even when + * ArrayBuffer.prototype.slice is not supported + * + * @api public + */ + +module.exports = function(arraybuffer, start, end) { + var bytes = arraybuffer.byteLength; + start = start || 0; + end = end || bytes; + + if (arraybuffer.slice) { return arraybuffer.slice(start, end); } + + if (start < 0) { start += bytes; } + if (end < 0) { end += bytes; } + if (end > bytes) { end = bytes; } + + if (start >= bytes || start >= end || bytes === 0) { + return new ArrayBuffer(0); + } + + var abv = new Uint8Array(arraybuffer); + var result = new Uint8Array(end - start); + for (var i = start, ii = 0; i < end; i++, ii++) { + result[ii] = abv[i]; + } + return result.buffer; +}; diff --git a/node_modules/arraybuffer.slice/package.json b/node_modules/arraybuffer.slice/package.json new file mode 100644 index 0000000..a5d16ae --- /dev/null +++ b/node_modules/arraybuffer.slice/package.json @@ -0,0 +1,44 @@ +{ + "_from": "arraybuffer.slice@~0.0.7", + "_id": "arraybuffer.slice@0.0.7", + "_inBundle": false, + "_integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==", + "_location": "/arraybuffer.slice", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "arraybuffer.slice@~0.0.7", + "name": "arraybuffer.slice", + "escapedName": "arraybuffer.slice", + "rawSpec": "~0.0.7", + "saveSpec": null, + "fetchSpec": "~0.0.7" + }, + "_requiredBy": [ + "/engine.io-parser" + ], + "_resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", + "_shasum": "3bbc4275dd584cc1b10809b89d4e8b63a69e7675", + "_spec": "arraybuffer.slice@~0.0.7", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/engine.io-parser", + "bugs": { + "url": "https://github.com/rase-/arraybuffer.slice/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Exports a function for slicing ArrayBuffers (no polyfilling)", + "devDependencies": { + "expect.js": "0.2.0", + "mocha": "1.17.1" + }, + "homepage": "https://github.com/rase-/arraybuffer.slice", + "license": "MIT", + "name": "arraybuffer.slice", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/rase-/arraybuffer.slice.git" + }, + "version": "0.0.7" +} diff --git a/node_modules/arraybuffer.slice/test/slice-buffer.js b/node_modules/arraybuffer.slice/test/slice-buffer.js new file mode 100644 index 0000000..4778da6 --- /dev/null +++ b/node_modules/arraybuffer.slice/test/slice-buffer.js @@ -0,0 +1,227 @@ +/* + * Test dependencies + */ + +var sliceBuffer = require('../index.js'); +var expect = require('expect.js'); + +/** + * Tests + */ + +describe('sliceBuffer', function() { + describe('using standard slice', function() { + it('should slice correctly with only start provided', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 3); + var sabv = new Uint8Array(sliced); + for (var i = 3, ii = 0; i < abv.length; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with start and end provided', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 3, 8); + var sabv = new Uint8Array(sliced); + for (var i = 3, ii = 0; i < 8; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative start', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, -3); + var sabv = new Uint8Array(sliced); + for (var i = abv.length - 3, ii = 0; i < abv.length; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 0, -3); + var sabv = new Uint8Array(sliced); + for (var i = 0, ii = 0; i < abv.length - 3; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative start and end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, -6, -3); + var sabv = new Uint8Array(sliced); + for (var i = abv.length - 6, ii = 0; i < abv.length - 3; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with equal start and end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 1, 1); + expect(sliced.byteLength).to.equal(0); + }); + + it('should slice correctly when end larger than buffer', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 0, 100); + expect(new Uint8Array(sliced)).to.eql(abv); + }); + + it('shoud slice correctly when start larger than end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + + var sliced = sliceBuffer(abv.buffer, 6, 5); + expect(sliced.byteLength).to.equal(0); + }); + }); + + describe('using fallback', function() { + it('should slice correctly with only start provided', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, 3); + var sabv = new Uint8Array(sliced); + for (var i = 3, ii = 0; i < abv.length; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with start and end provided', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + + var sliced = sliceBuffer(ab, 3, 8); + var sabv = new Uint8Array(sliced); + for (var i = 3, ii = 0; i < 8; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative start', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + + var sliced = sliceBuffer(ab, -3); + var sabv = new Uint8Array(sliced); + for (var i = abv.length - 3, ii = 0; i < abv.length; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, 0, -3); + var sabv = new Uint8Array(sliced); + for (var i = 0, ii = 0; i < abv.length - 3; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with negative start and end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, -6, -3); + var sabv = new Uint8Array(sliced); + for (var i = abv.length - 6, ii = 0; i < abv.length - 3; i++, ii++) { + expect(abv[i]).to.equal(sabv[ii]); + } + }); + + it('should slice correctly with equal start and end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, 1, 1); + expect(sliced.byteLength).to.equal(0); + }); + + it('should slice correctly when end larger than buffer', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, 0, 100); + var sabv = new Uint8Array(sliced); + for (var i = 0; i < abv.length; i++) { + expect(abv[i]).to.equal(sabv[i]); + } + }); + + it('shoud slice correctly when start larger than end', function() { + var abv = new Uint8Array(10); + for (var i = 0; i < abv.length; i++) { + abv[i] = i; + } + var ab = abv.buffer; + ab.slice = undefined; + + var sliced = sliceBuffer(ab, 6, 5); + expect(sliced.byteLength).to.equal(0); + }); + }); +}); diff --git a/node_modules/asap/CHANGES.md b/node_modules/asap/CHANGES.md new file mode 100644 index 0000000..f105b91 --- /dev/null +++ b/node_modules/asap/CHANGES.md @@ -0,0 +1,70 @@ + +## 2.0.6 + +Version 2.0.4 adds support for React Native by clarifying in package.json that +the browser environment does not support Node.js domains. +Why this is necessary, we leave as an exercise for the user. + +## 2.0.3 + +Version 2.0.3 fixes a bug when adjusting the capacity of the task queue. + +## 2.0.1-2.02 + +Version 2.0.1 fixes a bug in the way redirects were expressed that affected the +function of Browserify, but which Mr would tolerate. + +## 2.0.0 + +Version 2 of ASAP is a full rewrite with a few salient changes. +First, the ASAP source is CommonJS only and designed with [Browserify][] and +[Browserify-compatible][Mr] module loaders in mind. + +[Browserify]: https://github.com/substack/node-browserify +[Mr]: https://github.com/montagejs/mr + +The new version has been refactored in two dimensions. +Support for Node.js and browsers have been separated, using Browserify +redirects and ASAP has been divided into two modules. +The "raw" layer depends on the tasks to catch thrown exceptions and unravel +Node.js domains. + +The full implementation of ASAP is loadable as `require("asap")` in both Node.js +and browsers. + +The raw layer that lacks exception handling overhead is loadable as +`require("asap/raw")`. +The interface is the same for both layers. + +Tasks are no longer required to be functions, but can rather be any object that +implements `task.call()`. +With this feature you can recycle task objects to avoid garbage collector churn +and avoid closures in general. + +The implementation has been rigorously documented so that our successors can +understand the scope of the problem that this module solves and all of its +nuances, ensuring that the next generation of implementations know what details +are essential. + +- [asap.js](https://github.com/kriskowal/asap/blob/master/asap.js) +- [raw.js](https://github.com/kriskowal/asap/blob/master/raw.js) +- [browser-asap.js](https://github.com/kriskowal/asap/blob/master/browser-asap.js) +- [browser-raw.js](https://github.com/kriskowal/asap/blob/master/browser-raw.js) + +The new version has also been rigorously tested across a broad spectrum of +browsers, in both the window and worker context. +The following charts capture the browser test results for the most recent +release. +The first chart shows test results for ASAP running in the main window context. +The second chart shows test results for ASAP running in a web worker context. +Test results are inconclusive (grey) on browsers that do not support web +workers. +These data are captured automatically by [Continuous +Integration][]. + +![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg) + +![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg) + +[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md + diff --git a/node_modules/asap/LICENSE.md b/node_modules/asap/LICENSE.md new file mode 100644 index 0000000..ba18c61 --- /dev/null +++ b/node_modules/asap/LICENSE.md @@ -0,0 +1,21 @@ + +Copyright 2009–2014 Contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + diff --git a/node_modules/asap/README.md b/node_modules/asap/README.md new file mode 100644 index 0000000..452fd8c --- /dev/null +++ b/node_modules/asap/README.md @@ -0,0 +1,237 @@ +# ASAP + +[![Build Status](https://travis-ci.org/kriskowal/asap.png?branch=master)](https://travis-ci.org/kriskowal/asap) + +Promise and asynchronous observer libraries, as well as hand-rolled callback +programs and libraries, often need a mechanism to postpone the execution of a +callback until the next available event. +(See [Designing API’s for Asynchrony][Zalgo].) +The `asap` function executes a task **as soon as possible** but not before it +returns, waiting only for the completion of the current event and previously +scheduled tasks. + +```javascript +asap(function () { + // ... +}); +``` + +[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony + +This CommonJS package provides an `asap` module that exports a function that +executes a task function *as soon as possible*. + +ASAP strives to schedule events to occur before yielding for IO, reflow, +or redrawing. +Each event receives an independent stack, with only platform code in parent +frames and the events run in the order they are scheduled. + +ASAP provides a fast event queue that will execute tasks until it is +empty before yielding to the JavaScript engine's underlying event-loop. +When a task gets added to a previously empty event queue, ASAP schedules a flush +event, preferring for that event to occur before the JavaScript engine has an +opportunity to perform IO tasks or rendering, thus making the first task and +subsequent tasks semantically indistinguishable. +ASAP uses a variety of techniques to preserve this invariant on different +versions of browsers and Node.js. + +By design, ASAP prevents input events from being handled until the task +queue is empty. +If the process is busy enough, this may cause incoming connection requests to be +dropped, and may cause existing connections to inform the sender to reduce the +transmission rate or stall. +ASAP allows this on the theory that, if there is enough work to do, there is no +sense in looking for trouble. +As a consequence, ASAP can interfere with smooth animation. +If your task should be tied to the rendering loop, consider using +`requestAnimationFrame` instead. +A long sequence of tasks can also effect the long running script dialog. +If this is a problem, you may be able to use ASAP’s cousin `setImmediate` to +break long processes into shorter intervals and periodically allow the browser +to breathe. +`setImmediate` will yield for IO, reflow, and repaint events. +It also returns a handler and can be canceled. +For a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate]. + +[setImmediate]: https://github.com/YuzuJS/setImmediate + +Take care. +ASAP can sustain infinite recursive calls without warning. +It will not halt from a stack overflow, and it will not consume unbounded +memory. +This is behaviorally equivalent to an infinite loop. +Just as with infinite loops, you can monitor a Node.js process for this behavior +with a heart-beat signal. +As with infinite loops, a very small amount of caution goes a long way to +avoiding problems. + +```javascript +function loop() { + asap(loop); +} +loop(); +``` + +In browsers, if a task throws an exception, it will not interrupt the flushing +of high-priority tasks. +The exception will be postponed to a later, low-priority event to avoid +slow-downs. +In Node.js, if a task throws an exception, ASAP will resume flushing only if—and +only after—the error is handled by `domain.on("error")` or +`process.on("uncaughtException")`. + +## Raw ASAP + +Checking for exceptions comes at a cost. +The package also provides an `asap/raw` module that exports the underlying +implementation which is faster but stalls if a task throws an exception. +This internal version of the ASAP function does not check for errors. +If a task does throw an error, it will stall the event queue unless you manually +call `rawAsap.requestFlush()` before throwing the error, or any time after. + +In Node.js, `asap/raw` also runs all tasks outside any domain. +If you need a task to be bound to your domain, you will have to do it manually. + +```js +if (process.domain) { + task = process.domain.bind(task); +} +rawAsap(task); +``` + +## Tasks + +A task may be any object that implements `call()`. +A function will suffice, but closures tend not to be reusable and can cause +garbage collector churn. +Both `asap` and `rawAsap` accept task objects to give you the option of +recycling task objects or using higher callable object abstractions. +See the `asap` source for an illustration. + + +## Compatibility + +ASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers. +The following charts capture the browser test results for the most recent +release. +The first chart shows test results for ASAP running in the main window context. +The second chart shows test results for ASAP running in a web worker context. +Test results are inconclusive (grey) on browsers that do not support web +workers. +These data are captured automatically by [Continuous +Integration][]. + +[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md + +![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg) + +![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg) + +## Caveats + +When a task is added to an empty event queue, it is not always possible to +guarantee that the task queue will begin flushing immediately after the current +event. +However, once the task queue begins flushing, it will not yield until the queue +is empty, even if the queue grows while executing tasks. + +The following browsers allow the use of [DOM mutation observers][] to access +the HTML [microtask queue][], and thus begin flushing ASAP's task queue +immediately at the end of the current event loop turn, before any rendering or +IO: + +[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue +[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers + +- Android 4–4.3 +- Chrome 26–34 +- Firefox 14–29 +- Internet Explorer 11 +- iPad Safari 6–7.1 +- iPhone Safari 7–7.1 +- Safari 6–7 + +In the absense of mutation observers, there are a few browsers, and situations +like web workers in some of the above browsers, where [message channels][] +would be a useful way to avoid falling back to timers. +Message channels give direct access to the HTML [task queue][], so the ASAP +task queue would flush after any already queued rendering and IO tasks, but +without having the minimum delay imposed by timers. +However, among these browsers, Internet Explorer 10 and Safari do not reliably +dispatch messages, so they are not worth the trouble to implement. + +[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels +[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task + +- Internet Explorer 10 +- Safair 5.0-1 +- Opera 11-12 + +In the absense of mutation observers, these browsers and the following browsers +all fall back to using `setTimeout` and `setInterval` to ensure that a `flush` +occurs. +The implementation uses both and cancels whatever handler loses the race, since +`setTimeout` tends to occasionally skip tasks in unisolated circumstances. +Timers generally delay the flushing of ASAP's task queue for four milliseconds. + +- Firefox 3–13 +- Internet Explorer 6–10 +- iPad Safari 4.3 +- Lynx 2.8.7 + + +## Heritage + +ASAP has been factored out of the [Q][] asynchronous promise library. +It originally had a naïve implementation in terms of `setTimeout`, but +[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be +useful for creating a high-priority, no-delay event dispatch hack. +Since then, Internet Explorer proposed and implemented `setImmediate`. +Robert Katić began contributing to Q by measuring the performance of +the internal implementation of `asap`, paying particular attention to +error recovery. +Domenic, Robert, and Kris Kowal collectively settled on the current strategy of +unrolling the high-priority event queue internally regardless of what strategy +we used to dispatch the potentially lower-priority flush event. +Domenic went on to make ASAP cooperate with Node.js domains. + +[Q]: https://github.com/kriskowal/q +[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html + +For further reading, Nicholas Zakas provided a thorough article on [The +Case for setImmediate][NCZ]. + +[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/ + +Ember’s RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but +further developed the implentation. +Particularly, The `MessagePort` implementation was abandoned due to interaction +[problems with Mobile Internet Explorer][IE Problems] in favor of an +implementation backed on the newer and more reliable DOM `MutationObserver` +interface. +These changes were back-ported into this library. + +[IE Problems]: https://github.com/cujojs/when/issues/197 +[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js + +In addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained +exception-safe, but `asap/raw` provided a tight kernel that could be used for +tasks that guaranteed that they would not throw exceptions. +This core is useful for promise implementations that capture thrown errors in +rejected promises and do not need a second safety net. +At the same time, the exception handling in `asap` was factored into separate +implementations for Node.js and browsers, using the the [Browserify][Browser +Config] `browser` property in `package.json` to instruct browser module loaders +and bundlers, including [Browserify][], [Mr][], and [Mop][], to use the +browser-only implementation. + +[Browser Config]: https://gist.github.com/defunctzombie/4339901 +[Browserify]: https://github.com/substack/node-browserify +[Mr]: https://github.com/montagejs/mr +[Mop]: https://github.com/montagejs/mop + +## License + +Copyright 2009-2014 by Contributors +MIT License (enclosed) + diff --git a/node_modules/asap/asap.js b/node_modules/asap/asap.js new file mode 100644 index 0000000..f04fcd5 --- /dev/null +++ b/node_modules/asap/asap.js @@ -0,0 +1,65 @@ +"use strict"; + +var rawAsap = require("./raw"); +var freeTasks = []; + +/** + * Calls a task as soon as possible after returning, in its own event, with + * priority over IO events. An exception thrown in a task can be handled by + * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise + * crash the process. If the error is handled, all subsequent tasks will + * resume. + * + * @param {{call}} task A callable object, typically a function that takes no + * arguments. + */ +module.exports = asap; +function asap(task) { + var rawTask; + if (freeTasks.length) { + rawTask = freeTasks.pop(); + } else { + rawTask = new RawTask(); + } + rawTask.task = task; + rawTask.domain = process.domain; + rawAsap(rawTask); +} + +function RawTask() { + this.task = null; + this.domain = null; +} + +RawTask.prototype.call = function () { + if (this.domain) { + this.domain.enter(); + } + var threw = true; + try { + this.task.call(); + threw = false; + // If the task throws an exception (presumably) Node.js restores the + // domain stack for the next event. + if (this.domain) { + this.domain.exit(); + } + } finally { + // We use try/finally and a threw flag to avoid messing up stack traces + // when we catch and release errors. + if (threw) { + // In Node.js, uncaught exceptions are considered fatal errors. + // Re-throw them to interrupt flushing! + // Ensure that flushing continues if an uncaught exception is + // suppressed listening process.on("uncaughtException") or + // domain.on("error"). + rawAsap.requestFlush(); + } + // If the task threw an error, we do not want to exit the domain here. + // Exiting the domain would prevent the domain from catching the error. + this.task = null; + this.domain = null; + freeTasks.push(this); + } +}; + diff --git a/node_modules/asap/browser-asap.js b/node_modules/asap/browser-asap.js new file mode 100644 index 0000000..805c982 --- /dev/null +++ b/node_modules/asap/browser-asap.js @@ -0,0 +1,66 @@ +"use strict"; + +// rawAsap provides everything we need except exception management. +var rawAsap = require("./raw"); +// RawTasks are recycled to reduce GC churn. +var freeTasks = []; +// We queue errors to ensure they are thrown in right order (FIFO). +// Array-as-queue is good enough here, since we are just dealing with exceptions. +var pendingErrors = []; +var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError); + +function throwFirstError() { + if (pendingErrors.length) { + throw pendingErrors.shift(); + } +} + +/** + * Calls a task as soon as possible after returning, in its own event, with priority + * over other events like animation, reflow, and repaint. An error thrown from an + * event will not interrupt, nor even substantially slow down the processing of + * other events, but will be rather postponed to a lower priority event. + * @param {{call}} task A callable object, typically a function that takes no + * arguments. + */ +module.exports = asap; +function asap(task) { + var rawTask; + if (freeTasks.length) { + rawTask = freeTasks.pop(); + } else { + rawTask = new RawTask(); + } + rawTask.task = task; + rawAsap(rawTask); +} + +// We wrap tasks with recyclable task objects. A task object implements +// `call`, just like a function. +function RawTask() { + this.task = null; +} + +// The sole purpose of wrapping the task is to catch the exception and recycle +// the task object after its single use. +RawTask.prototype.call = function () { + try { + this.task.call(); + } catch (error) { + if (asap.onerror) { + // This hook exists purely for testing purposes. + // Its name will be periodically randomized to break any code that + // depends on its existence. + asap.onerror(error); + } else { + // In a web browser, exceptions are not fatal. However, to avoid + // slowing down the queue of pending tasks, we rethrow the error in a + // lower priority turn. + pendingErrors.push(error); + requestErrorThrow(); + } + } finally { + this.task = null; + freeTasks[freeTasks.length] = this; + } +}; diff --git a/node_modules/asap/browser-raw.js b/node_modules/asap/browser-raw.js new file mode 100644 index 0000000..9cee7e3 --- /dev/null +++ b/node_modules/asap/browser-raw.js @@ -0,0 +1,223 @@ +"use strict"; + +// Use the fastest means possible to execute a task in its own turn, with +// priority over other events including IO, animation, reflow, and redraw +// events in browsers. +// +// An exception thrown by a task will permanently interrupt the processing of +// subsequent tasks. The higher level `asap` function ensures that if an +// exception is thrown by a task, that the task queue will continue flushing as +// soon as possible, but if you use `rawAsap` directly, you are responsible to +// either ensure that no exceptions are thrown from your task, or to manually +// call `rawAsap.requestFlush` if an exception is thrown. +module.exports = rawAsap; +function rawAsap(task) { + if (!queue.length) { + requestFlush(); + flushing = true; + } + // Equivalent to push, but avoids a function call. + queue[queue.length] = task; +} + +var queue = []; +// Once a flush has been requested, no further calls to `requestFlush` are +// necessary until the next `flush` completes. +var flushing = false; +// `requestFlush` is an implementation-specific method that attempts to kick +// off a `flush` event as quickly as possible. `flush` will attempt to exhaust +// the event queue before yielding to the browser's own event loop. +var requestFlush; +// The position of the next task to execute in the task queue. This is +// preserved between calls to `flush` so that it can be resumed if +// a task throws an exception. +var index = 0; +// If a task schedules additional tasks recursively, the task queue can grow +// unbounded. To prevent memory exhaustion, the task queue will periodically +// truncate already-completed tasks. +var capacity = 1024; + +// The flush function processes all tasks that have been scheduled with +// `rawAsap` unless and until one of those tasks throws an exception. +// If a task throws an exception, `flush` ensures that its state will remain +// consistent and will resume where it left off when called again. +// However, `flush` does not make any arrangements to be called again if an +// exception is thrown. +function flush() { + while (index < queue.length) { + var currentIndex = index; + // Advance the index before calling the task. This ensures that we will + // begin flushing on the next task the task throws an error. + index = index + 1; + queue[currentIndex].call(); + // Prevent leaking memory for long chains of recursive calls to `asap`. + // If we call `asap` within tasks scheduled by `asap`, the queue will + // grow, but to avoid an O(n) walk for every task we execute, we don't + // shift tasks off the queue after they have been executed. + // Instead, we periodically shift 1024 tasks off the queue. + if (index > capacity) { + // Manually shift all values starting at the index back to the + // beginning of the queue. + for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { + queue[scan] = queue[scan + index]; + } + queue.length -= index; + index = 0; + } + } + queue.length = 0; + index = 0; + flushing = false; +} + +// `requestFlush` is implemented using a strategy based on data collected from +// every available SauceLabs Selenium web driver worker at time of writing. +// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593 + +// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that +// have WebKitMutationObserver but not un-prefixed MutationObserver. +// Must use `global` or `self` instead of `window` to work in both frames and web +// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop. + +/* globals self */ +var scope = typeof global !== "undefined" ? global : self; +var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver; + +// MutationObservers are desirable because they have high priority and work +// reliably everywhere they are implemented. +// They are implemented in all modern browsers. +// +// - Android 4-4.3 +// - Chrome 26-34 +// - Firefox 14-29 +// - Internet Explorer 11 +// - iPad Safari 6-7.1 +// - iPhone Safari 7-7.1 +// - Safari 6-7 +if (typeof BrowserMutationObserver === "function") { + requestFlush = makeRequestCallFromMutationObserver(flush); + +// MessageChannels are desirable because they give direct access to the HTML +// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera +// 11-12, and in web workers in many engines. +// Although message channels yield to any queued rendering and IO tasks, they +// would be better than imposing the 4ms delay of timers. +// However, they do not work reliably in Internet Explorer or Safari. + +// Internet Explorer 10 is the only browser that has setImmediate but does +// not have MutationObservers. +// Although setImmediate yields to the browser's renderer, it would be +// preferrable to falling back to setTimeout since it does not have +// the minimum 4ms penalty. +// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and +// Desktop to a lesser extent) that renders both setImmediate and +// MessageChannel useless for the purposes of ASAP. +// https://github.com/kriskowal/q/issues/396 + +// Timers are implemented universally. +// We fall back to timers in workers in most engines, and in foreground +// contexts in the following browsers. +// However, note that even this simple case requires nuances to operate in a +// broad spectrum of browsers. +// +// - Firefox 3-13 +// - Internet Explorer 6-9 +// - iPad Safari 4.3 +// - Lynx 2.8.7 +} else { + requestFlush = makeRequestCallFromTimer(flush); +} + +// `requestFlush` requests that the high priority event queue be flushed as +// soon as possible. +// This is useful to prevent an error thrown in a task from stalling the event +// queue if the exception handled by Node.js’s +// `process.on("uncaughtException")` or by a domain. +rawAsap.requestFlush = requestFlush; + +// To request a high priority event, we induce a mutation observer by toggling +// the text of a text node between "1" and "-1". +function makeRequestCallFromMutationObserver(callback) { + var toggle = 1; + var observer = new BrowserMutationObserver(callback); + var node = document.createTextNode(""); + observer.observe(node, {characterData: true}); + return function requestCall() { + toggle = -toggle; + node.data = toggle; + }; +} + +// The message channel technique was discovered by Malte Ubl and was the +// original foundation for this library. +// http://www.nonblocking.io/2011/06/windownexttick.html + +// Safari 6.0.5 (at least) intermittently fails to create message ports on a +// page's first load. Thankfully, this version of Safari supports +// MutationObservers, so we don't need to fall back in that case. + +// function makeRequestCallFromMessageChannel(callback) { +// var channel = new MessageChannel(); +// channel.port1.onmessage = callback; +// return function requestCall() { +// channel.port2.postMessage(0); +// }; +// } + +// For reasons explained above, we are also unable to use `setImmediate` +// under any circumstances. +// Even if we were, there is another bug in Internet Explorer 10. +// It is not sufficient to assign `setImmediate` to `requestFlush` because +// `setImmediate` must be called *by name* and therefore must be wrapped in a +// closure. +// Never forget. + +// function makeRequestCallFromSetImmediate(callback) { +// return function requestCall() { +// setImmediate(callback); +// }; +// } + +// Safari 6.0 has a problem where timers will get lost while the user is +// scrolling. This problem does not impact ASAP because Safari 6.0 supports +// mutation observers, so that implementation is used instead. +// However, if we ever elect to use timers in Safari, the prevalent work-around +// is to add a scroll event listener that calls for a flush. + +// `setTimeout` does not call the passed callback if the delay is less than +// approximately 7 in web workers in Firefox 8 through 18, and sometimes not +// even then. + +function makeRequestCallFromTimer(callback) { + return function requestCall() { + // We dispatch a timeout with a specified delay of 0 for engines that + // can reliably accommodate that request. This will usually be snapped + // to a 4 milisecond delay, but once we're flushing, there's no delay + // between events. + var timeoutHandle = setTimeout(handleTimer, 0); + // However, since this timer gets frequently dropped in Firefox + // workers, we enlist an interval handle that will try to fire + // an event 20 times per second until it succeeds. + var intervalHandle = setInterval(handleTimer, 50); + + function handleTimer() { + // Whichever timer succeeds will cancel both timers and + // execute the callback. + clearTimeout(timeoutHandle); + clearInterval(intervalHandle); + callback(); + } + }; +} + +// This is for `asap.js` only. +// Its name will be periodically randomized to break any code that depends on +// its existence. +rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer; + +// ASAP was originally a nextTick shim included in Q. This was factored out +// into this ASAP package. It was later adapted to RSVP which made further +// amendments. These decisions, particularly to marginalize MessageChannel and +// to capture the MutationObserver implementation in a closure, were integrated +// back into ASAP proper. +// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js diff --git a/node_modules/asap/package.json b/node_modules/asap/package.json new file mode 100644 index 0000000..0e64335 --- /dev/null +++ b/node_modules/asap/package.json @@ -0,0 +1,87 @@ +{ + "_from": "asap@~2.0.3", + "_id": "asap@2.0.6", + "_inBundle": false, + "_integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "_location": "/asap", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "asap@~2.0.3", + "name": "asap", + "escapedName": "asap", + "rawSpec": "~2.0.3", + "saveSpec": null, + "fetchSpec": "~2.0.3" + }, + "_requiredBy": [ + "/promise" + ], + "_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "_shasum": "e50347611d7e690943208bbdafebcbc2fb866d46", + "_spec": "asap@~2.0.3", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/promise", + "browser": { + "./asap": "./browser-asap.js", + "./asap.js": "./browser-asap.js", + "./raw": "./browser-raw.js", + "./raw.js": "./browser-raw.js", + "./test/domain.js": "./test/browser-domain.js" + }, + "bugs": { + "url": "https://github.com/kriskowal/asap/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "High-priority task queue for Node.js and browsers", + "devDependencies": { + "benchmark": "^1.0.0", + "events": "^1.0.1", + "jshint": "^2.5.1", + "knox": "^0.8.10", + "mr": "^2.0.5", + "opener": "^1.3.0", + "q": "^2.0.3", + "q-io": "^2.0.3", + "saucelabs": "^0.1.1", + "wd": "^0.2.21", + "weak-map": "^1.0.5" + }, + "files": [ + "raw.js", + "asap.js", + "browser-raw.js", + "browser-asap.js" + ], + "homepage": "https://github.com/kriskowal/asap#readme", + "keywords": [ + "event", + "task", + "queue" + ], + "license": "MIT", + "main": "./asap.js", + "name": "asap", + "react-native": { + "domain": false + }, + "repository": { + "type": "git", + "url": "git+https://github.com/kriskowal/asap.git" + }, + "scripts": { + "benchmarks": "node benchmarks", + "lint": "jshint raw.js asap.js browser-raw.js browser-asap.js $(find scripts -name '*.js' | grep -v gauntlet)", + "test": "npm run lint && npm run test-node", + "test-browser": "node scripts/publish-bundle.js test/asap-test.js | xargs opener", + "test-node": "node test/asap-test.js", + "test-publish": "node scripts/publish-bundle.js test/asap-test.js | pbcopy", + "test-saucelabs": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-spot-configurations.json", + "test-saucelabs-all": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-all-configurations.json", + "test-saucelabs-worker": "node scripts/saucelabs-worker-test.js scripts/saucelabs-spot-configurations.json", + "test-saucelabs-worker-all": "node scripts/saucelabs-worker-test.js scripts/saucelabs-all-configurations.json", + "test-travis": "npm run lint && npm run test-node && npm run test-saucelabs && npm run test-saucelabs-worker" + }, + "version": "2.0.6" +} diff --git a/node_modules/asap/raw.js b/node_modules/asap/raw.js new file mode 100644 index 0000000..ae3b892 --- /dev/null +++ b/node_modules/asap/raw.js @@ -0,0 +1,101 @@ +"use strict"; + +var domain; // The domain module is executed on demand +var hasSetImmediate = typeof setImmediate === "function"; + +// Use the fastest means possible to execute a task in its own turn, with +// priority over other events including network IO events in Node.js. +// +// An exception thrown by a task will permanently interrupt the processing of +// subsequent tasks. The higher level `asap` function ensures that if an +// exception is thrown by a task, that the task queue will continue flushing as +// soon as possible, but if you use `rawAsap` directly, you are responsible to +// either ensure that no exceptions are thrown from your task, or to manually +// call `rawAsap.requestFlush` if an exception is thrown. +module.exports = rawAsap; +function rawAsap(task) { + if (!queue.length) { + requestFlush(); + flushing = true; + } + // Avoids a function call + queue[queue.length] = task; +} + +var queue = []; +// Once a flush has been requested, no further calls to `requestFlush` are +// necessary until the next `flush` completes. +var flushing = false; +// The position of the next task to execute in the task queue. This is +// preserved between calls to `flush` so that it can be resumed if +// a task throws an exception. +var index = 0; +// If a task schedules additional tasks recursively, the task queue can grow +// unbounded. To prevent memory excaustion, the task queue will periodically +// truncate already-completed tasks. +var capacity = 1024; + +// The flush function processes all tasks that have been scheduled with +// `rawAsap` unless and until one of those tasks throws an exception. +// If a task throws an exception, `flush` ensures that its state will remain +// consistent and will resume where it left off when called again. +// However, `flush` does not make any arrangements to be called again if an +// exception is thrown. +function flush() { + while (index < queue.length) { + var currentIndex = index; + // Advance the index before calling the task. This ensures that we will + // begin flushing on the next task the task throws an error. + index = index + 1; + queue[currentIndex].call(); + // Prevent leaking memory for long chains of recursive calls to `asap`. + // If we call `asap` within tasks scheduled by `asap`, the queue will + // grow, but to avoid an O(n) walk for every task we execute, we don't + // shift tasks off the queue after they have been executed. + // Instead, we periodically shift 1024 tasks off the queue. + if (index > capacity) { + // Manually shift all values starting at the index back to the + // beginning of the queue. + for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { + queue[scan] = queue[scan + index]; + } + queue.length -= index; + index = 0; + } + } + queue.length = 0; + index = 0; + flushing = false; +} + +rawAsap.requestFlush = requestFlush; +function requestFlush() { + // Ensure flushing is not bound to any domain. + // It is not sufficient to exit the domain, because domains exist on a stack. + // To execute code outside of any domain, the following dance is necessary. + var parentDomain = process.domain; + if (parentDomain) { + if (!domain) { + // Lazy execute the domain module. + // Only employed if the user elects to use domains. + domain = require("domain"); + } + domain.active = process.domain = null; + } + + // `setImmediate` is slower that `process.nextTick`, but `process.nextTick` + // cannot handle recursion. + // `requestFlush` will only be called recursively from `asap.js`, to resume + // flushing after an error is thrown into a domain. + // Conveniently, `setImmediate` was introduced in the same version + // `process.nextTick` started throwing recursion errors. + if (flushing && hasSetImmediate) { + setImmediate(flush); + } else { + process.nextTick(flush); + } + + if (parentDomain) { + domain.active = process.domain = parentDomain; + } +} diff --git a/node_modules/ascli/.npmignore b/node_modules/ascli/.npmignore new file mode 100644 index 0000000..5df49dc --- /dev/null +++ b/node_modules/ascli/.npmignore @@ -0,0 +1,5 @@ +node_modules/ +npm-debug.log +ascli.png +example.png +.idea/ diff --git a/node_modules/ascli/LICENSE b/node_modules/ascli/LICENSE new file mode 100644 index 0000000..75b5248 --- /dev/null +++ b/node_modules/ascli/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/ascli/README.md b/node_modules/ascli/README.md new file mode 100644 index 0000000..96e5af3 --- /dev/null +++ b/node_modules/ascli/README.md @@ -0,0 +1,64 @@ +![ascli](https://raw.github.com/dcodeIO/ascli/master/ascli.png) +===== +**Why?** Some of us are not only programmers but also part-time artist. So am I. This is good. However, to limit myself +a bit to a straight look of my CLI apps, I've created ascli based on the thought of not making things too fancy but +still looking good. So, basically, this package is meant to be used by me but if you like my interpretation of +unobtrusiveness and ease-of-use ... You are welcome! + +

+ example +

+ +Installation +------------ +`npm install ascli` + +Usage +----- +```js +var cli = require("ascli")("myAppName"); +cli.banner(ascli.appName.green.bold, "v1.0.0 by Foo Bar "); +cli.log("Hello!"); +cli.info("World!"); +cli.warn("of"); +cli.error("ascli."); +// If it worked: +cli.ok("It worked!", /* optional exit code */ 0); +// If it didn't: +cli.fail("Nope, sorry.", /* optional exit code */ 1); +``` + +#### Using another alphabet +By default ascli uses a modified version of the **straight** ASCII alphabet. If you don't like it, you are free to +replace it: + +```js +cli.use("/path/to/my/alphabet.json"); +// or +var myAlphabet = { ... }; +cli.use(myAlphabet); +``` + +See the `alphabet/` directory for an example. + +#### Using colors +ascli automatically looks up and translates ANSI terminal colors applied to the title string. For that it depends on +[colour.js](https://github.com/dcodeIO/colour.js) which is also exposed as a property of the ascli namespace: +`cli.colour` / `cli.colors`. Also means: You don't need another ANSI terminal colors dependency. + +#### Indentation +`cli.log` etc. indents all console output by one space just because it looks better with the banner. + +Parsing command line arguments +------------------------------ +[opt.js](https://github.com/dcodeIO/opt.js) will be pre-run on the `cli` namespace and also exposed as `cli.optjs()`. +```js +cli.node // Node executable +cli.script // Executed script +cli.opt // Options as a hash +cli.argv // Remaining non-option arguments +``` + +License +------- +Apache License, Version 2.0 diff --git a/node_modules/ascli/alphabet/straight.json b/node_modules/ascli/alphabet/straight.json new file mode 100644 index 0000000..b290bc4 --- /dev/null +++ b/node_modules/ascli/alphabet/straight.json @@ -0,0 +1,212 @@ +{ + "a": [ + " _ ", + "(_|", + " " + ], + "b": [ + "|_ ", + "|_)", + " " + ], + "c": [ + " _", + "( ", + " " + ], + "d": [ + " _|", + "(_|", + " " + ], + "e": [ + " _", + "(-", + " " + ], + "f": [ + "(_", + "| ", + " " + ], + "g": [ + " _ ", + "(_)", + "_/ " + ], + "h": [ + "|_ ", + "| )", + " " + ], + "i": [ + ".", + "|", + " " + ], + "j": [ + ".", + "|", + "'" + ], + "k": [ + "| ", + "|<", + " " + ], + "l": [ + "|", + "|", + " " + ], + "m": [ + " _ ", + "||)", + " " + ], + "n": [ + " _ ", + "| )", + " " + ], + "o": [ + " _ ", + "(_)", + " " + ], + "p": [ + " _ ", + "|_)", + "| " + ], + "q": [ + " _ ", + "(_|", + " |" + ], + "r": [ + " _", + "| ", + " " + ], + "s": [ + " _", + "_)", + " " + ], + "t": [ + "|_", + "|_", + " " + ], + "u": [ + " ", + "|_|", + " " + ], + "v": [ + " ", + "\\/", + " " + ], + "w": [ + " ", + "\\)/", + " " + ], + "x": [ + " ", + ")(", + " " + ], + "y": [ + " ", + "\\/", + "/ " + ], + "z": [ + "_ ", + "/_", + " " + ], + "0": [ + " _ ", + "/ \\", + "\\_/" + ], + "1": [ + " .", + "/|", + " |" + ], + "2": [ + " _ ", + " _)", + "(_ " + ], + "3": [ + "_ ", + "_)", + "_)" + ], + "4": [ + " ", + "|_|", + " |" + ], + "5": [ + " _ ", + "|_ ", + " _)" + ], + "6": [ + " ", + " / ", + "(_)" + ], + "7": [ + "__", + " /", + "/ " + ], + "8": [ + " _ ", + "(_)", + "(_)" + ], + "9": [ + " _ ", + "( )", + " /" + ], + ".": [ + " ", + ".", + " " + ], + ",": [ + " ", + ",", + " " + ], + "-": [ + "_", + " ", + " " + ], + "_": [ + " ", + "__", + " " + ], + "!": [ + "|", + ".", + " " + ], + " ": [ + " ", + " ", + " " + ] +} diff --git a/node_modules/ascli/ascli.js b/node_modules/ascli/ascli.js new file mode 100644 index 0000000..a0527ff --- /dev/null +++ b/node_modules/ascli/ascli.js @@ -0,0 +1,137 @@ +/* + Copyright 2013 Daniel Wirtz + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +var util = require("util"), + path = require("path"), + colour = require("colour"); + +// Default alphabet +var alphabet = require(path.join(__dirname, "alphabet", "straight.json")); + +module.exports = function(appName) { + ascli.appName = appName; + return ascli; +}; + +module.exports.app = module.exports; // For backward compatibility + +/** + * Builds a banner. + * @param {string=} title App name + * @param {string=} appendix Appendix, e.g. version + * @returns {string} + */ +function ascli(title, appendix) { + title = title || ascli.appName; + appendix = appendix || ""; + var lines = ["", "", ""], c, a, j, ac = ""; + for (var i=0; i} alpha File name or alphabet to use + * @returns {Function} ascli + */ +ascli.use = function(alpha) { + if (typeof alpha === 'string') + alphabet = require(alpha); + else + alphabet = alpha; + return ascli; +}; + +/** + * Prints a final success message. + * @param {string} msg Message text + * @param {number=} code Exit code, defaults not to send it explicitly + */ +ascli.ok = function(msg, code) { + process.stderr.write('\n '+ascli.appName.green.bold+' OK'.white.bold+(msg ? ' '+msg : '')+'\n'); + if (typeof code !== 'undefined') + process.exit(code); +}; + +/** + * Prints a final failure message. + * @param {string} msg Message text + * @param {number=} code Exit code, defaults to not send it explicitly + */ +ascli.fail = function(msg, code) { + process.stderr.write('\n '+ascli.appName.red.bold+' ERROR'.white.bold+(msg ? ' '+msg : '')+'\n'); + if (typeof code !== 'undefined') + process.exit(code); +}; + +/** + * opt.js + * @param {Array.=} argv + * @returns {{node: string, script: string, argv: Array., opt: Object.}} + */ +ascli.optjs = require("optjs"); + +// Pre-run it +var opt = ascli.optjs(); +ascli.node = opt.node; +ascli.script = opt.script; +ascli.argv = opt.argv; +ascli.opt = opt.opt; + +// Expose colour.js +ascli.colour = ascli.colors = colour; diff --git a/node_modules/ascli/package.json b/node_modules/ascli/package.json new file mode 100644 index 0000000..0f98330 --- /dev/null +++ b/node_modules/ascli/package.json @@ -0,0 +1,56 @@ +{ + "_from": "ascli@~1", + "_id": "ascli@1.0.1", + "_inBundle": false, + "_integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", + "_location": "/ascli", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ascli@~1", + "name": "ascli", + "escapedName": "ascli", + "rawSpec": "~1", + "saveSpec": null, + "fetchSpec": "~1" + }, + "_requiredBy": [ + "/protobufjs" + ], + "_resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", + "_shasum": "bcfa5974a62f18e81cabaeb49732ab4a88f906bc", + "_spec": "ascli@~1", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/protobufjs", + "author": { + "name": "Daniel Wirtz" + }, + "bugs": { + "url": "https://github.com/dcodeIO/ascli/issues" + }, + "bundleDependencies": false, + "dependencies": { + "colour": "~0.7.1", + "optjs": "~3.2.2" + }, + "deprecated": false, + "description": "A uniform foundation for unobtrusive (ASCII art in) cli apps.", + "homepage": "https://github.com/dcodeIO/ascli#readme", + "keywords": [ + "ansi", + "terminal", + "colors", + "ascii" + ], + "license": "Apache-2.0", + "main": "./ascli.js", + "name": "ascli", + "repository": { + "type": "url", + "url": "git+https://github.com/dcodeIO/ascli.git" + }, + "scripts": { + "test": "node tests/test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/ascli/tests/test.js b/node_modules/ascli/tests/test.js new file mode 100644 index 0000000..c323df6 --- /dev/null +++ b/node_modules/ascli/tests/test.js @@ -0,0 +1,10 @@ +var cli = require("../ascli.js")("myapp"); + +cli.banner("staying straight".green.bold, "v1.0.0 through ascli"); +cli.log("Hello world!".white.bold); +cli.log("...of ascli\n"); +cli.log("Command line arguments".white.bold); +cli.log(cli.opt, cli.argv); +cli.banner("abcdefghijklmnopqrstuvwxyz 0123456789"); +cli.ok("yep, that worked."); +cli.fail("nope, that didn't."); diff --git a/node_modules/asn1/LICENSE b/node_modules/asn1/LICENSE new file mode 100644 index 0000000..9b5dcdb --- /dev/null +++ b/node_modules/asn1/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Mark Cavage, All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE diff --git a/node_modules/asn1/README.md b/node_modules/asn1/README.md new file mode 100644 index 0000000..2208210 --- /dev/null +++ b/node_modules/asn1/README.md @@ -0,0 +1,50 @@ +node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS. +Currently BER encoding is supported; at some point I'll likely have to do DER. + +## Usage + +Mostly, if you're *actually* needing to read and write ASN.1, you probably don't +need this readme to explain what and why. If you have no idea what ASN.1 is, +see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +The source is pretty much self-explanatory, and has read/write methods for the +common types out there. + +### Decoding + +The following reads an ASN.1 sequence with a boolean. + + var Ber = require('asn1').Ber; + + var reader = new Ber.Reader(Buffer.from([0x30, 0x03, 0x01, 0x01, 0xff])); + + reader.readSequence(); + console.log('Sequence len: ' + reader.length); + if (reader.peek() === Ber.Boolean) + console.log(reader.readBoolean()); + +### Encoding + +The following generates the same payload as above. + + var Ber = require('asn1').Ber; + + var writer = new Ber.Writer(); + + writer.startSequence(); + writer.writeBoolean(true); + writer.endSequence(); + + console.log(writer.buffer); + +## Installation + + npm install asn1 + +## License + +MIT. + +## Bugs + +See . diff --git a/node_modules/asn1/lib/ber/errors.js b/node_modules/asn1/lib/ber/errors.js new file mode 100644 index 0000000..4557b8a --- /dev/null +++ b/node_modules/asn1/lib/ber/errors.js @@ -0,0 +1,13 @@ +// Copyright 2011 Mark Cavage All rights reserved. + + +module.exports = { + + newInvalidAsn1Error: function (msg) { + var e = new Error(); + e.name = 'InvalidAsn1Error'; + e.message = msg || ''; + return e; + } + +}; diff --git a/node_modules/asn1/lib/ber/index.js b/node_modules/asn1/lib/ber/index.js new file mode 100644 index 0000000..387d132 --- /dev/null +++ b/node_modules/asn1/lib/ber/index.js @@ -0,0 +1,27 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var errors = require('./errors'); +var types = require('./types'); + +var Reader = require('./reader'); +var Writer = require('./writer'); + + +// --- Exports + +module.exports = { + + Reader: Reader, + + Writer: Writer + +}; + +for (var t in types) { + if (types.hasOwnProperty(t)) + module.exports[t] = types[t]; +} +for (var e in errors) { + if (errors.hasOwnProperty(e)) + module.exports[e] = errors[e]; +} diff --git a/node_modules/asn1/lib/ber/reader.js b/node_modules/asn1/lib/ber/reader.js new file mode 100644 index 0000000..8a7e4ca --- /dev/null +++ b/node_modules/asn1/lib/ber/reader.js @@ -0,0 +1,262 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = require('assert'); +var Buffer = require('safer-buffer').Buffer; + +var ASN1 = require('./types'); +var errors = require('./errors'); + + +// --- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + + + +// --- API + +function Reader(data) { + if (!data || !Buffer.isBuffer(data)) + throw new TypeError('data must be a node Buffer'); + + this._buf = data; + this._size = data.length; + + // These hold the "current" state + this._len = 0; + this._offset = 0; +} + +Object.defineProperty(Reader.prototype, 'length', { + enumerable: true, + get: function () { return (this._len); } +}); + +Object.defineProperty(Reader.prototype, 'offset', { + enumerable: true, + get: function () { return (this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'remain', { + get: function () { return (this._size - this._offset); } +}); + +Object.defineProperty(Reader.prototype, 'buffer', { + get: function () { return (this._buf.slice(this._offset)); } +}); + + +/** + * Reads a single byte and advances offset; you can pass in `true` to make this + * a "peek" operation (i.e., get the byte, but don't advance the offset). + * + * @param {Boolean} peek true means don't move offset. + * @return {Number} the next byte, null if not enough data. + */ +Reader.prototype.readByte = function (peek) { + if (this._size - this._offset < 1) + return null; + + var b = this._buf[this._offset] & 0xff; + + if (!peek) + this._offset += 1; + + return b; +}; + + +Reader.prototype.peek = function () { + return this.readByte(true); +}; + + +/** + * Reads a (potentially) variable length off the BER buffer. This call is + * not really meant to be called directly, as callers have to manipulate + * the internal buffer afterwards. + * + * As a result of this call, you can call `Reader.length`, until the + * next thing called that does a readLength. + * + * @return {Number} the amount of offset to advance the buffer. + * @throws {InvalidAsn1Error} on bad ASN.1 + */ +Reader.prototype.readLength = function (offset) { + if (offset === undefined) + offset = this._offset; + + if (offset >= this._size) + return null; + + var lenB = this._buf[offset++] & 0xff; + if (lenB === null) + return null; + + if ((lenB & 0x80) === 0x80) { + lenB &= 0x7f; + + if (lenB === 0) + throw newInvalidAsn1Error('Indefinite length not supported'); + + if (lenB > 4) + throw newInvalidAsn1Error('encoding too long'); + + if (this._size - offset < lenB) + return null; + + this._len = 0; + for (var i = 0; i < lenB; i++) + this._len = (this._len << 8) + (this._buf[offset++] & 0xff); + + } else { + // Wasn't a variable length + this._len = lenB; + } + + return offset; +}; + + +/** + * Parses the next sequence in this BER buffer. + * + * To get the length of the sequence, call `Reader.length`. + * + * @return {Number} the sequence's tag. + */ +Reader.prototype.readSequence = function (tag) { + var seq = this.peek(); + if (seq === null) + return null; + if (tag !== undefined && tag !== seq) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + seq.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + this._offset = o; + return seq; +}; + + +Reader.prototype.readInt = function () { + return this._readTag(ASN1.Integer); +}; + + +Reader.prototype.readBoolean = function () { + return (this._readTag(ASN1.Boolean) === 0 ? false : true); +}; + + +Reader.prototype.readEnumeration = function () { + return this._readTag(ASN1.Enumeration); +}; + + +Reader.prototype.readString = function (tag, retbuf) { + if (!tag) + tag = ASN1.OctetString; + + var b = this.peek(); + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + + if (o === null) + return null; + + if (this.length > this._size - o) + return null; + + this._offset = o; + + if (this.length === 0) + return retbuf ? Buffer.alloc(0) : ''; + + var str = this._buf.slice(this._offset, this._offset + this.length); + this._offset += this.length; + + return retbuf ? str : str.toString('utf8'); +}; + +Reader.prototype.readOID = function (tag) { + if (!tag) + tag = ASN1.OID; + + var b = this.readString(tag, true); + if (b === null) + return null; + + var values = []; + var value = 0; + + for (var i = 0; i < b.length; i++) { + var byte = b[i] & 0xff; + + value <<= 7; + value += byte & 0x7f; + if ((byte & 0x80) === 0) { + values.push(value); + value = 0; + } + } + + value = values.shift(); + values.unshift(value % 40); + values.unshift((value / 40) >> 0); + + return values.join('.'); +}; + + +Reader.prototype._readTag = function (tag) { + assert.ok(tag !== undefined); + + var b = this.peek(); + + if (b === null) + return null; + + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); + + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + + if (this.length > 4) + throw newInvalidAsn1Error('Integer too long: ' + this.length); + + if (this.length > this._size - o) + return null; + this._offset = o; + + var fb = this._buf[this._offset]; + var value = 0; + + for (var i = 0; i < this.length; i++) { + value <<= 8; + value |= (this._buf[this._offset++] & 0xff); + } + + if ((fb & 0x80) === 0x80 && i !== 4) + value -= (1 << (i * 8)); + + return value >> 0; +}; + + + +// --- Exported API + +module.exports = Reader; diff --git a/node_modules/asn1/lib/ber/types.js b/node_modules/asn1/lib/ber/types.js new file mode 100644 index 0000000..8aea000 --- /dev/null +++ b/node_modules/asn1/lib/ber/types.js @@ -0,0 +1,36 @@ +// Copyright 2011 Mark Cavage All rights reserved. + + +module.exports = { + EOC: 0, + Boolean: 1, + Integer: 2, + BitString: 3, + OctetString: 4, + Null: 5, + OID: 6, + ObjectDescriptor: 7, + External: 8, + Real: 9, // float + Enumeration: 10, + PDV: 11, + Utf8String: 12, + RelativeOID: 13, + Sequence: 16, + Set: 17, + NumericString: 18, + PrintableString: 19, + T61String: 20, + VideotexString: 21, + IA5String: 22, + UTCTime: 23, + GeneralizedTime: 24, + GraphicString: 25, + VisibleString: 26, + GeneralString: 28, + UniversalString: 29, + CharacterString: 30, + BMPString: 31, + Constructor: 32, + Context: 128 +}; diff --git a/node_modules/asn1/lib/ber/writer.js b/node_modules/asn1/lib/ber/writer.js new file mode 100644 index 0000000..3515acf --- /dev/null +++ b/node_modules/asn1/lib/ber/writer.js @@ -0,0 +1,317 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +var assert = require('assert'); +var Buffer = require('safer-buffer').Buffer; +var ASN1 = require('./types'); +var errors = require('./errors'); + + +// --- Globals + +var newInvalidAsn1Error = errors.newInvalidAsn1Error; + +var DEFAULT_OPTS = { + size: 1024, + growthFactor: 8 +}; + + +// --- Helpers + +function merge(from, to) { + assert.ok(from); + assert.equal(typeof (from), 'object'); + assert.ok(to); + assert.equal(typeof (to), 'object'); + + var keys = Object.getOwnPropertyNames(from); + keys.forEach(function (key) { + if (to[key]) + return; + + var value = Object.getOwnPropertyDescriptor(from, key); + Object.defineProperty(to, key, value); + }); + + return to; +} + + + +// --- API + +function Writer(options) { + options = merge(DEFAULT_OPTS, options || {}); + + this._buf = Buffer.alloc(options.size || 1024); + this._size = this._buf.length; + this._offset = 0; + this._options = options; + + // A list of offsets in the buffer where we need to insert + // sequence tag/len pairs. + this._seq = []; +} + +Object.defineProperty(Writer.prototype, 'buffer', { + get: function () { + if (this._seq.length) + throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)'); + + return (this._buf.slice(0, this._offset)); + } +}); + +Writer.prototype.writeByte = function (b) { + if (typeof (b) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(1); + this._buf[this._offset++] = b; +}; + + +Writer.prototype.writeInt = function (i, tag) { + if (typeof (i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof (tag) !== 'number') + tag = ASN1.Integer; + + var sz = 4; + + while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && + (sz > 1)) { + sz--; + i <<= 8; + } + + if (sz > 4) + throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff'); + + this._ensure(2 + sz); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = sz; + + while (sz-- > 0) { + this._buf[this._offset++] = ((i & 0xff000000) >>> 24); + i <<= 8; + } + +}; + + +Writer.prototype.writeNull = function () { + this.writeByte(ASN1.Null); + this.writeByte(0x00); +}; + + +Writer.prototype.writeEnumeration = function (i, tag) { + if (typeof (i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof (tag) !== 'number') + tag = ASN1.Enumeration; + + return this.writeInt(i, tag); +}; + + +Writer.prototype.writeBoolean = function (b, tag) { + if (typeof (b) !== 'boolean') + throw new TypeError('argument must be a Boolean'); + if (typeof (tag) !== 'number') + tag = ASN1.Boolean; + + this._ensure(3); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = 0x01; + this._buf[this._offset++] = b ? 0xff : 0x00; +}; + + +Writer.prototype.writeString = function (s, tag) { + if (typeof (s) !== 'string') + throw new TypeError('argument must be a string (was: ' + typeof (s) + ')'); + if (typeof (tag) !== 'number') + tag = ASN1.OctetString; + + var len = Buffer.byteLength(s); + this.writeByte(tag); + this.writeLength(len); + if (len) { + this._ensure(len); + this._buf.write(s, this._offset); + this._offset += len; + } +}; + + +Writer.prototype.writeBuffer = function (buf, tag) { + if (typeof (tag) !== 'number') + throw new TypeError('tag must be a number'); + if (!Buffer.isBuffer(buf)) + throw new TypeError('argument must be a buffer'); + + this.writeByte(tag); + this.writeLength(buf.length); + this._ensure(buf.length); + buf.copy(this._buf, this._offset, 0, buf.length); + this._offset += buf.length; +}; + + +Writer.prototype.writeStringArray = function (strings) { + if ((!strings instanceof Array)) + throw new TypeError('argument must be an Array[String]'); + + var self = this; + strings.forEach(function (s) { + self.writeString(s); + }); +}; + +// This is really to solve DER cases, but whatever for now +Writer.prototype.writeOID = function (s, tag) { + if (typeof (s) !== 'string') + throw new TypeError('argument must be a string'); + if (typeof (tag) !== 'number') + tag = ASN1.OID; + + if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) + throw new Error('argument is not a valid OID string'); + + function encodeOctet(bytes, octet) { + if (octet < 128) { + bytes.push(octet); + } else if (octet < 16384) { + bytes.push((octet >>> 7) | 0x80); + bytes.push(octet & 0x7F); + } else if (octet < 2097152) { + bytes.push((octet >>> 14) | 0x80); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else if (octet < 268435456) { + bytes.push((octet >>> 21) | 0x80); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else { + bytes.push(((octet >>> 28) | 0x80) & 0xFF); + bytes.push(((octet >>> 21) | 0x80) & 0xFF); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } + } + + var tmp = s.split('.'); + var bytes = []; + bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); + tmp.slice(2).forEach(function (b) { + encodeOctet(bytes, parseInt(b, 10)); + }); + + var self = this; + this._ensure(2 + bytes.length); + this.writeByte(tag); + this.writeLength(bytes.length); + bytes.forEach(function (b) { + self.writeByte(b); + }); +}; + + +Writer.prototype.writeLength = function (len) { + if (typeof (len) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(4); + + if (len <= 0x7f) { + this._buf[this._offset++] = len; + } else if (len <= 0xff) { + this._buf[this._offset++] = 0x81; + this._buf[this._offset++] = len; + } else if (len <= 0xffff) { + this._buf[this._offset++] = 0x82; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else if (len <= 0xffffff) { + this._buf[this._offset++] = 0x83; + this._buf[this._offset++] = len >> 16; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else { + throw newInvalidAsn1Error('Length too long (> 4 bytes)'); + } +}; + +Writer.prototype.startSequence = function (tag) { + if (typeof (tag) !== 'number') + tag = ASN1.Sequence | ASN1.Constructor; + + this.writeByte(tag); + this._seq.push(this._offset); + this._ensure(3); + this._offset += 3; +}; + + +Writer.prototype.endSequence = function () { + var seq = this._seq.pop(); + var start = seq + 3; + var len = this._offset - start; + + if (len <= 0x7f) { + this._shift(start, len, -2); + this._buf[seq] = len; + } else if (len <= 0xff) { + this._shift(start, len, -1); + this._buf[seq] = 0x81; + this._buf[seq + 1] = len; + } else if (len <= 0xffff) { + this._buf[seq] = 0x82; + this._buf[seq + 1] = len >> 8; + this._buf[seq + 2] = len; + } else if (len <= 0xffffff) { + this._shift(start, len, 1); + this._buf[seq] = 0x83; + this._buf[seq + 1] = len >> 16; + this._buf[seq + 2] = len >> 8; + this._buf[seq + 3] = len; + } else { + throw newInvalidAsn1Error('Sequence too long'); + } +}; + + +Writer.prototype._shift = function (start, len, shift) { + assert.ok(start !== undefined); + assert.ok(len !== undefined); + assert.ok(shift); + + this._buf.copy(this._buf, start + shift, start, start + len); + this._offset += shift; +}; + +Writer.prototype._ensure = function (len) { + assert.ok(len); + + if (this._size - this._offset < len) { + var sz = this._size * this._options.growthFactor; + if (sz - this._offset < len) + sz += len; + + var buf = Buffer.alloc(sz); + + this._buf.copy(buf, 0, 0, this._offset); + this._buf = buf; + this._size = sz; + } +}; + + + +// --- Exported API + +module.exports = Writer; diff --git a/node_modules/asn1/lib/index.js b/node_modules/asn1/lib/index.js new file mode 100644 index 0000000..ede3ab2 --- /dev/null +++ b/node_modules/asn1/lib/index.js @@ -0,0 +1,20 @@ +// Copyright 2011 Mark Cavage All rights reserved. + +// If you have no idea what ASN.1 or BER is, see this: +// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +var Ber = require('./ber/index'); + + + +// --- Exported API + +module.exports = { + + Ber: Ber, + + BerReader: Ber.Reader, + + BerWriter: Ber.Writer + +}; diff --git a/node_modules/asn1/package.json b/node_modules/asn1/package.json new file mode 100644 index 0000000..f2e2c09 --- /dev/null +++ b/node_modules/asn1/package.json @@ -0,0 +1,75 @@ +{ + "_from": "asn1@~0.2.3", + "_id": "asn1@0.2.4", + "_inBundle": false, + "_integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "_location": "/asn1", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "asn1@~0.2.3", + "name": "asn1", + "escapedName": "asn1", + "rawSpec": "~0.2.3", + "saveSpec": null, + "fetchSpec": "~0.2.3" + }, + "_requiredBy": [ + "/sshpk" + ], + "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "_shasum": "8d2475dfab553bb33e77b54e59e880bb8ce23136", + "_spec": "asn1@~0.2.3", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/sshpk", + "author": { + "name": "Joyent", + "url": "joyent.com" + }, + "bugs": { + "url": "https://github.com/joyent/node-asn1/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "David Gwynne", + "email": "loki@animata.net" + }, + { + "name": "Yunong Xiao", + "email": "yunong@joyent.com" + }, + { + "name": "Alex Wilson", + "email": "alex.wilson@joyent.com" + } + ], + "dependencies": { + "safer-buffer": "~2.1.0" + }, + "deprecated": false, + "description": "Contains parsers and serializers for ASN.1 (currently BER only)", + "devDependencies": { + "eslint": "2.13.1", + "eslint-plugin-joyent": "~1.3.0", + "faucet": "0.0.1", + "istanbul": "^0.3.6", + "tape": "^3.5.0" + }, + "homepage": "https://github.com/joyent/node-asn1#readme", + "license": "MIT", + "main": "lib/index.js", + "name": "asn1", + "repository": { + "type": "git", + "url": "git://github.com/joyent/node-asn1.git" + }, + "scripts": { + "test": "tape ./test/ber/*.test.js" + }, + "version": "0.2.4" +} diff --git a/node_modules/assert-plus/AUTHORS b/node_modules/assert-plus/AUTHORS new file mode 100644 index 0000000..1923524 --- /dev/null +++ b/node_modules/assert-plus/AUTHORS @@ -0,0 +1,6 @@ +Dave Eddy +Fred Kuo +Lars-Magnus Skog +Mark Cavage +Patrick Mooney +Rob Gulewich diff --git a/node_modules/assert-plus/CHANGES.md b/node_modules/assert-plus/CHANGES.md new file mode 100644 index 0000000..57d92bf --- /dev/null +++ b/node_modules/assert-plus/CHANGES.md @@ -0,0 +1,14 @@ +# assert-plus Changelog + +## 1.0.0 + +- *BREAKING* assert.number (and derivatives) now accept Infinity as valid input +- Add assert.finite check. Previous assert.number callers should use this if + they expect Infinity inputs to throw. + +## 0.2.0 + +- Fix `assert.object(null)` so it throws +- Fix optional/arrayOf exports for non-type-of asserts +- Add optiona/arrayOf exports for Stream/Date/Regex/uuid +- Add basic unit test coverage diff --git a/node_modules/assert-plus/README.md b/node_modules/assert-plus/README.md new file mode 100644 index 0000000..ec200d1 --- /dev/null +++ b/node_modules/assert-plus/README.md @@ -0,0 +1,162 @@ +# assert-plus + +This library is a super small wrapper over node's assert module that has two +things: (1) the ability to disable assertions with the environment variable +NODE\_NDEBUG, and (2) some API wrappers for argument testing. Like +`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks +like this: + +```javascript + var assert = require('assert-plus'); + + function fooAccount(options, callback) { + assert.object(options, 'options'); + assert.number(options.id, 'options.id'); + assert.bool(options.isManager, 'options.isManager'); + assert.string(options.name, 'options.name'); + assert.arrayOfString(options.email, 'options.email'); + assert.func(callback, 'callback'); + + // Do stuff + callback(null, {}); + } +``` + +# API + +All methods that *aren't* part of node's core assert API are simply assumed to +take an argument, and then a string 'name' that's not a message; `AssertionError` +will be thrown if the assertion fails with a message like: + + AssertionError: foo (string) is required + at test (/home/mark/work/foo/foo.js:3:9) + at Object. (/home/mark/work/foo/foo.js:15:1) + at Module._compile (module.js:446:26) + at Object..js (module.js:464:10) + at Module.load (module.js:353:31) + at Function._load (module.js:311:12) + at Array.0 (module.js:484:10) + at EventEmitter._tickCallback (node.js:190:38) + +from: + +```javascript + function test(foo) { + assert.string(foo, 'foo'); + } +``` + +There you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`: + +```javascript + function test(foo) { + assert.arrayOfString(foo, 'foo'); + } +``` + +You can assert IFF an argument is not `undefined` (i.e., an optional arg): + +```javascript + assert.optionalString(foo, 'foo'); +``` + +Lastly, you can opt-out of assertion checking altogether by setting the +environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have +lots of assertions, and don't want to pay `typeof ()` taxes to v8 in +production. Be advised: The standard functions re-exported from `assert` are +also disabled in assert-plus if NDEBUG is specified. Using them directly from +the `assert` module avoids this behavior. + +The complete list of APIs is: + +* assert.array +* assert.bool +* assert.buffer +* assert.func +* assert.number +* assert.finite +* assert.object +* assert.string +* assert.stream +* assert.date +* assert.regexp +* assert.uuid +* assert.arrayOfArray +* assert.arrayOfBool +* assert.arrayOfBuffer +* assert.arrayOfFunc +* assert.arrayOfNumber +* assert.arrayOfFinite +* assert.arrayOfObject +* assert.arrayOfString +* assert.arrayOfStream +* assert.arrayOfDate +* assert.arrayOfRegexp +* assert.arrayOfUuid +* assert.optionalArray +* assert.optionalBool +* assert.optionalBuffer +* assert.optionalFunc +* assert.optionalNumber +* assert.optionalFinite +* assert.optionalObject +* assert.optionalString +* assert.optionalStream +* assert.optionalDate +* assert.optionalRegexp +* assert.optionalUuid +* assert.optionalArrayOfArray +* assert.optionalArrayOfBool +* assert.optionalArrayOfBuffer +* assert.optionalArrayOfFunc +* assert.optionalArrayOfNumber +* assert.optionalArrayOfFinite +* assert.optionalArrayOfObject +* assert.optionalArrayOfString +* assert.optionalArrayOfStream +* assert.optionalArrayOfDate +* assert.optionalArrayOfRegexp +* assert.optionalArrayOfUuid +* assert.AssertionError +* assert.fail +* assert.ok +* assert.equal +* assert.notEqual +* assert.deepEqual +* assert.notDeepEqual +* assert.strictEqual +* assert.notStrictEqual +* assert.throws +* assert.doesNotThrow +* assert.ifError + +# Installation + + npm install assert-plus + +## License + +The MIT License (MIT) +Copyright (c) 2012 Mark Cavage + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +## Bugs + +See . diff --git a/node_modules/assert-plus/assert.js b/node_modules/assert-plus/assert.js new file mode 100644 index 0000000..26f944e --- /dev/null +++ b/node_modules/assert-plus/assert.js @@ -0,0 +1,211 @@ +// Copyright (c) 2012, Mark Cavage. All rights reserved. +// Copyright 2015 Joyent, Inc. + +var assert = require('assert'); +var Stream = require('stream').Stream; +var util = require('util'); + + +///--- Globals + +/* JSSTYLED */ +var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; + + +///--- Internal + +function _capitalize(str) { + return (str.charAt(0).toUpperCase() + str.slice(1)); +} + +function _toss(name, expected, oper, arg, actual) { + throw new assert.AssertionError({ + message: util.format('%s (%s) is required', name, expected), + actual: (actual === undefined) ? typeof (arg) : actual(arg), + expected: expected, + operator: oper || '===', + stackStartFunction: _toss.caller + }); +} + +function _getClass(arg) { + return (Object.prototype.toString.call(arg).slice(8, -1)); +} + +function noop() { + // Why even bother with asserts? +} + + +///--- Exports + +var types = { + bool: { + check: function (arg) { return typeof (arg) === 'boolean'; } + }, + func: { + check: function (arg) { return typeof (arg) === 'function'; } + }, + string: { + check: function (arg) { return typeof (arg) === 'string'; } + }, + object: { + check: function (arg) { + return typeof (arg) === 'object' && arg !== null; + } + }, + number: { + check: function (arg) { + return typeof (arg) === 'number' && !isNaN(arg); + } + }, + finite: { + check: function (arg) { + return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); + } + }, + buffer: { + check: function (arg) { return Buffer.isBuffer(arg); }, + operator: 'Buffer.isBuffer' + }, + array: { + check: function (arg) { return Array.isArray(arg); }, + operator: 'Array.isArray' + }, + stream: { + check: function (arg) { return arg instanceof Stream; }, + operator: 'instanceof', + actual: _getClass + }, + date: { + check: function (arg) { return arg instanceof Date; }, + operator: 'instanceof', + actual: _getClass + }, + regexp: { + check: function (arg) { return arg instanceof RegExp; }, + operator: 'instanceof', + actual: _getClass + }, + uuid: { + check: function (arg) { + return typeof (arg) === 'string' && UUID_REGEXP.test(arg); + }, + operator: 'isUUID' + } +}; + +function _setExports(ndebug) { + var keys = Object.keys(types); + var out; + + /* re-export standard assert */ + if (process.env.NODE_NDEBUG) { + out = noop; + } else { + out = function (arg, msg) { + if (!arg) { + _toss(msg, 'true', arg); + } + }; + } + + /* standard checks */ + keys.forEach(function (k) { + if (ndebug) { + out[k] = noop; + return; + } + var type = types[k]; + out[k] = function (arg, msg) { + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* optional checks */ + keys.forEach(function (k) { + var name = 'optional' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!type.check(arg)) { + _toss(msg, k, type.operator, arg, type.actual); + } + }; + }); + + /* arrayOf checks */ + keys.forEach(function (k) { + var name = 'arrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* optionalArrayOf checks */ + keys.forEach(function (k) { + var name = 'optionalArrayOf' + _capitalize(k); + if (ndebug) { + out[name] = noop; + return; + } + var type = types[k]; + var expected = '[' + k + ']'; + out[name] = function (arg, msg) { + if (arg === undefined || arg === null) { + return; + } + if (!Array.isArray(arg)) { + _toss(msg, expected, type.operator, arg, type.actual); + } + var i; + for (i = 0; i < arg.length; i++) { + if (!type.check(arg[i])) { + _toss(msg, expected, type.operator, arg, type.actual); + } + } + }; + }); + + /* re-export built-in assertions */ + Object.keys(assert).forEach(function (k) { + if (k === 'AssertionError') { + out[k] = assert[k]; + return; + } + if (ndebug) { + out[k] = noop; + return; + } + out[k] = assert[k]; + }); + + /* export ourselves (for unit tests _only_) */ + out._setExports = _setExports; + + return out; +} + +module.exports = _setExports(process.env.NODE_NDEBUG); diff --git a/node_modules/assert-plus/package.json b/node_modules/assert-plus/package.json new file mode 100644 index 0000000..785548c --- /dev/null +++ b/node_modules/assert-plus/package.json @@ -0,0 +1,87 @@ +{ + "_from": "assert-plus@^1.0.0", + "_id": "assert-plus@1.0.0", + "_inBundle": false, + "_integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "_location": "/assert-plus", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "assert-plus@^1.0.0", + "name": "assert-plus", + "escapedName": "assert-plus", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/dashdash", + "/getpass", + "/http-signature", + "/jsprim", + "/sshpk", + "/verror" + ], + "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", + "_spec": "assert-plus@^1.0.0", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/http-signature", + "author": { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + "bugs": { + "url": "https://github.com/mcavage/node-assert-plus/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Dave Eddy", + "email": "dave@daveeddy.com" + }, + { + "name": "Fred Kuo", + "email": "fred.kuo@joyent.com" + }, + { + "name": "Lars-Magnus Skog", + "email": "ralphtheninja@riseup.net" + }, + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "Patrick Mooney", + "email": "pmooney@pfmooney.com" + }, + { + "name": "Rob Gulewich", + "email": "robert.gulewich@joyent.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Extra assertions on top of node's assert module", + "devDependencies": { + "faucet": "0.0.1", + "tape": "4.2.2" + }, + "engines": { + "node": ">=0.8" + }, + "homepage": "https://github.com/mcavage/node-assert-plus#readme", + "license": "MIT", + "main": "./assert.js", + "name": "assert-plus", + "optionalDependencies": {}, + "repository": { + "type": "git", + "url": "git+https://github.com/mcavage/node-assert-plus.git" + }, + "scripts": { + "test": "tape tests/*.js | ./node_modules/.bin/faucet" + }, + "version": "1.0.0" +} diff --git a/node_modules/async-limiter/.eslintignore b/node_modules/async-limiter/.eslintignore new file mode 100644 index 0000000..e1661e5 --- /dev/null +++ b/node_modules/async-limiter/.eslintignore @@ -0,0 +1,2 @@ +coverage +.nyc_output \ No newline at end of file diff --git a/node_modules/async-limiter/.nycrc b/node_modules/async-limiter/.nycrc new file mode 100644 index 0000000..874c1de --- /dev/null +++ b/node_modules/async-limiter/.nycrc @@ -0,0 +1,10 @@ +{ + "check-coverage": false, + "lines": 99, + "statements": 99, + "functions": 99, + "branches": 99, + "include": [ + "index.js" + ] +} \ No newline at end of file diff --git a/node_modules/async-limiter/.travis.yml b/node_modules/async-limiter/.travis.yml new file mode 100644 index 0000000..37026e2 --- /dev/null +++ b/node_modules/async-limiter/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "6" + - "8" + - "10" + - "node" +script: npm run travis +cache: + yarn: true diff --git a/node_modules/async-limiter/LICENSE b/node_modules/async-limiter/LICENSE new file mode 100644 index 0000000..9c91fb2 --- /dev/null +++ b/node_modules/async-limiter/LICENSE @@ -0,0 +1,8 @@ +The MIT License (MIT) +Copyright (c) 2017 Samuel Reed + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/async-limiter/index.js b/node_modules/async-limiter/index.js new file mode 100644 index 0000000..c9bd2f9 --- /dev/null +++ b/node_modules/async-limiter/index.js @@ -0,0 +1,67 @@ +'use strict'; + +function Queue(options) { + if (!(this instanceof Queue)) { + return new Queue(options); + } + + options = options || {}; + this.concurrency = options.concurrency || Infinity; + this.pending = 0; + this.jobs = []; + this.cbs = []; + this._done = done.bind(this); +} + +var arrayAddMethods = [ + 'push', + 'unshift', + 'splice' +]; + +arrayAddMethods.forEach(function(method) { + Queue.prototype[method] = function() { + var methodResult = Array.prototype[method].apply(this.jobs, arguments); + this._run(); + return methodResult; + }; +}); + +Object.defineProperty(Queue.prototype, 'length', { + get: function() { + return this.pending + this.jobs.length; + } +}); + +Queue.prototype._run = function() { + if (this.pending === this.concurrency) { + return; + } + if (this.jobs.length) { + var job = this.jobs.shift(); + this.pending++; + job(this._done); + this._run(); + } + + if (this.pending === 0) { + while (this.cbs.length !== 0) { + var cb = this.cbs.pop(); + process.nextTick(cb); + } + } +}; + +Queue.prototype.onDone = function(cb) { + if (typeof cb === 'function') { + this.cbs.push(cb); + this._run(); + } +}; + +function done() { + this.pending--; + this._run(); +} + +module.exports = Queue; diff --git a/node_modules/async-limiter/package.json b/node_modules/async-limiter/package.json new file mode 100644 index 0000000..d2e4b1e --- /dev/null +++ b/node_modules/async-limiter/package.json @@ -0,0 +1,69 @@ +{ + "_from": "async-limiter@~1.0.0", + "_id": "async-limiter@1.0.1", + "_inBundle": false, + "_integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "_location": "/async-limiter", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "async-limiter@~1.0.0", + "name": "async-limiter", + "escapedName": "async-limiter", + "rawSpec": "~1.0.0", + "saveSpec": null, + "fetchSpec": "~1.0.0" + }, + "_requiredBy": [ + "/ws" + ], + "_resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "_shasum": "dd379e94f0db8310b08291f9d64c3209766617fd", + "_spec": "async-limiter@~1.0.0", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/ws", + "author": { + "name": "Samuel Reed" + }, + "bugs": { + "url": "https://github.com/strml/async-limiter/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "asynchronous function queue with adjustable concurrency", + "devDependencies": { + "coveralls": "^3.0.3", + "eslint": "^5.16.0", + "eslint-plugin-mocha": "^5.3.0", + "intelli-espower-loader": "^1.0.1", + "mocha": "^6.1.4", + "nyc": "^14.1.1", + "power-assert": "^1.6.1" + }, + "homepage": "https://github.com/strml/async-limiter#readme", + "keywords": [ + "throttle", + "async", + "limiter", + "asynchronous", + "job", + "task", + "concurrency", + "concurrent" + ], + "license": "MIT", + "name": "async-limiter", + "repository": { + "type": "git", + "url": "git+https://github.com/strml/async-limiter.git" + }, + "scripts": { + "coverage": "nyc npm test && nyc report --reporter=text-lcov | coveralls", + "example": "node example", + "lint": "eslint .", + "test": "mocha --require intelli-espower-loader test/", + "travis": "npm run lint && npm run test" + }, + "version": "1.0.1" +} diff --git a/node_modules/async-limiter/readme.md b/node_modules/async-limiter/readme.md new file mode 100644 index 0000000..fcaa22f --- /dev/null +++ b/node_modules/async-limiter/readme.md @@ -0,0 +1,132 @@ +# Async-Limiter + +A module for limiting concurrent asynchronous actions in flight. Forked from [queue](https://github.com/jessetane/queue). + +[![npm](http://img.shields.io/npm/v/async-limiter.svg?style=flat-square)](http://www.npmjs.org/async-limiter) +[![tests](https://img.shields.io/travis/STRML/async-limiter.svg?style=flat-square&branch=master)](https://travis-ci.org/STRML/async-limiter) +[![coverage](https://img.shields.io/coveralls/STRML/async-limiter.svg?style=flat-square&branch=master)](https://coveralls.io/r/STRML/async-limiter) + +This module exports a class `Limiter` that implements some of the `Array` API. +Pass async functions (ones that accept a callback or return a promise) to an instance's additive array methods. + +## Motivation + +Certain functions, like `zlib`, have [undesirable behavior](https://github.com/nodejs/node/issues/8871#issuecomment-250915913) when +run at infinite concurrency. + +In this case, it is actually faster, and takes far less memory, to limit concurrency. + +This module should do the absolute minimum work necessary to queue up functions. PRs are welcome that would +make this module faster or lighter, but new functionality is not desired. + +Style should confirm to nodejs/node style. + +## Example + +``` javascript +var Limiter = require('async-limiter') + +var t = new Limiter({concurrency: 2}); +var results = [] + +// add jobs using the familiar Array API +t.push(function (cb) { + results.push('two') + cb() +}) + +t.push( + function (cb) { + results.push('four') + cb() + }, + function (cb) { + results.push('five') + cb() + } +) + +t.unshift(function (cb) { + results.push('one') + cb() +}) + +t.splice(2, 0, function (cb) { + results.push('three') + cb() +}) + +// Jobs run automatically. If you want a callback when all are done, +// call 'onDone()'. +t.onDone(function () { + console.log('all done:', results) +}) +``` + +## Zlib Example + +```js +const zlib = require('zlib'); +const Limiter = require('async-limiter'); + +const message = {some: "data"}; +const payload = new Buffer(JSON.stringify(message)); + +// Try with different concurrency values to see how this actually +// slows significantly with higher concurrency! +// +// 5: 1398.607ms +// 10: 1375.668ms +// Infinity: 4423.300ms +// +const t = new Limiter({concurrency: 5}); +function deflate(payload, cb) { + t.push(function(done) { + zlib.deflate(payload, function(err, buffer) { + done(); + cb(err, buffer); + }); + }); +} + +console.time('deflate'); +for(let i = 0; i < 30000; ++i) { + deflate(payload, function (err, buffer) {}); +} +t.onDone(function() { + console.timeEnd('deflate'); +}); +``` + +## Install + +`npm install async-limiter` + +## Test + +`npm test` + +## API + +### `var t = new Limiter([opts])` +Constructor. `opts` may contain inital values for: +* `t.concurrency` + +## Instance methods + +### `t.onDone(fn)` +`fn` will be called once and only once, when the queue is empty. + +## Instance methods mixed in from `Array` +Mozilla has docs on how these methods work [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array). +### `t.push(element1, ..., elementN)` +### `t.unshift(element1, ..., elementN)` +### `t.splice(index , howMany[, element1[, ...[, elementN]]])` + +## Properties +### `t.concurrency` +Max number of jobs the queue should process concurrently, defaults to `Infinity`. + +### `t.length` +Jobs pending + jobs to process (readonly). + diff --git a/node_modules/async/CHANGELOG.md b/node_modules/async/CHANGELOG.md new file mode 100644 index 0000000..3f13a0d --- /dev/null +++ b/node_modules/async/CHANGELOG.md @@ -0,0 +1,275 @@ +# v2.6.3 +- Updated lodash to squelch a security warning (#1675) + +# v2.6.2 +- Updated lodash to squelch a security warning (#1620) + +# v2.6.1 +- Updated lodash to prevent `npm audit` warnings. (#1532, #1533) +- Made `async-es` more optimized for webpack users (#1517) +- Fixed a stack overflow with large collections and a synchronous iterator (#1514) +- Various small fixes/chores (#1505, #1511, #1527, #1530) + +# v2.6.0 +- Added missing aliases for many methods. Previously, you could not (e.g.) `require('async/find')` or use `async.anyLimit`. (#1483) +- Improved `queue` performance. (#1448, #1454) +- Add missing sourcemap (#1452, #1453) +- Various doc updates (#1448, #1471, #1483) + +# v2.5.0 +- Added `concatLimit`, the `Limit` equivalent of [`concat`](https://caolan.github.io/async/docs.html#concat) ([#1426](https://github.com/caolan/async/issues/1426), [#1430](https://github.com/caolan/async/pull/1430)) +- `concat` improvements: it now preserves order, handles falsy values and the `iteratee` callback takes a variable number of arguments ([#1437](https://github.com/caolan/async/issues/1437), [#1436](https://github.com/caolan/async/pull/1436)) +- Fixed an issue in `queue` where there was a size discrepancy between `workersList().length` and `running()` ([#1428](https://github.com/caolan/async/issues/1428), [#1429](https://github.com/caolan/async/pull/1429)) +- Various doc fixes ([#1422](https://github.com/caolan/async/issues/1422), [#1424](https://github.com/caolan/async/pull/1424)) + +# v2.4.1 +- Fixed a bug preventing functions wrapped with `timeout()` from being re-used. ([#1418](https://github.com/caolan/async/issues/1418), [#1419](https://github.com/caolan/async/issues/1419)) + +# v2.4.0 +- Added `tryEach`, for running async functions in parallel, where you only expect one to succeed. ([#1365](https://github.com/caolan/async/issues/1365), [#687](https://github.com/caolan/async/issues/687)) +- Improved performance, most notably in `parallel` and `waterfall` ([#1395](https://github.com/caolan/async/issues/1395)) +- Added `queue.remove()`, for removing items in a `queue` ([#1397](https://github.com/caolan/async/issues/1397), [#1391](https://github.com/caolan/async/issues/1391)) +- Fixed using `eval`, preventing Async from running in pages with Content Security Policy ([#1404](https://github.com/caolan/async/issues/1404), [#1403](https://github.com/caolan/async/issues/1403)) +- Fixed errors thrown in an `asyncify`ed function's callback being caught by the underlying Promise ([#1408](https://github.com/caolan/async/issues/1408)) +- Fixed timing of `queue.empty()` ([#1367](https://github.com/caolan/async/issues/1367)) +- Various doc fixes ([#1314](https://github.com/caolan/async/issues/1314), [#1394](https://github.com/caolan/async/issues/1394), [#1412](https://github.com/caolan/async/issues/1412)) + +# v2.3.0 +- Added support for ES2017 `async` functions. Wherever you can pass a Node-style/CPS function that uses a callback, you can also pass an `async` function. Previously, you had to wrap `async` functions with `asyncify`. The caveat is that it will only work if `async` functions are supported natively in your environment, transpiled implementations can't be detected. ([#1386](https://github.com/caolan/async/issues/1386), [#1390](https://github.com/caolan/async/issues/1390)) +- Small doc fix ([#1392](https://github.com/caolan/async/issues/1392)) + +# v2.2.0 +- Added `groupBy`, and the `Series`/`Limit` equivalents, analogous to [`_.groupBy`](http://lodash.com/docs#groupBy) ([#1364](https://github.com/caolan/async/issues/1364)) +- Fixed `transform` bug when `callback` was not passed ([#1381](https://github.com/caolan/async/issues/1381)) +- Added note about `reflect` to `parallel` docs ([#1385](https://github.com/caolan/async/issues/1385)) + +# v2.1.5 +- Fix `auto` bug when function names collided with Array.prototype ([#1358](https://github.com/caolan/async/issues/1358)) +- Improve some error messages ([#1349](https://github.com/caolan/async/issues/1349)) +- Avoid stack overflow case in queue +- Fixed an issue in `some`, `every` and `find` where processing would continue after the result was determined. +- Cleanup implementations of `some`, `every` and `find` + +# v2.1.3 +- Make bundle size smaller +- Create optimized hotpath for `filter` in array case. + +# v2.1.2 +- Fixed a stackoverflow bug with `detect`, `some`, `every` on large inputs ([#1293](https://github.com/caolan/async/issues/1293)). + +# v2.1.0 + +- `retry` and `retryable` now support an optional `errorFilter` function that determines if the `task` should retry on the error ([#1256](https://github.com/caolan/async/issues/1256), [#1261](https://github.com/caolan/async/issues/1261)) +- Optimized array iteration in `race`, `cargo`, `queue`, and `priorityQueue` ([#1253](https://github.com/caolan/async/issues/1253)) +- Added alias documentation to doc site ([#1251](https://github.com/caolan/async/issues/1251), [#1254](https://github.com/caolan/async/issues/1254)) +- Added [BootStrap scrollspy](http://getbootstrap.com/javascript/#scrollspy) to docs to highlight in the sidebar the current method being viewed ([#1289](https://github.com/caolan/async/issues/1289), [#1300](https://github.com/caolan/async/issues/1300)) +- Various minor doc fixes ([#1263](https://github.com/caolan/async/issues/1263), [#1264](https://github.com/caolan/async/issues/1264), [#1271](https://github.com/caolan/async/issues/1271), [#1278](https://github.com/caolan/async/issues/1278), [#1280](https://github.com/caolan/async/issues/1280), [#1282](https://github.com/caolan/async/issues/1282), [#1302](https://github.com/caolan/async/issues/1302)) + +# v2.0.1 + +- Significantly optimized all iteration based collection methods such as `each`, `map`, `filter`, etc ([#1245](https://github.com/caolan/async/issues/1245), [#1246](https://github.com/caolan/async/issues/1246), [#1247](https://github.com/caolan/async/issues/1247)). + +# v2.0.0 + +Lots of changes here! + +First and foremost, we have a slick new [site for docs](https://caolan.github.io/async/). Special thanks to [**@hargasinski**](https://github.com/hargasinski) for his work converting our old docs to `jsdoc` format and implementing the new website. Also huge ups to [**@ivanseidel**](https://github.com/ivanseidel) for designing our new logo. It was a long process for both of these tasks, but I think these changes turned out extraordinary well. + +The biggest feature is modularization. You can now `require("async/series")` to only require the `series` function. Every Async library function is available this way. You still can `require("async")` to require the entire library, like you could do before. + +We also provide Async as a collection of ES2015 modules. You can now `import {each} from 'async-es'` or `import waterfall from 'async-es/waterfall'`. If you are using only a few Async functions, and are using a ES bundler such as Rollup, this can significantly lower your build size. + +Major thanks to [**@Kikobeats**](github.com/Kikobeats), [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for doing the majority of the modularization work, as well as [**@jdalton**](github.com/jdalton) and [**@Rich-Harris**](github.com/Rich-Harris) for advisory work on the general modularization strategy. + +Another one of the general themes of the 2.0 release is standardization of what an "async" function is. We are now more strictly following the node-style continuation passing style. That is, an async function is a function that: + +1. Takes a variable number of arguments +2. The last argument is always a callback +3. The callback can accept any number of arguments +4. The first argument passed to the callback will be treated as an error result, if the argument is truthy +5. Any number of result arguments can be passed after the "error" argument +6. The callback is called once and exactly once, either on the same tick or later tick of the JavaScript event loop. + +There were several cases where Async accepted some functions that did not strictly have these properties, most notably `auto`, `every`, `some`, `filter`, `reject` and `detect`. + +Another theme is performance. We have eliminated internal deferrals in all cases where they make sense. For example, in `waterfall` and `auto`, there was a `setImmediate` between each task -- these deferrals have been removed. A `setImmediate` call can add up to 1ms of delay. This might not seem like a lot, but it can add up if you are using many Async functions in the course of processing a HTTP request, for example. Nearly all asynchronous functions that do I/O already have some sort of deferral built in, so the extra deferral is unnecessary. The trade-off of this change is removing our built-in stack-overflow defense. Many synchronous callback calls in series can quickly overflow the JS call stack. If you do have a function that is sometimes synchronous (calling its callback on the same tick), and are running into stack overflows, wrap it with `async.ensureAsync()`. + +Another big performance win has been re-implementing `queue`, `cargo`, and `priorityQueue` with [doubly linked lists](https://en.wikipedia.org/wiki/Doubly_linked_list) instead of arrays. This has lead to queues being an order of [magnitude faster on large sets of tasks](https://github.com/caolan/async/pull/1205). + +## New Features + +- Async is now modularized. Individual functions can be `require()`d from the main package. (`require('async/auto')`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996)) +- Async is also available as a collection of ES2015 modules in the new `async-es` package. (`import {forEachSeries} from 'async-es'`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996)) +- Added `race`, analogous to `Promise.race()`. It will run an array of async tasks in parallel and will call its callback with the result of the first task to respond. ([#568](https://github.com/caolan/async/issues/568), [#1038](https://github.com/caolan/async/issues/1038)) +- Collection methods now accept ES2015 iterators. Maps, Sets, and anything that implements the iterator spec can now be passed directly to `each`, `map`, `parallel`, etc.. ([#579](https://github.com/caolan/async/issues/579), [#839](https://github.com/caolan/async/issues/839), [#1074](https://github.com/caolan/async/issues/1074)) +- Added `mapValues`, for mapping over the properties of an object and returning an object with the same keys. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177)) +- Added `timeout`, a wrapper for an async function that will make the task time-out after the specified time. ([#1007](https://github.com/caolan/async/issues/1007), [#1027](https://github.com/caolan/async/issues/1027)) +- Added `reflect` and `reflectAll`, analagous to [`Promise.reflect()`](http://bluebirdjs.com/docs/api/reflect.html), a wrapper for async tasks that always succeeds, by gathering results and errors into an object. ([#942](https://github.com/caolan/async/issues/942), [#1012](https://github.com/caolan/async/issues/1012), [#1095](https://github.com/caolan/async/issues/1095)) +- `constant` supports dynamic arguments -- it will now always use its last argument as the callback. ([#1016](https://github.com/caolan/async/issues/1016), [#1052](https://github.com/caolan/async/issues/1052)) +- `setImmediate` and `nextTick` now support arguments to partially apply to the deferred function, like the node-native versions do. ([#940](https://github.com/caolan/async/issues/940), [#1053](https://github.com/caolan/async/issues/1053)) +- `auto` now supports resolving cyclic dependencies using [Kahn's algorithm](https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm) ([#1140](https://github.com/caolan/async/issues/1140)). +- Added `autoInject`, a relative of `auto` that automatically spreads a task's dependencies as arguments to the task function. ([#608](https://github.com/caolan/async/issues/608), [#1055](https://github.com/caolan/async/issues/1055), [#1099](https://github.com/caolan/async/issues/1099), [#1100](https://github.com/caolan/async/issues/1100)) +- You can now limit the concurrency of `auto` tasks. ([#635](https://github.com/caolan/async/issues/635), [#637](https://github.com/caolan/async/issues/637)) +- Added `retryable`, a relative of `retry` that wraps an async function, making it retry when called. ([#1058](https://github.com/caolan/async/issues/1058)) +- `retry` now supports specifying a function that determines the next time interval, useful for exponential backoff, logging and other retry strategies. ([#1161](https://github.com/caolan/async/issues/1161)) +- `retry` will now pass all of the arguments the task function was resolved with to the callback ([#1231](https://github.com/caolan/async/issues/1231)). +- Added `q.unsaturated` -- callback called when a `queue`'s number of running workers falls below a threshold. ([#868](https://github.com/caolan/async/issues/868), [#1030](https://github.com/caolan/async/issues/1030), [#1033](https://github.com/caolan/async/issues/1033), [#1034](https://github.com/caolan/async/issues/1034)) +- Added `q.error` -- a callback called whenever a `queue` task calls its callback with an error. ([#1170](https://github.com/caolan/async/issues/1170)) +- `applyEach` and `applyEachSeries` now pass results to the final callback. ([#1088](https://github.com/caolan/async/issues/1088)) + +## Breaking changes + +- Calling a callback more than once is considered an error, and an error will be thrown. This had an explicit breaking change in `waterfall`. If you were relying on this behavior, you should more accurately represent your control flow as an event emitter or stream. ([#814](https://github.com/caolan/async/issues/814), [#815](https://github.com/caolan/async/issues/815), [#1048](https://github.com/caolan/async/issues/1048), [#1050](https://github.com/caolan/async/issues/1050)) +- `auto` task functions now always take the callback as the last argument. If a task has dependencies, the `results` object will be passed as the first argument. To migrate old task functions, wrap them with [`_.flip`](https://lodash.com/docs#flip) ([#1036](https://github.com/caolan/async/issues/1036), [#1042](https://github.com/caolan/async/issues/1042)) +- Internal `setImmediate` calls have been refactored away. This may make existing flows vulnerable to stack overflows if you use many synchronous functions in series. Use `ensureAsync` to work around this. ([#696](https://github.com/caolan/async/issues/696), [#704](https://github.com/caolan/async/issues/704), [#1049](https://github.com/caolan/async/issues/1049), [#1050](https://github.com/caolan/async/issues/1050)) +- `map` used to return an object when iterating over an object. `map` now always returns an array, like in other libraries. The previous object behavior has been split out into `mapValues`. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177)) +- `filter`, `reject`, `some`, `every`, `detect` and their families like `{METHOD}Series` and `{METHOD}Limit` now expect an error as the first callback argument, rather than just a simple boolean. Pass `null` as the first argument, or use `fs.access` instead of `fs.exists`. ([#118](https://github.com/caolan/async/issues/118), [#774](https://github.com/caolan/async/issues/774), [#1028](https://github.com/caolan/async/issues/1028), [#1041](https://github.com/caolan/async/issues/1041)) +- `{METHOD}` and `{METHOD}Series` are now implemented in terms of `{METHOD}Limit`. This is a major internal simplification, and is not expected to cause many problems, but it does subtly affect how functions execute internally. ([#778](https://github.com/caolan/async/issues/778), [#847](https://github.com/caolan/async/issues/847)) +- `retry`'s callback is now optional. Previously, omitting the callback would partially apply the function, meaning it could be passed directly as a task to `series` or `auto`. The partially applied "control-flow" behavior has been separated out into `retryable`. ([#1054](https://github.com/caolan/async/issues/1054), [#1058](https://github.com/caolan/async/issues/1058)) +- The test function for `whilst`, `until`, and `during` used to be passed non-error args from the iteratee function's callback, but this led to weirdness where the first call of the test function would be passed no args. We have made it so the test function is never passed extra arguments, and only the `doWhilst`, `doUntil`, and `doDuring` functions pass iteratee callback arguments to the test function ([#1217](https://github.com/caolan/async/issues/1217), [#1224](https://github.com/caolan/async/issues/1224)) +- The `q.tasks` array has been renamed `q._tasks` and is now implemented as a doubly linked list (DLL). Any code that used to interact with this array will need to be updated to either use the provided helpers or support DLLs ([#1205](https://github.com/caolan/async/issues/1205)). +- The timing of the `q.saturated()` callback in a `queue` has been modified to better reflect when tasks pushed to the queue will start queueing. ([#724](https://github.com/caolan/async/issues/724), [#1078](https://github.com/caolan/async/issues/1078)) +- Removed `iterator` method in favour of [ES2015 iterator protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators ) which natively supports arrays ([#1237](https://github.com/caolan/async/issues/1237)) +- Dropped support for Component, Jam, SPM, and Volo ([#1175](https://github.com/caolan/async/issues/1175), #[#176](https://github.com/caolan/async/issues/176)) + +## Bug Fixes + +- Improved handling of no dependency cases in `auto` & `autoInject` ([#1147](https://github.com/caolan/async/issues/1147)). +- Fixed a bug where the callback generated by `asyncify` with `Promises` could resolve twice ([#1197](https://github.com/caolan/async/issues/1197)). +- Fixed several documented optional callbacks not actually being optional ([#1223](https://github.com/caolan/async/issues/1223)). + +## Other + +- Added `someSeries` and `everySeries` for symmetry, as well as a complete set of `any`/`anyLimit`/`anySeries` and `all`/`/allLmit`/`allSeries` aliases. +- Added `find` as an alias for `detect. (as well as `findLimit` and `findSeries`). +- Various doc fixes ([#1005](https://github.com/caolan/async/issues/1005), [#1008](https://github.com/caolan/async/issues/1008), [#1010](https://github.com/caolan/async/issues/1010), [#1015](https://github.com/caolan/async/issues/1015), [#1021](https://github.com/caolan/async/issues/1021), [#1037](https://github.com/caolan/async/issues/1037), [#1039](https://github.com/caolan/async/issues/1039), [#1051](https://github.com/caolan/async/issues/1051), [#1102](https://github.com/caolan/async/issues/1102), [#1107](https://github.com/caolan/async/issues/1107), [#1121](https://github.com/caolan/async/issues/1121), [#1123](https://github.com/caolan/async/issues/1123), [#1129](https://github.com/caolan/async/issues/1129), [#1135](https://github.com/caolan/async/issues/1135), [#1138](https://github.com/caolan/async/issues/1138), [#1141](https://github.com/caolan/async/issues/1141), [#1153](https://github.com/caolan/async/issues/1153), [#1216](https://github.com/caolan/async/issues/1216), [#1217](https://github.com/caolan/async/issues/1217), [#1232](https://github.com/caolan/async/issues/1232), [#1233](https://github.com/caolan/async/issues/1233), [#1236](https://github.com/caolan/async/issues/1236), [#1238](https://github.com/caolan/async/issues/1238)) + +Thank you [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for taking the lead on version 2 of async. + +------------------------------------------ + +# v1.5.2 +- Allow using `"constructor"` as an argument in `memoize` ([#998](https://github.com/caolan/async/issues/998)) +- Give a better error messsage when `auto` dependency checking fails ([#994](https://github.com/caolan/async/issues/994)) +- Various doc updates ([#936](https://github.com/caolan/async/issues/936), [#956](https://github.com/caolan/async/issues/956), [#979](https://github.com/caolan/async/issues/979), [#1002](https://github.com/caolan/async/issues/1002)) + +# v1.5.1 +- Fix issue with `pause` in `queue` with concurrency enabled ([#946](https://github.com/caolan/async/issues/946)) +- `while` and `until` now pass the final result to callback ([#963](https://github.com/caolan/async/issues/963)) +- `auto` will properly handle concurrency when there is no callback ([#966](https://github.com/caolan/async/issues/966)) +- `auto` will no. properly stop execution when an error occurs ([#988](https://github.com/caolan/async/issues/988), [#993](https://github.com/caolan/async/issues/993)) +- Various doc fixes ([#971](https://github.com/caolan/async/issues/971), [#980](https://github.com/caolan/async/issues/980)) + +# v1.5.0 + +- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) ([#892](https://github.com/caolan/async/issues/892)) +- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. ([#873](https://github.com/caolan/async/issues/873)) +- `auto` now accepts an optional `concurrency` argument to limit the number o. running tasks ([#637](https://github.com/caolan/async/issues/637)) +- Added `queue#workersList()`, to retrieve the lis. of currently running tasks. ([#891](https://github.com/caolan/async/issues/891)) +- Various code simplifications ([#896](https://github.com/caolan/async/issues/896), [#904](https://github.com/caolan/async/issues/904)) +- Various doc fixes :scroll: ([#890](https://github.com/caolan/async/issues/890), [#894](https://github.com/caolan/async/issues/894), [#903](https://github.com/caolan/async/issues/903), [#905](https://github.com/caolan/async/issues/905), [#912](https://github.com/caolan/async/issues/912)) + +# v1.4.2 + +- Ensure coverage files don't get published on npm ([#879](https://github.com/caolan/async/issues/879)) + +# v1.4.1 + +- Add in overlooked `detectLimit` method ([#866](https://github.com/caolan/async/issues/866)) +- Removed unnecessary files from npm releases ([#861](https://github.com/caolan/async/issues/861)) +- Removed usage of a reserved word to prevent :boom: in older environments ([#870](https://github.com/caolan/async/issues/870)) + +# v1.4.0 + +- `asyncify` now supports promises ([#840](https://github.com/caolan/async/issues/840)) +- Added `Limit` versions of `filter` and `reject` ([#836](https://github.com/caolan/async/issues/836)) +- Add `Limit` versions of `detect`, `some` and `every` ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829)) +- `some`, `every` and `detect` now short circuit early ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829)) +- Improve detection of the global object ([#804](https://github.com/caolan/async/issues/804)), enabling use in WebWorkers +- `whilst` now called with arguments from iterator ([#823](https://github.com/caolan/async/issues/823)) +- `during` now gets called with arguments from iterator ([#824](https://github.com/caolan/async/issues/824)) +- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0)) + + +# v1.3.0 + +New Features: +- Added `constant` +- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. ([#671](https://github.com/caolan/async/issues/671), [#806](https://github.com/caolan/async/issues/806)) +- Added `during` and `doDuring`, which are like `whilst` with an async truth test. ([#800](https://github.com/caolan/async/issues/800)) +- `retry` now accepts an `interval` parameter to specify a delay between retries. ([#793](https://github.com/caolan/async/issues/793)) +- `async` should work better in Web Workers due to better `root` detection ([#804](https://github.com/caolan/async/issues/804)) +- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` ([#642](https://github.com/caolan/async/issues/642)) +- Various internal updates ([#786](https://github.com/caolan/async/issues/786), [#801](https://github.com/caolan/async/issues/801), [#802](https://github.com/caolan/async/issues/802), [#803](https://github.com/caolan/async/issues/803)) +- Various doc fixes ([#790](https://github.com/caolan/async/issues/790), [#794](https://github.com/caolan/async/issues/794)) + +Bug Fixes: +- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. ([#740](https://github.com/caolan/async/issues/740), [#744](https://github.com/caolan/async/issues/744), [#783](https://github.com/caolan/async/issues/783)) + + +# v1.2.1 + +Bug Fix: + +- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782)) + + +# v1.2.0 + +New Features: + +- Added `timesLimit` ([#743](https://github.com/caolan/async/issues/743)) +- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. ([#747](https://github.com/caolan/async/issues/747), [#772](https://github.com/caolan/async/issues/772)) + +Bug Fixes: + +- Fixed a regression in `each` and family with empty arrays that have additional properties. ([#775](https://github.com/caolan/async/issues/775), [#777](https://github.com/caolan/async/issues/777)) + + +# v1.1.1 + +Bug Fix: + +- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782)) + + +# v1.1.0 + +New Features: + +- `cargo` now supports all of the same methods and event callbacks as `queue`. +- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. ([#769](https://github.com/caolan/async/issues/769)) +- Optimized `map`, `eachOf`, and `waterfall` families of functions +- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array ([#667](https://github.com/caolan/async/issues/667)). +- The callback is now optional for the composed results of `compose` and `seq`. ([#618](https://github.com/caolan/async/issues/618)) +- Reduced file size by 4kb, (minified version by 1kb) +- Added code coverage through `nyc` and `coveralls` ([#768](https://github.com/caolan/async/issues/768)) + +Bug Fixes: + +- `forever` will no longer stack overflow with a synchronous iterator ([#622](https://github.com/caolan/async/issues/622)) +- `eachLimit` and other limit functions will stop iterating once an error occurs ([#754](https://github.com/caolan/async/issues/754)) +- Always pass `null` in callbacks when there is no error ([#439](https://github.com/caolan/async/issues/439)) +- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue ([#668](https://github.com/caolan/async/issues/668)) +- `each` and family will properly handle an empty array ([#578](https://github.com/caolan/async/issues/578)) +- `eachSeries` and family will finish if the underlying array is modified during execution ([#557](https://github.com/caolan/async/issues/557)) +- `queue` will throw if a non-function is passed to `q.push()` ([#593](https://github.com/caolan/async/issues/593)) +- Doc fixes ([#629](https://github.com/caolan/async/issues/629), [#766](https://github.com/caolan/async/issues/766)) + + +# v1.0.0 + +No known breaking changes, we are simply complying with semver from here on out. + +Changes: + +- Start using a changelog! +- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) ([#168](https://github.com/caolan/async/issues/168) [#704](https://github.com/caolan/async/issues/704) [#321](https://github.com/caolan/async/issues/321)) +- Detect deadlocks in `auto` ([#663](https://github.com/caolan/async/issues/663)) +- Better support for require.js ([#527](https://github.com/caolan/async/issues/527)) +- Throw if queue created with concurrency `0` ([#714](https://github.com/caolan/async/issues/714)) +- Fix unneeded iteration in `queue.resume()` ([#758](https://github.com/caolan/async/issues/758)) +- Guard against timer mocking overriding `setImmediate` ([#609](https://github.com/caolan/async/issues/609) [#611](https://github.com/caolan/async/issues/611)) +- Miscellaneous doc fixes ([#542](https://github.com/caolan/async/issues/542) [#596](https://github.com/caolan/async/issues/596) [#615](https://github.com/caolan/async/issues/615) [#628](https://github.com/caolan/async/issues/628) [#631](https://github.com/caolan/async/issues/631) [#690](https://github.com/caolan/async/issues/690) [#729](https://github.com/caolan/async/issues/729)) +- Use single noop function internally ([#546](https://github.com/caolan/async/issues/546)) +- Optimize internal `_each`, `_map` and `_keys` functions. diff --git a/node_modules/async/LICENSE b/node_modules/async/LICENSE new file mode 100644 index 0000000..b18aed6 --- /dev/null +++ b/node_modules/async/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010-2018 Caolan McMahon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/async/README.md b/node_modules/async/README.md new file mode 100644 index 0000000..49cf950 --- /dev/null +++ b/node_modules/async/README.md @@ -0,0 +1,56 @@ +![Async Logo](https://raw.githubusercontent.com/caolan/async/master/logo/async-logo_readme.jpg) + +[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async) +[![NPM version](https://img.shields.io/npm/v/async.svg)](https://www.npmjs.com/package/async) +[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master) +[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![libhive - Open source examples](https://www.libhive.com/providers/npm/packages/async/examples/badge.svg)](https://www.libhive.com/providers/npm/packages/async) +[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/async/badge?style=rounded)](https://www.jsdelivr.com/package/npm/async) + + +Async is a utility module which provides straight-forward, powerful functions for working with [asynchronous JavaScript](http://caolan.github.io/async/global.html). Although originally designed for use with [Node.js](https://nodejs.org/) and installable via `npm install --save async`, it can also be used directly in the browser. + +This version of the package is optimized for the Node.js environment. If you use Async with webpack, install [`async-es`](https://www.npmjs.com/package/async-es) instead. + +For Documentation, visit + +*For Async v1.5.x documentation, go [HERE](https://github.com/caolan/async/blob/v1.5.2/README.md)* + + +```javascript +// for use with Node-style callbacks... +var async = require("async"); + +var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; +var configs = {}; + +async.forEachOf(obj, (value, key, callback) => { + fs.readFile(__dirname + value, "utf8", (err, data) => { + if (err) return callback(err); + try { + configs[key] = JSON.parse(data); + } catch (e) { + return callback(e); + } + callback(); + }); +}, err => { + if (err) console.error(err.message); + // configs is now a map of JSON data + doSomethingWith(configs); +}); +``` + +```javascript +var async = require("async"); + +// ...or ES2017 async functions +async.mapLimit(urls, 5, async function(url) { + const response = await fetch(url) + return response.body +}, (err, results) => { + if (err) throw err + // results is now an array of the response bodies + console.log(results) +}) +``` diff --git a/node_modules/async/all.js b/node_modules/async/all.js new file mode 100644 index 0000000..d0565b0 --- /dev/null +++ b/node_modules/async/all.js @@ -0,0 +1,50 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _doParallel = require('./internal/doParallel'); + +var _doParallel2 = _interopRequireDefault(_doParallel); + +var _notId = require('./internal/notId'); + +var _notId2 = _interopRequireDefault(_notId); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @example + * + * async.every(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, result) { + * // if result is true then every file exists + * }); + */ +exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default)); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/allLimit.js b/node_modules/async/allLimit.js new file mode 100644 index 0000000..a1a759a --- /dev/null +++ b/node_modules/async/allLimit.js @@ -0,0 +1,42 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _doParallelLimit = require('./internal/doParallelLimit'); + +var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit); + +var _notId = require('./internal/notId'); + +var _notId2 = _interopRequireDefault(_notId); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + */ +exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_notId2.default, _notId2.default)); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/allSeries.js b/node_modules/async/allSeries.js new file mode 100644 index 0000000..23bfebb --- /dev/null +++ b/node_modules/async/allSeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _everyLimit = require('./everyLimit'); + +var _everyLimit2 = _interopRequireDefault(_everyLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + */ +exports.default = (0, _doLimit2.default)(_everyLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/any.js b/node_modules/async/any.js new file mode 100644 index 0000000..a8e70f7 --- /dev/null +++ b/node_modules/async/any.js @@ -0,0 +1,52 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _doParallel = require('./internal/doParallel'); + +var _doParallel2 = _interopRequireDefault(_doParallel); + +var _identity = require('lodash/identity'); + +var _identity2 = _interopRequireDefault(_identity); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @example + * + * async.some(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, result) { + * // if result is true then at least one of the files exists + * }); + */ +exports.default = (0, _doParallel2.default)((0, _createTester2.default)(Boolean, _identity2.default)); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/anyLimit.js b/node_modules/async/anyLimit.js new file mode 100644 index 0000000..24ca3f4 --- /dev/null +++ b/node_modules/async/anyLimit.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _doParallelLimit = require('./internal/doParallelLimit'); + +var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit); + +var _identity = require('lodash/identity'); + +var _identity2 = _interopRequireDefault(_identity); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + */ +exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(Boolean, _identity2.default)); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/anySeries.js b/node_modules/async/anySeries.js new file mode 100644 index 0000000..dc24ed2 --- /dev/null +++ b/node_modules/async/anySeries.js @@ -0,0 +1,38 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _someLimit = require('./someLimit'); + +var _someLimit2 = _interopRequireDefault(_someLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + */ +exports.default = (0, _doLimit2.default)(_someLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/apply.js b/node_modules/async/apply.js new file mode 100644 index 0000000..f590fa5 --- /dev/null +++ b/node_modules/async/apply.js @@ -0,0 +1,68 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (fn /*, ...args*/) { + var args = (0, _slice2.default)(arguments, 1); + return function () /*callArgs*/{ + var callArgs = (0, _slice2.default)(arguments); + return fn.apply(null, args.concat(callArgs)); + }; +}; + +var _slice = require('./internal/slice'); + +var _slice2 = _interopRequireDefault(_slice); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +; + +/** + * Creates a continuation function with some arguments already applied. + * + * Useful as a shorthand when combined with other control flow functions. Any + * arguments passed to the returned function are added to the arguments + * originally passed to apply. + * + * @name apply + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {Function} fn - The function you want to eventually apply all + * arguments to. Invokes with (arguments...). + * @param {...*} arguments... - Any number of arguments to automatically apply + * when the continuation is called. + * @returns {Function} the partially-applied function + * @example + * + * // using apply + * async.parallel([ + * async.apply(fs.writeFile, 'testfile1', 'test1'), + * async.apply(fs.writeFile, 'testfile2', 'test2') + * ]); + * + * + * // the same process without using apply + * async.parallel([ + * function(callback) { + * fs.writeFile('testfile1', 'test1', callback); + * }, + * function(callback) { + * fs.writeFile('testfile2', 'test2', callback); + * } + * ]); + * + * // It's possible to pass any number of additional arguments when calling the + * // continuation: + * + * node> var fn = async.apply(sys.puts, 'one'); + * node> fn('two', 'three'); + * one + * two + * three + */ +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/applyEach.js b/node_modules/async/applyEach.js new file mode 100644 index 0000000..06c0845 --- /dev/null +++ b/node_modules/async/applyEach.js @@ -0,0 +1,51 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _applyEach = require('./internal/applyEach'); + +var _applyEach2 = _interopRequireDefault(_applyEach); + +var _map = require('./map'); + +var _map2 = _interopRequireDefault(_map); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Applies the provided arguments to each function in the array, calling + * `callback` after all functions have completed. If you only provide the first + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. + * + * @name applyEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s + * to all call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {Function} - If only the first argument, `fns`, is provided, it will + * return a function which lets you pass in the arguments as if it were a single + * function call. The signature is `(..args, callback)`. If invoked with any + * arguments, `callback` is required. + * @example + * + * async.applyEach([enableSearch, updateSchema], 'bucket', callback); + * + * // partial application example: + * async.each( + * buckets, + * async.applyEach([enableSearch, updateSchema]), + * callback + * ); + */ +exports.default = (0, _applyEach2.default)(_map2.default); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/applyEachSeries.js b/node_modules/async/applyEachSeries.js new file mode 100644 index 0000000..ad80280 --- /dev/null +++ b/node_modules/async/applyEachSeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _applyEach = require('./internal/applyEach'); + +var _applyEach2 = _interopRequireDefault(_applyEach); + +var _mapSeries = require('./mapSeries'); + +var _mapSeries2 = _interopRequireDefault(_mapSeries); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. + * + * @name applyEachSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.applyEach]{@link module:ControlFlow.applyEach} + * @category Control Flow + * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all + * call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {Function} - If only the first argument is provided, it will return + * a function which lets you pass in the arguments as if it were a single + * function call. + */ +exports.default = (0, _applyEach2.default)(_mapSeries2.default); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/asyncify.js b/node_modules/async/asyncify.js new file mode 100644 index 0000000..5e3fc91 --- /dev/null +++ b/node_modules/async/asyncify.js @@ -0,0 +1,110 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = asyncify; + +var _isObject = require('lodash/isObject'); + +var _isObject2 = _interopRequireDefault(_isObject); + +var _initialParams = require('./internal/initialParams'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _setImmediate = require('./internal/setImmediate'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ +function asyncify(func) { + return (0, _initialParams2.default)(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if ((0, _isObject2.default)(result) && typeof result.then === 'function') { + result.then(function (value) { + invokeCallback(callback, null, value); + }, function (err) { + invokeCallback(callback, err.message ? err : new Error(err)); + }); + } else { + callback(null, result); + } + }); +} + +function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (e) { + (0, _setImmediate2.default)(rethrow, e); + } +} + +function rethrow(error) { + throw error; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/auto.js b/node_modules/async/auto.js new file mode 100644 index 0000000..26c1d56 --- /dev/null +++ b/node_modules/async/auto.js @@ -0,0 +1,289 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (tasks, concurrency, callback) { + if (typeof concurrency === 'function') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = (0, _once2.default)(callback || _noop2.default); + var keys = (0, _keys2.default)(tasks); + var numTasks = keys.length; + if (!numTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = numTasks; + } + + var results = {}; + var runningTasks = 0; + var hasError = false; + + var listeners = Object.create(null); + + var readyTasks = []; + + // for cycle detection: + var readyToCheck = []; // tasks that have been identified as reachable + // without the possibility of returning to an ancestor task + var uncheckedDependencies = {}; + + (0, _baseForOwn2.default)(tasks, function (task, key) { + if (!(0, _isArray2.default)(task)) { + // no dependencies + enqueueTask(key, [task]); + readyToCheck.push(key); + return; + } + + var dependencies = task.slice(0, task.length - 1); + var remainingDependencies = dependencies.length; + if (remainingDependencies === 0) { + enqueueTask(key, task); + readyToCheck.push(key); + return; + } + uncheckedDependencies[key] = remainingDependencies; + + (0, _arrayEach2.default)(dependencies, function (dependencyName) { + if (!tasks[dependencyName]) { + throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', ')); + } + addListener(dependencyName, function () { + remainingDependencies--; + if (remainingDependencies === 0) { + enqueueTask(key, task); + } + }); + }); + }); + + checkForDeadlocks(); + processQueue(); + + function enqueueTask(key, task) { + readyTasks.push(function () { + runTask(key, task); + }); + } + + function processQueue() { + if (readyTasks.length === 0 && runningTasks === 0) { + return callback(null, results); + } + while (readyTasks.length && runningTasks < concurrency) { + var run = readyTasks.shift(); + run(); + } + } + + function addListener(taskName, fn) { + var taskListeners = listeners[taskName]; + if (!taskListeners) { + taskListeners = listeners[taskName] = []; + } + + taskListeners.push(fn); + } + + function taskComplete(taskName) { + var taskListeners = listeners[taskName] || []; + (0, _arrayEach2.default)(taskListeners, function (fn) { + fn(); + }); + processQueue(); + } + + function runTask(key, task) { + if (hasError) return; + + var taskCallback = (0, _onlyOnce2.default)(function (err, result) { + runningTasks--; + if (arguments.length > 2) { + result = (0, _slice2.default)(arguments, 1); + } + if (err) { + var safeResults = {}; + (0, _baseForOwn2.default)(results, function (val, rkey) { + safeResults[rkey] = val; + }); + safeResults[key] = result; + hasError = true; + listeners = Object.create(null); + + callback(err, safeResults); + } else { + results[key] = result; + taskComplete(key); + } + }); + + runningTasks++; + var taskFn = (0, _wrapAsync2.default)(task[task.length - 1]); + if (task.length > 1) { + taskFn(results, taskCallback); + } else { + taskFn(taskCallback); + } + } + + function checkForDeadlocks() { + // Kahn's algorithm + // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm + // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html + var currentTask; + var counter = 0; + while (readyToCheck.length) { + currentTask = readyToCheck.pop(); + counter++; + (0, _arrayEach2.default)(getDependents(currentTask), function (dependent) { + if (--uncheckedDependencies[dependent] === 0) { + readyToCheck.push(dependent); + } + }); + } + + if (counter !== numTasks) { + throw new Error('async.auto cannot execute tasks due to a recursive dependency'); + } + } + + function getDependents(taskName) { + var result = []; + (0, _baseForOwn2.default)(tasks, function (task, key) { + if ((0, _isArray2.default)(task) && (0, _baseIndexOf2.default)(task, taskName, 0) >= 0) { + result.push(key); + } + }); + return result; + } +}; + +var _arrayEach = require('lodash/_arrayEach'); + +var _arrayEach2 = _interopRequireDefault(_arrayEach); + +var _baseForOwn = require('lodash/_baseForOwn'); + +var _baseForOwn2 = _interopRequireDefault(_baseForOwn); + +var _baseIndexOf = require('lodash/_baseIndexOf'); + +var _baseIndexOf2 = _interopRequireDefault(_baseIndexOf); + +var _isArray = require('lodash/isArray'); + +var _isArray2 = _interopRequireDefault(_isArray); + +var _keys = require('lodash/keys'); + +var _keys2 = _interopRequireDefault(_keys); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _slice = require('./internal/slice'); + +var _slice2 = _interopRequireDefault(_slice); + +var _once = require('./internal/once'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports['default']; + +/** + * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on + * their requirements. Each function can optionally depend on other functions + * being completed first, and each function is run as soon as its requirements + * are satisfied. + * + * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence + * will stop. Further tasks will not execute (so any other functions depending + * on it will not run), and the main `callback` is immediately called with the + * error. + * + * {@link AsyncFunction}s also receive an object containing the results of functions which + * have completed so far as the first argument, if they have dependencies. If a + * task function has no dependencies, it will only be passed a callback. + * + * @name auto + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Object} tasks - An object. Each of its properties is either a + * function or an array of requirements, with the {@link AsyncFunction} itself the last item + * in the array. The object's key of a property serves as the name of the task + * defined by that property, i.e. can be used when specifying requirements for + * other tasks. The function receives one or two arguments: + * * a `results` object, containing the results of the previously executed + * functions, only passed if the task has any dependencies, + * * a `callback(err, result)` function, which must be called when finished, + * passing an `error` (which can be `null`) and the result of the function's + * execution. + * @param {number} [concurrency=Infinity] - An optional `integer` for + * determining the maximum number of tasks that can be run in parallel. By + * default, as many as possible. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback. Results are always returned; however, if an + * error occurs, no further `tasks` will be performed, and the results object + * will only contain partial results. Invoked with (err, results). + * @returns undefined + * @example + * + * async.auto({ + * // this function will just be passed a callback + * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'), + * showData: ['readData', function(results, cb) { + * // results.readData is the file's contents + * // ... + * }] + * }, callback); + * + * async.auto({ + * get_data: function(callback) { + * console.log('in get_data'); + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * console.log('in make_folder'); + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * console.log('in write_file', JSON.stringify(results)); + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * console.log('in email_link', JSON.stringify(results)); + * // once the file is written let's email a link to it... + * // results.write_file contains the filename returned by write_file. + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }, function(err, results) { + * console.log('err = ', err); + * console.log('results = ', results); + * }); + */ \ No newline at end of file diff --git a/node_modules/async/autoInject.js b/node_modules/async/autoInject.js new file mode 100644 index 0000000..bfbe7e8 --- /dev/null +++ b/node_modules/async/autoInject.js @@ -0,0 +1,170 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = autoInject; + +var _auto = require('./auto'); + +var _auto2 = _interopRequireDefault(_auto); + +var _baseForOwn = require('lodash/_baseForOwn'); + +var _baseForOwn2 = _interopRequireDefault(_baseForOwn); + +var _arrayMap = require('lodash/_arrayMap'); + +var _arrayMap2 = _interopRequireDefault(_arrayMap); + +var _isArray = require('lodash/isArray'); + +var _isArray2 = _interopRequireDefault(_isArray); + +var _trim = require('lodash/trim'); + +var _trim2 = _interopRequireDefault(_trim); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m; +var FN_ARG_SPLIT = /,/; +var FN_ARG = /(=.+)?(\s*)$/; +var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; + +function parseParams(func) { + func = func.toString().replace(STRIP_COMMENTS, ''); + func = func.match(FN_ARGS)[2].replace(' ', ''); + func = func ? func.split(FN_ARG_SPLIT) : []; + func = func.map(function (arg) { + return (0, _trim2.default)(arg.replace(FN_ARG, '')); + }); + return func; +} + +/** + * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent + * tasks are specified as parameters to the function, after the usual callback + * parameter, with the parameter names matching the names of the tasks it + * depends on. This can provide even more readable task graphs which can be + * easier to maintain. + * + * If a final callback is specified, the task results are similarly injected, + * specified as named parameters after the initial error parameter. + * + * The autoInject function is purely syntactic sugar and its semantics are + * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. + * + * @name autoInject + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.auto]{@link module:ControlFlow.auto} + * @category Control Flow + * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of + * the form 'func([dependencies...], callback). The object's key of a property + * serves as the name of the task defined by that property, i.e. can be used + * when specifying requirements for other tasks. + * * The `callback` parameter is a `callback(err, result)` which must be called + * when finished, passing an `error` (which can be `null`) and the result of + * the function's execution. The remaining parameters name other tasks on + * which the task is dependent, and the results from those tasks are the + * arguments of those parameters. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback, and a `results` object with any completed + * task results, similar to `auto`. + * @example + * + * // The example from `auto` can be rewritten as follows: + * async.autoInject({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: function(get_data, make_folder, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }, + * email_link: function(write_file, callback) { + * // once the file is written let's email a link to it... + * // write_file contains the filename returned by write_file. + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * } + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + * + * // If you are using a JS minifier that mangles parameter names, `autoInject` + * // will not work with plain functions, since the parameter names will be + * // collapsed to a single letter identifier. To work around this, you can + * // explicitly specify the names of the parameters your task function needs + * // in an array, similar to Angular.js dependency injection. + * + * // This still has an advantage over plain `auto`, since the results a task + * // depends on are still spread into arguments. + * async.autoInject({ + * //... + * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(write_file, callback) { + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * }] + * //... + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + */ +function autoInject(tasks, callback) { + var newTasks = {}; + + (0, _baseForOwn2.default)(tasks, function (taskFn, key) { + var params; + var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn); + var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0; + + if ((0, _isArray2.default)(taskFn)) { + params = taskFn.slice(0, -1); + taskFn = taskFn[taskFn.length - 1]; + + newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); + } else if (hasNoDeps) { + // no dependencies, use the function as-is + newTasks[key] = taskFn; + } else { + params = parseParams(taskFn); + if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { + throw new Error("autoInject task functions require explicit parameters."); + } + + // remove callback param + if (!fnIsAsync) params.pop(); + + newTasks[key] = params.concat(newTask); + } + + function newTask(results, taskCb) { + var newArgs = (0, _arrayMap2.default)(params, function (name) { + return results[name]; + }); + newArgs.push(taskCb); + (0, _wrapAsync2.default)(taskFn).apply(null, newArgs); + } + }); + + (0, _auto2.default)(newTasks, callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/bower.json b/node_modules/async/bower.json new file mode 100644 index 0000000..7dbeb14 --- /dev/null +++ b/node_modules/async/bower.json @@ -0,0 +1,17 @@ +{ + "name": "async", + "main": "dist/async.js", + "ignore": [ + "bower_components", + "lib", + "mocha_test", + "node_modules", + "perf", + "support", + "**/.*", + "*.config.js", + "*.json", + "index.js", + "Makefile" + ] +} diff --git a/node_modules/async/cargo.js b/node_modules/async/cargo.js new file mode 100644 index 0000000..c7e59c7 --- /dev/null +++ b/node_modules/async/cargo.js @@ -0,0 +1,94 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = cargo; + +var _queue = require('./internal/queue'); + +var _queue2 = _interopRequireDefault(_queue); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A cargo of tasks for the worker function to complete. Cargo inherits all of + * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}. + * @typedef {Object} CargoObject + * @memberOf module:ControlFlow + * @property {Function} length - A function returning the number of items + * waiting to be processed. Invoke like `cargo.length()`. + * @property {number} payload - An `integer` for determining how many tasks + * should be process per round. This property can be changed after a `cargo` is + * created to alter the payload on-the-fly. + * @property {Function} push - Adds `task` to the `queue`. The callback is + * called once the `worker` has finished processing the task. Instead of a + * single task, an array of `tasks` can be submitted. The respective callback is + * used for every task in the list. Invoke like `cargo.push(task, [callback])`. + * @property {Function} saturated - A callback that is called when the + * `queue.length()` hits the concurrency and further tasks will be queued. + * @property {Function} empty - A callback that is called when the last item + * from the `queue` is given to a `worker`. + * @property {Function} drain - A callback that is called when the last item + * from the `queue` has returned from the `worker`. + * @property {Function} idle - a function returning false if there are items + * waiting or being processed, or true if not. Invoke like `cargo.idle()`. + * @property {Function} pause - a function that pauses the processing of tasks + * until `resume()` is called. Invoke like `cargo.pause()`. + * @property {Function} resume - a function that resumes the processing of + * queued tasks when the queue is paused. Invoke like `cargo.resume()`. + * @property {Function} kill - a function that removes the `drain` callback and + * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`. + */ + +/** + * Creates a `cargo` object with the specified payload. Tasks added to the + * cargo will be processed altogether (up to the `payload` limit). If the + * `worker` is in progress, the task is queued until it becomes available. Once + * the `worker` has completed some tasks, each callback of those tasks is + * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) + * for how `cargo` and `queue` work. + * + * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers + * at a time, cargo passes an array of tasks to a single worker, repeating + * when the worker is finished. + * + * @name cargo + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An asynchronous function for processing an array + * of queued tasks. Invoked with `(tasks, callback)`. + * @param {number} [payload=Infinity] - An optional `integer` for determining + * how many tasks should be processed per round; if omitted, the default is + * unlimited. + * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the cargo and inner queue. + * @example + * + * // create a cargo object with payload 2 + * var cargo = async.cargo(function(tasks, callback) { + * for (var i=0; i async.dir(hello, 'world'); + * {hello: 'world'} + */ +exports.default = (0, _consoleFunc2.default)('dir'); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/dist/async.js b/node_modules/async/dist/async.js new file mode 100644 index 0000000..72264cc --- /dev/null +++ b/node_modules/async/dist/async.js @@ -0,0 +1,5609 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.async = global.async || {}))); +}(this, (function (exports) { 'use strict'; + +function slice(arrayLike, start) { + start = start|0; + var newLen = Math.max(arrayLike.length - start, 0); + var newArr = Array(newLen); + for(var idx = 0; idx < newLen; idx++) { + newArr[idx] = arrayLike[start + idx]; + } + return newArr; +} + +/** + * Creates a continuation function with some arguments already applied. + * + * Useful as a shorthand when combined with other control flow functions. Any + * arguments passed to the returned function are added to the arguments + * originally passed to apply. + * + * @name apply + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {Function} fn - The function you want to eventually apply all + * arguments to. Invokes with (arguments...). + * @param {...*} arguments... - Any number of arguments to automatically apply + * when the continuation is called. + * @returns {Function} the partially-applied function + * @example + * + * // using apply + * async.parallel([ + * async.apply(fs.writeFile, 'testfile1', 'test1'), + * async.apply(fs.writeFile, 'testfile2', 'test2') + * ]); + * + * + * // the same process without using apply + * async.parallel([ + * function(callback) { + * fs.writeFile('testfile1', 'test1', callback); + * }, + * function(callback) { + * fs.writeFile('testfile2', 'test2', callback); + * } + * ]); + * + * // It's possible to pass any number of additional arguments when calling the + * // continuation: + * + * node> var fn = async.apply(sys.puts, 'one'); + * node> fn('two', 'three'); + * one + * two + * three + */ +var apply = function(fn/*, ...args*/) { + var args = slice(arguments, 1); + return function(/*callArgs*/) { + var callArgs = slice(arguments); + return fn.apply(null, args.concat(callArgs)); + }; +}; + +var initialParams = function (fn) { + return function (/*...args, callback*/) { + var args = slice(arguments); + var callback = args.pop(); + fn.call(this, args, callback); + }; +}; + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; +var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + +function fallback(fn) { + setTimeout(fn, 0); +} + +function wrap(defer) { + return function (fn/*, ...args*/) { + var args = slice(arguments, 1); + defer(function () { + fn.apply(null, args); + }); + }; +} + +var _defer; + +if (hasSetImmediate) { + _defer = setImmediate; +} else if (hasNextTick) { + _defer = process.nextTick; +} else { + _defer = fallback; +} + +var setImmediate$1 = wrap(_defer); + +/** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ +function asyncify(func) { + return initialParams(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (isObject(result) && typeof result.then === 'function') { + result.then(function(value) { + invokeCallback(callback, null, value); + }, function(err) { + invokeCallback(callback, err.message ? err : new Error(err)); + }); + } else { + callback(null, result); + } + }); +} + +function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (e) { + setImmediate$1(rethrow, e); + } +} + +function rethrow(error) { + throw error; +} + +var supportsSymbol = typeof Symbol === 'function'; + +function isAsync(fn) { + return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction'; +} + +function wrapAsync(asyncFn) { + return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; +} + +function applyEach$1(eachfn) { + return function(fns/*, ...args*/) { + var args = slice(arguments, 1); + var go = initialParams(function(args, callback) { + var that = this; + return eachfn(fns, function (fn, cb) { + wrapAsync(fn).apply(that, args.concat(cb)); + }, callback); + }); + if (args.length) { + return go.apply(this, args); + } + else { + return go; + } + }; +} + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Built-in value references. */ +var Symbol$1 = root.Symbol; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag$1), + tag = value[symToStringTag$1]; + + try { + value[symToStringTag$1] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag$1] = tag; + } else { + delete value[symToStringTag$1]; + } + } + return result; +} + +/** Used for built-in method references. */ +var objectProto$1 = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString$1 = objectProto$1.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString$1.call(value); +} + +/** `Object#toString` result references. */ +var nullTag = '[object Null]'; +var undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]'; +var funcTag = '[object Function]'; +var genTag = '[object GeneratorFunction]'; +var proxyTag = '[object Proxy]'; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +// A temporary value used to identify if the loop should be broken. +// See #1064, #1293 +var breakLoop = {}; + +/** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ +function noop() { + // No operation performed. +} + +function once(fn) { + return function () { + if (fn === null) return; + var callFn = fn; + fn = null; + callFn.apply(this, arguments); + }; +} + +var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator; + +var getIterator = function (coll) { + return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol](); +}; + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** Used for built-in method references. */ +var objectProto$3 = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty$2 = objectProto$3.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto$3.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER$1 = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER$1 : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** `Object#toString` result references. */ +var argsTag$1 = '[object Arguments]'; +var arrayTag = '[object Array]'; +var boolTag = '[object Boolean]'; +var dateTag = '[object Date]'; +var errorTag = '[object Error]'; +var funcTag$1 = '[object Function]'; +var mapTag = '[object Map]'; +var numberTag = '[object Number]'; +var objectTag = '[object Object]'; +var regexpTag = '[object RegExp]'; +var setTag = '[object Set]'; +var stringTag = '[object String]'; +var weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]'; +var dataViewTag = '[object DataView]'; +var float32Tag = '[object Float32Array]'; +var float64Tag = '[object Float64Array]'; +var int8Tag = '[object Int8Array]'; +var int16Tag = '[object Int16Array]'; +var int32Tag = '[object Int32Array]'; +var uint8Tag = '[object Uint8Array]'; +var uint8ClampedTag = '[object Uint8ClampedArray]'; +var uint16Tag = '[object Uint16Array]'; +var uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag$1] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** Detect free variable `exports`. */ +var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports$1 && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** Used for built-in method references. */ +var objectProto$2 = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty$1 = objectProto$2.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty$1.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** Used for built-in method references. */ +var objectProto$5 = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5; + + return value === proto; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +/** Used for built-in method references. */ +var objectProto$4 = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty$3 = objectProto$4.hasOwnProperty; + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty$3.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len ? {value: coll[i], key: i} : null; + } +} + +function createES2015Iterator(iterator) { + var i = -1; + return function next() { + var item = iterator.next(); + if (item.done) + return null; + i++; + return {value: item.value, key: i}; + } +} + +function createObjectIterator(obj) { + var okeys = keys(obj); + var i = -1; + var len = okeys.length; + return function next() { + var key = okeys[++i]; + return i < len ? {value: obj[key], key: key} : null; + }; +} + +function iterator(coll) { + if (isArrayLike(coll)) { + return createArrayIterator(coll); + } + + var iterator = getIterator(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); +} + +function onlyOnce(fn) { + return function() { + if (fn === null) throw new Error("Callback was already called."); + var callFn = fn; + fn = null; + callFn.apply(this, arguments); + }; +} + +function _eachOfLimit(limit) { + return function (obj, iteratee, callback) { + callback = once(callback || noop); + if (limit <= 0 || !obj) { + return callback(null); + } + var nextElem = iterator(obj); + var done = false; + var running = 0; + var looping = false; + + function iterateeCallback(err, value) { + running -= 1; + if (err) { + done = true; + callback(err); + } + else if (value === breakLoop || (done && running <= 0)) { + done = true; + return callback(null); + } + else if (!looping) { + replenish(); + } + } + + function replenish () { + looping = true; + while (running < limit && !done) { + var elem = nextElem(); + if (elem === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); + } + looping = false; + } + + replenish(); + }; +} + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + */ +function eachOfLimit(coll, limit, iteratee, callback) { + _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); +} + +function doLimit(fn, limit) { + return function (iterable, iteratee, callback) { + return fn(iterable, limit, iteratee, callback); + }; +} + +// eachOf implementation optimized for array-likes +function eachOfArrayLike(coll, iteratee, callback) { + callback = once(callback || noop); + var index = 0, + completed = 0, + length = coll.length; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err) { + callback(err); + } else if ((++completed === length) || value === breakLoop) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, onlyOnce(iteratorCallback)); + } +} + +// a generic version of eachOf which can handle array, object, and iterator cases. +var eachOfGeneric = doLimit(eachOfLimit, Infinity); + +/** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @example + * + * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; + * var configs = {}; + * + * async.forEachOf(obj, function (value, key, callback) { + * fs.readFile(__dirname + value, "utf8", function (err, data) { + * if (err) return callback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * }, function (err) { + * if (err) console.error(err.message); + * // configs is now a map of JSON data + * doSomethingWith(configs); + * }); + */ +var eachOf = function(coll, iteratee, callback) { + var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; + eachOfImplementation(coll, wrapAsync(iteratee), callback); +}; + +function doParallel(fn) { + return function (obj, iteratee, callback) { + return fn(eachOf, obj, wrapAsync(iteratee), callback); + }; +} + +function _asyncMap(eachfn, arr, iteratee, callback) { + callback = callback || noop; + arr = arr || []; + var results = []; + var counter = 0; + var _iteratee = wrapAsync(iteratee); + + eachfn(arr, function (value, _, callback) { + var index = counter++; + _iteratee(value, function (err, v) { + results[index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); +} + +/** + * Produces a new collection of values by mapping each value in `coll` through + * the `iteratee` function. The `iteratee` is called with an item from `coll` + * and a callback for when it has finished processing. Each of these callback + * takes 2 arguments: an `error`, and the transformed item from `coll`. If + * `iteratee` passes an error to its callback, the main `callback` (for the + * `map` function) is immediately called with the error. + * + * Note, that since this function applies the `iteratee` to each item in + * parallel, there is no guarantee that the `iteratee` functions will complete + * in order. However, the results array will be in the same order as the + * original `coll`. + * + * If `map` is passed an Object, the results will be an Array. The results + * will roughly be in the order of the original Objects' keys (but this can + * vary across JavaScript engines). + * + * @name map + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an Array of the + * transformed items from the `coll`. Invoked with (err, results). + * @example + * + * async.map(['file1','file2','file3'], fs.stat, function(err, results) { + * // results is now an array of stats for each file + * }); + */ +var map = doParallel(_asyncMap); + +/** + * Applies the provided arguments to each function in the array, calling + * `callback` after all functions have completed. If you only provide the first + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. + * + * @name applyEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s + * to all call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {Function} - If only the first argument, `fns`, is provided, it will + * return a function which lets you pass in the arguments as if it were a single + * function call. The signature is `(..args, callback)`. If invoked with any + * arguments, `callback` is required. + * @example + * + * async.applyEach([enableSearch, updateSchema], 'bucket', callback); + * + * // partial application example: + * async.each( + * buckets, + * async.applyEach([enableSearch, updateSchema]), + * callback + * ); + */ +var applyEach = applyEach$1(map); + +function doParallelLimit(fn) { + return function (obj, limit, iteratee, callback) { + return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback); + }; +} + +/** + * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. + * + * @name mapLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + */ +var mapLimit = doParallelLimit(_asyncMap); + +/** + * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. + * + * @name mapSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + */ +var mapSeries = doLimit(mapLimit, 1); + +/** + * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. + * + * @name applyEachSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.applyEach]{@link module:ControlFlow.applyEach} + * @category Control Flow + * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all + * call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {Function} - If only the first argument is provided, it will return + * a function which lets you pass in the arguments as if it were a single + * function call. + */ +var applyEachSeries = applyEach$1(mapSeries); + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); +} + +/** + * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on + * their requirements. Each function can optionally depend on other functions + * being completed first, and each function is run as soon as its requirements + * are satisfied. + * + * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence + * will stop. Further tasks will not execute (so any other functions depending + * on it will not run), and the main `callback` is immediately called with the + * error. + * + * {@link AsyncFunction}s also receive an object containing the results of functions which + * have completed so far as the first argument, if they have dependencies. If a + * task function has no dependencies, it will only be passed a callback. + * + * @name auto + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Object} tasks - An object. Each of its properties is either a + * function or an array of requirements, with the {@link AsyncFunction} itself the last item + * in the array. The object's key of a property serves as the name of the task + * defined by that property, i.e. can be used when specifying requirements for + * other tasks. The function receives one or two arguments: + * * a `results` object, containing the results of the previously executed + * functions, only passed if the task has any dependencies, + * * a `callback(err, result)` function, which must be called when finished, + * passing an `error` (which can be `null`) and the result of the function's + * execution. + * @param {number} [concurrency=Infinity] - An optional `integer` for + * determining the maximum number of tasks that can be run in parallel. By + * default, as many as possible. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback. Results are always returned; however, if an + * error occurs, no further `tasks` will be performed, and the results object + * will only contain partial results. Invoked with (err, results). + * @returns undefined + * @example + * + * async.auto({ + * // this function will just be passed a callback + * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'), + * showData: ['readData', function(results, cb) { + * // results.readData is the file's contents + * // ... + * }] + * }, callback); + * + * async.auto({ + * get_data: function(callback) { + * console.log('in get_data'); + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * console.log('in make_folder'); + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * console.log('in write_file', JSON.stringify(results)); + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * console.log('in email_link', JSON.stringify(results)); + * // once the file is written let's email a link to it... + * // results.write_file contains the filename returned by write_file. + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }, function(err, results) { + * console.log('err = ', err); + * console.log('results = ', results); + * }); + */ +var auto = function (tasks, concurrency, callback) { + if (typeof concurrency === 'function') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = once(callback || noop); + var keys$$1 = keys(tasks); + var numTasks = keys$$1.length; + if (!numTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = numTasks; + } + + var results = {}; + var runningTasks = 0; + var hasError = false; + + var listeners = Object.create(null); + + var readyTasks = []; + + // for cycle detection: + var readyToCheck = []; // tasks that have been identified as reachable + // without the possibility of returning to an ancestor task + var uncheckedDependencies = {}; + + baseForOwn(tasks, function (task, key) { + if (!isArray(task)) { + // no dependencies + enqueueTask(key, [task]); + readyToCheck.push(key); + return; + } + + var dependencies = task.slice(0, task.length - 1); + var remainingDependencies = dependencies.length; + if (remainingDependencies === 0) { + enqueueTask(key, task); + readyToCheck.push(key); + return; + } + uncheckedDependencies[key] = remainingDependencies; + + arrayEach(dependencies, function (dependencyName) { + if (!tasks[dependencyName]) { + throw new Error('async.auto task `' + key + + '` has a non-existent dependency `' + + dependencyName + '` in ' + + dependencies.join(', ')); + } + addListener(dependencyName, function () { + remainingDependencies--; + if (remainingDependencies === 0) { + enqueueTask(key, task); + } + }); + }); + }); + + checkForDeadlocks(); + processQueue(); + + function enqueueTask(key, task) { + readyTasks.push(function () { + runTask(key, task); + }); + } + + function processQueue() { + if (readyTasks.length === 0 && runningTasks === 0) { + return callback(null, results); + } + while(readyTasks.length && runningTasks < concurrency) { + var run = readyTasks.shift(); + run(); + } + + } + + function addListener(taskName, fn) { + var taskListeners = listeners[taskName]; + if (!taskListeners) { + taskListeners = listeners[taskName] = []; + } + + taskListeners.push(fn); + } + + function taskComplete(taskName) { + var taskListeners = listeners[taskName] || []; + arrayEach(taskListeners, function (fn) { + fn(); + }); + processQueue(); + } + + + function runTask(key, task) { + if (hasError) return; + + var taskCallback = onlyOnce(function(err, result) { + runningTasks--; + if (arguments.length > 2) { + result = slice(arguments, 1); + } + if (err) { + var safeResults = {}; + baseForOwn(results, function(val, rkey) { + safeResults[rkey] = val; + }); + safeResults[key] = result; + hasError = true; + listeners = Object.create(null); + + callback(err, safeResults); + } else { + results[key] = result; + taskComplete(key); + } + }); + + runningTasks++; + var taskFn = wrapAsync(task[task.length - 1]); + if (task.length > 1) { + taskFn(results, taskCallback); + } else { + taskFn(taskCallback); + } + } + + function checkForDeadlocks() { + // Kahn's algorithm + // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm + // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html + var currentTask; + var counter = 0; + while (readyToCheck.length) { + currentTask = readyToCheck.pop(); + counter++; + arrayEach(getDependents(currentTask), function (dependent) { + if (--uncheckedDependencies[dependent] === 0) { + readyToCheck.push(dependent); + } + }); + } + + if (counter !== numTasks) { + throw new Error( + 'async.auto cannot execute tasks due to a recursive dependency' + ); + } + } + + function getDependents(taskName) { + var result = []; + baseForOwn(tasks, function (task, key) { + if (isArray(task) && baseIndexOf(task, taskName, 0) >= 0) { + result.push(key); + } + }); + return result; + } +}; + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; +var symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +/** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ +function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff'; +var rsComboMarksRange = '\\u0300-\\u036f'; +var reComboHalfMarksRange = '\\ufe20-\\ufe2f'; +var rsComboSymbolsRange = '\\u20d0-\\u20ff'; +var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; +var rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsZWJ = '\\u200d'; + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +/** Used to compose unicode character classes. */ +var rsAstralRange$1 = '\\ud800-\\udfff'; +var rsComboMarksRange$1 = '\\u0300-\\u036f'; +var reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f'; +var rsComboSymbolsRange$1 = '\\u20d0-\\u20ff'; +var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1; +var rsVarRange$1 = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange$1 + ']'; +var rsCombo = '[' + rsComboRange$1 + ']'; +var rsFitz = '\\ud83c[\\udffb-\\udfff]'; +var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; +var rsNonAstral = '[^' + rsAstralRange$1 + ']'; +var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; +var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; +var rsZWJ$1 = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?'; +var rsOptVar = '[' + rsVarRange$1 + ']?'; +var rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; +var rsSeq = rsOptVar + reOptMod + rsOptJoin; +var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** + * Removes leading and trailing whitespace or specified characters from `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to trim. + * @param {string} [chars=whitespace] The characters to trim. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the trimmed string. + * @example + * + * _.trim(' abc '); + * // => 'abc' + * + * _.trim('-_-abc-_-', '_-'); + * // => 'abc' + * + * _.map([' foo ', ' bar '], _.trim); + * // => ['foo', 'bar'] + */ +function trim(string, chars, guard) { + string = toString(string); + if (string && (guard || chars === undefined)) { + return string.replace(reTrim, ''); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), + chrSymbols = stringToArray(chars), + start = charsStartIndex(strSymbols, chrSymbols), + end = charsEndIndex(strSymbols, chrSymbols) + 1; + + return castSlice(strSymbols, start, end).join(''); +} + +var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m; +var FN_ARG_SPLIT = /,/; +var FN_ARG = /(=.+)?(\s*)$/; +var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; + +function parseParams(func) { + func = func.toString().replace(STRIP_COMMENTS, ''); + func = func.match(FN_ARGS)[2].replace(' ', ''); + func = func ? func.split(FN_ARG_SPLIT) : []; + func = func.map(function (arg){ + return trim(arg.replace(FN_ARG, '')); + }); + return func; +} + +/** + * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent + * tasks are specified as parameters to the function, after the usual callback + * parameter, with the parameter names matching the names of the tasks it + * depends on. This can provide even more readable task graphs which can be + * easier to maintain. + * + * If a final callback is specified, the task results are similarly injected, + * specified as named parameters after the initial error parameter. + * + * The autoInject function is purely syntactic sugar and its semantics are + * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. + * + * @name autoInject + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.auto]{@link module:ControlFlow.auto} + * @category Control Flow + * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of + * the form 'func([dependencies...], callback). The object's key of a property + * serves as the name of the task defined by that property, i.e. can be used + * when specifying requirements for other tasks. + * * The `callback` parameter is a `callback(err, result)` which must be called + * when finished, passing an `error` (which can be `null`) and the result of + * the function's execution. The remaining parameters name other tasks on + * which the task is dependent, and the results from those tasks are the + * arguments of those parameters. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback, and a `results` object with any completed + * task results, similar to `auto`. + * @example + * + * // The example from `auto` can be rewritten as follows: + * async.autoInject({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: function(get_data, make_folder, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }, + * email_link: function(write_file, callback) { + * // once the file is written let's email a link to it... + * // write_file contains the filename returned by write_file. + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * } + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + * + * // If you are using a JS minifier that mangles parameter names, `autoInject` + * // will not work with plain functions, since the parameter names will be + * // collapsed to a single letter identifier. To work around this, you can + * // explicitly specify the names of the parameters your task function needs + * // in an array, similar to Angular.js dependency injection. + * + * // This still has an advantage over plain `auto`, since the results a task + * // depends on are still spread into arguments. + * async.autoInject({ + * //... + * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(write_file, callback) { + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * }] + * //... + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + */ +function autoInject(tasks, callback) { + var newTasks = {}; + + baseForOwn(tasks, function (taskFn, key) { + var params; + var fnIsAsync = isAsync(taskFn); + var hasNoDeps = + (!fnIsAsync && taskFn.length === 1) || + (fnIsAsync && taskFn.length === 0); + + if (isArray(taskFn)) { + params = taskFn.slice(0, -1); + taskFn = taskFn[taskFn.length - 1]; + + newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); + } else if (hasNoDeps) { + // no dependencies, use the function as-is + newTasks[key] = taskFn; + } else { + params = parseParams(taskFn); + if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { + throw new Error("autoInject task functions require explicit parameters."); + } + + // remove callback param + if (!fnIsAsync) params.pop(); + + newTasks[key] = params.concat(newTask); + } + + function newTask(results, taskCb) { + var newArgs = arrayMap(params, function (name) { + return results[name]; + }); + newArgs.push(taskCb); + wrapAsync(taskFn).apply(null, newArgs); + } + }); + + auto(newTasks, callback); +} + +// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation +// used for queues. This implementation assumes that the node provided by the user can be modified +// to adjust the next and last properties. We implement only the minimal functionality +// for queue support. +function DLL() { + this.head = this.tail = null; + this.length = 0; +} + +function setInitial(dll, node) { + dll.length = 1; + dll.head = dll.tail = node; +} + +DLL.prototype.removeLink = function(node) { + if (node.prev) node.prev.next = node.next; + else this.head = node.next; + if (node.next) node.next.prev = node.prev; + else this.tail = node.prev; + + node.prev = node.next = null; + this.length -= 1; + return node; +}; + +DLL.prototype.empty = function () { + while(this.head) this.shift(); + return this; +}; + +DLL.prototype.insertAfter = function(node, newNode) { + newNode.prev = node; + newNode.next = node.next; + if (node.next) node.next.prev = newNode; + else this.tail = newNode; + node.next = newNode; + this.length += 1; +}; + +DLL.prototype.insertBefore = function(node, newNode) { + newNode.prev = node.prev; + newNode.next = node; + if (node.prev) node.prev.next = newNode; + else this.head = newNode; + node.prev = newNode; + this.length += 1; +}; + +DLL.prototype.unshift = function(node) { + if (this.head) this.insertBefore(this.head, node); + else setInitial(this, node); +}; + +DLL.prototype.push = function(node) { + if (this.tail) this.insertAfter(this.tail, node); + else setInitial(this, node); +}; + +DLL.prototype.shift = function() { + return this.head && this.removeLink(this.head); +}; + +DLL.prototype.pop = function() { + return this.tail && this.removeLink(this.tail); +}; + +DLL.prototype.toArray = function () { + var arr = Array(this.length); + var curr = this.head; + for(var idx = 0; idx < this.length; idx++) { + arr[idx] = curr.data; + curr = curr.next; + } + return arr; +}; + +DLL.prototype.remove = function (testFn) { + var curr = this.head; + while(!!curr) { + var next = curr.next; + if (testFn(curr)) { + this.removeLink(curr); + } + curr = next; + } + return this; +}; + +function queue(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } + else if(concurrency === 0) { + throw new Error('Concurrency must not be zero'); + } + + var _worker = wrapAsync(worker); + var numRunning = 0; + var workersList = []; + + var processingScheduled = false; + function _insert(data, insertAtFront, callback) { + if (callback != null && typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + if (!isArray(data)) { + data = [data]; + } + if (data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + return setImmediate$1(function() { + q.drain(); + }); + } + + for (var i = 0, l = data.length; i < l; i++) { + var item = { + data: data[i], + callback: callback || noop + }; + + if (insertAtFront) { + q._tasks.unshift(item); + } else { + q._tasks.push(item); + } + } + + if (!processingScheduled) { + processingScheduled = true; + setImmediate$1(function() { + processingScheduled = false; + q.process(); + }); + } + } + + function _next(tasks) { + return function(err){ + numRunning -= 1; + + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; + + var index = baseIndexOf(workersList, task, 0); + if (index === 0) { + workersList.shift(); + } else if (index > 0) { + workersList.splice(index, 1); + } + + task.callback.apply(task, arguments); + + if (err != null) { + q.error(err, task.data); + } + } + + if (numRunning <= (q.concurrency - q.buffer) ) { + q.unsaturated(); + } + + if (q.idle()) { + q.drain(); + } + q.process(); + }; + } + + var isProcessing = false; + var q = { + _tasks: new DLL(), + concurrency: concurrency, + payload: payload, + saturated: noop, + unsaturated:noop, + buffer: concurrency / 4, + empty: noop, + drain: noop, + error: noop, + started: false, + paused: false, + push: function (data, callback) { + _insert(data, false, callback); + }, + kill: function () { + q.drain = noop; + q._tasks.empty(); + }, + unshift: function (data, callback) { + _insert(data, true, callback); + }, + remove: function (testFn) { + q._tasks.remove(testFn); + }, + process: function () { + // Avoid trying to start too many processing operations. This can occur + // when callbacks resolve synchronously (#1267). + if (isProcessing) { + return; + } + isProcessing = true; + while(!q.paused && numRunning < q.concurrency && q._tasks.length){ + var tasks = [], data = []; + var l = q._tasks.length; + if (q.payload) l = Math.min(l, q.payload); + for (var i = 0; i < l; i++) { + var node = q._tasks.shift(); + tasks.push(node); + workersList.push(node); + data.push(node.data); + } + + numRunning += 1; + + if (q._tasks.length === 0) { + q.empty(); + } + + if (numRunning === q.concurrency) { + q.saturated(); + } + + var cb = onlyOnce(_next(tasks)); + _worker(data, cb); + } + isProcessing = false; + }, + length: function () { + return q._tasks.length; + }, + running: function () { + return numRunning; + }, + workersList: function () { + return workersList; + }, + idle: function() { + return q._tasks.length + numRunning === 0; + }, + pause: function () { + q.paused = true; + }, + resume: function () { + if (q.paused === false) { return; } + q.paused = false; + setImmediate$1(q.process); + } + }; + return q; +} + +/** + * A cargo of tasks for the worker function to complete. Cargo inherits all of + * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}. + * @typedef {Object} CargoObject + * @memberOf module:ControlFlow + * @property {Function} length - A function returning the number of items + * waiting to be processed. Invoke like `cargo.length()`. + * @property {number} payload - An `integer` for determining how many tasks + * should be process per round. This property can be changed after a `cargo` is + * created to alter the payload on-the-fly. + * @property {Function} push - Adds `task` to the `queue`. The callback is + * called once the `worker` has finished processing the task. Instead of a + * single task, an array of `tasks` can be submitted. The respective callback is + * used for every task in the list. Invoke like `cargo.push(task, [callback])`. + * @property {Function} saturated - A callback that is called when the + * `queue.length()` hits the concurrency and further tasks will be queued. + * @property {Function} empty - A callback that is called when the last item + * from the `queue` is given to a `worker`. + * @property {Function} drain - A callback that is called when the last item + * from the `queue` has returned from the `worker`. + * @property {Function} idle - a function returning false if there are items + * waiting or being processed, or true if not. Invoke like `cargo.idle()`. + * @property {Function} pause - a function that pauses the processing of tasks + * until `resume()` is called. Invoke like `cargo.pause()`. + * @property {Function} resume - a function that resumes the processing of + * queued tasks when the queue is paused. Invoke like `cargo.resume()`. + * @property {Function} kill - a function that removes the `drain` callback and + * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`. + */ + +/** + * Creates a `cargo` object with the specified payload. Tasks added to the + * cargo will be processed altogether (up to the `payload` limit). If the + * `worker` is in progress, the task is queued until it becomes available. Once + * the `worker` has completed some tasks, each callback of those tasks is + * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) + * for how `cargo` and `queue` work. + * + * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers + * at a time, cargo passes an array of tasks to a single worker, repeating + * when the worker is finished. + * + * @name cargo + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An asynchronous function for processing an array + * of queued tasks. Invoked with `(tasks, callback)`. + * @param {number} [payload=Infinity] - An optional `integer` for determining + * how many tasks should be processed per round; if omitted, the default is + * unlimited. + * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the cargo and inner queue. + * @example + * + * // create a cargo object with payload 2 + * var cargo = async.cargo(function(tasks, callback) { + * for (var i=0; i true + */ +function identity(value) { + return value; +} + +function _createTester(check, getResult) { + return function(eachfn, arr, iteratee, cb) { + cb = cb || noop; + var testPassed = false; + var testResult; + eachfn(arr, function(value, _, callback) { + iteratee(value, function(err, result) { + if (err) { + callback(err); + } else if (check(result) && !testResult) { + testPassed = true; + testResult = getResult(true, value); + callback(null, breakLoop); + } else { + callback(); + } + }); + }, function(err) { + if (err) { + cb(err); + } else { + cb(null, testPassed ? testResult : getResult(false)); + } + }); + }; +} + +function _findGetResult(v, x) { + return x; +} + +/** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. + + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @example + * + * async.detect(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, result) { + * // result now equals the first file in the list that exists + * }); + */ +var detect = doParallel(_createTester(identity, _findGetResult)); + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + */ +var detectLimit = doParallelLimit(_createTester(identity, _findGetResult)); + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + */ +var detectSeries = doLimit(detectLimit, 1); + +function consoleFunc(name) { + return function (fn/*, ...args*/) { + var args = slice(arguments, 1); + args.push(function (err/*, ...args*/) { + var args = slice(arguments, 1); + if (typeof console === 'object') { + if (err) { + if (console.error) { + console.error(err); + } + } else if (console[name]) { + arrayEach(args, function (x) { + console[name](x); + }); + } + } + }); + wrapAsync(fn).apply(null, args); + }; +} + +/** + * Logs the result of an [`async` function]{@link AsyncFunction} to the + * `console` using `console.dir` to display the properties of the resulting object. + * Only works in Node.js or in browsers that support `console.dir` and + * `console.error` (such as FF and Chrome). + * If multiple arguments are returned from the async function, + * `console.dir` is called on each argument in order. + * + * @name dir + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, {hello: name}); + * }, 1000); + * }; + * + * // in the node repl + * node> async.dir(hello, 'world'); + * {hello: 'world'} + */ +var dir = consoleFunc('dir'); + +/** + * The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in + * the order of operations, the arguments `test` and `fn` are switched. + * + * Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function. + * @name doDuring + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.during]{@link module:ControlFlow.during} + * @category Control Flow + * @param {AsyncFunction} fn - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `fn`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `fn`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `fn` has stopped. `callback` + * will be passed an error if one occurred, otherwise `null`. + */ +function doDuring(fn, test, callback) { + callback = onlyOnce(callback || noop); + var _fn = wrapAsync(fn); + var _test = wrapAsync(test); + + function next(err/*, ...args*/) { + if (err) return callback(err); + var args = slice(arguments, 1); + args.push(check); + _test.apply(this, args); + } + + function check(err, truth) { + if (err) return callback(err); + if (!truth) return callback(null); + _fn(next); + } + + check(null, true); + +} + +/** + * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in + * the order of operations, the arguments `test` and `iteratee` are switched. + * + * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + * + * @name doWhilst + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - A function which is called each time `test` + * passes. Invoked with (callback). + * @param {Function} test - synchronous truth test to perform after each + * execution of `iteratee`. Invoked with any non-error callback results of + * `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. + * `callback` will be passed an error and any arguments passed to the final + * `iteratee`'s callback. Invoked with (err, [results]); + */ +function doWhilst(iteratee, test, callback) { + callback = onlyOnce(callback || noop); + var _iteratee = wrapAsync(iteratee); + var next = function(err/*, ...args*/) { + if (err) return callback(err); + var args = slice(arguments, 1); + if (test.apply(this, args)) return _iteratee(next); + callback.apply(null, [null].concat(args)); + }; + _iteratee(next); +} + +/** + * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the + * argument ordering differs from `until`. + * + * @name doUntil + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {Function} test - synchronous truth test to perform after each + * execution of `iteratee`. Invoked with any non-error callback results of + * `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + */ +function doUntil(iteratee, test, callback) { + doWhilst(iteratee, function() { + return !test.apply(this, arguments); + }, callback); +} + +/** + * Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that + * is passed a callback in the form of `function (err, truth)`. If error is + * passed to `test` or `fn`, the main callback is immediately called with the + * value of the error. + * + * @name during + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `fn`. Invoked with (callback). + * @param {AsyncFunction} fn - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `fn` has stopped. `callback` + * will be passed an error, if one occurred, otherwise `null`. + * @example + * + * var count = 0; + * + * async.during( + * function (callback) { + * return callback(null, count < 5); + * }, + * function (callback) { + * count++; + * setTimeout(callback, 1000); + * }, + * function (err) { + * // 5 seconds have passed + * } + * ); + */ +function during(test, fn, callback) { + callback = onlyOnce(callback || noop); + var _fn = wrapAsync(fn); + var _test = wrapAsync(test); + + function next(err) { + if (err) return callback(err); + _test(check); + } + + function check(err, truth) { + if (err) return callback(err); + if (!truth) return callback(null); + _fn(next); + } + + _test(check); +} + +function _withoutIndex(iteratee) { + return function (value, index, callback) { + return iteratee(value, callback); + }; +} + +/** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @example + * + * // assuming openFiles is an array of file names and saveFile is a function + * // to save the modified contents of that file: + * + * async.each(openFiles, saveFile, function(err){ + * // if any of the saves produced an error, err would equal that error + * }); + * + * // assuming openFiles is an array of file names + * async.each(openFiles, function(file, callback) { + * + * // Perform operation on file here. + * console.log('Processing file ' + file); + * + * if( file.length > 32 ) { + * console.log('This file name is too long'); + * callback('File name too long'); + * } else { + * // Do work to process file here + * console.log('File processed'); + * callback(); + * } + * }, function(err) { + * // if any of the file processing produced an error, err would equal that error + * if( err ) { + * // One of the iterations produced an error. + * // All processing will now stop. + * console.log('A file failed to process'); + * } else { + * console.log('All files have been processed successfully'); + * } + * }); + */ +function eachLimit(coll, iteratee, callback) { + eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback); +} + +/** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + */ +function eachLimit$1(coll, limit, iteratee, callback) { + _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); +} + +/** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + */ +var eachSeries = doLimit(eachLimit$1, 1); + +/** + * Wrap an async function and ensure it calls its callback on a later tick of + * the event loop. If the function already calls its callback on a next tick, + * no extra deferral is added. This is useful for preventing stack overflows + * (`RangeError: Maximum call stack size exceeded`) and generally keeping + * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) + * contained. ES2017 `async` functions are returned as-is -- they are immune + * to Zalgo's corrupting influences, as they always resolve on a later tick. + * + * @name ensureAsync + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - an async function, one that expects a node-style + * callback as its last argument. + * @returns {AsyncFunction} Returns a wrapped function with the exact same call + * signature as the function passed in. + * @example + * + * function sometimesAsync(arg, callback) { + * if (cache[arg]) { + * return callback(null, cache[arg]); // this would be synchronous!! + * } else { + * doSomeIO(arg, callback); // this IO would be asynchronous + * } + * } + * + * // this has a risk of stack overflows if many results are cached in a row + * async.mapSeries(args, sometimesAsync, done); + * + * // this will defer sometimesAsync's callback if necessary, + * // preventing stack overflows + * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + */ +function ensureAsync(fn) { + if (isAsync(fn)) return fn; + return initialParams(function (args, callback) { + var sync = true; + args.push(function () { + var innerArgs = arguments; + if (sync) { + setImmediate$1(function () { + callback.apply(null, innerArgs); + }); + } else { + callback.apply(null, innerArgs); + } + }); + fn.apply(this, args); + sync = false; + }); +} + +function notId(v) { + return !v; +} + +/** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @example + * + * async.every(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, result) { + * // if result is true then every file exists + * }); + */ +var every = doParallel(_createTester(notId, notId)); + +/** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + */ +var everyLimit = doParallelLimit(_createTester(notId, notId)); + +/** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + */ +var everySeries = doLimit(everyLimit, 1); + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +function filterArray(eachfn, arr, iteratee, callback) { + var truthValues = new Array(arr.length); + eachfn(arr, function (x, index, callback) { + iteratee(x, function (err, v) { + truthValues[index] = !!v; + callback(err); + }); + }, function (err) { + if (err) return callback(err); + var results = []; + for (var i = 0; i < arr.length; i++) { + if (truthValues[i]) results.push(arr[i]); + } + callback(null, results); + }); +} + +function filterGeneric(eachfn, coll, iteratee, callback) { + var results = []; + eachfn(coll, function (x, index, callback) { + iteratee(x, function (err, v) { + if (err) { + callback(err); + } else { + if (v) { + results.push({index: index, value: x}); + } + callback(); + } + }); + }, function (err) { + if (err) { + callback(err); + } else { + callback(null, arrayMap(results.sort(function (a, b) { + return a.index - b.index; + }), baseProperty('value'))); + } + }); +} + +function _filter(eachfn, coll, iteratee, callback) { + var filter = isArrayLike(coll) ? filterArray : filterGeneric; + filter(eachfn, coll, wrapAsync(iteratee), callback || noop); +} + +/** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @example + * + * async.filter(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, results) { + * // results now equals an array of the existing files + * }); + */ +var filter = doParallel(_filter); + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + */ +var filterLimit = doParallelLimit(_filter); + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + */ +var filterSeries = doLimit(filterLimit, 1); + +/** + * Calls the asynchronous function `fn` with a callback parameter that allows it + * to call itself again, in series, indefinitely. + + * If an error is passed to the callback then `errback` is called with the + * error, and execution stops, otherwise it will never be called. + * + * @name forever + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} fn - an async function to call repeatedly. + * Invoked with (next). + * @param {Function} [errback] - when `fn` passes an error to it's callback, + * this function will be called, and execution stops. Invoked with (err). + * @example + * + * async.forever( + * function(next) { + * // next is suitable for passing to things that need a callback(err [, whatever]); + * // it will result in this function being called again. + * }, + * function(err) { + * // if next is called with a value in its first parameter, it will appear + * // in here as 'err', and execution will stop. + * } + * ); + */ +function forever(fn, errback) { + var done = onlyOnce(errback || noop); + var task = wrapAsync(ensureAsync(fn)); + + function next(err) { + if (err) return done(err); + task(next); + } + next(); +} + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. + * + * @name groupByLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + */ +var groupByLimit = function(coll, limit, iteratee, callback) { + callback = callback || noop; + var _iteratee = wrapAsync(iteratee); + mapLimit(coll, limit, function(val, callback) { + _iteratee(val, function(err, key) { + if (err) return callback(err); + return callback(null, {key: key, val: val}); + }); + }, function(err, mapResults) { + var result = {}; + // from MDN, handle object having an `hasOwnProperty` prop + var hasOwnProperty = Object.prototype.hasOwnProperty; + + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + var key = mapResults[i].key; + var val = mapResults[i].val; + + if (hasOwnProperty.call(result, key)) { + result[key].push(val); + } else { + result[key] = [val]; + } + } + } + + return callback(err, result); + }); +}; + +/** + * Returns a new object, where each value corresponds to an array of items, from + * `coll`, that returned the corresponding key. That is, the keys of the object + * correspond to the values passed to the `iteratee` callback. + * + * Note: Since this function applies the `iteratee` to each item in parallel, + * there is no guarantee that the `iteratee` functions will complete in order. + * However, the values for each key in the `result` will be in the same order as + * the original `coll`. For Objects, the values will roughly be in the order of + * the original Objects' keys (but this can vary across JavaScript engines). + * + * @name groupBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @example + * + * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) { + * db.findById(userId, function(err, user) { + * if (err) return callback(err); + * return callback(null, user.age); + * }); + * }, function(err, result) { + * // result is object containing the userIds grouped by age + * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']}; + * }); + */ +var groupBy = doLimit(groupByLimit, Infinity); + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. + * + * @name groupBySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + */ +var groupBySeries = doLimit(groupByLimit, 1); + +/** + * Logs the result of an `async` function to the `console`. Only works in + * Node.js or in browsers that support `console.log` and `console.error` (such + * as FF and Chrome). If multiple arguments are returned from the async + * function, `console.log` is called on each argument in order. + * + * @name log + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, 'hello ' + name); + * }, 1000); + * }; + * + * // in the node repl + * node> async.log(hello, 'world'); + * 'hello world' + */ +var log = consoleFunc('log'); + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a + * time. + * + * @name mapValuesLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + */ +function mapValuesLimit(obj, limit, iteratee, callback) { + callback = once(callback || noop); + var newObj = {}; + var _iteratee = wrapAsync(iteratee); + eachOfLimit(obj, limit, function(val, key, next) { + _iteratee(val, key, function (err, result) { + if (err) return next(err); + newObj[key] = result; + next(); + }); + }, function (err) { + callback(err, newObj); + }); +} + +/** + * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. + * + * Produces a new Object by mapping each value of `obj` through the `iteratee` + * function. The `iteratee` is called each `value` and `key` from `obj` and a + * callback for when it has finished processing. Each of these callbacks takes + * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` + * passes an error to its callback, the main `callback` (for the `mapValues` + * function) is immediately called with the error. + * + * Note, the order of the keys in the result is not guaranteed. The keys will + * be roughly in the order they complete, (but this is very engine-specific) + * + * @name mapValues + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @example + * + * async.mapValues({ + * f1: 'file1', + * f2: 'file2', + * f3: 'file3' + * }, function (file, key, callback) { + * fs.stat(file, callback); + * }, function(err, result) { + * // result is now a map of stats for each file, e.g. + * // { + * // f1: [stats for file1], + * // f2: [stats for file2], + * // f3: [stats for file3] + * // } + * }); + */ + +var mapValues = doLimit(mapValuesLimit, Infinity); + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. + * + * @name mapValuesSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + */ +var mapValuesSeries = doLimit(mapValuesLimit, 1); + +function has(obj, key) { + return key in obj; +} + +/** + * Caches the results of an async function. When creating a hash to store + * function results against, the callback is omitted from the hash and an + * optional hash function can be used. + * + * If no hash function is specified, the first argument is used as a hash key, + * which may work reasonably if it is a string or a data type that converts to a + * distinct string. Note that objects and arrays will not behave reasonably. + * Neither will cases where the other arguments are significant. In such cases, + * specify your own hash function. + * + * The cache of results is exposed as the `memo` property of the function + * returned by `memoize`. + * + * @name memoize + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function to proxy and cache results from. + * @param {Function} hasher - An optional function for generating a custom hash + * for storing results. It has all the arguments applied to it apart from the + * callback, and must be synchronous. + * @returns {AsyncFunction} a memoized version of `fn` + * @example + * + * var slow_fn = function(name, callback) { + * // do something + * callback(null, result); + * }; + * var fn = async.memoize(slow_fn); + * + * // fn can now be used as if it were slow_fn + * fn('some name', function() { + * // callback + * }); + */ +function memoize(fn, hasher) { + var memo = Object.create(null); + var queues = Object.create(null); + hasher = hasher || identity; + var _fn = wrapAsync(fn); + var memoized = initialParams(function memoized(args, callback) { + var key = hasher.apply(null, args); + if (has(memo, key)) { + setImmediate$1(function() { + callback.apply(null, memo[key]); + }); + } else if (has(queues, key)) { + queues[key].push(callback); + } else { + queues[key] = [callback]; + _fn.apply(null, args.concat(function(/*args*/) { + var args = slice(arguments); + memo[key] = args; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, args); + } + })); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; +} + +/** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `process.nextTick`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name nextTick + * @static + * @memberOf module:Utils + * @method + * @see [async.setImmediate]{@link module:Utils.setImmediate} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ +var _defer$1; + +if (hasNextTick) { + _defer$1 = process.nextTick; +} else if (hasSetImmediate) { + _defer$1 = setImmediate; +} else { + _defer$1 = fallback; +} + +var nextTick = wrap(_defer$1); + +function _parallel(eachfn, tasks, callback) { + callback = callback || noop; + var results = isArrayLike(tasks) ? [] : {}; + + eachfn(tasks, function (task, key, callback) { + wrapAsync(task)(function (err, result) { + if (arguments.length > 2) { + result = slice(arguments, 1); + } + results[key] = result; + callback(err); + }); + }, function (err) { + callback(err, results); + }); +} + +/** + * Run the `tasks` collection of functions in parallel, without waiting until + * the previous function has completed. If any of the functions pass an error to + * its callback, the main `callback` is immediately called with the value of the + * error. Once the `tasks` have completed, the results are passed to the final + * `callback` as an array. + * + * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about + * parallel execution of code. If your tasks do not use any timers or perform + * any I/O, they will actually be executed in series. Any synchronous setup + * sections for each task will happen one after the other. JavaScript remains + * single-threaded. + * + * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the + * execution of other tasks when a task fails. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.parallel}. + * + * @name parallel + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * + * @example + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // optional callback + * function(err, results) { + * // the results array will equal ['one','two'] even though + * // the second function had a shorter timeout. + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * // results is now equals to: {one: 1, two: 2} + * }); + */ +function parallelLimit(tasks, callback) { + _parallel(eachOf, tasks, callback); +} + +/** + * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a + * time. + * + * @name parallelLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.parallel]{@link module:ControlFlow.parallel} + * @category Control Flow + * @param {Array|Iterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + */ +function parallelLimit$1(tasks, limit, callback) { + _parallel(_eachOfLimit(limit), tasks, callback); +} + +/** + * A queue of tasks for the worker function to complete. + * @typedef {Object} QueueObject + * @memberOf module:ControlFlow + * @property {Function} length - a function returning the number of items + * waiting to be processed. Invoke with `queue.length()`. + * @property {boolean} started - a boolean indicating whether or not any + * items have been pushed and processed by the queue. + * @property {Function} running - a function returning the number of items + * currently being processed. Invoke with `queue.running()`. + * @property {Function} workersList - a function returning the array of items + * currently being processed. Invoke with `queue.workersList()`. + * @property {Function} idle - a function returning false if there are items + * waiting or being processed, or true if not. Invoke with `queue.idle()`. + * @property {number} concurrency - an integer for determining how many `worker` + * functions should be run in parallel. This property can be changed after a + * `queue` is created to alter the concurrency on-the-fly. + * @property {Function} push - add a new task to the `queue`. Calls `callback` + * once the `worker` has finished processing the task. Instead of a single task, + * a `tasks` array can be submitted. The respective callback is used for every + * task in the list. Invoke with `queue.push(task, [callback])`, + * @property {Function} unshift - add a new task to the front of the `queue`. + * Invoke with `queue.unshift(task, [callback])`. + * @property {Function} remove - remove items from the queue that match a test + * function. The test function will be passed an object with a `data` property, + * and a `priority` property, if this is a + * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. + * Invoked with `queue.remove(testFn)`, where `testFn` is of the form + * `function ({data, priority}) {}` and returns a Boolean. + * @property {Function} saturated - a callback that is called when the number of + * running workers hits the `concurrency` limit, and further tasks will be + * queued. + * @property {Function} unsaturated - a callback that is called when the number + * of running workers is less than the `concurrency` & `buffer` limits, and + * further tasks will not be queued. + * @property {number} buffer - A minimum threshold buffer in order to say that + * the `queue` is `unsaturated`. + * @property {Function} empty - a callback that is called when the last item + * from the `queue` is given to a `worker`. + * @property {Function} drain - a callback that is called when the last item + * from the `queue` has returned from the `worker`. + * @property {Function} error - a callback that is called when a task errors. + * Has the signature `function(error, task)`. + * @property {boolean} paused - a boolean for determining whether the queue is + * in a paused state. + * @property {Function} pause - a function that pauses the processing of tasks + * until `resume()` is called. Invoke with `queue.pause()`. + * @property {Function} resume - a function that resumes the processing of + * queued tasks when the queue is paused. Invoke with `queue.resume()`. + * @property {Function} kill - a function that removes the `drain` callback and + * empties remaining tasks from the queue forcing it to go idle. No more tasks + * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. + */ + +/** + * Creates a `queue` object with the specified `concurrency`. Tasks added to the + * `queue` are processed in parallel (up to the `concurrency` limit). If all + * `worker`s are in progress, the task is queued until one becomes available. + * Once a `worker` completes a `task`, that `task`'s callback is called. + * + * @name queue + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. Invoked with (task, callback). + * @param {number} [concurrency=1] - An `integer` for determining how many + * `worker` functions should be run in parallel. If omitted, the concurrency + * defaults to `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the queue. + * @example + * + * // create a queue object with concurrency 2 + * var q = async.queue(function(task, callback) { + * console.log('hello ' + task.name); + * callback(); + * }, 2); + * + * // assign a callback + * q.drain = function() { + * console.log('all items have been processed'); + * }; + * + * // add some items to the queue + * q.push({name: 'foo'}, function(err) { + * console.log('finished processing foo'); + * }); + * q.push({name: 'bar'}, function (err) { + * console.log('finished processing bar'); + * }); + * + * // add some items to the queue (batch-wise) + * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { + * console.log('finished processing item'); + * }); + * + * // add some items to the front of the queue + * q.unshift({name: 'bar'}, function (err) { + * console.log('finished processing bar'); + * }); + */ +var queue$1 = function (worker, concurrency) { + var _worker = wrapAsync(worker); + return queue(function (items, cb) { + _worker(items[0], cb); + }, concurrency, 1); +}; + +/** + * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and + * completed in ascending priority order. + * + * @name priorityQueue + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. + * Invoked with (task, callback). + * @param {number} concurrency - An `integer` for determining how many `worker` + * functions should be run in parallel. If omitted, the concurrency defaults to + * `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two + * differences between `queue` and `priorityQueue` objects: + * * `push(task, priority, [callback])` - `priority` should be a number. If an + * array of `tasks` is given, all tasks will be assigned the same priority. + * * The `unshift` method was removed. + */ +var priorityQueue = function(worker, concurrency) { + // Start with a normal queue + var q = queue$1(worker, concurrency); + + // Override push to accept second parameter representing priority + q.push = function(data, priority, callback) { + if (callback == null) callback = noop; + if (typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + if (!isArray(data)) { + data = [data]; + } + if (data.length === 0) { + // call drain immediately if there are no tasks + return setImmediate$1(function() { + q.drain(); + }); + } + + priority = priority || 0; + var nextNode = q._tasks.head; + while (nextNode && priority >= nextNode.priority) { + nextNode = nextNode.next; + } + + for (var i = 0, l = data.length; i < l; i++) { + var item = { + data: data[i], + priority: priority, + callback: callback + }; + + if (nextNode) { + q._tasks.insertBefore(nextNode, item); + } else { + q._tasks.push(item); + } + } + setImmediate$1(q.process); + }; + + // Remove unshift function + delete q.unshift; + + return q; +}; + +/** + * Runs the `tasks` array of functions in parallel, without waiting until the + * previous function has completed. Once any of the `tasks` complete or pass an + * error to its callback, the main `callback` is immediately called. It's + * equivalent to `Promise.race()`. + * + * @name race + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} + * to run. Each function can complete with an optional `result` value. + * @param {Function} callback - A callback to run once any of the functions have + * completed. This function gets an error or result from the first function that + * completed. Invoked with (err, result). + * @returns undefined + * @example + * + * async.race([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // main callback + * function(err, result) { + * // the result will be equal to 'two' as it finishes earlier + * }); + */ +function race(tasks, callback) { + callback = once(callback || noop); + if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); + if (!tasks.length) return callback(); + for (var i = 0, l = tasks.length; i < l; i++) { + wrapAsync(tasks[i])(callback); + } +} + +/** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee complete with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + */ +function reduceRight (array, memo, iteratee, callback) { + var reversed = slice(array).reverse(); + reduce(reversed, memo, iteratee, callback); +} + +/** + * Wraps the async function in another function that always completes with a + * result object, even when it errors. + * + * The result object has either the property `error` or `value`. + * + * @name reflect + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function you want to wrap + * @returns {Function} - A function that always passes null to it's callback as + * the error. The second argument to the callback will be an `object` with + * either an `error` or a `value` property. + * @example + * + * async.parallel([ + * async.reflect(function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }), + * async.reflect(function(callback) { + * // do some more stuff but error ... + * callback('bad stuff happened'); + * }), + * async.reflect(function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * }) + * ], + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = 'bad stuff happened' + * // results[2].value = 'two' + * }); + */ +function reflect(fn) { + var _fn = wrapAsync(fn); + return initialParams(function reflectOn(args, reflectCallback) { + args.push(function callback(error, cbArg) { + if (error) { + reflectCallback(null, { error: error }); + } else { + var value; + if (arguments.length <= 2) { + value = cbArg; + } else { + value = slice(arguments, 1); + } + reflectCallback(null, { value: value }); + } + }); + + return _fn.apply(this, args); + }); +} + +/** + * A helper function that wraps an array or an object of functions with `reflect`. + * + * @name reflectAll + * @static + * @memberOf module:Utils + * @method + * @see [async.reflect]{@link module:Utils.reflect} + * @category Util + * @param {Array|Object|Iterable} tasks - The collection of + * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. + * @returns {Array} Returns an array of async functions, each wrapped in + * `async.reflect` + * @example + * + * let tasks = [ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * // do some more stuff but error ... + * callback(new Error('bad stuff happened')); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = Error('bad stuff happened') + * // results[2].value = 'two' + * }); + * + * // an example using an object instead of an array + * let tasks = { + * one: function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * two: function(callback) { + * callback('two'); + * }, + * three: function(callback) { + * setTimeout(function() { + * callback(null, 'three'); + * }, 100); + * } + * }; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results.one.value = 'one' + * // results.two.error = 'two' + * // results.three.value = 'three' + * }); + */ +function reflectAll(tasks) { + var results; + if (isArray(tasks)) { + results = arrayMap(tasks, reflect); + } else { + results = {}; + baseForOwn(tasks, function(task, key) { + results[key] = reflect.call(this, task); + }); + } + return results; +} + +function reject$1(eachfn, arr, iteratee, callback) { + _filter(eachfn, arr, function(value, cb) { + iteratee(value, function(err, v) { + cb(err, !v); + }); + }, callback); +} + +/** + * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. + * + * @name reject + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @example + * + * async.reject(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, results) { + * // results now equals an array of missing files + * createFiles(results); + * }); + */ +var reject = doParallel(reject$1); + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a + * time. + * + * @name rejectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + */ +var rejectLimit = doParallelLimit(reject$1); + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. + * + * @name rejectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + */ +var rejectSeries = doLimit(rejectLimit, 1); + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant$1(value) { + return function() { + return value; + }; +} + +/** + * Attempts to get a successful response from `task` no more than `times` times + * before returning an error. If the task is successful, the `callback` will be + * passed the result of the successful task. If all attempts fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name retry + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @see [async.retryable]{@link module:ControlFlow.retryable} + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an + * object with `times` and `interval` or a number. + * * `times` - The number of attempts to make before giving up. The default + * is `5`. + * * `interval` - The time to wait between retries, in milliseconds. The + * default is `0`. The interval may also be specified as a function of the + * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). + * * If `opts` is a number, the number specifies the number of times to retry, + * with the default interval of `0`. + * @param {AsyncFunction} task - An async function to retry. + * Invoked with (callback). + * @param {Function} [callback] - An optional callback which is called when the + * task has succeeded, or after the final failed attempt. It receives the `err` + * and `result` arguments of the last attempt at completing the `task`. Invoked + * with (err, results). + * + * @example + * + * // The `retry` function can be used as a stand-alone control flow by passing + * // a callback, as shown below: + * + * // try calling apiMethod 3 times + * async.retry(3, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 3 times, waiting 200 ms between each retry + * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 10 times with exponential backoff + * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) + * async.retry({ + * times: 10, + * interval: function(retryCount) { + * return 50 * Math.pow(2, retryCount); + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod the default 5 times no delay between each retry + * async.retry(apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // to retry individual methods that are not as reliable within other + * // control flow functions, use the `retryable` wrapper: + * async.auto({ + * users: api.getUsers.bind(api), + * payments: async.retryable(3, api.getPayments.bind(api)) + * }, function(err, results) { + * // do something with the results + * }); + * + */ +function retry(opts, task, callback) { + var DEFAULT_TIMES = 5; + var DEFAULT_INTERVAL = 0; + + var options = { + times: DEFAULT_TIMES, + intervalFunc: constant$1(DEFAULT_INTERVAL) + }; + + function parseTimes(acc, t) { + if (typeof t === 'object') { + acc.times = +t.times || DEFAULT_TIMES; + + acc.intervalFunc = typeof t.interval === 'function' ? + t.interval : + constant$1(+t.interval || DEFAULT_INTERVAL); + + acc.errorFilter = t.errorFilter; + } else if (typeof t === 'number' || typeof t === 'string') { + acc.times = +t || DEFAULT_TIMES; + } else { + throw new Error("Invalid arguments for async.retry"); + } + } + + if (arguments.length < 3 && typeof opts === 'function') { + callback = task || noop; + task = opts; + } else { + parseTimes(options, opts); + callback = callback || noop; + } + + if (typeof task !== 'function') { + throw new Error("Invalid arguments for async.retry"); + } + + var _task = wrapAsync(task); + + var attempt = 1; + function retryAttempt() { + _task(function(err) { + if (err && attempt++ < options.times && + (typeof options.errorFilter != 'function' || + options.errorFilter(err))) { + setTimeout(retryAttempt, options.intervalFunc(attempt)); + } else { + callback.apply(null, arguments); + } + }); + } + + retryAttempt(); +} + +/** + * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method + * wraps a task and makes it retryable, rather than immediately calling it + * with retries. + * + * @name retryable + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.retry]{@link module:ControlFlow.retry} + * @category Control Flow + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional + * options, exactly the same as from `retry` + * @param {AsyncFunction} task - the asynchronous function to wrap. + * This function will be passed any arguments passed to the returned wrapper. + * Invoked with (...args, callback). + * @returns {AsyncFunction} The wrapped function, which when invoked, will + * retry on an error, based on the parameters specified in `opts`. + * This function will accept the same parameters as `task`. + * @example + * + * async.auto({ + * dep1: async.retryable(3, getFromFlakyService), + * process: ["dep1", async.retryable(3, function (results, cb) { + * maybeProcessData(results.dep1, cb); + * })] + * }, callback); + */ +var retryable = function (opts, task) { + if (!task) { + task = opts; + opts = null; + } + var _task = wrapAsync(task); + return initialParams(function (args, callback) { + function taskFn(cb) { + _task.apply(null, args.concat(cb)); + } + + if (opts) retry(opts, taskFn, callback); + else retry(taskFn, callback); + + }); +}; + +/** + * Run the functions in the `tasks` collection in series, each one running once + * the previous function has completed. If any functions in the series pass an + * error to its callback, no more functions are run, and `callback` is + * immediately called with the value of the error. Otherwise, `callback` + * receives an array of results when `tasks` have completed. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function, and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.series}. + * + * **Note** that while many implementations preserve the order of object + * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) + * explicitly states that + * + * > The mechanics and order of enumerating the properties is not specified. + * + * So if you rely on the order in which your series of functions are executed, + * and want this to work on all platforms, consider using an array. + * + * @name series + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|Object} tasks - A collection containing + * [async functions]{@link AsyncFunction} to run in series. + * Each function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This function gets a results array (or object) + * containing all the result arguments passed to the `task` callbacks. Invoked + * with (err, result). + * @example + * async.series([ + * function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }, + * function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * } + * ], + * // optional callback + * function(err, results) { + * // results is now equal to ['one', 'two'] + * }); + * + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback){ + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * // results is now equal to: {one: 1, two: 2} + * }); + */ +function series(tasks, callback) { + _parallel(eachOfSeries, tasks, callback); +} + +/** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @example + * + * async.some(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, result) { + * // if result is true then at least one of the files exists + * }); + */ +var some = doParallel(_createTester(Boolean, identity)); + +/** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + */ +var someLimit = doParallelLimit(_createTester(Boolean, identity)); + +/** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + */ +var someSeries = doLimit(someLimit, 1); + +/** + * Sorts a list by the results of running each `coll` value through an async + * `iteratee`. + * + * @name sortBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a value to use as the sort criteria as + * its `result`. + * Invoked with (item, callback). + * @param {Function} callback - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is the items + * from the original `coll` sorted by the values returned by the `iteratee` + * calls. Invoked with (err, results). + * @example + * + * async.sortBy(['file1','file2','file3'], function(file, callback) { + * fs.stat(file, function(err, stats) { + * callback(err, stats.mtime); + * }); + * }, function(err, results) { + * // results is now the original array of files sorted by + * // modified date + * }); + * + * // By modifying the callback parameter the + * // sorting order can be influenced: + * + * // ascending order + * async.sortBy([1,9,3,5], function(x, callback) { + * callback(null, x); + * }, function(err,result) { + * // result callback + * }); + * + * // descending order + * async.sortBy([1,9,3,5], function(x, callback) { + * callback(null, x*-1); //<- x*-1 instead of x, turns the order around + * }, function(err,result) { + * // result callback + * }); + */ +function sortBy (coll, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + map(coll, function (x, callback) { + _iteratee(x, function (err, criteria) { + if (err) return callback(err); + callback(null, {value: x, criteria: criteria}); + }); + }, function (err, results) { + if (err) return callback(err); + callback(null, arrayMap(results.sort(comparator), baseProperty('value'))); + }); + + function comparator(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } +} + +/** + * Sets a time limit on an asynchronous function. If the function does not call + * its callback within the specified milliseconds, it will be called with a + * timeout error. The code property for the error object will be `'ETIMEDOUT'`. + * + * @name timeout + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} asyncFn - The async function to limit in time. + * @param {number} milliseconds - The specified time limit. + * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) + * to timeout Error for more information.. + * @returns {AsyncFunction} Returns a wrapped function that can be used with any + * of the control flow functions. + * Invoke this function with the same parameters as you would `asyncFunc`. + * @example + * + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); + */ +function timeout(asyncFn, milliseconds, info) { + var fn = wrapAsync(asyncFn); + + return initialParams(function (args, callback) { + var timedOut = false; + var timer; + + function timeoutCallback() { + var name = asyncFn.name || 'anonymous'; + var error = new Error('Callback function "' + name + '" timed out.'); + error.code = 'ETIMEDOUT'; + if (info) { + error.info = info; + } + timedOut = true; + callback(error); + } + + args.push(function () { + if (!timedOut) { + callback.apply(null, arguments); + clearTimeout(timer); + } + }); + + // setup timer and call original function + timer = setTimeout(timeoutCallback, milliseconds); + fn.apply(null, args); + }); +} + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil; +var nativeMax = Math.max; + +/** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ +function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; +} + +/** + * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a + * time. + * + * @name timesLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} count - The number of times to run the function. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see [async.map]{@link module:Collections.map}. + */ +function timeLimit(count, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + mapLimit(baseRange(0, count, 1), limit, _iteratee, callback); +} + +/** + * Calls the `iteratee` function `n` times, and accumulates results in the same + * manner you would use with [map]{@link module:Collections.map}. + * + * @name times + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.map]{@link module:Collections.map} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @example + * + * // Pretend this is some complicated async factory + * var createUser = function(id, callback) { + * callback(null, { + * id: 'user' + id + * }); + * }; + * + * // generate 5 users + * async.times(5, function(n, next) { + * createUser(n, function(err, user) { + * next(err, user); + * }); + * }, function(err, users) { + * // we should now have 5 users + * }); + */ +var times = doLimit(timeLimit, Infinity); + +/** + * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. + * + * @name timesSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + */ +var timesSeries = doLimit(timeLimit, 1); + +/** + * A relative of `reduce`. Takes an Object or Array, and iterates over each + * element in series, each step potentially mutating an `accumulator` value. + * The type of the accumulator defaults to the type of collection passed in. + * + * @name transform + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {*} [accumulator] - The initial state of the transform. If omitted, + * it will default to an empty Object or Array, depending on the type of `coll` + * @param {AsyncFunction} iteratee - A function applied to each item in the + * collection that potentially modifies the accumulator. + * Invoked with (accumulator, item, key, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the transformed accumulator. + * Invoked with (err, result). + * @example + * + * async.transform([1,2,3], function(acc, item, index, callback) { + * // pointless async: + * process.nextTick(function() { + * acc.push(item * 2) + * callback(null) + * }); + * }, function(err, result) { + * // result is now equal to [2, 4, 6] + * }); + * + * @example + * + * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) { + * setImmediate(function () { + * obj[key] = val * 2; + * callback(); + * }) + * }, function (err, result) { + * // result is equal to {a: 2, b: 4, c: 6} + * }) + */ +function transform (coll, accumulator, iteratee, callback) { + if (arguments.length <= 3) { + callback = iteratee; + iteratee = accumulator; + accumulator = isArray(coll) ? [] : {}; + } + callback = once(callback || noop); + var _iteratee = wrapAsync(iteratee); + + eachOf(coll, function(v, k, cb) { + _iteratee(accumulator, v, k, cb); + }, function(err) { + callback(err, accumulator); + }); +} + +/** + * It runs each task in series but stops whenever any of the functions were + * successful. If one of the tasks were successful, the `callback` will be + * passed the result of the successful task. If all tasks fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name tryEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|Object} tasks - A collection containing functions to + * run, each function is passed a `callback(err, result)` it must call on + * completion with an error `err` (which can be `null`) and an optional `result` + * value. + * @param {Function} [callback] - An optional callback which is called when one + * of the tasks has succeeded, or all have failed. It receives the `err` and + * `result` arguments of the last attempt at completing the `task`. Invoked with + * (err, results). + * @example + * async.tryEach([ + * function getDataFromFirstWebsite(callback) { + * // Try getting the data from the first website + * callback(err, data); + * }, + * function getDataFromSecondWebsite(callback) { + * // First website failed, + * // Try getting the data from the backup website + * callback(err, data); + * } + * ], + * // optional callback + * function(err, results) { + * Now do something with the data. + * }); + * + */ +function tryEach(tasks, callback) { + var error = null; + var result; + callback = callback || noop; + eachSeries(tasks, function(task, callback) { + wrapAsync(task)(function (err, res/*, ...args*/) { + if (arguments.length > 2) { + result = slice(arguments, 1); + } else { + result = res; + } + error = err; + callback(!err); + }); + }, function () { + callback(error, result); + }); +} + +/** + * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, + * unmemoized form. Handy for testing. + * + * @name unmemoize + * @static + * @memberOf module:Utils + * @method + * @see [async.memoize]{@link module:Utils.memoize} + * @category Util + * @param {AsyncFunction} fn - the memoized function + * @returns {AsyncFunction} a function that calls the original unmemoized function + */ +function unmemoize(fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; +} + +/** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Function} test - synchronous truth test to perform before each + * execution of `iteratee`. Invoked with (). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns undefined + * @example + * + * var count = 0; + * async.whilst( + * function() { return count < 5; }, + * function(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ +function whilst(test, iteratee, callback) { + callback = onlyOnce(callback || noop); + var _iteratee = wrapAsync(iteratee); + if (!test()) return callback(null); + var next = function(err/*, ...args*/) { + if (err) return callback(err); + if (test()) return _iteratee(next); + var args = slice(arguments, 1); + callback.apply(null, [null].concat(args)); + }; + _iteratee(next); +} + +/** + * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. `callback` will be passed an error and any + * arguments passed to the final `iteratee`'s callback. + * + * The inverse of [whilst]{@link module:ControlFlow.whilst}. + * + * @name until + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {Function} test - synchronous truth test to perform before each + * execution of `iteratee`. Invoked with (). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + */ +function until(test, iteratee, callback) { + whilst(function() { + return !test.apply(this, arguments); + }, iteratee, callback); +} + +/** + * Runs the `tasks` array of functions in series, each passing their results to + * the next in the array. However, if any of the `tasks` pass an error to their + * own callback, the next function is not executed, and the main `callback` is + * immediately called with the error. + * + * @name waterfall + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} + * to run. + * Each function should complete with any number of `result` values. + * The `result` values will be passed as arguments, in order, to the next task. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This will be passed the results of the last task's + * callback. Invoked with (err, [results]). + * @returns undefined + * @example + * + * async.waterfall([ + * function(callback) { + * callback(null, 'one', 'two'); + * }, + * function(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * }, + * function(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + * ], function (err, result) { + * // result now equals 'done' + * }); + * + * // Or, with named functions: + * async.waterfall([ + * myFirstFunction, + * mySecondFunction, + * myLastFunction, + * ], function (err, result) { + * // result now equals 'done' + * }); + * function myFirstFunction(callback) { + * callback(null, 'one', 'two'); + * } + * function mySecondFunction(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * } + * function myLastFunction(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + */ +var waterfall = function(tasks, callback) { + callback = once(callback || noop); + if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); + if (!tasks.length) return callback(); + var taskIndex = 0; + + function nextTask(args) { + var task = wrapAsync(tasks[taskIndex++]); + args.push(onlyOnce(next)); + task.apply(null, args); + } + + function next(err/*, ...args*/) { + if (err || taskIndex === tasks.length) { + return callback.apply(null, arguments); + } + nextTask(slice(arguments, 1)); + } + + nextTask([]); +}; + +/** + * An "async function" in the context of Async is an asynchronous function with + * a variable number of parameters, with the final parameter being a callback. + * (`function (arg1, arg2, ..., callback) {}`) + * The final callback is of the form `callback(err, results...)`, which must be + * called once the function is completed. The callback should be called with a + * Error as its first argument to signal that an error occurred. + * Otherwise, if no error occurred, it should be called with `null` as the first + * argument, and any additional `result` arguments that may apply, to signal + * successful completion. + * The callback must be called exactly once, ideally on a later tick of the + * JavaScript event loop. + * + * This type of function is also referred to as a "Node-style async function", + * or a "continuation passing-style function" (CPS). Most of the methods of this + * library are themselves CPS/Node-style async functions, or functions that + * return CPS/Node-style async functions. + * + * Wherever we accept a Node-style async function, we also directly accept an + * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. + * In this case, the `async` function will not be passed a final callback + * argument, and any thrown error will be used as the `err` argument of the + * implicit callback, and the return value will be used as the `result` value. + * (i.e. a `rejected` of the returned Promise becomes the `err` callback + * argument, and a `resolved` value becomes the `result`.) + * + * Note, due to JavaScript limitations, we can only detect native `async` + * functions and not transpilied implementations. + * Your environment must have `async`/`await` support for this to work. + * (e.g. Node > v7.6, or a recent version of a modern browser). + * If you are using `async` functions through a transpiler (e.g. Babel), you + * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, + * because the `async function` will be compiled to an ordinary function that + * returns a promise. + * + * @typedef {Function} AsyncFunction + * @static + */ + +/** + * Async is a utility module which provides straight-forward, powerful functions + * for working with asynchronous JavaScript. Although originally designed for + * use with [Node.js](http://nodejs.org) and installable via + * `npm install --save async`, it can also be used directly in the browser. + * @module async + * @see AsyncFunction + */ + + +/** + * A collection of `async` functions for manipulating collections, such as + * arrays and objects. + * @module Collections + */ + +/** + * A collection of `async` functions for controlling the flow through a script. + * @module ControlFlow + */ + +/** + * A collection of `async` utility functions. + * @module Utils + */ + +var index = { + apply: apply, + applyEach: applyEach, + applyEachSeries: applyEachSeries, + asyncify: asyncify, + auto: auto, + autoInject: autoInject, + cargo: cargo, + compose: compose, + concat: concat, + concatLimit: concatLimit, + concatSeries: concatSeries, + constant: constant, + detect: detect, + detectLimit: detectLimit, + detectSeries: detectSeries, + dir: dir, + doDuring: doDuring, + doUntil: doUntil, + doWhilst: doWhilst, + during: during, + each: eachLimit, + eachLimit: eachLimit$1, + eachOf: eachOf, + eachOfLimit: eachOfLimit, + eachOfSeries: eachOfSeries, + eachSeries: eachSeries, + ensureAsync: ensureAsync, + every: every, + everyLimit: everyLimit, + everySeries: everySeries, + filter: filter, + filterLimit: filterLimit, + filterSeries: filterSeries, + forever: forever, + groupBy: groupBy, + groupByLimit: groupByLimit, + groupBySeries: groupBySeries, + log: log, + map: map, + mapLimit: mapLimit, + mapSeries: mapSeries, + mapValues: mapValues, + mapValuesLimit: mapValuesLimit, + mapValuesSeries: mapValuesSeries, + memoize: memoize, + nextTick: nextTick, + parallel: parallelLimit, + parallelLimit: parallelLimit$1, + priorityQueue: priorityQueue, + queue: queue$1, + race: race, + reduce: reduce, + reduceRight: reduceRight, + reflect: reflect, + reflectAll: reflectAll, + reject: reject, + rejectLimit: rejectLimit, + rejectSeries: rejectSeries, + retry: retry, + retryable: retryable, + seq: seq, + series: series, + setImmediate: setImmediate$1, + some: some, + someLimit: someLimit, + someSeries: someSeries, + sortBy: sortBy, + timeout: timeout, + times: times, + timesLimit: timeLimit, + timesSeries: timesSeries, + transform: transform, + tryEach: tryEach, + unmemoize: unmemoize, + until: until, + waterfall: waterfall, + whilst: whilst, + + // aliases + all: every, + allLimit: everyLimit, + allSeries: everySeries, + any: some, + anyLimit: someLimit, + anySeries: someSeries, + find: detect, + findLimit: detectLimit, + findSeries: detectSeries, + forEach: eachLimit, + forEachSeries: eachSeries, + forEachLimit: eachLimit$1, + forEachOf: eachOf, + forEachOfSeries: eachOfSeries, + forEachOfLimit: eachOfLimit, + inject: reduce, + foldl: reduce, + foldr: reduceRight, + select: filter, + selectLimit: filterLimit, + selectSeries: filterSeries, + wrapSync: asyncify +}; + +exports['default'] = index; +exports.apply = apply; +exports.applyEach = applyEach; +exports.applyEachSeries = applyEachSeries; +exports.asyncify = asyncify; +exports.auto = auto; +exports.autoInject = autoInject; +exports.cargo = cargo; +exports.compose = compose; +exports.concat = concat; +exports.concatLimit = concatLimit; +exports.concatSeries = concatSeries; +exports.constant = constant; +exports.detect = detect; +exports.detectLimit = detectLimit; +exports.detectSeries = detectSeries; +exports.dir = dir; +exports.doDuring = doDuring; +exports.doUntil = doUntil; +exports.doWhilst = doWhilst; +exports.during = during; +exports.each = eachLimit; +exports.eachLimit = eachLimit$1; +exports.eachOf = eachOf; +exports.eachOfLimit = eachOfLimit; +exports.eachOfSeries = eachOfSeries; +exports.eachSeries = eachSeries; +exports.ensureAsync = ensureAsync; +exports.every = every; +exports.everyLimit = everyLimit; +exports.everySeries = everySeries; +exports.filter = filter; +exports.filterLimit = filterLimit; +exports.filterSeries = filterSeries; +exports.forever = forever; +exports.groupBy = groupBy; +exports.groupByLimit = groupByLimit; +exports.groupBySeries = groupBySeries; +exports.log = log; +exports.map = map; +exports.mapLimit = mapLimit; +exports.mapSeries = mapSeries; +exports.mapValues = mapValues; +exports.mapValuesLimit = mapValuesLimit; +exports.mapValuesSeries = mapValuesSeries; +exports.memoize = memoize; +exports.nextTick = nextTick; +exports.parallel = parallelLimit; +exports.parallelLimit = parallelLimit$1; +exports.priorityQueue = priorityQueue; +exports.queue = queue$1; +exports.race = race; +exports.reduce = reduce; +exports.reduceRight = reduceRight; +exports.reflect = reflect; +exports.reflectAll = reflectAll; +exports.reject = reject; +exports.rejectLimit = rejectLimit; +exports.rejectSeries = rejectSeries; +exports.retry = retry; +exports.retryable = retryable; +exports.seq = seq; +exports.series = series; +exports.setImmediate = setImmediate$1; +exports.some = some; +exports.someLimit = someLimit; +exports.someSeries = someSeries; +exports.sortBy = sortBy; +exports.timeout = timeout; +exports.times = times; +exports.timesLimit = timeLimit; +exports.timesSeries = timesSeries; +exports.transform = transform; +exports.tryEach = tryEach; +exports.unmemoize = unmemoize; +exports.until = until; +exports.waterfall = waterfall; +exports.whilst = whilst; +exports.all = every; +exports.allLimit = everyLimit; +exports.allSeries = everySeries; +exports.any = some; +exports.anyLimit = someLimit; +exports.anySeries = someSeries; +exports.find = detect; +exports.findLimit = detectLimit; +exports.findSeries = detectSeries; +exports.forEach = eachLimit; +exports.forEachSeries = eachSeries; +exports.forEachLimit = eachLimit$1; +exports.forEachOf = eachOf; +exports.forEachOfSeries = eachOfSeries; +exports.forEachOfLimit = eachOfLimit; +exports.inject = reduce; +exports.foldl = reduce; +exports.foldr = reduceRight; +exports.select = filter; +exports.selectLimit = filterLimit; +exports.selectSeries = filterSeries; +exports.wrapSync = asyncify; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/async/dist/async.min.js b/node_modules/async/dist/async.min.js new file mode 100644 index 0000000..013f194 --- /dev/null +++ b/node_modules/async/dist/async.min.js @@ -0,0 +1,2 @@ +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.async=n.async||{})}(this,function(n){"use strict";function t(n,t){t|=0;for(var e=Math.max(n.length-t,0),r=Array(e),u=0;u-1&&n%1==0&&n<=Tt}function d(n){return null!=n&&v(n.length)&&!y(n)}function m(){}function g(n){return function(){if(null!==n){var t=n;n=null,t.apply(this,arguments)}}}function b(n,t){for(var e=-1,r=Array(n);++e-1&&n%1==0&&nu?0:u+t),e=e>u?u:e,e<0&&(e+=u),u=t>e?0:e-t>>>0,t>>>=0;for(var i=Array(u);++r=r?n:Z(n,t,e)}function tn(n,t){for(var e=n.length;e--&&J(t,n[e],0)>-1;);return e}function en(n,t){for(var e=-1,r=n.length;++e-1;);return e}function rn(n){return n.split("")}function un(n){return Xe.test(n)}function on(n){return n.match(mr)||[]}function cn(n){return un(n)?on(n):rn(n)}function fn(n){return null==n?"":Y(n)}function an(n,t,e){if(n=fn(n),n&&(e||void 0===t))return n.replace(gr,"");if(!n||!(t=Y(t)))return n;var r=cn(n),u=cn(t),i=en(r,u),o=tn(r,u)+1;return nn(r,i,o).join("")}function ln(n){return n=n.toString().replace(kr,""),n=n.match(br)[2].replace(" ",""),n=n?n.split(jr):[],n=n.map(function(n){return an(n.replace(Sr,""))})}function sn(n,t){var e={};N(n,function(n,t){function r(t,e){var r=K(u,function(n){return t[n]});r.push(e),a(n).apply(null,r)}var u,i=f(n),o=!i&&1===n.length||i&&0===n.length;if(Pt(n))u=n.slice(0,-1),n=n[n.length-1],e[t]=u.concat(u.length>0?r:n);else if(o)e[t]=n;else{if(u=ln(n),0===n.length&&!i&&0===u.length)throw new Error("autoInject task functions require explicit parameters.");i||u.pop(),e[t]=u.concat(r)}}),Ve(e,t)}function pn(){this.head=this.tail=null,this.length=0}function hn(n,t){n.length=1,n.head=n.tail=t}function yn(n,t,e){function r(n,t,e){if(null!=e&&"function"!=typeof e)throw new Error("task callback must be a function");if(s.started=!0,Pt(n)||(n=[n]),0===n.length&&s.idle())return lt(function(){s.drain()});for(var r=0,u=n.length;r0&&c.splice(i,1),u.callback.apply(u,arguments),null!=t&&s.error(t,u.data)}o<=s.concurrency-s.buffer&&s.unsaturated(),s.idle()&&s.drain(),s.process()}}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var i=a(n),o=0,c=[],f=!1,l=!1,s={_tasks:new pn,concurrency:t,payload:e,saturated:m,unsaturated:m,buffer:t/4,empty:m,drain:m,error:m,started:!1,paused:!1,push:function(n,t){r(n,!1,t)},kill:function(){s.drain=m,s._tasks.empty()},unshift:function(n,t){r(n,!0,t)},remove:function(n){s._tasks.remove(n)},process:function(){if(!l){for(l=!0;!s.paused&&o2&&(i=t(arguments,1)),u[e]=i,r(n)})},function(n){r(n,u)})}function Dn(n,t){Vn(Ie,n,t)}function Rn(n,t,e){Vn(q(t),n,e)}function Cn(n,t){if(t=g(t||m),!Pt(n))return t(new TypeError("First argument to race must be an array of functions"));if(!n.length)return t();for(var e=0,r=n.length;er?1:0}var u=a(t);_e(n,function(n,t){u(n,function(e,r){return e?t(e):void t(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,K(t.sort(r),Fn("value")))})}function Xn(n,t,e){var r=a(n);return ct(function(u,i){function o(){var t=n.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",e&&(r.info=e),f=!0,i(r)}var c,f=!1;u.push(function(){f||(i.apply(null,arguments),clearTimeout(c))}),c=setTimeout(o,t),r.apply(null,u)})}function Yn(n,t,e,r){for(var u=-1,i=iu(uu((t-n)/(e||1)),0),o=Array(i);i--;)o[r?i:++u]=n,n+=e;return o}function Zn(n,t,e,r){var u=a(e);Ue(Yn(0,n,1),t,u,r)}function nt(n,t,e,r){arguments.length<=3&&(r=e,e=t,t=Pt(n)?[]:{}),r=g(r||m);var u=a(e);Ie(n,function(n,e,r){u(t,n,e,r)},function(n){r(n,t)})}function tt(n,e){var r,u=null;e=e||m,Ur(n,function(n,e){a(n)(function(n,i){r=arguments.length>2?t(arguments,1):i,u=n,e(!n)})},function(){e(u,r)})}function et(n){return function(){return(n.unmemoized||n).apply(null,arguments)}}function rt(n,e,r){r=U(r||m);var u=a(e);if(!n())return r(null);var i=function(e){if(e)return r(e);if(n())return u(i);var o=t(arguments,1);r.apply(null,[null].concat(o))};u(i)}function ut(n,t,e){rt(function(){return!n.apply(this,arguments)},t,e)}var it,ot=function(n){var e=t(arguments,1);return function(){var r=t(arguments);return n.apply(null,e.concat(r))}},ct=function(n){return function(){var e=t(arguments),r=e.pop();n.call(this,e,r)}},ft="function"==typeof setImmediate&&setImmediate,at="object"==typeof process&&"function"==typeof process.nextTick;it=ft?setImmediate:at?process.nextTick:r;var lt=u(it),st="function"==typeof Symbol,pt="object"==typeof global&&global&&global.Object===Object&&global,ht="object"==typeof self&&self&&self.Object===Object&&self,yt=pt||ht||Function("return this")(),vt=yt.Symbol,dt=Object.prototype,mt=dt.hasOwnProperty,gt=dt.toString,bt=vt?vt.toStringTag:void 0,jt=Object.prototype,St=jt.toString,kt="[object Null]",Lt="[object Undefined]",Ot=vt?vt.toStringTag:void 0,wt="[object AsyncFunction]",xt="[object Function]",Et="[object GeneratorFunction]",At="[object Proxy]",Tt=9007199254740991,Bt={},Ft="function"==typeof Symbol&&Symbol.iterator,It=function(n){return Ft&&n[Ft]&&n[Ft]()},_t="[object Arguments]",Mt=Object.prototype,Ut=Mt.hasOwnProperty,qt=Mt.propertyIsEnumerable,zt=S(function(){return arguments}())?S:function(n){return j(n)&&Ut.call(n,"callee")&&!qt.call(n,"callee")},Pt=Array.isArray,Vt="object"==typeof n&&n&&!n.nodeType&&n,Dt=Vt&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=Dt&&Dt.exports===Vt,Ct=Rt?yt.Buffer:void 0,$t=Ct?Ct.isBuffer:void 0,Wt=$t||k,Nt=9007199254740991,Qt=/^(?:0|[1-9]\d*)$/,Gt="[object Arguments]",Ht="[object Array]",Jt="[object Boolean]",Kt="[object Date]",Xt="[object Error]",Yt="[object Function]",Zt="[object Map]",ne="[object Number]",te="[object Object]",ee="[object RegExp]",re="[object Set]",ue="[object String]",ie="[object WeakMap]",oe="[object ArrayBuffer]",ce="[object DataView]",fe="[object Float32Array]",ae="[object Float64Array]",le="[object Int8Array]",se="[object Int16Array]",pe="[object Int32Array]",he="[object Uint8Array]",ye="[object Uint8ClampedArray]",ve="[object Uint16Array]",de="[object Uint32Array]",me={};me[fe]=me[ae]=me[le]=me[se]=me[pe]=me[he]=me[ye]=me[ve]=me[de]=!0,me[Gt]=me[Ht]=me[oe]=me[Jt]=me[ce]=me[Kt]=me[Xt]=me[Yt]=me[Zt]=me[ne]=me[te]=me[ee]=me[re]=me[ue]=me[ie]=!1;var ge="object"==typeof n&&n&&!n.nodeType&&n,be=ge&&"object"==typeof module&&module&&!module.nodeType&&module,je=be&&be.exports===ge,Se=je&&pt.process,ke=function(){try{var n=be&&be.require&&be.require("util").types;return n?n:Se&&Se.binding&&Se.binding("util")}catch(n){}}(),Le=ke&&ke.isTypedArray,Oe=Le?w(Le):O,we=Object.prototype,xe=we.hasOwnProperty,Ee=Object.prototype,Ae=A(Object.keys,Object),Te=Object.prototype,Be=Te.hasOwnProperty,Fe=P(z,1/0),Ie=function(n,t,e){var r=d(n)?V:Fe;r(n,a(t),e)},_e=D(R),Me=l(_e),Ue=C(R),qe=P(Ue,1),ze=l(qe),Pe=W(),Ve=function(n,e,r){function u(n,t){j.push(function(){f(n,t)})}function i(){if(0===j.length&&0===v)return r(null,y);for(;j.length&&v2&&(u=t(arguments,1)),e){var i={};N(y,function(n,t){i[t]=n}),i[n]=u,d=!0,b=Object.create(null),r(e,i)}else y[n]=u,c(n)});v++;var i=a(e[e.length-1]);e.length>1?i(y,u):i(u)}}function l(){for(var n,t=0;S.length;)n=S.pop(),t++,$(s(n),function(n){0===--k[n]&&S.push(n)});if(t!==h)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function s(t){var e=[];return N(n,function(n,r){Pt(n)&&J(n,t,0)>=0&&e.push(r)}),e}"function"==typeof e&&(r=e,e=null),r=g(r||m);var p=B(n),h=p.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=!1,b=Object.create(null),j=[],S=[],k={};N(n,function(t,e){if(!Pt(t))return u(e,[t]),void S.push(e);var r=t.slice(0,t.length-1),i=r.length;return 0===i?(u(e,t),void S.push(e)):(k[e]=i,void $(r,function(c){if(!n[c])throw new Error("async.auto task `"+e+"` has a non-existent dependency `"+c+"` in "+r.join(", "));o(c,function(){i--,0===i&&u(e,t)})}))}),l(),i()},De="[object Symbol]",Re=1/0,Ce=vt?vt.prototype:void 0,$e=Ce?Ce.toString:void 0,We="\\ud800-\\udfff",Ne="\\u0300-\\u036f",Qe="\\ufe20-\\ufe2f",Ge="\\u20d0-\\u20ff",He=Ne+Qe+Ge,Je="\\ufe0e\\ufe0f",Ke="\\u200d",Xe=RegExp("["+Ke+We+He+Je+"]"),Ye="\\ud800-\\udfff",Ze="\\u0300-\\u036f",nr="\\ufe20-\\ufe2f",tr="\\u20d0-\\u20ff",er=Ze+nr+tr,rr="\\ufe0e\\ufe0f",ur="["+Ye+"]",ir="["+er+"]",or="\\ud83c[\\udffb-\\udfff]",cr="(?:"+ir+"|"+or+")",fr="[^"+Ye+"]",ar="(?:\\ud83c[\\udde6-\\uddff]){2}",lr="[\\ud800-\\udbff][\\udc00-\\udfff]",sr="\\u200d",pr=cr+"?",hr="["+rr+"]?",yr="(?:"+sr+"(?:"+[fr,ar,lr].join("|")+")"+hr+pr+")*",vr=hr+pr+yr,dr="(?:"+[fr+ir+"?",ir,ar,lr,ur].join("|")+")",mr=RegExp(or+"(?="+or+")|"+dr+vr,"g"),gr=/^\s+|\s+$/g,br=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,jr=/,/,Sr=/(=.+)?(\s*)$/,kr=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;pn.prototype.removeLink=function(n){return n.prev?n.prev.next=n.next:this.head=n.next,n.next?n.next.prev=n.prev:this.tail=n.prev,n.prev=n.next=null,this.length-=1,n},pn.prototype.empty=function(){for(;this.head;)this.shift();return this},pn.prototype.insertAfter=function(n,t){t.prev=n,t.next=n.next,n.next?n.next.prev=t:this.tail=t,n.next=t,this.length+=1},pn.prototype.insertBefore=function(n,t){t.prev=n.prev,t.next=n,n.prev?n.prev.next=t:this.head=t,n.prev=t,this.length+=1},pn.prototype.unshift=function(n){this.head?this.insertBefore(this.head,n):hn(this,n)},pn.prototype.push=function(n){this.tail?this.insertAfter(this.tail,n):hn(this,n)},pn.prototype.shift=function(){return this.head&&this.removeLink(this.head)},pn.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},pn.prototype.toArray=function(){for(var n=Array(this.length),t=this.head,e=0;e=u.priority;)u=u.next;for(var i=0,o=n.length;i 32 ) { + * console.log('This file name is too long'); + * callback('File name too long'); + * } else { + * // Do work to process file here + * console.log('File processed'); + * callback(); + * } + * }, function(err) { + * // if any of the file processing produced an error, err would equal that error + * if( err ) { + * // One of the iterations produced an error. + * // All processing will now stop. + * console.log('A file failed to process'); + * } else { + * console.log('All files have been processed successfully'); + * } + * }); + */ +function eachLimit(coll, iteratee, callback) { + (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachLimit.js b/node_modules/async/eachLimit.js new file mode 100644 index 0000000..fff721b --- /dev/null +++ b/node_modules/async/eachLimit.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = eachLimit; + +var _eachOfLimit = require('./internal/eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _withoutIndex = require('./internal/withoutIndex'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + */ +function eachLimit(coll, limit, iteratee, callback) { + (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachOf.js b/node_modules/async/eachOf.js new file mode 100644 index 0000000..055b9bd --- /dev/null +++ b/node_modules/async/eachOf.js @@ -0,0 +1,111 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (coll, iteratee, callback) { + var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; + eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); +}; + +var _isArrayLike = require('lodash/isArrayLike'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _breakLoop = require('./internal/breakLoop'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +var _eachOfLimit = require('./eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _once = require('./internal/once'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// eachOf implementation optimized for array-likes +function eachOfArrayLike(coll, iteratee, callback) { + callback = (0, _once2.default)(callback || _noop2.default); + var index = 0, + completed = 0, + length = coll.length; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err) { + callback(err); + } else if (++completed === length || value === _breakLoop2.default) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); + } +} + +// a generic version of eachOf which can handle array, object, and iterator cases. +var eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity); + +/** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @example + * + * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; + * var configs = {}; + * + * async.forEachOf(obj, function (value, key, callback) { + * fs.readFile(__dirname + value, "utf8", function (err, data) { + * if (err) return callback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * }, function (err) { + * if (err) console.error(err.message); + * // configs is now a map of JSON data + * doSomethingWith(configs); + * }); + */ +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachOfLimit.js b/node_modules/async/eachOfLimit.js new file mode 100644 index 0000000..30a1329 --- /dev/null +++ b/node_modules/async/eachOfLimit.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = eachOfLimit; + +var _eachOfLimit2 = require('./internal/eachOfLimit'); + +var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + */ +function eachOfLimit(coll, limit, iteratee, callback) { + (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachOfSeries.js b/node_modules/async/eachOfSeries.js new file mode 100644 index 0000000..9dfd711 --- /dev/null +++ b/node_modules/async/eachOfSeries.js @@ -0,0 +1,35 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + */ +exports.default = (0, _doLimit2.default)(_eachOfLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachSeries.js b/node_modules/async/eachSeries.js new file mode 100644 index 0000000..55c7840 --- /dev/null +++ b/node_modules/async/eachSeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachLimit = require('./eachLimit'); + +var _eachLimit2 = _interopRequireDefault(_eachLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + */ +exports.default = (0, _doLimit2.default)(_eachLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/ensureAsync.js b/node_modules/async/ensureAsync.js new file mode 100644 index 0000000..1f57aec --- /dev/null +++ b/node_modules/async/ensureAsync.js @@ -0,0 +1,73 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = ensureAsync; + +var _setImmediate = require('./internal/setImmediate'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _initialParams = require('./internal/initialParams'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Wrap an async function and ensure it calls its callback on a later tick of + * the event loop. If the function already calls its callback on a next tick, + * no extra deferral is added. This is useful for preventing stack overflows + * (`RangeError: Maximum call stack size exceeded`) and generally keeping + * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) + * contained. ES2017 `async` functions are returned as-is -- they are immune + * to Zalgo's corrupting influences, as they always resolve on a later tick. + * + * @name ensureAsync + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - an async function, one that expects a node-style + * callback as its last argument. + * @returns {AsyncFunction} Returns a wrapped function with the exact same call + * signature as the function passed in. + * @example + * + * function sometimesAsync(arg, callback) { + * if (cache[arg]) { + * return callback(null, cache[arg]); // this would be synchronous!! + * } else { + * doSomeIO(arg, callback); // this IO would be asynchronous + * } + * } + * + * // this has a risk of stack overflows if many results are cached in a row + * async.mapSeries(args, sometimesAsync, done); + * + * // this will defer sometimesAsync's callback if necessary, + * // preventing stack overflows + * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + */ +function ensureAsync(fn) { + if ((0, _wrapAsync.isAsync)(fn)) return fn; + return (0, _initialParams2.default)(function (args, callback) { + var sync = true; + args.push(function () { + var innerArgs = arguments; + if (sync) { + (0, _setImmediate2.default)(function () { + callback.apply(null, innerArgs); + }); + } else { + callback.apply(null, innerArgs); + } + }); + fn.apply(this, args); + sync = false; + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/every.js b/node_modules/async/every.js new file mode 100644 index 0000000..d0565b0 --- /dev/null +++ b/node_modules/async/every.js @@ -0,0 +1,50 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _doParallel = require('./internal/doParallel'); + +var _doParallel2 = _interopRequireDefault(_doParallel); + +var _notId = require('./internal/notId'); + +var _notId2 = _interopRequireDefault(_notId); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @example + * + * async.every(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, result) { + * // if result is true then every file exists + * }); + */ +exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default)); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/everyLimit.js b/node_modules/async/everyLimit.js new file mode 100644 index 0000000..a1a759a --- /dev/null +++ b/node_modules/async/everyLimit.js @@ -0,0 +1,42 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _doParallelLimit = require('./internal/doParallelLimit'); + +var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit); + +var _notId = require('./internal/notId'); + +var _notId2 = _interopRequireDefault(_notId); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + */ +exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_notId2.default, _notId2.default)); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/everySeries.js b/node_modules/async/everySeries.js new file mode 100644 index 0000000..23bfebb --- /dev/null +++ b/node_modules/async/everySeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _everyLimit = require('./everyLimit'); + +var _everyLimit2 = _interopRequireDefault(_everyLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + */ +exports.default = (0, _doLimit2.default)(_everyLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/filter.js b/node_modules/async/filter.js new file mode 100644 index 0000000..54772d5 --- /dev/null +++ b/node_modules/async/filter.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter = require('./internal/filter'); + +var _filter2 = _interopRequireDefault(_filter); + +var _doParallel = require('./internal/doParallel'); + +var _doParallel2 = _interopRequireDefault(_doParallel); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @example + * + * async.filter(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, results) { + * // results now equals an array of the existing files + * }); + */ +exports.default = (0, _doParallel2.default)(_filter2.default); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/filterLimit.js b/node_modules/async/filterLimit.js new file mode 100644 index 0000000..06216f7 --- /dev/null +++ b/node_modules/async/filterLimit.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter = require('./internal/filter'); + +var _filter2 = _interopRequireDefault(_filter); + +var _doParallelLimit = require('./internal/doParallelLimit'); + +var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + */ +exports.default = (0, _doParallelLimit2.default)(_filter2.default); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/filterSeries.js b/node_modules/async/filterSeries.js new file mode 100644 index 0000000..e48d966 --- /dev/null +++ b/node_modules/async/filterSeries.js @@ -0,0 +1,35 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filterLimit = require('./filterLimit'); + +var _filterLimit2 = _interopRequireDefault(_filterLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + */ +exports.default = (0, _doLimit2.default)(_filterLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/find.js b/node_modules/async/find.js new file mode 100644 index 0000000..db46783 --- /dev/null +++ b/node_modules/async/find.js @@ -0,0 +1,61 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _identity = require('lodash/identity'); + +var _identity2 = _interopRequireDefault(_identity); + +var _createTester = require('./internal/createTester'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _doParallel = require('./internal/doParallel'); + +var _doParallel2 = _interopRequireDefault(_doParallel); + +var _findGetResult = require('./internal/findGetResult'); + +var _findGetResult2 = _interopRequireDefault(_findGetResult); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. + + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @example + * + * async.detect(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, result) { + * // result now equals the first file in the list that exists + * }); + */ +exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default)); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/findLimit.js b/node_modules/async/findLimit.js new file mode 100644 index 0000000..6bf6560 --- /dev/null +++ b/node_modules/async/findLimit.js @@ -0,0 +1,48 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _identity = require('lodash/identity'); + +var _identity2 = _interopRequireDefault(_identity); + +var _createTester = require('./internal/createTester'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _doParallelLimit = require('./internal/doParallelLimit'); + +var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit); + +var _findGetResult = require('./internal/findGetResult'); + +var _findGetResult2 = _interopRequireDefault(_findGetResult); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + */ +exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default)); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/findSeries.js b/node_modules/async/findSeries.js new file mode 100644 index 0000000..6fe16c9 --- /dev/null +++ b/node_modules/async/findSeries.js @@ -0,0 +1,38 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _detectLimit = require('./detectLimit'); + +var _detectLimit2 = _interopRequireDefault(_detectLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + */ +exports.default = (0, _doLimit2.default)(_detectLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/foldl.js b/node_modules/async/foldl.js new file mode 100644 index 0000000..3fb8019 --- /dev/null +++ b/node_modules/async/foldl.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reduce; + +var _eachOfSeries = require('./eachOfSeries'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _once = require('./internal/once'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Reduces `coll` into a single value using an async `iteratee` to return each + * successive step. `memo` is the initial state of the reduction. This function + * only operates in series. + * + * For performance reasons, it may make sense to split a call to this function + * into a parallel map, and then use the normal `Array.prototype.reduce` on the + * results. This function is for situations where each step in the reduction + * needs to be async; if you can get the data before reducing it, then it's + * probably a good idea to do so. + * + * @name reduce + * @static + * @memberOf module:Collections + * @method + * @alias inject + * @alias foldl + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee complete with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @example + * + * async.reduce([1,2,3], 0, function(memo, item, callback) { + * // pointless async: + * process.nextTick(function() { + * callback(null, memo + item) + * }); + * }, function(err, result) { + * // result is now equal to the last value of memo, which is 6 + * }); + */ +function reduce(coll, memo, iteratee, callback) { + callback = (0, _once2.default)(callback || _noop2.default); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + (0, _eachOfSeries2.default)(coll, function (x, i, callback) { + _iteratee(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/foldr.js b/node_modules/async/foldr.js new file mode 100644 index 0000000..3d17d32 --- /dev/null +++ b/node_modules/async/foldr.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reduceRight; + +var _reduce = require('./reduce'); + +var _reduce2 = _interopRequireDefault(_reduce); + +var _slice = require('./internal/slice'); + +var _slice2 = _interopRequireDefault(_slice); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee complete with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + */ +function reduceRight(array, memo, iteratee, callback) { + var reversed = (0, _slice2.default)(array).reverse(); + (0, _reduce2.default)(reversed, memo, iteratee, callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEach.js b/node_modules/async/forEach.js new file mode 100644 index 0000000..4b20af3 --- /dev/null +++ b/node_modules/async/forEach.js @@ -0,0 +1,82 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = eachLimit; + +var _eachOf = require('./eachOf'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _withoutIndex = require('./internal/withoutIndex'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @example + * + * // assuming openFiles is an array of file names and saveFile is a function + * // to save the modified contents of that file: + * + * async.each(openFiles, saveFile, function(err){ + * // if any of the saves produced an error, err would equal that error + * }); + * + * // assuming openFiles is an array of file names + * async.each(openFiles, function(file, callback) { + * + * // Perform operation on file here. + * console.log('Processing file ' + file); + * + * if( file.length > 32 ) { + * console.log('This file name is too long'); + * callback('File name too long'); + * } else { + * // Do work to process file here + * console.log('File processed'); + * callback(); + * } + * }, function(err) { + * // if any of the file processing produced an error, err would equal that error + * if( err ) { + * // One of the iterations produced an error. + * // All processing will now stop. + * console.log('A file failed to process'); + * } else { + * console.log('All files have been processed successfully'); + * } + * }); + */ +function eachLimit(coll, iteratee, callback) { + (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachLimit.js b/node_modules/async/forEachLimit.js new file mode 100644 index 0000000..fff721b --- /dev/null +++ b/node_modules/async/forEachLimit.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = eachLimit; + +var _eachOfLimit = require('./internal/eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _withoutIndex = require('./internal/withoutIndex'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + */ +function eachLimit(coll, limit, iteratee, callback) { + (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachOf.js b/node_modules/async/forEachOf.js new file mode 100644 index 0000000..055b9bd --- /dev/null +++ b/node_modules/async/forEachOf.js @@ -0,0 +1,111 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (coll, iteratee, callback) { + var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; + eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); +}; + +var _isArrayLike = require('lodash/isArrayLike'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _breakLoop = require('./internal/breakLoop'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +var _eachOfLimit = require('./eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _once = require('./internal/once'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// eachOf implementation optimized for array-likes +function eachOfArrayLike(coll, iteratee, callback) { + callback = (0, _once2.default)(callback || _noop2.default); + var index = 0, + completed = 0, + length = coll.length; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err) { + callback(err); + } else if (++completed === length || value === _breakLoop2.default) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); + } +} + +// a generic version of eachOf which can handle array, object, and iterator cases. +var eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity); + +/** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @example + * + * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; + * var configs = {}; + * + * async.forEachOf(obj, function (value, key, callback) { + * fs.readFile(__dirname + value, "utf8", function (err, data) { + * if (err) return callback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * }, function (err) { + * if (err) console.error(err.message); + * // configs is now a map of JSON data + * doSomethingWith(configs); + * }); + */ +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachOfLimit.js b/node_modules/async/forEachOfLimit.js new file mode 100644 index 0000000..30a1329 --- /dev/null +++ b/node_modules/async/forEachOfLimit.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = eachOfLimit; + +var _eachOfLimit2 = require('./internal/eachOfLimit'); + +var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + */ +function eachOfLimit(coll, limit, iteratee, callback) { + (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachOfSeries.js b/node_modules/async/forEachOfSeries.js new file mode 100644 index 0000000..9dfd711 --- /dev/null +++ b/node_modules/async/forEachOfSeries.js @@ -0,0 +1,35 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + */ +exports.default = (0, _doLimit2.default)(_eachOfLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachSeries.js b/node_modules/async/forEachSeries.js new file mode 100644 index 0000000..55c7840 --- /dev/null +++ b/node_modules/async/forEachSeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachLimit = require('./eachLimit'); + +var _eachLimit2 = _interopRequireDefault(_eachLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + */ +exports.default = (0, _doLimit2.default)(_eachLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forever.js b/node_modules/async/forever.js new file mode 100644 index 0000000..6c7b8a4 --- /dev/null +++ b/node_modules/async/forever.js @@ -0,0 +1,65 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = forever; + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _onlyOnce = require('./internal/onlyOnce'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _ensureAsync = require('./ensureAsync'); + +var _ensureAsync2 = _interopRequireDefault(_ensureAsync); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calls the asynchronous function `fn` with a callback parameter that allows it + * to call itself again, in series, indefinitely. + + * If an error is passed to the callback then `errback` is called with the + * error, and execution stops, otherwise it will never be called. + * + * @name forever + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} fn - an async function to call repeatedly. + * Invoked with (next). + * @param {Function} [errback] - when `fn` passes an error to it's callback, + * this function will be called, and execution stops. Invoked with (err). + * @example + * + * async.forever( + * function(next) { + * // next is suitable for passing to things that need a callback(err [, whatever]); + * // it will result in this function being called again. + * }, + * function(err) { + * // if next is called with a value in its first parameter, it will appear + * // in here as 'err', and execution will stop. + * } + * ); + */ +function forever(fn, errback) { + var done = (0, _onlyOnce2.default)(errback || _noop2.default); + var task = (0, _wrapAsync2.default)((0, _ensureAsync2.default)(fn)); + + function next(err) { + if (err) return done(err); + task(next); + } + next(); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/groupBy.js b/node_modules/async/groupBy.js new file mode 100644 index 0000000..755cba7 --- /dev/null +++ b/node_modules/async/groupBy.js @@ -0,0 +1,54 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +var _groupByLimit = require('./groupByLimit'); + +var _groupByLimit2 = _interopRequireDefault(_groupByLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns a new object, where each value corresponds to an array of items, from + * `coll`, that returned the corresponding key. That is, the keys of the object + * correspond to the values passed to the `iteratee` callback. + * + * Note: Since this function applies the `iteratee` to each item in parallel, + * there is no guarantee that the `iteratee` functions will complete in order. + * However, the values for each key in the `result` will be in the same order as + * the original `coll`. For Objects, the values will roughly be in the order of + * the original Objects' keys (but this can vary across JavaScript engines). + * + * @name groupBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @example + * + * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) { + * db.findById(userId, function(err, user) { + * if (err) return callback(err); + * return callback(null, user.age); + * }); + * }, function(err, result) { + * // result is object containing the userIds grouped by age + * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']}; + * }); + */ +exports.default = (0, _doLimit2.default)(_groupByLimit2.default, Infinity); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/groupByLimit.js b/node_modules/async/groupByLimit.js new file mode 100644 index 0000000..fec13f8 --- /dev/null +++ b/node_modules/async/groupByLimit.js @@ -0,0 +1,71 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (coll, limit, iteratee, callback) { + callback = callback || _noop2.default; + var _iteratee = (0, _wrapAsync2.default)(iteratee); + (0, _mapLimit2.default)(coll, limit, function (val, callback) { + _iteratee(val, function (err, key) { + if (err) return callback(err); + return callback(null, { key: key, val: val }); + }); + }, function (err, mapResults) { + var result = {}; + // from MDN, handle object having an `hasOwnProperty` prop + var hasOwnProperty = Object.prototype.hasOwnProperty; + + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + var key = mapResults[i].key; + var val = mapResults[i].val; + + if (hasOwnProperty.call(result, key)) { + result[key].push(val); + } else { + result[key] = [val]; + } + } + } + + return callback(err, result); + }); +}; + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _mapLimit = require('./mapLimit'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +; +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. + * + * @name groupByLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + */ +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/groupBySeries.js b/node_modules/async/groupBySeries.js new file mode 100644 index 0000000..b94805e --- /dev/null +++ b/node_modules/async/groupBySeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +var _groupByLimit = require('./groupByLimit'); + +var _groupByLimit2 = _interopRequireDefault(_groupByLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. + * + * @name groupBySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + */ +exports.default = (0, _doLimit2.default)(_groupByLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/index.js b/node_modules/async/index.js new file mode 100644 index 0000000..c39d8d8 --- /dev/null +++ b/node_modules/async/index.js @@ -0,0 +1,582 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; + +var _apply = require('./apply'); + +var _apply2 = _interopRequireDefault(_apply); + +var _applyEach = require('./applyEach'); + +var _applyEach2 = _interopRequireDefault(_applyEach); + +var _applyEachSeries = require('./applyEachSeries'); + +var _applyEachSeries2 = _interopRequireDefault(_applyEachSeries); + +var _asyncify = require('./asyncify'); + +var _asyncify2 = _interopRequireDefault(_asyncify); + +var _auto = require('./auto'); + +var _auto2 = _interopRequireDefault(_auto); + +var _autoInject = require('./autoInject'); + +var _autoInject2 = _interopRequireDefault(_autoInject); + +var _cargo = require('./cargo'); + +var _cargo2 = _interopRequireDefault(_cargo); + +var _compose = require('./compose'); + +var _compose2 = _interopRequireDefault(_compose); + +var _concat = require('./concat'); + +var _concat2 = _interopRequireDefault(_concat); + +var _concatLimit = require('./concatLimit'); + +var _concatLimit2 = _interopRequireDefault(_concatLimit); + +var _concatSeries = require('./concatSeries'); + +var _concatSeries2 = _interopRequireDefault(_concatSeries); + +var _constant = require('./constant'); + +var _constant2 = _interopRequireDefault(_constant); + +var _detect = require('./detect'); + +var _detect2 = _interopRequireDefault(_detect); + +var _detectLimit = require('./detectLimit'); + +var _detectLimit2 = _interopRequireDefault(_detectLimit); + +var _detectSeries = require('./detectSeries'); + +var _detectSeries2 = _interopRequireDefault(_detectSeries); + +var _dir = require('./dir'); + +var _dir2 = _interopRequireDefault(_dir); + +var _doDuring = require('./doDuring'); + +var _doDuring2 = _interopRequireDefault(_doDuring); + +var _doUntil = require('./doUntil'); + +var _doUntil2 = _interopRequireDefault(_doUntil); + +var _doWhilst = require('./doWhilst'); + +var _doWhilst2 = _interopRequireDefault(_doWhilst); + +var _during = require('./during'); + +var _during2 = _interopRequireDefault(_during); + +var _each = require('./each'); + +var _each2 = _interopRequireDefault(_each); + +var _eachLimit = require('./eachLimit'); + +var _eachLimit2 = _interopRequireDefault(_eachLimit); + +var _eachOf = require('./eachOf'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _eachOfLimit = require('./eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _eachOfSeries = require('./eachOfSeries'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _eachSeries = require('./eachSeries'); + +var _eachSeries2 = _interopRequireDefault(_eachSeries); + +var _ensureAsync = require('./ensureAsync'); + +var _ensureAsync2 = _interopRequireDefault(_ensureAsync); + +var _every = require('./every'); + +var _every2 = _interopRequireDefault(_every); + +var _everyLimit = require('./everyLimit'); + +var _everyLimit2 = _interopRequireDefault(_everyLimit); + +var _everySeries = require('./everySeries'); + +var _everySeries2 = _interopRequireDefault(_everySeries); + +var _filter = require('./filter'); + +var _filter2 = _interopRequireDefault(_filter); + +var _filterLimit = require('./filterLimit'); + +var _filterLimit2 = _interopRequireDefault(_filterLimit); + +var _filterSeries = require('./filterSeries'); + +var _filterSeries2 = _interopRequireDefault(_filterSeries); + +var _forever = require('./forever'); + +var _forever2 = _interopRequireDefault(_forever); + +var _groupBy = require('./groupBy'); + +var _groupBy2 = _interopRequireDefault(_groupBy); + +var _groupByLimit = require('./groupByLimit'); + +var _groupByLimit2 = _interopRequireDefault(_groupByLimit); + +var _groupBySeries = require('./groupBySeries'); + +var _groupBySeries2 = _interopRequireDefault(_groupBySeries); + +var _log = require('./log'); + +var _log2 = _interopRequireDefault(_log); + +var _map = require('./map'); + +var _map2 = _interopRequireDefault(_map); + +var _mapLimit = require('./mapLimit'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _mapSeries = require('./mapSeries'); + +var _mapSeries2 = _interopRequireDefault(_mapSeries); + +var _mapValues = require('./mapValues'); + +var _mapValues2 = _interopRequireDefault(_mapValues); + +var _mapValuesLimit = require('./mapValuesLimit'); + +var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); + +var _mapValuesSeries = require('./mapValuesSeries'); + +var _mapValuesSeries2 = _interopRequireDefault(_mapValuesSeries); + +var _memoize = require('./memoize'); + +var _memoize2 = _interopRequireDefault(_memoize); + +var _nextTick = require('./nextTick'); + +var _nextTick2 = _interopRequireDefault(_nextTick); + +var _parallel = require('./parallel'); + +var _parallel2 = _interopRequireDefault(_parallel); + +var _parallelLimit = require('./parallelLimit'); + +var _parallelLimit2 = _interopRequireDefault(_parallelLimit); + +var _priorityQueue = require('./priorityQueue'); + +var _priorityQueue2 = _interopRequireDefault(_priorityQueue); + +var _queue = require('./queue'); + +var _queue2 = _interopRequireDefault(_queue); + +var _race = require('./race'); + +var _race2 = _interopRequireDefault(_race); + +var _reduce = require('./reduce'); + +var _reduce2 = _interopRequireDefault(_reduce); + +var _reduceRight = require('./reduceRight'); + +var _reduceRight2 = _interopRequireDefault(_reduceRight); + +var _reflect = require('./reflect'); + +var _reflect2 = _interopRequireDefault(_reflect); + +var _reflectAll = require('./reflectAll'); + +var _reflectAll2 = _interopRequireDefault(_reflectAll); + +var _reject = require('./reject'); + +var _reject2 = _interopRequireDefault(_reject); + +var _rejectLimit = require('./rejectLimit'); + +var _rejectLimit2 = _interopRequireDefault(_rejectLimit); + +var _rejectSeries = require('./rejectSeries'); + +var _rejectSeries2 = _interopRequireDefault(_rejectSeries); + +var _retry = require('./retry'); + +var _retry2 = _interopRequireDefault(_retry); + +var _retryable = require('./retryable'); + +var _retryable2 = _interopRequireDefault(_retryable); + +var _seq = require('./seq'); + +var _seq2 = _interopRequireDefault(_seq); + +var _series = require('./series'); + +var _series2 = _interopRequireDefault(_series); + +var _setImmediate = require('./setImmediate'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _some = require('./some'); + +var _some2 = _interopRequireDefault(_some); + +var _someLimit = require('./someLimit'); + +var _someLimit2 = _interopRequireDefault(_someLimit); + +var _someSeries = require('./someSeries'); + +var _someSeries2 = _interopRequireDefault(_someSeries); + +var _sortBy = require('./sortBy'); + +var _sortBy2 = _interopRequireDefault(_sortBy); + +var _timeout = require('./timeout'); + +var _timeout2 = _interopRequireDefault(_timeout); + +var _times = require('./times'); + +var _times2 = _interopRequireDefault(_times); + +var _timesLimit = require('./timesLimit'); + +var _timesLimit2 = _interopRequireDefault(_timesLimit); + +var _timesSeries = require('./timesSeries'); + +var _timesSeries2 = _interopRequireDefault(_timesSeries); + +var _transform = require('./transform'); + +var _transform2 = _interopRequireDefault(_transform); + +var _tryEach = require('./tryEach'); + +var _tryEach2 = _interopRequireDefault(_tryEach); + +var _unmemoize = require('./unmemoize'); + +var _unmemoize2 = _interopRequireDefault(_unmemoize); + +var _until = require('./until'); + +var _until2 = _interopRequireDefault(_until); + +var _waterfall = require('./waterfall'); + +var _waterfall2 = _interopRequireDefault(_waterfall); + +var _whilst = require('./whilst'); + +var _whilst2 = _interopRequireDefault(_whilst); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = { + apply: _apply2.default, + applyEach: _applyEach2.default, + applyEachSeries: _applyEachSeries2.default, + asyncify: _asyncify2.default, + auto: _auto2.default, + autoInject: _autoInject2.default, + cargo: _cargo2.default, + compose: _compose2.default, + concat: _concat2.default, + concatLimit: _concatLimit2.default, + concatSeries: _concatSeries2.default, + constant: _constant2.default, + detect: _detect2.default, + detectLimit: _detectLimit2.default, + detectSeries: _detectSeries2.default, + dir: _dir2.default, + doDuring: _doDuring2.default, + doUntil: _doUntil2.default, + doWhilst: _doWhilst2.default, + during: _during2.default, + each: _each2.default, + eachLimit: _eachLimit2.default, + eachOf: _eachOf2.default, + eachOfLimit: _eachOfLimit2.default, + eachOfSeries: _eachOfSeries2.default, + eachSeries: _eachSeries2.default, + ensureAsync: _ensureAsync2.default, + every: _every2.default, + everyLimit: _everyLimit2.default, + everySeries: _everySeries2.default, + filter: _filter2.default, + filterLimit: _filterLimit2.default, + filterSeries: _filterSeries2.default, + forever: _forever2.default, + groupBy: _groupBy2.default, + groupByLimit: _groupByLimit2.default, + groupBySeries: _groupBySeries2.default, + log: _log2.default, + map: _map2.default, + mapLimit: _mapLimit2.default, + mapSeries: _mapSeries2.default, + mapValues: _mapValues2.default, + mapValuesLimit: _mapValuesLimit2.default, + mapValuesSeries: _mapValuesSeries2.default, + memoize: _memoize2.default, + nextTick: _nextTick2.default, + parallel: _parallel2.default, + parallelLimit: _parallelLimit2.default, + priorityQueue: _priorityQueue2.default, + queue: _queue2.default, + race: _race2.default, + reduce: _reduce2.default, + reduceRight: _reduceRight2.default, + reflect: _reflect2.default, + reflectAll: _reflectAll2.default, + reject: _reject2.default, + rejectLimit: _rejectLimit2.default, + rejectSeries: _rejectSeries2.default, + retry: _retry2.default, + retryable: _retryable2.default, + seq: _seq2.default, + series: _series2.default, + setImmediate: _setImmediate2.default, + some: _some2.default, + someLimit: _someLimit2.default, + someSeries: _someSeries2.default, + sortBy: _sortBy2.default, + timeout: _timeout2.default, + times: _times2.default, + timesLimit: _timesLimit2.default, + timesSeries: _timesSeries2.default, + transform: _transform2.default, + tryEach: _tryEach2.default, + unmemoize: _unmemoize2.default, + until: _until2.default, + waterfall: _waterfall2.default, + whilst: _whilst2.default, + + // aliases + all: _every2.default, + allLimit: _everyLimit2.default, + allSeries: _everySeries2.default, + any: _some2.default, + anyLimit: _someLimit2.default, + anySeries: _someSeries2.default, + find: _detect2.default, + findLimit: _detectLimit2.default, + findSeries: _detectSeries2.default, + forEach: _each2.default, + forEachSeries: _eachSeries2.default, + forEachLimit: _eachLimit2.default, + forEachOf: _eachOf2.default, + forEachOfSeries: _eachOfSeries2.default, + forEachOfLimit: _eachOfLimit2.default, + inject: _reduce2.default, + foldl: _reduce2.default, + foldr: _reduceRight2.default, + select: _filter2.default, + selectLimit: _filterLimit2.default, + selectSeries: _filterSeries2.default, + wrapSync: _asyncify2.default +}; /** + * An "async function" in the context of Async is an asynchronous function with + * a variable number of parameters, with the final parameter being a callback. + * (`function (arg1, arg2, ..., callback) {}`) + * The final callback is of the form `callback(err, results...)`, which must be + * called once the function is completed. The callback should be called with a + * Error as its first argument to signal that an error occurred. + * Otherwise, if no error occurred, it should be called with `null` as the first + * argument, and any additional `result` arguments that may apply, to signal + * successful completion. + * The callback must be called exactly once, ideally on a later tick of the + * JavaScript event loop. + * + * This type of function is also referred to as a "Node-style async function", + * or a "continuation passing-style function" (CPS). Most of the methods of this + * library are themselves CPS/Node-style async functions, or functions that + * return CPS/Node-style async functions. + * + * Wherever we accept a Node-style async function, we also directly accept an + * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. + * In this case, the `async` function will not be passed a final callback + * argument, and any thrown error will be used as the `err` argument of the + * implicit callback, and the return value will be used as the `result` value. + * (i.e. a `rejected` of the returned Promise becomes the `err` callback + * argument, and a `resolved` value becomes the `result`.) + * + * Note, due to JavaScript limitations, we can only detect native `async` + * functions and not transpilied implementations. + * Your environment must have `async`/`await` support for this to work. + * (e.g. Node > v7.6, or a recent version of a modern browser). + * If you are using `async` functions through a transpiler (e.g. Babel), you + * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, + * because the `async function` will be compiled to an ordinary function that + * returns a promise. + * + * @typedef {Function} AsyncFunction + * @static + */ + +/** + * Async is a utility module which provides straight-forward, powerful functions + * for working with asynchronous JavaScript. Although originally designed for + * use with [Node.js](http://nodejs.org) and installable via + * `npm install --save async`, it can also be used directly in the browser. + * @module async + * @see AsyncFunction + */ + +/** + * A collection of `async` functions for manipulating collections, such as + * arrays and objects. + * @module Collections + */ + +/** + * A collection of `async` functions for controlling the flow through a script. + * @module ControlFlow + */ + +/** + * A collection of `async` utility functions. + * @module Utils + */ + +exports.apply = _apply2.default; +exports.applyEach = _applyEach2.default; +exports.applyEachSeries = _applyEachSeries2.default; +exports.asyncify = _asyncify2.default; +exports.auto = _auto2.default; +exports.autoInject = _autoInject2.default; +exports.cargo = _cargo2.default; +exports.compose = _compose2.default; +exports.concat = _concat2.default; +exports.concatLimit = _concatLimit2.default; +exports.concatSeries = _concatSeries2.default; +exports.constant = _constant2.default; +exports.detect = _detect2.default; +exports.detectLimit = _detectLimit2.default; +exports.detectSeries = _detectSeries2.default; +exports.dir = _dir2.default; +exports.doDuring = _doDuring2.default; +exports.doUntil = _doUntil2.default; +exports.doWhilst = _doWhilst2.default; +exports.during = _during2.default; +exports.each = _each2.default; +exports.eachLimit = _eachLimit2.default; +exports.eachOf = _eachOf2.default; +exports.eachOfLimit = _eachOfLimit2.default; +exports.eachOfSeries = _eachOfSeries2.default; +exports.eachSeries = _eachSeries2.default; +exports.ensureAsync = _ensureAsync2.default; +exports.every = _every2.default; +exports.everyLimit = _everyLimit2.default; +exports.everySeries = _everySeries2.default; +exports.filter = _filter2.default; +exports.filterLimit = _filterLimit2.default; +exports.filterSeries = _filterSeries2.default; +exports.forever = _forever2.default; +exports.groupBy = _groupBy2.default; +exports.groupByLimit = _groupByLimit2.default; +exports.groupBySeries = _groupBySeries2.default; +exports.log = _log2.default; +exports.map = _map2.default; +exports.mapLimit = _mapLimit2.default; +exports.mapSeries = _mapSeries2.default; +exports.mapValues = _mapValues2.default; +exports.mapValuesLimit = _mapValuesLimit2.default; +exports.mapValuesSeries = _mapValuesSeries2.default; +exports.memoize = _memoize2.default; +exports.nextTick = _nextTick2.default; +exports.parallel = _parallel2.default; +exports.parallelLimit = _parallelLimit2.default; +exports.priorityQueue = _priorityQueue2.default; +exports.queue = _queue2.default; +exports.race = _race2.default; +exports.reduce = _reduce2.default; +exports.reduceRight = _reduceRight2.default; +exports.reflect = _reflect2.default; +exports.reflectAll = _reflectAll2.default; +exports.reject = _reject2.default; +exports.rejectLimit = _rejectLimit2.default; +exports.rejectSeries = _rejectSeries2.default; +exports.retry = _retry2.default; +exports.retryable = _retryable2.default; +exports.seq = _seq2.default; +exports.series = _series2.default; +exports.setImmediate = _setImmediate2.default; +exports.some = _some2.default; +exports.someLimit = _someLimit2.default; +exports.someSeries = _someSeries2.default; +exports.sortBy = _sortBy2.default; +exports.timeout = _timeout2.default; +exports.times = _times2.default; +exports.timesLimit = _timesLimit2.default; +exports.timesSeries = _timesSeries2.default; +exports.transform = _transform2.default; +exports.tryEach = _tryEach2.default; +exports.unmemoize = _unmemoize2.default; +exports.until = _until2.default; +exports.waterfall = _waterfall2.default; +exports.whilst = _whilst2.default; +exports.all = _every2.default; +exports.allLimit = _everyLimit2.default; +exports.allSeries = _everySeries2.default; +exports.any = _some2.default; +exports.anyLimit = _someLimit2.default; +exports.anySeries = _someSeries2.default; +exports.find = _detect2.default; +exports.findLimit = _detectLimit2.default; +exports.findSeries = _detectSeries2.default; +exports.forEach = _each2.default; +exports.forEachSeries = _eachSeries2.default; +exports.forEachLimit = _eachLimit2.default; +exports.forEachOf = _eachOf2.default; +exports.forEachOfSeries = _eachOfSeries2.default; +exports.forEachOfLimit = _eachOfLimit2.default; +exports.inject = _reduce2.default; +exports.foldl = _reduce2.default; +exports.foldr = _reduceRight2.default; +exports.select = _filter2.default; +exports.selectLimit = _filterLimit2.default; +exports.selectSeries = _filterSeries2.default; +exports.wrapSync = _asyncify2.default; \ No newline at end of file diff --git a/node_modules/async/inject.js b/node_modules/async/inject.js new file mode 100644 index 0000000..3fb8019 --- /dev/null +++ b/node_modules/async/inject.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reduce; + +var _eachOfSeries = require('./eachOfSeries'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _once = require('./internal/once'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Reduces `coll` into a single value using an async `iteratee` to return each + * successive step. `memo` is the initial state of the reduction. This function + * only operates in series. + * + * For performance reasons, it may make sense to split a call to this function + * into a parallel map, and then use the normal `Array.prototype.reduce` on the + * results. This function is for situations where each step in the reduction + * needs to be async; if you can get the data before reducing it, then it's + * probably a good idea to do so. + * + * @name reduce + * @static + * @memberOf module:Collections + * @method + * @alias inject + * @alias foldl + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee complete with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @example + * + * async.reduce([1,2,3], 0, function(memo, item, callback) { + * // pointless async: + * process.nextTick(function() { + * callback(null, memo + item) + * }); + * }, function(err, result) { + * // result is now equal to the last value of memo, which is 6 + * }); + */ +function reduce(coll, memo, iteratee, callback) { + callback = (0, _once2.default)(callback || _noop2.default); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + (0, _eachOfSeries2.default)(coll, function (x, i, callback) { + _iteratee(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/DoublyLinkedList.js b/node_modules/async/internal/DoublyLinkedList.js new file mode 100644 index 0000000..7e71728 --- /dev/null +++ b/node_modules/async/internal/DoublyLinkedList.js @@ -0,0 +1,88 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = DLL; +// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation +// used for queues. This implementation assumes that the node provided by the user can be modified +// to adjust the next and last properties. We implement only the minimal functionality +// for queue support. +function DLL() { + this.head = this.tail = null; + this.length = 0; +} + +function setInitial(dll, node) { + dll.length = 1; + dll.head = dll.tail = node; +} + +DLL.prototype.removeLink = function (node) { + if (node.prev) node.prev.next = node.next;else this.head = node.next; + if (node.next) node.next.prev = node.prev;else this.tail = node.prev; + + node.prev = node.next = null; + this.length -= 1; + return node; +}; + +DLL.prototype.empty = function () { + while (this.head) this.shift(); + return this; +}; + +DLL.prototype.insertAfter = function (node, newNode) { + newNode.prev = node; + newNode.next = node.next; + if (node.next) node.next.prev = newNode;else this.tail = newNode; + node.next = newNode; + this.length += 1; +}; + +DLL.prototype.insertBefore = function (node, newNode) { + newNode.prev = node.prev; + newNode.next = node; + if (node.prev) node.prev.next = newNode;else this.head = newNode; + node.prev = newNode; + this.length += 1; +}; + +DLL.prototype.unshift = function (node) { + if (this.head) this.insertBefore(this.head, node);else setInitial(this, node); +}; + +DLL.prototype.push = function (node) { + if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node); +}; + +DLL.prototype.shift = function () { + return this.head && this.removeLink(this.head); +}; + +DLL.prototype.pop = function () { + return this.tail && this.removeLink(this.tail); +}; + +DLL.prototype.toArray = function () { + var arr = Array(this.length); + var curr = this.head; + for (var idx = 0; idx < this.length; idx++) { + arr[idx] = curr.data; + curr = curr.next; + } + return arr; +}; + +DLL.prototype.remove = function (testFn) { + var curr = this.head; + while (!!curr) { + var next = curr.next; + if (testFn(curr)) { + this.removeLink(curr); + } + curr = next; + } + return this; +}; +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/applyEach.js b/node_modules/async/internal/applyEach.js new file mode 100644 index 0000000..322e03c --- /dev/null +++ b/node_modules/async/internal/applyEach.js @@ -0,0 +1,38 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = applyEach; + +var _slice = require('./slice'); + +var _slice2 = _interopRequireDefault(_slice); + +var _initialParams = require('./initialParams'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function applyEach(eachfn) { + return function (fns /*, ...args*/) { + var args = (0, _slice2.default)(arguments, 1); + var go = (0, _initialParams2.default)(function (args, callback) { + var that = this; + return eachfn(fns, function (fn, cb) { + (0, _wrapAsync2.default)(fn).apply(that, args.concat(cb)); + }, callback); + }); + if (args.length) { + return go.apply(this, args); + } else { + return go; + } + }; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/breakLoop.js b/node_modules/async/internal/breakLoop.js new file mode 100644 index 0000000..1065058 --- /dev/null +++ b/node_modules/async/internal/breakLoop.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// A temporary value used to identify if the loop should be broken. +// See #1064, #1293 +exports.default = {}; +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/consoleFunc.js b/node_modules/async/internal/consoleFunc.js new file mode 100644 index 0000000..603f48e --- /dev/null +++ b/node_modules/async/internal/consoleFunc.js @@ -0,0 +1,42 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = consoleFunc; + +var _arrayEach = require('lodash/_arrayEach'); + +var _arrayEach2 = _interopRequireDefault(_arrayEach); + +var _slice = require('./slice'); + +var _slice2 = _interopRequireDefault(_slice); + +var _wrapAsync = require('./wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function consoleFunc(name) { + return function (fn /*, ...args*/) { + var args = (0, _slice2.default)(arguments, 1); + args.push(function (err /*, ...args*/) { + var args = (0, _slice2.default)(arguments, 1); + if (typeof console === 'object') { + if (err) { + if (console.error) { + console.error(err); + } + } else if (console[name]) { + (0, _arrayEach2.default)(args, function (x) { + console[name](x); + }); + } + } + }); + (0, _wrapAsync2.default)(fn).apply(null, args); + }; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/createTester.js b/node_modules/async/internal/createTester.js new file mode 100644 index 0000000..ce96e8b --- /dev/null +++ b/node_modules/async/internal/createTester.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _createTester; + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _breakLoop = require('./breakLoop'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _createTester(check, getResult) { + return function (eachfn, arr, iteratee, cb) { + cb = cb || _noop2.default; + var testPassed = false; + var testResult; + eachfn(arr, function (value, _, callback) { + iteratee(value, function (err, result) { + if (err) { + callback(err); + } else if (check(result) && !testResult) { + testPassed = true; + testResult = getResult(true, value); + callback(null, _breakLoop2.default); + } else { + callback(); + } + }); + }, function (err) { + if (err) { + cb(err); + } else { + cb(null, testPassed ? testResult : getResult(false)); + } + }); + }; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/doLimit.js b/node_modules/async/internal/doLimit.js new file mode 100644 index 0000000..963c608 --- /dev/null +++ b/node_modules/async/internal/doLimit.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = doLimit; +function doLimit(fn, limit) { + return function (iterable, iteratee, callback) { + return fn(iterable, limit, iteratee, callback); + }; +} +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/doParallel.js b/node_modules/async/internal/doParallel.js new file mode 100644 index 0000000..bb40207 --- /dev/null +++ b/node_modules/async/internal/doParallel.js @@ -0,0 +1,23 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = doParallel; + +var _eachOf = require('../eachOf'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _wrapAsync = require('./wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function doParallel(fn) { + return function (obj, iteratee, callback) { + return fn(_eachOf2.default, obj, (0, _wrapAsync2.default)(iteratee), callback); + }; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/doParallelLimit.js b/node_modules/async/internal/doParallelLimit.js new file mode 100644 index 0000000..a7e963d --- /dev/null +++ b/node_modules/async/internal/doParallelLimit.js @@ -0,0 +1,23 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = doParallelLimit; + +var _eachOfLimit = require('./eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _wrapAsync = require('./wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function doParallelLimit(fn) { + return function (obj, limit, iteratee, callback) { + return fn((0, _eachOfLimit2.default)(limit), obj, (0, _wrapAsync2.default)(iteratee), callback); + }; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/eachOfLimit.js b/node_modules/async/internal/eachOfLimit.js new file mode 100644 index 0000000..6f6fe55 --- /dev/null +++ b/node_modules/async/internal/eachOfLimit.js @@ -0,0 +1,74 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _eachOfLimit; + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _once = require('./once'); + +var _once2 = _interopRequireDefault(_once); + +var _iterator = require('./iterator'); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _onlyOnce = require('./onlyOnce'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _breakLoop = require('./breakLoop'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _eachOfLimit(limit) { + return function (obj, iteratee, callback) { + callback = (0, _once2.default)(callback || _noop2.default); + if (limit <= 0 || !obj) { + return callback(null); + } + var nextElem = (0, _iterator2.default)(obj); + var done = false; + var running = 0; + var looping = false; + + function iterateeCallback(err, value) { + running -= 1; + if (err) { + done = true; + callback(err); + } else if (value === _breakLoop2.default || done && running <= 0) { + done = true; + return callback(null); + } else if (!looping) { + replenish(); + } + } + + function replenish() { + looping = true; + while (running < limit && !done) { + var elem = nextElem(); + if (elem === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback)); + } + looping = false; + } + + replenish(); + }; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/filter.js b/node_modules/async/internal/filter.js new file mode 100644 index 0000000..74f3986 --- /dev/null +++ b/node_modules/async/internal/filter.js @@ -0,0 +1,75 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _filter; + +var _arrayMap = require('lodash/_arrayMap'); + +var _arrayMap2 = _interopRequireDefault(_arrayMap); + +var _isArrayLike = require('lodash/isArrayLike'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _baseProperty = require('lodash/_baseProperty'); + +var _baseProperty2 = _interopRequireDefault(_baseProperty); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _wrapAsync = require('./wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function filterArray(eachfn, arr, iteratee, callback) { + var truthValues = new Array(arr.length); + eachfn(arr, function (x, index, callback) { + iteratee(x, function (err, v) { + truthValues[index] = !!v; + callback(err); + }); + }, function (err) { + if (err) return callback(err); + var results = []; + for (var i = 0; i < arr.length; i++) { + if (truthValues[i]) results.push(arr[i]); + } + callback(null, results); + }); +} + +function filterGeneric(eachfn, coll, iteratee, callback) { + var results = []; + eachfn(coll, function (x, index, callback) { + iteratee(x, function (err, v) { + if (err) { + callback(err); + } else { + if (v) { + results.push({ index: index, value: x }); + } + callback(); + } + }); + }, function (err) { + if (err) { + callback(err); + } else { + callback(null, (0, _arrayMap2.default)(results.sort(function (a, b) { + return a.index - b.index; + }), (0, _baseProperty2.default)('value'))); + } + }); +} + +function _filter(eachfn, coll, iteratee, callback) { + var filter = (0, _isArrayLike2.default)(coll) ? filterArray : filterGeneric; + filter(eachfn, coll, (0, _wrapAsync2.default)(iteratee), callback || _noop2.default); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/findGetResult.js b/node_modules/async/internal/findGetResult.js new file mode 100644 index 0000000..f8d3fe0 --- /dev/null +++ b/node_modules/async/internal/findGetResult.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _findGetResult; +function _findGetResult(v, x) { + return x; +} +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/getIterator.js b/node_modules/async/internal/getIterator.js new file mode 100644 index 0000000..3eadd24 --- /dev/null +++ b/node_modules/async/internal/getIterator.js @@ -0,0 +1,13 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (coll) { + return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol](); +}; + +var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator; + +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/initialParams.js b/node_modules/async/internal/initialParams.js new file mode 100644 index 0000000..df02cb1 --- /dev/null +++ b/node_modules/async/internal/initialParams.js @@ -0,0 +1,21 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (fn) { + return function () /*...args, callback*/{ + var args = (0, _slice2.default)(arguments); + var callback = args.pop(); + fn.call(this, args, callback); + }; +}; + +var _slice = require('./slice'); + +var _slice2 = _interopRequireDefault(_slice); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/iterator.js b/node_modules/async/internal/iterator.js new file mode 100644 index 0000000..3d32942 --- /dev/null +++ b/node_modules/async/internal/iterator.js @@ -0,0 +1,58 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = iterator; + +var _isArrayLike = require('lodash/isArrayLike'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _getIterator = require('./getIterator'); + +var _getIterator2 = _interopRequireDefault(_getIterator); + +var _keys = require('lodash/keys'); + +var _keys2 = _interopRequireDefault(_keys); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len ? { value: coll[i], key: i } : null; + }; +} + +function createES2015Iterator(iterator) { + var i = -1; + return function next() { + var item = iterator.next(); + if (item.done) return null; + i++; + return { value: item.value, key: i }; + }; +} + +function createObjectIterator(obj) { + var okeys = (0, _keys2.default)(obj); + var i = -1; + var len = okeys.length; + return function next() { + var key = okeys[++i]; + return i < len ? { value: obj[key], key: key } : null; + }; +} + +function iterator(coll) { + if ((0, _isArrayLike2.default)(coll)) { + return createArrayIterator(coll); + } + + var iterator = (0, _getIterator2.default)(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/map.js b/node_modules/async/internal/map.js new file mode 100644 index 0000000..f4f2aa5 --- /dev/null +++ b/node_modules/async/internal/map.js @@ -0,0 +1,35 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _asyncMap; + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _wrapAsync = require('./wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _asyncMap(eachfn, arr, iteratee, callback) { + callback = callback || _noop2.default; + arr = arr || []; + var results = []; + var counter = 0; + var _iteratee = (0, _wrapAsync2.default)(iteratee); + + eachfn(arr, function (value, _, callback) { + var index = counter++; + _iteratee(value, function (err, v) { + results[index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/notId.js b/node_modules/async/internal/notId.js new file mode 100644 index 0000000..0106c92 --- /dev/null +++ b/node_modules/async/internal/notId.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = notId; +function notId(v) { + return !v; +} +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/once.js b/node_modules/async/internal/once.js new file mode 100644 index 0000000..f0c379f --- /dev/null +++ b/node_modules/async/internal/once.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = once; +function once(fn) { + return function () { + if (fn === null) return; + var callFn = fn; + fn = null; + callFn.apply(this, arguments); + }; +} +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/onlyOnce.js b/node_modules/async/internal/onlyOnce.js new file mode 100644 index 0000000..f2e3001 --- /dev/null +++ b/node_modules/async/internal/onlyOnce.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = onlyOnce; +function onlyOnce(fn) { + return function () { + if (fn === null) throw new Error("Callback was already called."); + var callFn = fn; + fn = null; + callFn.apply(this, arguments); + }; +} +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/parallel.js b/node_modules/async/internal/parallel.js new file mode 100644 index 0000000..c97293b --- /dev/null +++ b/node_modules/async/internal/parallel.js @@ -0,0 +1,42 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _parallel; + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _isArrayLike = require('lodash/isArrayLike'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _slice = require('./slice'); + +var _slice2 = _interopRequireDefault(_slice); + +var _wrapAsync = require('./wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _parallel(eachfn, tasks, callback) { + callback = callback || _noop2.default; + var results = (0, _isArrayLike2.default)(tasks) ? [] : {}; + + eachfn(tasks, function (task, key, callback) { + (0, _wrapAsync2.default)(task)(function (err, result) { + if (arguments.length > 2) { + result = (0, _slice2.default)(arguments, 1); + } + results[key] = result; + callback(err); + }); + }, function (err) { + callback(err, results); + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/queue.js b/node_modules/async/internal/queue.js new file mode 100644 index 0000000..19534a7 --- /dev/null +++ b/node_modules/async/internal/queue.js @@ -0,0 +1,204 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = queue; + +var _baseIndexOf = require('lodash/_baseIndexOf'); + +var _baseIndexOf2 = _interopRequireDefault(_baseIndexOf); + +var _isArray = require('lodash/isArray'); + +var _isArray2 = _interopRequireDefault(_isArray); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _onlyOnce = require('./onlyOnce'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _setImmediate = require('./setImmediate'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _DoublyLinkedList = require('./DoublyLinkedList'); + +var _DoublyLinkedList2 = _interopRequireDefault(_DoublyLinkedList); + +var _wrapAsync = require('./wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function queue(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } else if (concurrency === 0) { + throw new Error('Concurrency must not be zero'); + } + + var _worker = (0, _wrapAsync2.default)(worker); + var numRunning = 0; + var workersList = []; + + var processingScheduled = false; + function _insert(data, insertAtFront, callback) { + if (callback != null && typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + if (!(0, _isArray2.default)(data)) { + data = [data]; + } + if (data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + return (0, _setImmediate2.default)(function () { + q.drain(); + }); + } + + for (var i = 0, l = data.length; i < l; i++) { + var item = { + data: data[i], + callback: callback || _noop2.default + }; + + if (insertAtFront) { + q._tasks.unshift(item); + } else { + q._tasks.push(item); + } + } + + if (!processingScheduled) { + processingScheduled = true; + (0, _setImmediate2.default)(function () { + processingScheduled = false; + q.process(); + }); + } + } + + function _next(tasks) { + return function (err) { + numRunning -= 1; + + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; + + var index = (0, _baseIndexOf2.default)(workersList, task, 0); + if (index === 0) { + workersList.shift(); + } else if (index > 0) { + workersList.splice(index, 1); + } + + task.callback.apply(task, arguments); + + if (err != null) { + q.error(err, task.data); + } + } + + if (numRunning <= q.concurrency - q.buffer) { + q.unsaturated(); + } + + if (q.idle()) { + q.drain(); + } + q.process(); + }; + } + + var isProcessing = false; + var q = { + _tasks: new _DoublyLinkedList2.default(), + concurrency: concurrency, + payload: payload, + saturated: _noop2.default, + unsaturated: _noop2.default, + buffer: concurrency / 4, + empty: _noop2.default, + drain: _noop2.default, + error: _noop2.default, + started: false, + paused: false, + push: function (data, callback) { + _insert(data, false, callback); + }, + kill: function () { + q.drain = _noop2.default; + q._tasks.empty(); + }, + unshift: function (data, callback) { + _insert(data, true, callback); + }, + remove: function (testFn) { + q._tasks.remove(testFn); + }, + process: function () { + // Avoid trying to start too many processing operations. This can occur + // when callbacks resolve synchronously (#1267). + if (isProcessing) { + return; + } + isProcessing = true; + while (!q.paused && numRunning < q.concurrency && q._tasks.length) { + var tasks = [], + data = []; + var l = q._tasks.length; + if (q.payload) l = Math.min(l, q.payload); + for (var i = 0; i < l; i++) { + var node = q._tasks.shift(); + tasks.push(node); + workersList.push(node); + data.push(node.data); + } + + numRunning += 1; + + if (q._tasks.length === 0) { + q.empty(); + } + + if (numRunning === q.concurrency) { + q.saturated(); + } + + var cb = (0, _onlyOnce2.default)(_next(tasks)); + _worker(data, cb); + } + isProcessing = false; + }, + length: function () { + return q._tasks.length; + }, + running: function () { + return numRunning; + }, + workersList: function () { + return workersList; + }, + idle: function () { + return q._tasks.length + numRunning === 0; + }, + pause: function () { + q.paused = true; + }, + resume: function () { + if (q.paused === false) { + return; + } + q.paused = false; + (0, _setImmediate2.default)(q.process); + } + }; + return q; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/reject.js b/node_modules/async/internal/reject.js new file mode 100644 index 0000000..5dbfcfb --- /dev/null +++ b/node_modules/async/internal/reject.js @@ -0,0 +1,21 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reject; + +var _filter = require('./filter'); + +var _filter2 = _interopRequireDefault(_filter); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function reject(eachfn, arr, iteratee, callback) { + (0, _filter2.default)(eachfn, arr, function (value, cb) { + iteratee(value, function (err, v) { + cb(err, !v); + }); + }, callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/setImmediate.js b/node_modules/async/internal/setImmediate.js new file mode 100644 index 0000000..3545f2b --- /dev/null +++ b/node_modules/async/internal/setImmediate.js @@ -0,0 +1,42 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hasNextTick = exports.hasSetImmediate = undefined; +exports.fallback = fallback; +exports.wrap = wrap; + +var _slice = require('./slice'); + +var _slice2 = _interopRequireDefault(_slice); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === 'function' && setImmediate; +var hasNextTick = exports.hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + +function fallback(fn) { + setTimeout(fn, 0); +} + +function wrap(defer) { + return function (fn /*, ...args*/) { + var args = (0, _slice2.default)(arguments, 1); + defer(function () { + fn.apply(null, args); + }); + }; +} + +var _defer; + +if (hasSetImmediate) { + _defer = setImmediate; +} else if (hasNextTick) { + _defer = process.nextTick; +} else { + _defer = fallback; +} + +exports.default = wrap(_defer); \ No newline at end of file diff --git a/node_modules/async/internal/slice.js b/node_modules/async/internal/slice.js new file mode 100644 index 0000000..56f10c0 --- /dev/null +++ b/node_modules/async/internal/slice.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = slice; +function slice(arrayLike, start) { + start = start | 0; + var newLen = Math.max(arrayLike.length - start, 0); + var newArr = Array(newLen); + for (var idx = 0; idx < newLen; idx++) { + newArr[idx] = arrayLike[start + idx]; + } + return newArr; +} +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/withoutIndex.js b/node_modules/async/internal/withoutIndex.js new file mode 100644 index 0000000..2bd3579 --- /dev/null +++ b/node_modules/async/internal/withoutIndex.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _withoutIndex; +function _withoutIndex(iteratee) { + return function (value, index, callback) { + return iteratee(value, callback); + }; +} +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/wrapAsync.js b/node_modules/async/internal/wrapAsync.js new file mode 100644 index 0000000..bc6c966 --- /dev/null +++ b/node_modules/async/internal/wrapAsync.js @@ -0,0 +1,25 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isAsync = undefined; + +var _asyncify = require('../asyncify'); + +var _asyncify2 = _interopRequireDefault(_asyncify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var supportsSymbol = typeof Symbol === 'function'; + +function isAsync(fn) { + return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction'; +} + +function wrapAsync(asyncFn) { + return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn; +} + +exports.default = wrapAsync; +exports.isAsync = isAsync; \ No newline at end of file diff --git a/node_modules/async/log.js b/node_modules/async/log.js new file mode 100644 index 0000000..c643867 --- /dev/null +++ b/node_modules/async/log.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _consoleFunc = require('./internal/consoleFunc'); + +var _consoleFunc2 = _interopRequireDefault(_consoleFunc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Logs the result of an `async` function to the `console`. Only works in + * Node.js or in browsers that support `console.log` and `console.error` (such + * as FF and Chrome). If multiple arguments are returned from the async + * function, `console.log` is called on each argument in order. + * + * @name log + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, 'hello ' + name); + * }, 1000); + * }; + * + * // in the node repl + * node> async.log(hello, 'world'); + * 'hello world' + */ +exports.default = (0, _consoleFunc2.default)('log'); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/map.js b/node_modules/async/map.js new file mode 100644 index 0000000..67c9cda --- /dev/null +++ b/node_modules/async/map.js @@ -0,0 +1,54 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _doParallel = require('./internal/doParallel'); + +var _doParallel2 = _interopRequireDefault(_doParallel); + +var _map = require('./internal/map'); + +var _map2 = _interopRequireDefault(_map); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Produces a new collection of values by mapping each value in `coll` through + * the `iteratee` function. The `iteratee` is called with an item from `coll` + * and a callback for when it has finished processing. Each of these callback + * takes 2 arguments: an `error`, and the transformed item from `coll`. If + * `iteratee` passes an error to its callback, the main `callback` (for the + * `map` function) is immediately called with the error. + * + * Note, that since this function applies the `iteratee` to each item in + * parallel, there is no guarantee that the `iteratee` functions will complete + * in order. However, the results array will be in the same order as the + * original `coll`. + * + * If `map` is passed an Object, the results will be an Array. The results + * will roughly be in the order of the original Objects' keys (but this can + * vary across JavaScript engines). + * + * @name map + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an Array of the + * transformed items from the `coll`. Invoked with (err, results). + * @example + * + * async.map(['file1','file2','file3'], fs.stat, function(err, results) { + * // results is now an array of stats for each file + * }); + */ +exports.default = (0, _doParallel2.default)(_map2.default); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapLimit.js b/node_modules/async/mapLimit.js new file mode 100644 index 0000000..c8b60d8 --- /dev/null +++ b/node_modules/async/mapLimit.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _doParallelLimit = require('./internal/doParallelLimit'); + +var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit); + +var _map = require('./internal/map'); + +var _map2 = _interopRequireDefault(_map); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. + * + * @name mapLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + */ +exports.default = (0, _doParallelLimit2.default)(_map2.default); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapSeries.js b/node_modules/async/mapSeries.js new file mode 100644 index 0000000..61b42d0 --- /dev/null +++ b/node_modules/async/mapSeries.js @@ -0,0 +1,36 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _mapLimit = require('./mapLimit'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. + * + * @name mapSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + */ +exports.default = (0, _doLimit2.default)(_mapLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapValues.js b/node_modules/async/mapValues.js new file mode 100644 index 0000000..3d838ca --- /dev/null +++ b/node_modules/async/mapValues.js @@ -0,0 +1,63 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _mapValuesLimit = require('./mapValuesLimit'); + +var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. + * + * Produces a new Object by mapping each value of `obj` through the `iteratee` + * function. The `iteratee` is called each `value` and `key` from `obj` and a + * callback for when it has finished processing. Each of these callbacks takes + * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` + * passes an error to its callback, the main `callback` (for the `mapValues` + * function) is immediately called with the error. + * + * Note, the order of the keys in the result is not guaranteed. The keys will + * be roughly in the order they complete, (but this is very engine-specific) + * + * @name mapValues + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @example + * + * async.mapValues({ + * f1: 'file1', + * f2: 'file2', + * f3: 'file3' + * }, function (file, key, callback) { + * fs.stat(file, callback); + * }, function(err, result) { + * // result is now a map of stats for each file, e.g. + * // { + * // f1: [stats for file1], + * // f2: [stats for file2], + * // f3: [stats for file3] + * // } + * }); + */ + +exports.default = (0, _doLimit2.default)(_mapValuesLimit2.default, Infinity); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapValuesLimit.js b/node_modules/async/mapValuesLimit.js new file mode 100644 index 0000000..912a8b5 --- /dev/null +++ b/node_modules/async/mapValuesLimit.js @@ -0,0 +1,61 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = mapValuesLimit; + +var _eachOfLimit = require('./eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _once = require('./internal/once'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a + * time. + * + * @name mapValuesLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + */ +function mapValuesLimit(obj, limit, iteratee, callback) { + callback = (0, _once2.default)(callback || _noop2.default); + var newObj = {}; + var _iteratee = (0, _wrapAsync2.default)(iteratee); + (0, _eachOfLimit2.default)(obj, limit, function (val, key, next) { + _iteratee(val, key, function (err, result) { + if (err) return next(err); + newObj[key] = result; + next(); + }); + }, function (err) { + callback(err, newObj); + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapValuesSeries.js b/node_modules/async/mapValuesSeries.js new file mode 100644 index 0000000..b378c4a --- /dev/null +++ b/node_modules/async/mapValuesSeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _mapValuesLimit = require('./mapValuesLimit'); + +var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. + * + * @name mapValuesSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + */ +exports.default = (0, _doLimit2.default)(_mapValuesLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/memoize.js b/node_modules/async/memoize.js new file mode 100644 index 0000000..1f2b566 --- /dev/null +++ b/node_modules/async/memoize.js @@ -0,0 +1,101 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = memoize; + +var _identity = require('lodash/identity'); + +var _identity2 = _interopRequireDefault(_identity); + +var _slice = require('./internal/slice'); + +var _slice2 = _interopRequireDefault(_slice); + +var _setImmediate = require('./internal/setImmediate'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _initialParams = require('./internal/initialParams'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function has(obj, key) { + return key in obj; +} + +/** + * Caches the results of an async function. When creating a hash to store + * function results against, the callback is omitted from the hash and an + * optional hash function can be used. + * + * If no hash function is specified, the first argument is used as a hash key, + * which may work reasonably if it is a string or a data type that converts to a + * distinct string. Note that objects and arrays will not behave reasonably. + * Neither will cases where the other arguments are significant. In such cases, + * specify your own hash function. + * + * The cache of results is exposed as the `memo` property of the function + * returned by `memoize`. + * + * @name memoize + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function to proxy and cache results from. + * @param {Function} hasher - An optional function for generating a custom hash + * for storing results. It has all the arguments applied to it apart from the + * callback, and must be synchronous. + * @returns {AsyncFunction} a memoized version of `fn` + * @example + * + * var slow_fn = function(name, callback) { + * // do something + * callback(null, result); + * }; + * var fn = async.memoize(slow_fn); + * + * // fn can now be used as if it were slow_fn + * fn('some name', function() { + * // callback + * }); + */ +function memoize(fn, hasher) { + var memo = Object.create(null); + var queues = Object.create(null); + hasher = hasher || _identity2.default; + var _fn = (0, _wrapAsync2.default)(fn); + var memoized = (0, _initialParams2.default)(function memoized(args, callback) { + var key = hasher.apply(null, args); + if (has(memo, key)) { + (0, _setImmediate2.default)(function () { + callback.apply(null, memo[key]); + }); + } else if (has(queues, key)) { + queues[key].push(callback); + } else { + queues[key] = [callback]; + _fn.apply(null, args.concat(function () /*args*/{ + var args = (0, _slice2.default)(arguments); + memo[key] = args; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, args); + } + })); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/nextTick.js b/node_modules/async/nextTick.js new file mode 100644 index 0000000..886f58e --- /dev/null +++ b/node_modules/async/nextTick.js @@ -0,0 +1,51 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _setImmediate = require('./internal/setImmediate'); + +/** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `process.nextTick`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name nextTick + * @static + * @memberOf module:Utils + * @method + * @see [async.setImmediate]{@link module:Utils.setImmediate} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ +var _defer; + +if (_setImmediate.hasNextTick) { + _defer = process.nextTick; +} else if (_setImmediate.hasSetImmediate) { + _defer = setImmediate; +} else { + _defer = _setImmediate.fallback; +} + +exports.default = (0, _setImmediate.wrap)(_defer); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/package.json b/node_modules/async/package.json new file mode 100644 index 0000000..3b3f6fd --- /dev/null +++ b/node_modules/async/package.json @@ -0,0 +1,107 @@ +{ + "_from": "async@^2.6.0", + "_id": "async@2.6.3", + "_inBundle": false, + "_integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "_location": "/async", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "async@^2.6.0", + "name": "async", + "escapedName": "async", + "rawSpec": "^2.6.0", + "saveSpec": null, + "fetchSpec": "^2.6.0" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "_shasum": "d72625e2344a3656e3a3ad4fa749fa83299d82ff", + "_spec": "async@^2.6.0", + "_where": "/home/sergiu/linx-audio-simulator", + "author": { + "name": "Caolan McMahon" + }, + "bugs": { + "url": "https://github.com/caolan/async/issues" + }, + "bundleDependencies": false, + "dependencies": { + "lodash": "^4.17.14" + }, + "deprecated": false, + "description": "Higher-order functions and common patterns for asynchronous code", + "devDependencies": { + "babel-cli": "^6.24.0", + "babel-core": "^6.26.3", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-istanbul": "^2.0.1", + "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", + "babel-preset-es2015": "^6.3.13", + "babel-preset-es2017": "^6.22.0", + "babelify": "^8.0.0", + "benchmark": "^2.1.1", + "bluebird": "^3.4.6", + "browserify": "^16.2.2", + "chai": "^4.1.2", + "cheerio": "^0.22.0", + "coveralls": "^3.0.1", + "es6-promise": "^2.3.0", + "eslint": "^2.13.1", + "fs-extra": "^0.26.7", + "gh-pages-deploy": "^0.5.0", + "jsdoc": "^3.4.0", + "karma": "^2.0.2", + "karma-browserify": "^5.2.0", + "karma-firefox-launcher": "^1.1.0", + "karma-mocha": "^1.2.0", + "karma-mocha-reporter": "^2.2.0", + "mocha": "^5.2.0", + "native-promise-only": "^0.8.0-a", + "nyc": "^11.8.0", + "rimraf": "^2.5.0", + "rollup": "^0.36.3", + "rollup-plugin-node-resolve": "^2.0.0", + "rollup-plugin-npm": "^2.0.0", + "rsvp": "^3.0.18", + "semver": "^5.5.0", + "uglify-js": "~2.7.3", + "yargs": "^11.0.0" + }, + "gh-pages-deploy": { + "staticpath": "docs" + }, + "homepage": "https://caolan.github.io/async/", + "keywords": [ + "async", + "callback", + "module", + "utility" + ], + "license": "MIT", + "main": "dist/async.js", + "name": "async", + "nyc": { + "exclude": [ + "mocha_test" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/caolan/async.git" + }, + "scripts": { + "coverage": "nyc npm run mocha-node-test -- --grep @nycinvalid --invert", + "coveralls": "npm run coverage && nyc report --reporter=text-lcov | coveralls", + "jsdoc": "jsdoc -c ./support/jsdoc/jsdoc.json && node support/jsdoc/jsdoc-fix-html.js", + "lint": "eslint lib/ mocha_test/ perf/memory.js perf/suites.js perf/benchmark.js support/build/ support/*.js karma.conf.js", + "mocha-browser-test": "karma start", + "mocha-node-test": "mocha mocha_test/ --compilers js:babel-core/register", + "mocha-test": "npm run mocha-node-test && npm run mocha-browser-test", + "test": "npm run lint && npm run mocha-node-test" + }, + "version": "2.6.3" +} diff --git a/node_modules/async/parallel.js b/node_modules/async/parallel.js new file mode 100644 index 0000000..da28a4d --- /dev/null +++ b/node_modules/async/parallel.js @@ -0,0 +1,90 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = parallelLimit; + +var _eachOf = require('./eachOf'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _parallel = require('./internal/parallel'); + +var _parallel2 = _interopRequireDefault(_parallel); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Run the `tasks` collection of functions in parallel, without waiting until + * the previous function has completed. If any of the functions pass an error to + * its callback, the main `callback` is immediately called with the value of the + * error. Once the `tasks` have completed, the results are passed to the final + * `callback` as an array. + * + * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about + * parallel execution of code. If your tasks do not use any timers or perform + * any I/O, they will actually be executed in series. Any synchronous setup + * sections for each task will happen one after the other. JavaScript remains + * single-threaded. + * + * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the + * execution of other tasks when a task fails. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.parallel}. + * + * @name parallel + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * + * @example + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // optional callback + * function(err, results) { + * // the results array will equal ['one','two'] even though + * // the second function had a shorter timeout. + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * // results is now equals to: {one: 1, two: 2} + * }); + */ +function parallelLimit(tasks, callback) { + (0, _parallel2.default)(_eachOf2.default, tasks, callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/parallelLimit.js b/node_modules/async/parallelLimit.js new file mode 100644 index 0000000..a026526 --- /dev/null +++ b/node_modules/async/parallelLimit.js @@ -0,0 +1,40 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = parallelLimit; + +var _eachOfLimit = require('./internal/eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _parallel = require('./internal/parallel'); + +var _parallel2 = _interopRequireDefault(_parallel); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a + * time. + * + * @name parallelLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.parallel]{@link module:ControlFlow.parallel} + * @category Control Flow + * @param {Array|Iterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + */ +function parallelLimit(tasks, limit, callback) { + (0, _parallel2.default)((0, _eachOfLimit2.default)(limit), tasks, callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/priorityQueue.js b/node_modules/async/priorityQueue.js new file mode 100644 index 0000000..3a5f023 --- /dev/null +++ b/node_modules/async/priorityQueue.js @@ -0,0 +1,98 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (worker, concurrency) { + // Start with a normal queue + var q = (0, _queue2.default)(worker, concurrency); + + // Override push to accept second parameter representing priority + q.push = function (data, priority, callback) { + if (callback == null) callback = _noop2.default; + if (typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + if (!(0, _isArray2.default)(data)) { + data = [data]; + } + if (data.length === 0) { + // call drain immediately if there are no tasks + return (0, _setImmediate2.default)(function () { + q.drain(); + }); + } + + priority = priority || 0; + var nextNode = q._tasks.head; + while (nextNode && priority >= nextNode.priority) { + nextNode = nextNode.next; + } + + for (var i = 0, l = data.length; i < l; i++) { + var item = { + data: data[i], + priority: priority, + callback: callback + }; + + if (nextNode) { + q._tasks.insertBefore(nextNode, item); + } else { + q._tasks.push(item); + } + } + (0, _setImmediate2.default)(q.process); + }; + + // Remove unshift function + delete q.unshift; + + return q; +}; + +var _isArray = require('lodash/isArray'); + +var _isArray2 = _interopRequireDefault(_isArray); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _setImmediate = require('./setImmediate'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _queue = require('./queue'); + +var _queue2 = _interopRequireDefault(_queue); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports['default']; + +/** + * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and + * completed in ascending priority order. + * + * @name priorityQueue + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. + * Invoked with (task, callback). + * @param {number} concurrency - An `integer` for determining how many `worker` + * functions should be run in parallel. If omitted, the concurrency defaults to + * `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two + * differences between `queue` and `priorityQueue` objects: + * * `push(task, priority, [callback])` - `priority` should be a number. If an + * array of `tasks` is given, all tasks will be assigned the same priority. + * * The `unshift` method was removed. + */ \ No newline at end of file diff --git a/node_modules/async/queue.js b/node_modules/async/queue.js new file mode 100644 index 0000000..0ca8ba2 --- /dev/null +++ b/node_modules/async/queue.js @@ -0,0 +1,130 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (worker, concurrency) { + var _worker = (0, _wrapAsync2.default)(worker); + return (0, _queue2.default)(function (items, cb) { + _worker(items[0], cb); + }, concurrency, 1); +}; + +var _queue = require('./internal/queue'); + +var _queue2 = _interopRequireDefault(_queue); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports['default']; + +/** + * A queue of tasks for the worker function to complete. + * @typedef {Object} QueueObject + * @memberOf module:ControlFlow + * @property {Function} length - a function returning the number of items + * waiting to be processed. Invoke with `queue.length()`. + * @property {boolean} started - a boolean indicating whether or not any + * items have been pushed and processed by the queue. + * @property {Function} running - a function returning the number of items + * currently being processed. Invoke with `queue.running()`. + * @property {Function} workersList - a function returning the array of items + * currently being processed. Invoke with `queue.workersList()`. + * @property {Function} idle - a function returning false if there are items + * waiting or being processed, or true if not. Invoke with `queue.idle()`. + * @property {number} concurrency - an integer for determining how many `worker` + * functions should be run in parallel. This property can be changed after a + * `queue` is created to alter the concurrency on-the-fly. + * @property {Function} push - add a new task to the `queue`. Calls `callback` + * once the `worker` has finished processing the task. Instead of a single task, + * a `tasks` array can be submitted. The respective callback is used for every + * task in the list. Invoke with `queue.push(task, [callback])`, + * @property {Function} unshift - add a new task to the front of the `queue`. + * Invoke with `queue.unshift(task, [callback])`. + * @property {Function} remove - remove items from the queue that match a test + * function. The test function will be passed an object with a `data` property, + * and a `priority` property, if this is a + * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. + * Invoked with `queue.remove(testFn)`, where `testFn` is of the form + * `function ({data, priority}) {}` and returns a Boolean. + * @property {Function} saturated - a callback that is called when the number of + * running workers hits the `concurrency` limit, and further tasks will be + * queued. + * @property {Function} unsaturated - a callback that is called when the number + * of running workers is less than the `concurrency` & `buffer` limits, and + * further tasks will not be queued. + * @property {number} buffer - A minimum threshold buffer in order to say that + * the `queue` is `unsaturated`. + * @property {Function} empty - a callback that is called when the last item + * from the `queue` is given to a `worker`. + * @property {Function} drain - a callback that is called when the last item + * from the `queue` has returned from the `worker`. + * @property {Function} error - a callback that is called when a task errors. + * Has the signature `function(error, task)`. + * @property {boolean} paused - a boolean for determining whether the queue is + * in a paused state. + * @property {Function} pause - a function that pauses the processing of tasks + * until `resume()` is called. Invoke with `queue.pause()`. + * @property {Function} resume - a function that resumes the processing of + * queued tasks when the queue is paused. Invoke with `queue.resume()`. + * @property {Function} kill - a function that removes the `drain` callback and + * empties remaining tasks from the queue forcing it to go idle. No more tasks + * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. + */ + +/** + * Creates a `queue` object with the specified `concurrency`. Tasks added to the + * `queue` are processed in parallel (up to the `concurrency` limit). If all + * `worker`s are in progress, the task is queued until one becomes available. + * Once a `worker` completes a `task`, that `task`'s callback is called. + * + * @name queue + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. Invoked with (task, callback). + * @param {number} [concurrency=1] - An `integer` for determining how many + * `worker` functions should be run in parallel. If omitted, the concurrency + * defaults to `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the queue. + * @example + * + * // create a queue object with concurrency 2 + * var q = async.queue(function(task, callback) { + * console.log('hello ' + task.name); + * callback(); + * }, 2); + * + * // assign a callback + * q.drain = function() { + * console.log('all items have been processed'); + * }; + * + * // add some items to the queue + * q.push({name: 'foo'}, function(err) { + * console.log('finished processing foo'); + * }); + * q.push({name: 'bar'}, function (err) { + * console.log('finished processing bar'); + * }); + * + * // add some items to the queue (batch-wise) + * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { + * console.log('finished processing item'); + * }); + * + * // add some items to the front of the queue + * q.unshift({name: 'bar'}, function (err) { + * console.log('finished processing bar'); + * }); + */ \ No newline at end of file diff --git a/node_modules/async/race.js b/node_modules/async/race.js new file mode 100644 index 0000000..6713c74 --- /dev/null +++ b/node_modules/async/race.js @@ -0,0 +1,70 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = race; + +var _isArray = require('lodash/isArray'); + +var _isArray2 = _interopRequireDefault(_isArray); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _once = require('./internal/once'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Runs the `tasks` array of functions in parallel, without waiting until the + * previous function has completed. Once any of the `tasks` complete or pass an + * error to its callback, the main `callback` is immediately called. It's + * equivalent to `Promise.race()`. + * + * @name race + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} + * to run. Each function can complete with an optional `result` value. + * @param {Function} callback - A callback to run once any of the functions have + * completed. This function gets an error or result from the first function that + * completed. Invoked with (err, result). + * @returns undefined + * @example + * + * async.race([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // main callback + * function(err, result) { + * // the result will be equal to 'two' as it finishes earlier + * }); + */ +function race(tasks, callback) { + callback = (0, _once2.default)(callback || _noop2.default); + if (!(0, _isArray2.default)(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); + if (!tasks.length) return callback(); + for (var i = 0, l = tasks.length; i < l; i++) { + (0, _wrapAsync2.default)(tasks[i])(callback); + } +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reduce.js b/node_modules/async/reduce.js new file mode 100644 index 0000000..3fb8019 --- /dev/null +++ b/node_modules/async/reduce.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reduce; + +var _eachOfSeries = require('./eachOfSeries'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _once = require('./internal/once'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Reduces `coll` into a single value using an async `iteratee` to return each + * successive step. `memo` is the initial state of the reduction. This function + * only operates in series. + * + * For performance reasons, it may make sense to split a call to this function + * into a parallel map, and then use the normal `Array.prototype.reduce` on the + * results. This function is for situations where each step in the reduction + * needs to be async; if you can get the data before reducing it, then it's + * probably a good idea to do so. + * + * @name reduce + * @static + * @memberOf module:Collections + * @method + * @alias inject + * @alias foldl + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee complete with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @example + * + * async.reduce([1,2,3], 0, function(memo, item, callback) { + * // pointless async: + * process.nextTick(function() { + * callback(null, memo + item) + * }); + * }, function(err, result) { + * // result is now equal to the last value of memo, which is 6 + * }); + */ +function reduce(coll, memo, iteratee, callback) { + callback = (0, _once2.default)(callback || _noop2.default); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + (0, _eachOfSeries2.default)(coll, function (x, i, callback) { + _iteratee(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reduceRight.js b/node_modules/async/reduceRight.js new file mode 100644 index 0000000..3d17d32 --- /dev/null +++ b/node_modules/async/reduceRight.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reduceRight; + +var _reduce = require('./reduce'); + +var _reduce2 = _interopRequireDefault(_reduce); + +var _slice = require('./internal/slice'); + +var _slice2 = _interopRequireDefault(_slice); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee complete with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + */ +function reduceRight(array, memo, iteratee, callback) { + var reversed = (0, _slice2.default)(array).reverse(); + (0, _reduce2.default)(reversed, memo, iteratee, callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reflect.js b/node_modules/async/reflect.js new file mode 100644 index 0000000..098ba86 --- /dev/null +++ b/node_modules/async/reflect.js @@ -0,0 +1,81 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reflect; + +var _initialParams = require('./internal/initialParams'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _slice = require('./internal/slice'); + +var _slice2 = _interopRequireDefault(_slice); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Wraps the async function in another function that always completes with a + * result object, even when it errors. + * + * The result object has either the property `error` or `value`. + * + * @name reflect + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function you want to wrap + * @returns {Function} - A function that always passes null to it's callback as + * the error. The second argument to the callback will be an `object` with + * either an `error` or a `value` property. + * @example + * + * async.parallel([ + * async.reflect(function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }), + * async.reflect(function(callback) { + * // do some more stuff but error ... + * callback('bad stuff happened'); + * }), + * async.reflect(function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * }) + * ], + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = 'bad stuff happened' + * // results[2].value = 'two' + * }); + */ +function reflect(fn) { + var _fn = (0, _wrapAsync2.default)(fn); + return (0, _initialParams2.default)(function reflectOn(args, reflectCallback) { + args.push(function callback(error, cbArg) { + if (error) { + reflectCallback(null, { error: error }); + } else { + var value; + if (arguments.length <= 2) { + value = cbArg; + } else { + value = (0, _slice2.default)(arguments, 1); + } + reflectCallback(null, { value: value }); + } + }); + + return _fn.apply(this, args); + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reflectAll.js b/node_modules/async/reflectAll.js new file mode 100644 index 0000000..966e83d --- /dev/null +++ b/node_modules/async/reflectAll.js @@ -0,0 +1,105 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reflectAll; + +var _reflect = require('./reflect'); + +var _reflect2 = _interopRequireDefault(_reflect); + +var _isArray = require('lodash/isArray'); + +var _isArray2 = _interopRequireDefault(_isArray); + +var _arrayMap2 = require('lodash/_arrayMap'); + +var _arrayMap3 = _interopRequireDefault(_arrayMap2); + +var _baseForOwn = require('lodash/_baseForOwn'); + +var _baseForOwn2 = _interopRequireDefault(_baseForOwn); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A helper function that wraps an array or an object of functions with `reflect`. + * + * @name reflectAll + * @static + * @memberOf module:Utils + * @method + * @see [async.reflect]{@link module:Utils.reflect} + * @category Util + * @param {Array|Object|Iterable} tasks - The collection of + * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. + * @returns {Array} Returns an array of async functions, each wrapped in + * `async.reflect` + * @example + * + * let tasks = [ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * // do some more stuff but error ... + * callback(new Error('bad stuff happened')); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = Error('bad stuff happened') + * // results[2].value = 'two' + * }); + * + * // an example using an object instead of an array + * let tasks = { + * one: function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * two: function(callback) { + * callback('two'); + * }, + * three: function(callback) { + * setTimeout(function() { + * callback(null, 'three'); + * }, 100); + * } + * }; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results.one.value = 'one' + * // results.two.error = 'two' + * // results.three.value = 'three' + * }); + */ +function reflectAll(tasks) { + var results; + if ((0, _isArray2.default)(tasks)) { + results = (0, _arrayMap3.default)(tasks, _reflect2.default); + } else { + results = {}; + (0, _baseForOwn2.default)(tasks, function (task, key) { + results[key] = _reflect2.default.call(this, task); + }); + } + return results; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reject.js b/node_modules/async/reject.js new file mode 100644 index 0000000..53802b5 --- /dev/null +++ b/node_modules/async/reject.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reject = require('./internal/reject'); + +var _reject2 = _interopRequireDefault(_reject); + +var _doParallel = require('./internal/doParallel'); + +var _doParallel2 = _interopRequireDefault(_doParallel); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. + * + * @name reject + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @example + * + * async.reject(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, results) { + * // results now equals an array of missing files + * createFiles(results); + * }); + */ +exports.default = (0, _doParallel2.default)(_reject2.default); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/rejectLimit.js b/node_modules/async/rejectLimit.js new file mode 100644 index 0000000..74bba7f --- /dev/null +++ b/node_modules/async/rejectLimit.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reject = require('./internal/reject'); + +var _reject2 = _interopRequireDefault(_reject); + +var _doParallelLimit = require('./internal/doParallelLimit'); + +var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a + * time. + * + * @name rejectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + */ +exports.default = (0, _doParallelLimit2.default)(_reject2.default); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/rejectSeries.js b/node_modules/async/rejectSeries.js new file mode 100644 index 0000000..f905588 --- /dev/null +++ b/node_modules/async/rejectSeries.js @@ -0,0 +1,35 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _rejectLimit = require('./rejectLimit'); + +var _rejectLimit2 = _interopRequireDefault(_rejectLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. + * + * @name rejectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + */ +exports.default = (0, _doLimit2.default)(_rejectLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/retry.js b/node_modules/async/retry.js new file mode 100644 index 0000000..6a1aa1e --- /dev/null +++ b/node_modules/async/retry.js @@ -0,0 +1,156 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = retry; + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _constant = require('lodash/constant'); + +var _constant2 = _interopRequireDefault(_constant); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Attempts to get a successful response from `task` no more than `times` times + * before returning an error. If the task is successful, the `callback` will be + * passed the result of the successful task. If all attempts fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name retry + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @see [async.retryable]{@link module:ControlFlow.retryable} + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an + * object with `times` and `interval` or a number. + * * `times` - The number of attempts to make before giving up. The default + * is `5`. + * * `interval` - The time to wait between retries, in milliseconds. The + * default is `0`. The interval may also be specified as a function of the + * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). + * * If `opts` is a number, the number specifies the number of times to retry, + * with the default interval of `0`. + * @param {AsyncFunction} task - An async function to retry. + * Invoked with (callback). + * @param {Function} [callback] - An optional callback which is called when the + * task has succeeded, or after the final failed attempt. It receives the `err` + * and `result` arguments of the last attempt at completing the `task`. Invoked + * with (err, results). + * + * @example + * + * // The `retry` function can be used as a stand-alone control flow by passing + * // a callback, as shown below: + * + * // try calling apiMethod 3 times + * async.retry(3, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 3 times, waiting 200 ms between each retry + * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 10 times with exponential backoff + * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) + * async.retry({ + * times: 10, + * interval: function(retryCount) { + * return 50 * Math.pow(2, retryCount); + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod the default 5 times no delay between each retry + * async.retry(apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // to retry individual methods that are not as reliable within other + * // control flow functions, use the `retryable` wrapper: + * async.auto({ + * users: api.getUsers.bind(api), + * payments: async.retryable(3, api.getPayments.bind(api)) + * }, function(err, results) { + * // do something with the results + * }); + * + */ +function retry(opts, task, callback) { + var DEFAULT_TIMES = 5; + var DEFAULT_INTERVAL = 0; + + var options = { + times: DEFAULT_TIMES, + intervalFunc: (0, _constant2.default)(DEFAULT_INTERVAL) + }; + + function parseTimes(acc, t) { + if (typeof t === 'object') { + acc.times = +t.times || DEFAULT_TIMES; + + acc.intervalFunc = typeof t.interval === 'function' ? t.interval : (0, _constant2.default)(+t.interval || DEFAULT_INTERVAL); + + acc.errorFilter = t.errorFilter; + } else if (typeof t === 'number' || typeof t === 'string') { + acc.times = +t || DEFAULT_TIMES; + } else { + throw new Error("Invalid arguments for async.retry"); + } + } + + if (arguments.length < 3 && typeof opts === 'function') { + callback = task || _noop2.default; + task = opts; + } else { + parseTimes(options, opts); + callback = callback || _noop2.default; + } + + if (typeof task !== 'function') { + throw new Error("Invalid arguments for async.retry"); + } + + var _task = (0, _wrapAsync2.default)(task); + + var attempt = 1; + function retryAttempt() { + _task(function (err) { + if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) { + setTimeout(retryAttempt, options.intervalFunc(attempt)); + } else { + callback.apply(null, arguments); + } + }); + } + + retryAttempt(); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/retryable.js b/node_modules/async/retryable.js new file mode 100644 index 0000000..002bfb0 --- /dev/null +++ b/node_modules/async/retryable.js @@ -0,0 +1,65 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (opts, task) { + if (!task) { + task = opts; + opts = null; + } + var _task = (0, _wrapAsync2.default)(task); + return (0, _initialParams2.default)(function (args, callback) { + function taskFn(cb) { + _task.apply(null, args.concat(cb)); + } + + if (opts) (0, _retry2.default)(opts, taskFn, callback);else (0, _retry2.default)(taskFn, callback); + }); +}; + +var _retry = require('./retry'); + +var _retry2 = _interopRequireDefault(_retry); + +var _initialParams = require('./internal/initialParams'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports['default']; + +/** + * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method + * wraps a task and makes it retryable, rather than immediately calling it + * with retries. + * + * @name retryable + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.retry]{@link module:ControlFlow.retry} + * @category Control Flow + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional + * options, exactly the same as from `retry` + * @param {AsyncFunction} task - the asynchronous function to wrap. + * This function will be passed any arguments passed to the returned wrapper. + * Invoked with (...args, callback). + * @returns {AsyncFunction} The wrapped function, which when invoked, will + * retry on an error, based on the parameters specified in `opts`. + * This function will accept the same parameters as `task`. + * @example + * + * async.auto({ + * dep1: async.retryable(3, getFromFlakyService), + * process: ["dep1", async.retryable(3, function (results, cb) { + * maybeProcessData(results.dep1, cb); + * })] + * }, callback); + */ \ No newline at end of file diff --git a/node_modules/async/select.js b/node_modules/async/select.js new file mode 100644 index 0000000..54772d5 --- /dev/null +++ b/node_modules/async/select.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter = require('./internal/filter'); + +var _filter2 = _interopRequireDefault(_filter); + +var _doParallel = require('./internal/doParallel'); + +var _doParallel2 = _interopRequireDefault(_doParallel); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @example + * + * async.filter(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, results) { + * // results now equals an array of the existing files + * }); + */ +exports.default = (0, _doParallel2.default)(_filter2.default); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/selectLimit.js b/node_modules/async/selectLimit.js new file mode 100644 index 0000000..06216f7 --- /dev/null +++ b/node_modules/async/selectLimit.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter = require('./internal/filter'); + +var _filter2 = _interopRequireDefault(_filter); + +var _doParallelLimit = require('./internal/doParallelLimit'); + +var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + */ +exports.default = (0, _doParallelLimit2.default)(_filter2.default); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/selectSeries.js b/node_modules/async/selectSeries.js new file mode 100644 index 0000000..e48d966 --- /dev/null +++ b/node_modules/async/selectSeries.js @@ -0,0 +1,35 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filterLimit = require('./filterLimit'); + +var _filterLimit2 = _interopRequireDefault(_filterLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + */ +exports.default = (0, _doLimit2.default)(_filterLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/seq.js b/node_modules/async/seq.js new file mode 100644 index 0000000..ff86ef9 --- /dev/null +++ b/node_modules/async/seq.js @@ -0,0 +1,91 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = seq; + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _slice = require('./internal/slice'); + +var _slice2 = _interopRequireDefault(_slice); + +var _reduce = require('./reduce'); + +var _reduce2 = _interopRequireDefault(_reduce); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _arrayMap = require('lodash/_arrayMap'); + +var _arrayMap2 = _interopRequireDefault(_arrayMap); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Version of the compose function that is more natural to read. Each function + * consumes the return value of the previous function. It is the equivalent of + * [compose]{@link module:ControlFlow.compose} with the arguments reversed. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name seq + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.compose]{@link module:ControlFlow.compose} + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} a function that composes the `functions` in order + * @example + * + * // Requires lodash (or underscore), express3 and dresende's orm2. + * // Part of an app, that fetches cats of the logged user. + * // This example uses `seq` function to avoid overnesting and error + * // handling clutter. + * app.get('/cats', function(request, response) { + * var User = request.models.User; + * async.seq( + * _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data)) + * function(user, fn) { + * user.getCats(fn); // 'getCats' has signature (callback(err, data)) + * } + * )(req.session.user_id, function (err, cats) { + * if (err) { + * console.error(err); + * response.json({ status: 'error', message: err.message }); + * } else { + * response.json({ status: 'ok', message: 'Cats found', data: cats }); + * } + * }); + * }); + */ +function seq() /*...functions*/{ + var _functions = (0, _arrayMap2.default)(arguments, _wrapAsync2.default); + return function () /*...args*/{ + var args = (0, _slice2.default)(arguments); + var that = this; + + var cb = args[args.length - 1]; + if (typeof cb == 'function') { + args.pop(); + } else { + cb = _noop2.default; + } + + (0, _reduce2.default)(_functions, args, function (newargs, fn, cb) { + fn.apply(that, newargs.concat(function (err /*, ...nextargs*/) { + var nextargs = (0, _slice2.default)(arguments, 1); + cb(err, nextargs); + })); + }, function (err, results) { + cb.apply(that, [err].concat(results)); + }); + }; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/series.js b/node_modules/async/series.js new file mode 100644 index 0000000..e8c2928 --- /dev/null +++ b/node_modules/async/series.js @@ -0,0 +1,85 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = series; + +var _parallel = require('./internal/parallel'); + +var _parallel2 = _interopRequireDefault(_parallel); + +var _eachOfSeries = require('./eachOfSeries'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Run the functions in the `tasks` collection in series, each one running once + * the previous function has completed. If any functions in the series pass an + * error to its callback, no more functions are run, and `callback` is + * immediately called with the value of the error. Otherwise, `callback` + * receives an array of results when `tasks` have completed. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function, and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.series}. + * + * **Note** that while many implementations preserve the order of object + * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) + * explicitly states that + * + * > The mechanics and order of enumerating the properties is not specified. + * + * So if you rely on the order in which your series of functions are executed, + * and want this to work on all platforms, consider using an array. + * + * @name series + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|Object} tasks - A collection containing + * [async functions]{@link AsyncFunction} to run in series. + * Each function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This function gets a results array (or object) + * containing all the result arguments passed to the `task` callbacks. Invoked + * with (err, result). + * @example + * async.series([ + * function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }, + * function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * } + * ], + * // optional callback + * function(err, results) { + * // results is now equal to ['one', 'two'] + * }); + * + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback){ + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * // results is now equal to: {one: 1, two: 2} + * }); + */ +function series(tasks, callback) { + (0, _parallel2.default)(_eachOfSeries2.default, tasks, callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/setImmediate.js b/node_modules/async/setImmediate.js new file mode 100644 index 0000000..e52f7c5 --- /dev/null +++ b/node_modules/async/setImmediate.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _setImmediate = require('./internal/setImmediate'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `setImmediate`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name setImmediate + * @static + * @memberOf module:Utils + * @method + * @see [async.nextTick]{@link module:Utils.nextTick} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ +exports.default = _setImmediate2.default; +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/some.js b/node_modules/async/some.js new file mode 100644 index 0000000..a8e70f7 --- /dev/null +++ b/node_modules/async/some.js @@ -0,0 +1,52 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _doParallel = require('./internal/doParallel'); + +var _doParallel2 = _interopRequireDefault(_doParallel); + +var _identity = require('lodash/identity'); + +var _identity2 = _interopRequireDefault(_identity); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @example + * + * async.some(['file1','file2','file3'], function(filePath, callback) { + * fs.access(filePath, function(err) { + * callback(null, !err) + * }); + * }, function(err, result) { + * // if result is true then at least one of the files exists + * }); + */ +exports.default = (0, _doParallel2.default)((0, _createTester2.default)(Boolean, _identity2.default)); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/someLimit.js b/node_modules/async/someLimit.js new file mode 100644 index 0000000..24ca3f4 --- /dev/null +++ b/node_modules/async/someLimit.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _doParallelLimit = require('./internal/doParallelLimit'); + +var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit); + +var _identity = require('lodash/identity'); + +var _identity2 = _interopRequireDefault(_identity); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + */ +exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(Boolean, _identity2.default)); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/someSeries.js b/node_modules/async/someSeries.js new file mode 100644 index 0000000..dc24ed2 --- /dev/null +++ b/node_modules/async/someSeries.js @@ -0,0 +1,38 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _someLimit = require('./someLimit'); + +var _someLimit2 = _interopRequireDefault(_someLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + */ +exports.default = (0, _doLimit2.default)(_someLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/sortBy.js b/node_modules/async/sortBy.js new file mode 100644 index 0000000..ee5e93d --- /dev/null +++ b/node_modules/async/sortBy.js @@ -0,0 +1,91 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = sortBy; + +var _arrayMap = require('lodash/_arrayMap'); + +var _arrayMap2 = _interopRequireDefault(_arrayMap); + +var _baseProperty = require('lodash/_baseProperty'); + +var _baseProperty2 = _interopRequireDefault(_baseProperty); + +var _map = require('./map'); + +var _map2 = _interopRequireDefault(_map); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Sorts a list by the results of running each `coll` value through an async + * `iteratee`. + * + * @name sortBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a value to use as the sort criteria as + * its `result`. + * Invoked with (item, callback). + * @param {Function} callback - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is the items + * from the original `coll` sorted by the values returned by the `iteratee` + * calls. Invoked with (err, results). + * @example + * + * async.sortBy(['file1','file2','file3'], function(file, callback) { + * fs.stat(file, function(err, stats) { + * callback(err, stats.mtime); + * }); + * }, function(err, results) { + * // results is now the original array of files sorted by + * // modified date + * }); + * + * // By modifying the callback parameter the + * // sorting order can be influenced: + * + * // ascending order + * async.sortBy([1,9,3,5], function(x, callback) { + * callback(null, x); + * }, function(err,result) { + * // result callback + * }); + * + * // descending order + * async.sortBy([1,9,3,5], function(x, callback) { + * callback(null, x*-1); //<- x*-1 instead of x, turns the order around + * }, function(err,result) { + * // result callback + * }); + */ +function sortBy(coll, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + (0, _map2.default)(coll, function (x, callback) { + _iteratee(x, function (err, criteria) { + if (err) return callback(err); + callback(null, { value: x, criteria: criteria }); + }); + }, function (err, results) { + if (err) return callback(err); + callback(null, (0, _arrayMap2.default)(results.sort(comparator), (0, _baseProperty2.default)('value'))); + }); + + function comparator(left, right) { + var a = left.criteria, + b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/timeout.js b/node_modules/async/timeout.js new file mode 100644 index 0000000..b5cb505 --- /dev/null +++ b/node_modules/async/timeout.js @@ -0,0 +1,89 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = timeout; + +var _initialParams = require('./internal/initialParams'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Sets a time limit on an asynchronous function. If the function does not call + * its callback within the specified milliseconds, it will be called with a + * timeout error. The code property for the error object will be `'ETIMEDOUT'`. + * + * @name timeout + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} asyncFn - The async function to limit in time. + * @param {number} milliseconds - The specified time limit. + * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) + * to timeout Error for more information.. + * @returns {AsyncFunction} Returns a wrapped function that can be used with any + * of the control flow functions. + * Invoke this function with the same parameters as you would `asyncFunc`. + * @example + * + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); + */ +function timeout(asyncFn, milliseconds, info) { + var fn = (0, _wrapAsync2.default)(asyncFn); + + return (0, _initialParams2.default)(function (args, callback) { + var timedOut = false; + var timer; + + function timeoutCallback() { + var name = asyncFn.name || 'anonymous'; + var error = new Error('Callback function "' + name + '" timed out.'); + error.code = 'ETIMEDOUT'; + if (info) { + error.info = info; + } + timedOut = true; + callback(error); + } + + args.push(function () { + if (!timedOut) { + callback.apply(null, arguments); + clearTimeout(timer); + } + }); + + // setup timer and call original function + timer = setTimeout(timeoutCallback, milliseconds); + fn.apply(null, args); + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/times.js b/node_modules/async/times.js new file mode 100644 index 0000000..b5ca24d --- /dev/null +++ b/node_modules/async/times.js @@ -0,0 +1,50 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _timesLimit = require('./timesLimit'); + +var _timesLimit2 = _interopRequireDefault(_timesLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calls the `iteratee` function `n` times, and accumulates results in the same + * manner you would use with [map]{@link module:Collections.map}. + * + * @name times + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.map]{@link module:Collections.map} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @example + * + * // Pretend this is some complicated async factory + * var createUser = function(id, callback) { + * callback(null, { + * id: 'user' + id + * }); + * }; + * + * // generate 5 users + * async.times(5, function(n, next) { + * createUser(n, function(err, user) { + * next(err, user); + * }); + * }, function(err, users) { + * // we should now have 5 users + * }); + */ +exports.default = (0, _doLimit2.default)(_timesLimit2.default, Infinity); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/timesLimit.js b/node_modules/async/timesLimit.js new file mode 100644 index 0000000..aad8495 --- /dev/null +++ b/node_modules/async/timesLimit.js @@ -0,0 +1,42 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = timeLimit; + +var _mapLimit = require('./mapLimit'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _baseRange = require('lodash/_baseRange'); + +var _baseRange2 = _interopRequireDefault(_baseRange); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a + * time. + * + * @name timesLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} count - The number of times to run the function. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see [async.map]{@link module:Collections.map}. + */ +function timeLimit(count, limit, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + (0, _mapLimit2.default)((0, _baseRange2.default)(0, count, 1), limit, _iteratee, callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/timesSeries.js b/node_modules/async/timesSeries.js new file mode 100644 index 0000000..f187a35 --- /dev/null +++ b/node_modules/async/timesSeries.js @@ -0,0 +1,32 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _timesLimit = require('./timesLimit'); + +var _timesLimit2 = _interopRequireDefault(_timesLimit); + +var _doLimit = require('./internal/doLimit'); + +var _doLimit2 = _interopRequireDefault(_doLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. + * + * @name timesSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + */ +exports.default = (0, _doLimit2.default)(_timesLimit2.default, 1); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/transform.js b/node_modules/async/transform.js new file mode 100644 index 0000000..84ee217 --- /dev/null +++ b/node_modules/async/transform.js @@ -0,0 +1,87 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = transform; + +var _isArray = require('lodash/isArray'); + +var _isArray2 = _interopRequireDefault(_isArray); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _eachOf = require('./eachOf'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _once = require('./internal/once'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A relative of `reduce`. Takes an Object or Array, and iterates over each + * element in series, each step potentially mutating an `accumulator` value. + * The type of the accumulator defaults to the type of collection passed in. + * + * @name transform + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|Object} coll - A collection to iterate over. + * @param {*} [accumulator] - The initial state of the transform. If omitted, + * it will default to an empty Object or Array, depending on the type of `coll` + * @param {AsyncFunction} iteratee - A function applied to each item in the + * collection that potentially modifies the accumulator. + * Invoked with (accumulator, item, key, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the transformed accumulator. + * Invoked with (err, result). + * @example + * + * async.transform([1,2,3], function(acc, item, index, callback) { + * // pointless async: + * process.nextTick(function() { + * acc.push(item * 2) + * callback(null) + * }); + * }, function(err, result) { + * // result is now equal to [2, 4, 6] + * }); + * + * @example + * + * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) { + * setImmediate(function () { + * obj[key] = val * 2; + * callback(); + * }) + * }, function (err, result) { + * // result is equal to {a: 2, b: 4, c: 6} + * }) + */ +function transform(coll, accumulator, iteratee, callback) { + if (arguments.length <= 3) { + callback = iteratee; + iteratee = accumulator; + accumulator = (0, _isArray2.default)(coll) ? [] : {}; + } + callback = (0, _once2.default)(callback || _noop2.default); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + + (0, _eachOf2.default)(coll, function (v, k, cb) { + _iteratee(accumulator, v, k, cb); + }, function (err) { + callback(err, accumulator); + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/tryEach.js b/node_modules/async/tryEach.js new file mode 100644 index 0000000..f4e4c97 --- /dev/null +++ b/node_modules/async/tryEach.js @@ -0,0 +1,81 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = tryEach; + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _eachSeries = require('./eachSeries'); + +var _eachSeries2 = _interopRequireDefault(_eachSeries); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _slice = require('./internal/slice'); + +var _slice2 = _interopRequireDefault(_slice); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * It runs each task in series but stops whenever any of the functions were + * successful. If one of the tasks were successful, the `callback` will be + * passed the result of the successful task. If all tasks fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name tryEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|Object} tasks - A collection containing functions to + * run, each function is passed a `callback(err, result)` it must call on + * completion with an error `err` (which can be `null`) and an optional `result` + * value. + * @param {Function} [callback] - An optional callback which is called when one + * of the tasks has succeeded, or all have failed. It receives the `err` and + * `result` arguments of the last attempt at completing the `task`. Invoked with + * (err, results). + * @example + * async.tryEach([ + * function getDataFromFirstWebsite(callback) { + * // Try getting the data from the first website + * callback(err, data); + * }, + * function getDataFromSecondWebsite(callback) { + * // First website failed, + * // Try getting the data from the backup website + * callback(err, data); + * } + * ], + * // optional callback + * function(err, results) { + * Now do something with the data. + * }); + * + */ +function tryEach(tasks, callback) { + var error = null; + var result; + callback = callback || _noop2.default; + (0, _eachSeries2.default)(tasks, function (task, callback) { + (0, _wrapAsync2.default)(task)(function (err, res /*, ...args*/) { + if (arguments.length > 2) { + result = (0, _slice2.default)(arguments, 1); + } else { + result = res; + } + error = err; + callback(!err); + }); + }, function () { + callback(error, result); + }); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/unmemoize.js b/node_modules/async/unmemoize.js new file mode 100644 index 0000000..08f9f9f --- /dev/null +++ b/node_modules/async/unmemoize.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = unmemoize; +/** + * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, + * unmemoized form. Handy for testing. + * + * @name unmemoize + * @static + * @memberOf module:Utils + * @method + * @see [async.memoize]{@link module:Utils.memoize} + * @category Util + * @param {AsyncFunction} fn - the memoized function + * @returns {AsyncFunction} a function that calls the original unmemoized function + */ +function unmemoize(fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; +} +module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/until.js b/node_modules/async/until.js new file mode 100644 index 0000000..29955ab --- /dev/null +++ b/node_modules/async/until.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = until; + +var _whilst = require('./whilst'); + +var _whilst2 = _interopRequireDefault(_whilst); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. `callback` will be passed an error and any + * arguments passed to the final `iteratee`'s callback. + * + * The inverse of [whilst]{@link module:ControlFlow.whilst}. + * + * @name until + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {Function} test - synchronous truth test to perform before each + * execution of `iteratee`. Invoked with (). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + */ +function until(test, iteratee, callback) { + (0, _whilst2.default)(function () { + return !test.apply(this, arguments); + }, iteratee, callback); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/waterfall.js b/node_modules/async/waterfall.js new file mode 100644 index 0000000..d547d6b --- /dev/null +++ b/node_modules/async/waterfall.js @@ -0,0 +1,113 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (tasks, callback) { + callback = (0, _once2.default)(callback || _noop2.default); + if (!(0, _isArray2.default)(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); + if (!tasks.length) return callback(); + var taskIndex = 0; + + function nextTask(args) { + var task = (0, _wrapAsync2.default)(tasks[taskIndex++]); + args.push((0, _onlyOnce2.default)(next)); + task.apply(null, args); + } + + function next(err /*, ...args*/) { + if (err || taskIndex === tasks.length) { + return callback.apply(null, arguments); + } + nextTask((0, _slice2.default)(arguments, 1)); + } + + nextTask([]); +}; + +var _isArray = require('lodash/isArray'); + +var _isArray2 = _interopRequireDefault(_isArray); + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _once = require('./internal/once'); + +var _once2 = _interopRequireDefault(_once); + +var _slice = require('./internal/slice'); + +var _slice2 = _interopRequireDefault(_slice); + +var _onlyOnce = require('./internal/onlyOnce'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports['default']; + +/** + * Runs the `tasks` array of functions in series, each passing their results to + * the next in the array. However, if any of the `tasks` pass an error to their + * own callback, the next function is not executed, and the main `callback` is + * immediately called with the error. + * + * @name waterfall + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} + * to run. + * Each function should complete with any number of `result` values. + * The `result` values will be passed as arguments, in order, to the next task. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This will be passed the results of the last task's + * callback. Invoked with (err, [results]). + * @returns undefined + * @example + * + * async.waterfall([ + * function(callback) { + * callback(null, 'one', 'two'); + * }, + * function(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * }, + * function(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + * ], function (err, result) { + * // result now equals 'done' + * }); + * + * // Or, with named functions: + * async.waterfall([ + * myFirstFunction, + * mySecondFunction, + * myLastFunction, + * ], function (err, result) { + * // result now equals 'done' + * }); + * function myFirstFunction(callback) { + * callback(null, 'one', 'two'); + * } + * function mySecondFunction(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * } + * function myLastFunction(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + */ \ No newline at end of file diff --git a/node_modules/async/whilst.js b/node_modules/async/whilst.js new file mode 100644 index 0000000..9c4d8f6 --- /dev/null +++ b/node_modules/async/whilst.js @@ -0,0 +1,72 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = whilst; + +var _noop = require('lodash/noop'); + +var _noop2 = _interopRequireDefault(_noop); + +var _slice = require('./internal/slice'); + +var _slice2 = _interopRequireDefault(_slice); + +var _onlyOnce = require('./internal/onlyOnce'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Function} test - synchronous truth test to perform before each + * execution of `iteratee`. Invoked with (). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns undefined + * @example + * + * var count = 0; + * async.whilst( + * function() { return count < 5; }, + * function(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ +function whilst(test, iteratee, callback) { + callback = (0, _onlyOnce2.default)(callback || _noop2.default); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + if (!test()) return callback(null); + var next = function (err /*, ...args*/) { + if (err) return callback(err); + if (test()) return _iteratee(next); + var args = (0, _slice2.default)(arguments, 1); + callback.apply(null, [null].concat(args)); + }; + _iteratee(next); +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/wrapSync.js b/node_modules/async/wrapSync.js new file mode 100644 index 0000000..5e3fc91 --- /dev/null +++ b/node_modules/async/wrapSync.js @@ -0,0 +1,110 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = asyncify; + +var _isObject = require('lodash/isObject'); + +var _isObject2 = _interopRequireDefault(_isObject); + +var _initialParams = require('./internal/initialParams'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _setImmediate = require('./internal/setImmediate'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ +function asyncify(func) { + return (0, _initialParams2.default)(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if ((0, _isObject2.default)(result) && typeof result.then === 'function') { + result.then(function (value) { + invokeCallback(callback, null, value); + }, function (err) { + invokeCallback(callback, err.message ? err : new Error(err)); + }); + } else { + callback(null, result); + } + }); +} + +function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (e) { + (0, _setImmediate2.default)(rethrow, e); + } +} + +function rethrow(error) { + throw error; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/asynckit/LICENSE b/node_modules/asynckit/LICENSE new file mode 100644 index 0000000..c9eca5d --- /dev/null +++ b/node_modules/asynckit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Alex Indigo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/asynckit/README.md b/node_modules/asynckit/README.md new file mode 100644 index 0000000..ddcc7e6 --- /dev/null +++ b/node_modules/asynckit/README.md @@ -0,0 +1,233 @@ +# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit) + +Minimal async jobs utility library, with streams support. + +[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit) + +[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master) +[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit) +[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit) + + + +AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects. +Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method. + +It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators. + +| compression | size | +| :----------------- | -------: | +| asynckit.js | 12.34 kB | +| asynckit.min.js | 4.11 kB | +| asynckit.min.js.gz | 1.47 kB | + + +## Install + +```sh +$ npm install --save asynckit +``` + +## Examples + +### Parallel Jobs + +Runs iterator over provided array in parallel. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will terminate rest of the active jobs (if abort function is provided) +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var parallel = require('asynckit').parallel + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , target = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// async job accepts one element from the array +// and a callback function +function asyncJob(item, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var parallel = require('asynckit/parallel') + , assert = require('assert') + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ] + , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ] + , target = [] + , keys = [] + ; + +parallel(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); + assert.deepEqual(keys, expectedKeys); +}); + +// supports full value, key, callback (shortcut) interface +function asyncJob(item, key, cb) +{ + // different delays (in ms) per item + var delay = item * 25; + + // pretend different jobs take different time to finish + // and not in consequential order + var timeoutId = setTimeout(function() { + keys.push(key); + target.push(item); + cb(null, item * 2); + }, delay); + + // allow to cancel "leftover" jobs upon error + // return function, invoking of which will abort this job + return clearTimeout.bind(null, timeoutId); +} +``` + +More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js). + +### Serial Jobs + +Runs iterator over provided array sequentially. Stores output in the `result` array, +on the matching positions. In unlikely event of an error from one of the jobs, +will not proceed to the rest of the items in the list +and return error along with salvaged data to the main callback function. + +#### Input Array + +```javascript +var serial = require('asynckit/serial') + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// extended interface (item, key, callback) +// also supported for arrays +function asyncJob(item, key, cb) +{ + target.push(key); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-array.js](test/test-serial-array.js). + +#### Input Object + +Also it supports named jobs, listed via object. + +```javascript +var serial = require('asynckit').serial + , assert = require('assert') + ; + +var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ] + , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ] + , target = [] + ; + +var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 } + , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 } + , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ] + , target = [] + ; + + +serial(source, asyncJob, function(err, result) +{ + assert.deepEqual(result, expectedResult); + assert.deepEqual(target, expectedTarget); +}); + +// shortcut interface (item, callback) +// works for object as well as for the arrays +function asyncJob(item, cb) +{ + target.push(item); + + // it will be automatically made async + // even it iterator "returns" in the same event loop + cb(null, item * 2); +} +``` + +More examples could be found in [test/test-serial-object.js](test/test-serial-object.js). + +_Note: Since _object_ is an _unordered_ collection of properties, +it may produce unexpected results with sequential iterations. +Whenever order of the jobs' execution is important please use `serialOrdered` method._ + +### Ordered Serial Iterations + +TBD + +For example [compare-property](compare-property) package. + +### Streaming interface + +TBD + +## Want to Know More? + +More examples can be found in [test folder](test/). + +Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions. + +## License + +AsyncKit is licensed under the MIT license. diff --git a/node_modules/asynckit/bench.js b/node_modules/asynckit/bench.js new file mode 100644 index 0000000..c612f1a --- /dev/null +++ b/node_modules/asynckit/bench.js @@ -0,0 +1,76 @@ +/* eslint no-console: "off" */ + +var asynckit = require('./') + , async = require('async') + , assert = require('assert') + , expected = 0 + ; + +var Benchmark = require('benchmark'); +var suite = new Benchmark.Suite; + +var source = []; +for (var z = 1; z < 100; z++) +{ + source.push(z); + expected += z; +} + +suite +// add tests + +.add('async.map', function(deferred) +{ + var total = 0; + + async.map(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +.add('asynckit.parallel', function(deferred) +{ + var total = 0; + + asynckit.parallel(source, + function(i, cb) + { + setImmediate(function() + { + total += i; + cb(null, total); + }); + }, + function(err, result) + { + assert.ifError(err); + assert.equal(result[result.length - 1], expected); + deferred.resolve(); + }); +}, {'defer': true}) + + +// add listeners +.on('cycle', function(ev) +{ + console.log(String(ev.target)); +}) +.on('complete', function() +{ + console.log('Fastest is ' + this.filter('fastest').map('name')); +}) +// run async +.run({ 'async': true }); diff --git a/node_modules/asynckit/index.js b/node_modules/asynckit/index.js new file mode 100644 index 0000000..455f945 --- /dev/null +++ b/node_modules/asynckit/index.js @@ -0,0 +1,6 @@ +module.exports = +{ + parallel : require('./parallel.js'), + serial : require('./serial.js'), + serialOrdered : require('./serialOrdered.js') +}; diff --git a/node_modules/asynckit/lib/abort.js b/node_modules/asynckit/lib/abort.js new file mode 100644 index 0000000..114367e --- /dev/null +++ b/node_modules/asynckit/lib/abort.js @@ -0,0 +1,29 @@ +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} diff --git a/node_modules/asynckit/lib/async.js b/node_modules/asynckit/lib/async.js new file mode 100644 index 0000000..7f1288a --- /dev/null +++ b/node_modules/asynckit/lib/async.js @@ -0,0 +1,34 @@ +var defer = require('./defer.js'); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} diff --git a/node_modules/asynckit/lib/defer.js b/node_modules/asynckit/lib/defer.js new file mode 100644 index 0000000..b67110c --- /dev/null +++ b/node_modules/asynckit/lib/defer.js @@ -0,0 +1,26 @@ +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} diff --git a/node_modules/asynckit/lib/iterate.js b/node_modules/asynckit/lib/iterate.js new file mode 100644 index 0000000..5d2839a --- /dev/null +++ b/node_modules/asynckit/lib/iterate.js @@ -0,0 +1,75 @@ +var async = require('./async.js') + , abort = require('./abort.js') + ; + +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); +} + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; +} diff --git a/node_modules/asynckit/lib/readable_asynckit.js b/node_modules/asynckit/lib/readable_asynckit.js new file mode 100644 index 0000000..78ad240 --- /dev/null +++ b/node_modules/asynckit/lib/readable_asynckit.js @@ -0,0 +1,91 @@ +var streamify = require('./streamify.js') + , defer = require('./defer.js') + ; + +// API +module.exports = ReadableAsyncKit; + +/** + * Base constructor for all streams + * used to hold properties/methods + */ +function ReadableAsyncKit() +{ + ReadableAsyncKit.super_.apply(this, arguments); + + // list of active jobs + this.jobs = {}; + + // add stream methods + this.destroy = destroy; + this._start = _start; + this._read = _read; +} + +/** + * Destroys readable stream, + * by aborting outstanding jobs + * + * @returns {void} + */ +function destroy() +{ + if (this.destroyed) + { + return; + } + + this.destroyed = true; + + if (typeof this.terminator == 'function') + { + this.terminator(); + } +} + +/** + * Starts provided jobs in async manner + * + * @private + */ +function _start() +{ + // first argument – runner function + var runner = arguments[0] + // take away first argument + , args = Array.prototype.slice.call(arguments, 1) + // second argument - input data + , input = args[0] + // last argument - result callback + , endCb = streamify.callback.call(this, args[args.length - 1]) + ; + + args[args.length - 1] = endCb; + // third argument - iterator + args[1] = streamify.iterator.call(this, args[1]); + + // allow time for proper setup + defer(function() + { + if (!this.destroyed) + { + this.terminator = runner.apply(null, args); + } + else + { + endCb(null, Array.isArray(input) ? [] : {}); + } + }.bind(this)); +} + + +/** + * Implement _read to comply with Readable streams + * Doesn't really make sense for flowing object mode + * + * @private + */ +function _read() +{ + +} diff --git a/node_modules/asynckit/lib/readable_parallel.js b/node_modules/asynckit/lib/readable_parallel.js new file mode 100644 index 0000000..5d2929f --- /dev/null +++ b/node_modules/asynckit/lib/readable_parallel.js @@ -0,0 +1,25 @@ +var parallel = require('../parallel.js'); + +// API +module.exports = ReadableParallel; + +/** + * Streaming wrapper to `asynckit.parallel` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableParallel(list, iterator, callback) +{ + if (!(this instanceof ReadableParallel)) + { + return new ReadableParallel(list, iterator, callback); + } + + // turn on object mode + ReadableParallel.super_.call(this, {objectMode: true}); + + this._start(parallel, list, iterator, callback); +} diff --git a/node_modules/asynckit/lib/readable_serial.js b/node_modules/asynckit/lib/readable_serial.js new file mode 100644 index 0000000..7822698 --- /dev/null +++ b/node_modules/asynckit/lib/readable_serial.js @@ -0,0 +1,25 @@ +var serial = require('../serial.js'); + +// API +module.exports = ReadableSerial; + +/** + * Streaming wrapper to `asynckit.serial` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerial(list, iterator, callback) +{ + if (!(this instanceof ReadableSerial)) + { + return new ReadableSerial(list, iterator, callback); + } + + // turn on object mode + ReadableSerial.super_.call(this, {objectMode: true}); + + this._start(serial, list, iterator, callback); +} diff --git a/node_modules/asynckit/lib/readable_serial_ordered.js b/node_modules/asynckit/lib/readable_serial_ordered.js new file mode 100644 index 0000000..3de89c4 --- /dev/null +++ b/node_modules/asynckit/lib/readable_serial_ordered.js @@ -0,0 +1,29 @@ +var serialOrdered = require('../serialOrdered.js'); + +// API +module.exports = ReadableSerialOrdered; +// expose sort helpers +module.exports.ascending = serialOrdered.ascending; +module.exports.descending = serialOrdered.descending; + +/** + * Streaming wrapper to `asynckit.serialOrdered` + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {stream.Readable#} + */ +function ReadableSerialOrdered(list, iterator, sortMethod, callback) +{ + if (!(this instanceof ReadableSerialOrdered)) + { + return new ReadableSerialOrdered(list, iterator, sortMethod, callback); + } + + // turn on object mode + ReadableSerialOrdered.super_.call(this, {objectMode: true}); + + this._start(serialOrdered, list, iterator, sortMethod, callback); +} diff --git a/node_modules/asynckit/lib/state.js b/node_modules/asynckit/lib/state.js new file mode 100644 index 0000000..cbea7ad --- /dev/null +++ b/node_modules/asynckit/lib/state.js @@ -0,0 +1,37 @@ +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; +} diff --git a/node_modules/asynckit/lib/streamify.js b/node_modules/asynckit/lib/streamify.js new file mode 100644 index 0000000..f56a1c9 --- /dev/null +++ b/node_modules/asynckit/lib/streamify.js @@ -0,0 +1,141 @@ +var async = require('./async.js'); + +// API +module.exports = { + iterator: wrapIterator, + callback: wrapCallback +}; + +/** + * Wraps iterators with long signature + * + * @this ReadableAsyncKit# + * @param {function} iterator - function to wrap + * @returns {function} - wrapped function + */ +function wrapIterator(iterator) +{ + var stream = this; + + return function(item, key, cb) + { + var aborter + , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key)) + ; + + stream.jobs[key] = wrappedCb; + + // it's either shortcut (item, cb) + if (iterator.length == 2) + { + aborter = iterator(item, wrappedCb); + } + // or long format (item, key, cb) + else + { + aborter = iterator(item, key, wrappedCb); + } + + return aborter; + }; +} + +/** + * Wraps provided callback function + * allowing to execute snitch function before + * real callback + * + * @this ReadableAsyncKit# + * @param {function} callback - function to wrap + * @returns {function} - wrapped function + */ +function wrapCallback(callback) +{ + var stream = this; + + var wrapped = function(error, result) + { + return finisher.call(stream, error, result, callback); + }; + + return wrapped; +} + +/** + * Wraps provided iterator callback function + * makes sure snitch only called once, + * but passes secondary calls to the original callback + * + * @this ReadableAsyncKit# + * @param {function} callback - callback to wrap + * @param {number|string} key - iteration key + * @returns {function} wrapped callback + */ +function wrapIteratorCallback(callback, key) +{ + var stream = this; + + return function(error, output) + { + // don't repeat yourself + if (!(key in stream.jobs)) + { + callback(error, output); + return; + } + + // clean up jobs + delete stream.jobs[key]; + + return streamer.call(stream, error, {key: key, value: output}, callback); + }; +} + +/** + * Stream wrapper for iterator callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects iterator results + */ +function streamer(error, output, callback) +{ + if (error && !this.error) + { + this.error = error; + this.pause(); + this.emit('error', error); + // send back value only, as expected + callback(error, output && output.value); + return; + } + + // stream stuff + this.push(output); + + // back to original track + // send back value only, as expected + callback(error, output && output.value); +} + +/** + * Stream wrapper for finishing callback + * + * @this ReadableAsyncKit# + * @param {mixed} error - error response + * @param {mixed} output - iterator output + * @param {function} callback - callback that expects final results + */ +function finisher(error, output, callback) +{ + // signal end of the stream + // only for successfully finished streams + if (!error) + { + this.push(null); + } + + // back to original track + callback(error, output); +} diff --git a/node_modules/asynckit/lib/terminator.js b/node_modules/asynckit/lib/terminator.js new file mode 100644 index 0000000..d6eb992 --- /dev/null +++ b/node_modules/asynckit/lib/terminator.js @@ -0,0 +1,29 @@ +var abort = require('./abort.js') + , async = require('./async.js') + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); +} diff --git a/node_modules/asynckit/package.json b/node_modules/asynckit/package.json new file mode 100644 index 0000000..f1d2d1b --- /dev/null +++ b/node_modules/asynckit/package.json @@ -0,0 +1,91 @@ +{ + "_from": "asynckit@^0.4.0", + "_id": "asynckit@0.4.0", + "_inBundle": false, + "_integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "_location": "/asynckit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "asynckit@^0.4.0", + "name": "asynckit", + "escapedName": "asynckit", + "rawSpec": "^0.4.0", + "saveSpec": null, + "fetchSpec": "^0.4.0" + }, + "_requiredBy": [ + "/form-data" + ], + "_resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "_shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", + "_spec": "asynckit@^0.4.0", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/form-data", + "author": { + "name": "Alex Indigo", + "email": "iam@alexindigo.com" + }, + "bugs": { + "url": "https://github.com/alexindigo/asynckit/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Minimal async jobs utility library, with streams support", + "devDependencies": { + "browserify": "^13.0.0", + "browserify-istanbul": "^2.0.0", + "coveralls": "^2.11.9", + "eslint": "^2.9.0", + "istanbul": "^0.4.3", + "obake": "^0.1.2", + "phantomjs-prebuilt": "^2.1.7", + "pre-commit": "^1.1.3", + "reamde": "^1.1.0", + "rimraf": "^2.5.2", + "size-table": "^0.2.0", + "tap-spec": "^4.1.1", + "tape": "^4.5.1" + }, + "homepage": "https://github.com/alexindigo/asynckit#readme", + "keywords": [ + "async", + "jobs", + "parallel", + "serial", + "iterator", + "array", + "object", + "stream", + "destroy", + "terminate", + "abort" + ], + "license": "MIT", + "main": "index.js", + "name": "asynckit", + "pre-commit": [ + "clean", + "lint", + "test", + "browser", + "report", + "size" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/alexindigo/asynckit.git" + }, + "scripts": { + "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec", + "clean": "rimraf coverage", + "debug": "tape test/test-*.js", + "lint": "eslint *.js lib/*.js test/*.js", + "report": "istanbul report", + "size": "browserify index.js | size-table asynckit", + "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec", + "win-test": "tape test/test-*.js" + }, + "version": "0.4.0" +} diff --git a/node_modules/asynckit/parallel.js b/node_modules/asynckit/parallel.js new file mode 100644 index 0000000..3c50344 --- /dev/null +++ b/node_modules/asynckit/parallel.js @@ -0,0 +1,43 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); +} diff --git a/node_modules/asynckit/serial.js b/node_modules/asynckit/serial.js new file mode 100644 index 0000000..6cd949a --- /dev/null +++ b/node_modules/asynckit/serial.js @@ -0,0 +1,17 @@ +var serialOrdered = require('./serialOrdered.js'); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} diff --git a/node_modules/asynckit/serialOrdered.js b/node_modules/asynckit/serialOrdered.js new file mode 100644 index 0000000..607eafe --- /dev/null +++ b/node_modules/asynckit/serialOrdered.js @@ -0,0 +1,75 @@ +var iterate = require('./lib/iterate.js') + , initState = require('./lib/state.js') + , terminator = require('./lib/terminator.js') + ; + +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); +} diff --git a/node_modules/asynckit/stream.js b/node_modules/asynckit/stream.js new file mode 100644 index 0000000..d43465f --- /dev/null +++ b/node_modules/asynckit/stream.js @@ -0,0 +1,21 @@ +var inherits = require('util').inherits + , Readable = require('stream').Readable + , ReadableAsyncKit = require('./lib/readable_asynckit.js') + , ReadableParallel = require('./lib/readable_parallel.js') + , ReadableSerial = require('./lib/readable_serial.js') + , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js') + ; + +// API +module.exports = +{ + parallel : ReadableParallel, + serial : ReadableSerial, + serialOrdered : ReadableSerialOrdered, +}; + +inherits(ReadableAsyncKit, Readable); + +inherits(ReadableParallel, ReadableAsyncKit); +inherits(ReadableSerial, ReadableAsyncKit); +inherits(ReadableSerialOrdered, ReadableAsyncKit); diff --git a/node_modules/aws-sign2/LICENSE b/node_modules/aws-sign2/LICENSE new file mode 100644 index 0000000..a4a9aee --- /dev/null +++ b/node_modules/aws-sign2/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/node_modules/aws-sign2/README.md b/node_modules/aws-sign2/README.md new file mode 100644 index 0000000..763564e --- /dev/null +++ b/node_modules/aws-sign2/README.md @@ -0,0 +1,4 @@ +aws-sign +======== + +AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module. diff --git a/node_modules/aws-sign2/index.js b/node_modules/aws-sign2/index.js new file mode 100644 index 0000000..fb35f6d --- /dev/null +++ b/node_modules/aws-sign2/index.js @@ -0,0 +1,212 @@ + +/*! + * Copyright 2010 LearnBoost + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Module dependencies. + */ + +var crypto = require('crypto') + , parse = require('url').parse + ; + +/** + * Valid keys. + */ + +var keys = + [ 'acl' + , 'location' + , 'logging' + , 'notification' + , 'partNumber' + , 'policy' + , 'requestPayment' + , 'torrent' + , 'uploadId' + , 'uploads' + , 'versionId' + , 'versioning' + , 'versions' + , 'website' + ] + +/** + * Return an "Authorization" header value with the given `options` + * in the form of "AWS :" + * + * @param {Object} options + * @return {String} + * @api private + */ + +function authorization (options) { + return 'AWS ' + options.key + ':' + sign(options) +} + +module.exports = authorization +module.exports.authorization = authorization + +/** + * Simple HMAC-SHA1 Wrapper + * + * @param {Object} options + * @return {String} + * @api private + */ + +function hmacSha1 (options) { + return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +} + +module.exports.hmacSha1 = hmacSha1 + +/** + * Create a base64 sha1 HMAC for `options`. + * + * @param {Object} options + * @return {String} + * @api private + */ + +function sign (options) { + options.message = stringToSign(options) + return hmacSha1(options) +} +module.exports.sign = sign + +/** + * Create a base64 sha1 HMAC for `options`. + * + * Specifically to be used with S3 presigned URLs + * + * @param {Object} options + * @return {String} + * @api private + */ + +function signQuery (options) { + options.message = queryStringToSign(options) + return hmacSha1(options) +} +module.exports.signQuery= signQuery + +/** + * Return a string for sign() with the given `options`. + * + * Spec: + * + * \n + * \n + * \n + * \n + * [headers\n] + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function stringToSign (options) { + var headers = options.amazonHeaders || '' + if (headers) headers += '\n' + var r = + [ options.verb + , options.md5 + , options.contentType + , options.date ? options.date.toUTCString() : '' + , headers + options.resource + ] + return r.join('\n') +} +module.exports.stringToSign = stringToSign + +/** + * Return a string for sign() with the given `options`, but is meant exclusively + * for S3 presigned URLs + * + * Spec: + * + * \n + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function queryStringToSign (options){ + return 'GET\n\n\n' + options.date + '\n' + options.resource +} +module.exports.queryStringToSign = queryStringToSign + +/** + * Perform the following: + * + * - ignore non-amazon headers + * - lowercase fields + * - sort lexicographically + * - trim whitespace between ":" + * - join with newline + * + * @param {Object} headers + * @return {String} + * @api private + */ + +function canonicalizeHeaders (headers) { + var buf = [] + , fields = Object.keys(headers) + ; + for (var i = 0, len = fields.length; i < len; ++i) { + var field = fields[i] + , val = headers[field] + , field = field.toLowerCase() + ; + if (0 !== field.indexOf('x-amz')) continue + buf.push(field + ':' + val) + } + return buf.sort().join('\n') +} +module.exports.canonicalizeHeaders = canonicalizeHeaders + +/** + * Perform the following: + * + * - ignore non sub-resources + * - sort lexicographically + * + * @param {String} resource + * @return {String} + * @api private + */ + +function canonicalizeResource (resource) { + var url = parse(resource, true) + , path = url.pathname + , buf = [] + ; + + Object.keys(url.query).forEach(function(key){ + if (!~keys.indexOf(key)) return + var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) + buf.push(key + val) + }) + + return path + (buf.length ? '?' + buf.sort().join('&') : '') +} +module.exports.canonicalizeResource = canonicalizeResource diff --git a/node_modules/aws-sign2/package.json b/node_modules/aws-sign2/package.json new file mode 100644 index 0000000..5d6f168 --- /dev/null +++ b/node_modules/aws-sign2/package.json @@ -0,0 +1,50 @@ +{ + "_from": "aws-sign2@~0.7.0", + "_id": "aws-sign2@0.7.0", + "_inBundle": false, + "_integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "_location": "/aws-sign2", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aws-sign2@~0.7.0", + "name": "aws-sign2", + "escapedName": "aws-sign2", + "rawSpec": "~0.7.0", + "saveSpec": null, + "fetchSpec": "~0.7.0" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "_shasum": "b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8", + "_spec": "aws-sign2@~0.7.0", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/request", + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "bugs": { + "url": "https://github.com/mikeal/aws-sign/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", + "devDependencies": {}, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/mikeal/aws-sign#readme", + "license": "Apache-2.0", + "main": "index.js", + "name": "aws-sign2", + "optionalDependencies": {}, + "repository": { + "url": "git+https://github.com/mikeal/aws-sign.git" + }, + "version": "0.7.0" +} diff --git a/node_modules/aws4/.travis.yml b/node_modules/aws4/.travis.yml new file mode 100644 index 0000000..61d0634 --- /dev/null +++ b/node_modules/aws4/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - "4.2" diff --git a/node_modules/aws4/LICENSE b/node_modules/aws4/LICENSE new file mode 100644 index 0000000..4f321e5 --- /dev/null +++ b/node_modules/aws4/LICENSE @@ -0,0 +1,19 @@ +Copyright 2013 Michael Hart (michael.hart.au@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/aws4/README.md b/node_modules/aws4/README.md new file mode 100644 index 0000000..6b002d0 --- /dev/null +++ b/node_modules/aws4/README.md @@ -0,0 +1,523 @@ +aws4 +---- + +[![Build Status](https://secure.travis-ci.org/mhart/aws4.png?branch=master)](http://travis-ci.org/mhart/aws4) + +A small utility to sign vanilla node.js http(s) request options using Amazon's +[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html). + +Can also be used [in the browser](./browser). + +This signature is supported by nearly all Amazon services, including +[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/), +[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/), +[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html), +[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/), +[Lambda](http://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html), +[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/), +[SNS](http://docs.aws.amazon.com/sns/latest/api/), +[IAM](http://docs.aws.amazon.com/IAM/latest/APIReference/), +[STS](http://docs.aws.amazon.com/STS/latest/APIReference/), +[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/), +[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/), +[CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/), +[CodeDeploy](http://docs.aws.amazon.com/codedeploy/latest/APIReference/), +[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/), +[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/), +[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/), +[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/), +[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html), +[CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html), +[Elastic Load Balancing](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/), +[Elastic Transcoder](http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html), +[CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/), +[Elastic Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/api/), +[Storage Gateway](http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html), +[Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/APIReference/), +[Direct Connect](http://docs.aws.amazon.com/directconnect/latest/APIReference/), +[Redshift](http://docs.aws.amazon.com/redshift/latest/APIReference/), +[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/), +[SES](http://docs.aws.amazon.com/ses/latest/APIReference/), +[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/), +[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/), +[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html), +[Cognito Identity](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/), +[Cognito Sync](http://docs.aws.amazon.com/cognitosync/latest/APIReference/), +[Container Service](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/), +[AppStream](http://docs.aws.amazon.com/appstream/latest/developerguide/appstream-api-rest.html), +[Key Management Service](http://docs.aws.amazon.com/kms/latest/APIReference/), +[Config](http://docs.aws.amazon.com/config/latest/APIReference/), +[CloudHSM](http://docs.aws.amazon.com/cloudhsm/latest/dg/api-ref.html), +[Route53](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html) and +[Route53 Domains](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html). + +Indeed, the only AWS services that *don't* support v4 as of 2014-12-30 are +[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html) and +[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html) +(they only support [AWS Signature Version 2](https://github.com/mhart/aws2)). + +It also provides defaults for a number of core AWS headers and +request parameters, making it very easy to query AWS services, or +build out a fully-featured AWS library. + +Example +------- + +```javascript +var http = require('http'), + https = require('https'), + aws4 = require('aws4') + +// given an options object you could pass to http.request +var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'} + +// alternatively (as aws4 can infer the host): +opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'} + +// alternatively (as us-east-1 is default): +opts = {service: 'sqs', path: '/?Action=ListQueues'} + +aws4.sign(opts) // assumes AWS credentials are available in process.env + +console.log(opts) +/* +{ + host: 'sqs.us-east-1.amazonaws.com', + path: '/?Action=ListQueues', + headers: { + Host: 'sqs.us-east-1.amazonaws.com', + 'X-Amz-Date': '20121226T061030Z', + Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...' + } +} +*/ + +// we can now use this to query AWS using the standard node.js http API +http.request(opts, function(res) { res.pipe(process.stdout) }).end() +/* + + +... +*/ +``` + +More options +------------ + +```javascript +// you can also pass AWS credentials in explicitly (otherwise taken from process.env) +aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''}) + +// can also add the signature to query strings +aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true}) + +// create a utility function to pipe to stdout (with https this time) +function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') } + +// aws4 can infer the HTTP method if a body is passed in +// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8' +request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'})) +/* + +... +*/ + +// can specify any custom option or header as per usual +request(aws4.sign({ + service: 'dynamodb', + region: 'ap-southeast-2', + method: 'POST', + path: '/', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'DynamoDB_20120810.ListTables' + }, + body: '{}' +})) +/* +{"TableNames":[]} +... +*/ + +// works with all other services that support Signature Version 4 + +request(aws4.sign({service: 's3', path: '/', signQuery: true})) +/* + +... +*/ + +request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'})) +/* + +... +*/ + +request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'})) +/* + +... +*/ + +request(aws4.sign({service: 'appstream', path: '/applications'})) +/* +{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/... +... +*/ + +request(aws4.sign({service: 'cognito-sync', path: '/identitypools'})) +/* +{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null} +... +*/ + +request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'})) +/* +{"NextPageToken":null,"Pipelines":[]} +... +*/ + +request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'})) +/* +{"Functions":[],"NextMarker":null} +... +*/ + +request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'})) +/* + +... +*/ + +request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}})) +/* +{"Marker":null,"VaultList":[]} +... +*/ + +request(aws4.sign({service: 'storagegateway', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StorageGateway_20120630.ListGateways' +}})) +/* +{"Gateways":[]} +... +*/ + +request(aws4.sign({service: 'datapipeline', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'DataPipeline.ListPipelines' +}})) +/* +{"hasMoreResults":false,"pipelineIdList":[]} +... +*/ + +request(aws4.sign({service: 'opsworks', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks' +}})) +/* +{"Stacks":[]} +... +*/ + +request(aws4.sign({service: 'route53domains', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains' +}})) +/* +{"Domains":[]} +... +*/ + +request(aws4.sign({service: 'kinesis', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Kinesis_20131202.ListStreams' +}})) +/* +{"HasMoreStreams":false,"StreamNames":[]} +... +*/ + +request(aws4.sign({service: 'cloudtrail', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails' +}})) +/* +{"trailList":[]} +... +*/ + +request(aws4.sign({service: 'logs', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups' +}})) +/* +{"logGroups":[]} +... +*/ + +request(aws4.sign({service: 'codedeploy', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications' +}})) +/* +{"applications":[]} +... +*/ + +request(aws4.sign({service: 'directconnect', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OvertureService.DescribeConnections' +}})) +/* +{"connections":[]} +... +*/ + +request(aws4.sign({service: 'kms', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'TrentService.ListKeys' +}})) +/* +{"Keys":[],"Truncated":false} +... +*/ + +request(aws4.sign({service: 'config', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels' +}})) +/* +{"DeliveryChannels":[]} +... +*/ + +request(aws4.sign({service: 'cloudhsm', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones' +}})) +/* +{"AZList":["us-east-1a","us-east-1b","us-east-1c"]} +... +*/ + +request(aws4.sign({ + service: 'swf', + body: '{"registrationStatus":"REGISTERED"}', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'SimpleWorkflowService.ListDomains' + } +})) +/* +{"domainInfos":[]} +... +*/ + +request(aws4.sign({ + service: 'cognito-identity', + body: '{"MaxResults": 1}', + headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools' + } +})) +/* +{"IdentityPools":[]} +... +*/ + +request(aws4.sign({ + service: 'mobileanalytics', + path: '/2014-06-05/events', + body: JSON.stringify({events:[{ + eventType: 'a', + timestamp: new Date().toISOString(), + session: {}, + }]}), + headers: { + 'Content-Type': 'application/json', + 'X-Amz-Client-Context': JSON.stringify({ + client: {client_id: 'a', app_title: 'a'}, + custom: {}, + env: {platform: 'a'}, + services: {}, + }), + } +})) +/* +(HTTP 202, empty response) +*/ + +// Generate CodeCommit Git access password +var signer = new aws4.RequestSigner({ + service: 'codecommit', + host: 'git-codecommit.us-east-1.amazonaws.com', + method: 'GIT', + path: '/v1/repos/MyAwesomeRepo', +}) +var password = signer.getDateTime() + 'Z' + signer.signature() +``` + +API +--- + +### aws4.sign(requestOptions, [credentials]) + +This calculates and populates the `Authorization` header of +`requestOptions`, and any other necessary AWS headers and/or request +options. Returns `requestOptions` as a convenience for chaining. + +`requestOptions` is an object holding the same options that the node.js +[http.request](http://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback) +function takes. + +The following properties of `requestOptions` are used in the signing or +populated if they don't already exist: + +- `hostname` or `host` (will be determined from `service` and `region` if not given) +- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`) +- `path` (will use `'/'` if not given) +- `body` (will use `''` if not given) +- `service` (will be calculated from `hostname` or `host` if not given) +- `region` (will be calculated from `hostname` or `host` or use `'us-east-1'` if not given) +- `headers['Host']` (will use `hostname` or `host` or be calculated if not given) +- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'` + if not given and there is a `body`) +- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used) + +Your AWS credentials (which can be found in your +[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials)) +can be specified in one of two ways: + +- As the second argument, like this: + +```javascript +aws4.sign(requestOptions, { + secretAccessKey: "", + accessKeyId: "", + sessionToken: "" +}) +``` + +- From `process.env`, such as this: + +``` +export AWS_SECRET_ACCESS_KEY="" +export AWS_ACCESS_KEY_ID="" +export AWS_SESSION_TOKEN="" +``` + +(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available) + +The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing +with [IAM STS temporary credentials](http://docs.aws.amazon.com/STS/latest/UsingSTS/using-temp-creds.html). + +Installation +------------ + +With [npm](http://npmjs.org/) do: + +``` +npm install aws4 +``` + +Can also be used [in the browser](./browser). + +Thanks +------ + +Thanks to [@jed](https://github.com/jed) for his +[dynamo-client](https://github.com/jed/dynamo-client) lib where I first +committed and subsequently extracted this code. + +Also thanks to the +[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving +me a start on implementing the v4 signature. + diff --git a/node_modules/aws4/aws4.js b/node_modules/aws4/aws4.js new file mode 100644 index 0000000..124cd7a --- /dev/null +++ b/node_modules/aws4/aws4.js @@ -0,0 +1,332 @@ +var aws4 = exports, + url = require('url'), + querystring = require('querystring'), + crypto = require('crypto'), + lru = require('./lru'), + credentialsCache = lru(1000) + +// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html + +function hmac(key, string, encoding) { + return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) +} + +function hash(string, encoding) { + return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +} + +// This function assumes the string has already been percent encoded +function encodeRfc3986(urlEncodedString) { + return urlEncodedString.replace(/[!'()*]/g, function(c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +// request: { path | body, [host], [method], [headers], [service], [region] } +// credentials: { accessKeyId, secretAccessKey, [sessionToken] } +function RequestSigner(request, credentials) { + + if (typeof request === 'string') request = url.parse(request) + + var headers = request.headers = (request.headers || {}), + hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) + + this.request = request + this.credentials = credentials || this.defaultCredentials() + + this.service = request.service || hostParts[0] || '' + this.region = request.region || hostParts[1] || 'us-east-1' + + // SES uses a different domain from the service name + if (this.service === 'email') this.service = 'ses' + + if (!request.method && request.body) + request.method = 'POST' + + if (!headers.Host && !headers.host) { + headers.Host = request.hostname || request.host || this.createHost() + + // If a port is specified explicitly, use it as is + if (request.port) + headers.Host += ':' + request.port + } + if (!request.hostname && !request.host) + request.hostname = headers.Host || headers.host + + this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' +} + +RequestSigner.prototype.matchHost = function(host) { + var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/) + var hostParts = (match || []).slice(1, 3) + + // ES's hostParts are sometimes the other way round, if the value that is expected + // to be region equals ‘es’ switch them back + // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com + if (hostParts[1] === 'es') + hostParts = hostParts.reverse() + + return hostParts +} + +// http://docs.aws.amazon.com/general/latest/gr/rande.html +RequestSigner.prototype.isSingleRegion = function() { + // Special case for S3 and SimpleDB in us-east-1 + if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true + + return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] + .indexOf(this.service) >= 0 +} + +RequestSigner.prototype.createHost = function() { + var region = this.isSingleRegion() ? '' : + (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, + service = this.service === 'ses' ? 'email' : this.service + return service + region + '.amazonaws.com' +} + +RequestSigner.prototype.prepareRequest = function() { + this.parsePath() + + var request = this.request, headers = request.headers, query + + if (request.signQuery) { + + this.parsedPath.query = query = this.parsedPath.query || {} + + if (this.credentials.sessionToken) + query['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !query['X-Amz-Expires']) + query['X-Amz-Expires'] = 86400 + + if (query['X-Amz-Date']) + this.datetime = query['X-Amz-Date'] + else + query['X-Amz-Date'] = this.getDateTime() + + query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' + query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() + query['X-Amz-SignedHeaders'] = this.signedHeaders() + + } else { + + if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { + if (request.body && !headers['Content-Type'] && !headers['content-type']) + headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' + + if (request.body && !headers['Content-Length'] && !headers['content-length']) + headers['Content-Length'] = Buffer.byteLength(request.body) + + if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) + headers['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) + headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') + + if (headers['X-Amz-Date'] || headers['x-amz-date']) + this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] + else + headers['X-Amz-Date'] = this.getDateTime() + } + + delete headers.Authorization + delete headers.authorization + } +} + +RequestSigner.prototype.sign = function() { + if (!this.parsedPath) this.prepareRequest() + + if (this.request.signQuery) { + this.parsedPath.query['X-Amz-Signature'] = this.signature() + } else { + this.request.headers.Authorization = this.authHeader() + } + + this.request.path = this.formatPath() + + return this.request +} + +RequestSigner.prototype.getDateTime = function() { + if (!this.datetime) { + var headers = this.request.headers, + date = new Date(headers.Date || headers.date || new Date) + + this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + + // Remove the trailing 'Z' on the timestamp string for CodeCommit git access + if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) + } + return this.datetime +} + +RequestSigner.prototype.getDate = function() { + return this.getDateTime().substr(0, 8) +} + +RequestSigner.prototype.authHeader = function() { + return [ + 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), + 'SignedHeaders=' + this.signedHeaders(), + 'Signature=' + this.signature(), + ].join(', ') +} + +RequestSigner.prototype.signature = function() { + var date = this.getDate(), + cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), + kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) + if (!kCredentials) { + kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) + kRegion = hmac(kDate, this.region) + kService = hmac(kRegion, this.service) + kCredentials = hmac(kService, 'aws4_request') + credentialsCache.set(cacheKey, kCredentials) + } + return hmac(kCredentials, this.stringToSign(), 'hex') +} + +RequestSigner.prototype.stringToSign = function() { + return [ + 'AWS4-HMAC-SHA256', + this.getDateTime(), + this.credentialString(), + hash(this.canonicalString(), 'hex'), + ].join('\n') +} + +RequestSigner.prototype.canonicalString = function() { + if (!this.parsedPath) this.prepareRequest() + + var pathStr = this.parsedPath.path, + query = this.parsedPath.query, + headers = this.request.headers, + queryStr = '', + normalizePath = this.service !== 's3', + decodePath = this.service === 's3' || this.request.doNotEncodePath, + decodeSlashesInPath = this.service === 's3', + firstValOnly = this.service === 's3', + bodyHash + + if (this.service === 's3' && this.request.signQuery) { + bodyHash = 'UNSIGNED-PAYLOAD' + } else if (this.isCodeCommitGit) { + bodyHash = '' + } else { + bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || + hash(this.request.body || '', 'hex') + } + + if (query) { + queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { + if (!key) return obj + obj[key] = !Array.isArray(query[key]) ? query[key] : + (firstValOnly ? query[key][0] : query[key].slice().sort()) + return obj + }, {}))) + } + if (pathStr !== '/') { + if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') + pathStr = pathStr.split('/').reduce(function(path, piece) { + if (normalizePath && piece === '..') { + path.pop() + } else if (!normalizePath || piece !== '.') { + if (decodePath) piece = decodeURIComponent(piece) + path.push(encodeRfc3986(encodeURIComponent(piece))) + } + return path + }, []).join('/') + if (pathStr[0] !== '/') pathStr = '/' + pathStr + if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') + } + + return [ + this.request.method || 'GET', + pathStr, + queryStr, + this.canonicalHeaders() + '\n', + this.signedHeaders(), + bodyHash, + ].join('\n') +} + +RequestSigner.prototype.canonicalHeaders = function() { + var headers = this.request.headers + function trimAll(header) { + return header.toString().trim().replace(/\s+/g, ' ') + } + return Object.keys(headers) + .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) + .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) + .join('\n') +} + +RequestSigner.prototype.signedHeaders = function() { + return Object.keys(this.request.headers) + .map(function(key) { return key.toLowerCase() }) + .sort() + .join(';') +} + +RequestSigner.prototype.credentialString = function() { + return [ + this.getDate(), + this.region, + this.service, + 'aws4_request', + ].join('/') +} + +RequestSigner.prototype.defaultCredentials = function() { + var env = process.env + return { + accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, + secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, + sessionToken: env.AWS_SESSION_TOKEN, + } +} + +RequestSigner.prototype.parsePath = function() { + var path = this.request.path || '/', + queryIx = path.indexOf('?'), + query = null + + if (queryIx >= 0) { + query = querystring.parse(path.slice(queryIx + 1)) + path = path.slice(0, queryIx) + } + + // S3 doesn't always encode characters > 127 correctly and + // all services don't encode characters > 255 correctly + // So if there are non-reserved chars (and it's not already all % encoded), just encode them all + if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { + path = path.split('/').map(function(piece) { + return encodeURIComponent(decodeURIComponent(piece)) + }).join('/') + } + + this.parsedPath = { + path: path, + query: query, + } +} + +RequestSigner.prototype.formatPath = function() { + var path = this.parsedPath.path, + query = this.parsedPath.query + + if (!query) return path + + // Services don't support empty query string keys + if (query[''] != null) delete query[''] + + return path + '?' + encodeRfc3986(querystring.stringify(query)) +} + +aws4.RequestSigner = RequestSigner + +aws4.sign = function(request, credentials) { + return new RequestSigner(request, credentials).sign() +} diff --git a/node_modules/aws4/lru.js b/node_modules/aws4/lru.js new file mode 100644 index 0000000..333f66a --- /dev/null +++ b/node_modules/aws4/lru.js @@ -0,0 +1,96 @@ +module.exports = function(size) { + return new LruCache(size) +} + +function LruCache(size) { + this.capacity = size | 0 + this.map = Object.create(null) + this.list = new DoublyLinkedList() +} + +LruCache.prototype.get = function(key) { + var node = this.map[key] + if (node == null) return undefined + this.used(node) + return node.val +} + +LruCache.prototype.set = function(key, val) { + var node = this.map[key] + if (node != null) { + node.val = val + } else { + if (!this.capacity) this.prune() + if (!this.capacity) return false + node = new DoublyLinkedNode(key, val) + this.map[key] = node + this.capacity-- + } + this.used(node) + return true +} + +LruCache.prototype.used = function(node) { + this.list.moveToFront(node) +} + +LruCache.prototype.prune = function() { + var node = this.list.pop() + if (node != null) { + delete this.map[node.key] + this.capacity++ + } +} + + +function DoublyLinkedList() { + this.firstNode = null + this.lastNode = null +} + +DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.firstNode == node) return + + this.remove(node) + + if (this.firstNode == null) { + this.firstNode = node + this.lastNode = node + node.prev = null + node.next = null + } else { + node.prev = null + node.next = this.firstNode + node.next.prev = node + this.firstNode = node + } +} + +DoublyLinkedList.prototype.pop = function() { + var lastNode = this.lastNode + if (lastNode != null) { + this.remove(lastNode) + } + return lastNode +} + +DoublyLinkedList.prototype.remove = function(node) { + if (this.firstNode == node) { + this.firstNode = node.next + } else if (node.prev != null) { + node.prev.next = node.next + } + if (this.lastNode == node) { + this.lastNode = node.prev + } else if (node.next != null) { + node.next.prev = node.prev + } +} + + +function DoublyLinkedNode(key, val) { + this.key = key + this.val = val + this.prev = null + this.next = null +} diff --git a/node_modules/aws4/package.json b/node_modules/aws4/package.json new file mode 100644 index 0000000..704011e --- /dev/null +++ b/node_modules/aws4/package.json @@ -0,0 +1,104 @@ +{ + "_from": "aws4@^1.8.0", + "_id": "aws4@1.8.0", + "_inBundle": false, + "_integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "_location": "/aws4", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "aws4@^1.8.0", + "name": "aws4", + "escapedName": "aws4", + "rawSpec": "^1.8.0", + "saveSpec": null, + "fetchSpec": "^1.8.0" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "_shasum": "f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f", + "_spec": "aws4@^1.8.0", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/request", + "author": { + "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", + "url": "http://github.com/mhart" + }, + "bugs": { + "url": "https://github.com/mhart/aws4/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Signs and prepares requests using AWS Signature Version 4", + "devDependencies": { + "mocha": "^2.4.5", + "should": "^8.2.2" + }, + "homepage": "https://github.com/mhart/aws4#readme", + "keywords": [ + "amazon", + "aws", + "signature", + "s3", + "ec2", + "autoscaling", + "cloudformation", + "elasticloadbalancing", + "elb", + "elasticbeanstalk", + "cloudsearch", + "dynamodb", + "kinesis", + "lambda", + "glacier", + "sqs", + "sns", + "iam", + "sts", + "ses", + "swf", + "storagegateway", + "datapipeline", + "directconnect", + "redshift", + "opsworks", + "rds", + "monitoring", + "cloudtrail", + "cloudfront", + "codedeploy", + "elasticache", + "elasticmapreduce", + "elastictranscoder", + "emr", + "cloudwatch", + "mobileanalytics", + "cognitoidentity", + "cognitosync", + "cognito", + "containerservice", + "ecs", + "appstream", + "keymanagementservice", + "kms", + "config", + "cloudhsm", + "route53", + "route53domains", + "logs" + ], + "license": "MIT", + "main": "aws4.js", + "name": "aws4", + "repository": { + "type": "git", + "url": "git+https://github.com/mhart/aws4.git" + }, + "scripts": { + "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" + }, + "version": "1.8.0" +} diff --git a/node_modules/backo2/.npmignore b/node_modules/backo2/.npmignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/node_modules/backo2/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/node_modules/backo2/History.md b/node_modules/backo2/History.md new file mode 100644 index 0000000..8eb28b8 --- /dev/null +++ b/node_modules/backo2/History.md @@ -0,0 +1,12 @@ + +1.0.1 / 2014-02-17 +================== + + * go away decimal point + * history + +1.0.0 / 2014-02-17 +================== + + * add jitter option + * Initial commit diff --git a/node_modules/backo2/Makefile b/node_modules/backo2/Makefile new file mode 100644 index 0000000..9987df8 --- /dev/null +++ b/node_modules/backo2/Makefile @@ -0,0 +1,8 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter dot \ + --bail + +.PHONY: test \ No newline at end of file diff --git a/node_modules/backo2/Readme.md b/node_modules/backo2/Readme.md new file mode 100644 index 0000000..0df2a39 --- /dev/null +++ b/node_modules/backo2/Readme.md @@ -0,0 +1,34 @@ +# backo + + Simple exponential backoff because the others seem to have weird abstractions. + +## Installation + +``` +$ npm install backo +``` + +## Options + + - `min` initial timeout in milliseconds [100] + - `max` max timeout [10000] + - `jitter` [0] + - `factor` [2] + +## Example + +```js +var Backoff = require('backo'); +var backoff = new Backoff({ min: 100, max: 20000 }); + +setTimeout(function(){ + something.reconnect(); +}, backoff.duration()); + +// later when something works +backoff.reset() +``` + +# License + + MIT diff --git a/node_modules/backo2/component.json b/node_modules/backo2/component.json new file mode 100644 index 0000000..994845a --- /dev/null +++ b/node_modules/backo2/component.json @@ -0,0 +1,11 @@ +{ + "name": "backo", + "repo": "segmentio/backo", + "dependencies": {}, + "version": "1.0.1", + "description": "simple backoff without the weird abstractions", + "keywords": ["backoff"], + "license": "MIT", + "scripts": ["index.js"], + "main": "index.js" +} diff --git a/node_modules/backo2/index.js b/node_modules/backo2/index.js new file mode 100644 index 0000000..fac4429 --- /dev/null +++ b/node_modules/backo2/index.js @@ -0,0 +1,85 @@ + +/** + * Expose `Backoff`. + */ + +module.exports = Backoff; + +/** + * Initialize backoff timer with `opts`. + * + * - `min` initial timeout in milliseconds [100] + * - `max` max timeout [10000] + * - `jitter` [0] + * - `factor` [2] + * + * @param {Object} opts + * @api public + */ + +function Backoff(opts) { + opts = opts || {}; + this.ms = opts.min || 100; + this.max = opts.max || 10000; + this.factor = opts.factor || 2; + this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0; + this.attempts = 0; +} + +/** + * Return the backoff duration. + * + * @return {Number} + * @api public + */ + +Backoff.prototype.duration = function(){ + var ms = this.ms * Math.pow(this.factor, this.attempts++); + if (this.jitter) { + var rand = Math.random(); + var deviation = Math.floor(rand * this.jitter * ms); + ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation; + } + return Math.min(ms, this.max) | 0; +}; + +/** + * Reset the number of attempts. + * + * @api public + */ + +Backoff.prototype.reset = function(){ + this.attempts = 0; +}; + +/** + * Set the minimum duration + * + * @api public + */ + +Backoff.prototype.setMin = function(min){ + this.ms = min; +}; + +/** + * Set the maximum duration + * + * @api public + */ + +Backoff.prototype.setMax = function(max){ + this.max = max; +}; + +/** + * Set the jitter + * + * @api public + */ + +Backoff.prototype.setJitter = function(jitter){ + this.jitter = jitter; +}; + diff --git a/node_modules/backo2/package.json b/node_modules/backo2/package.json new file mode 100644 index 0000000..0fc1ee0 --- /dev/null +++ b/node_modules/backo2/package.json @@ -0,0 +1,47 @@ +{ + "_from": "backo2@1.0.2", + "_id": "backo2@1.0.2", + "_inBundle": false, + "_integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", + "_location": "/backo2", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "backo2@1.0.2", + "name": "backo2", + "escapedName": "backo2", + "rawSpec": "1.0.2", + "saveSpec": null, + "fetchSpec": "1.0.2" + }, + "_requiredBy": [ + "/socket.io-client" + ], + "_resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "_shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947", + "_spec": "backo2@1.0.2", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/socket.io-client", + "bugs": { + "url": "https://github.com/mokesmokes/backo/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "simple backoff based on segmentio/backo", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "homepage": "https://github.com/mokesmokes/backo#readme", + "keywords": [ + "backoff" + ], + "license": "MIT", + "name": "backo2", + "repository": { + "type": "git", + "url": "git+https://github.com/mokesmokes/backo.git" + }, + "version": "1.0.2" +} diff --git a/node_modules/backo2/test/index.js b/node_modules/backo2/test/index.js new file mode 100644 index 0000000..ea1f6de --- /dev/null +++ b/node_modules/backo2/test/index.js @@ -0,0 +1,18 @@ + +var Backoff = require('..'); +var assert = require('assert'); + +describe('.duration()', function(){ + it('should increase the backoff', function(){ + var b = new Backoff; + + assert(100 == b.duration()); + assert(200 == b.duration()); + assert(400 == b.duration()); + assert(800 == b.duration()); + + b.reset(); + assert(100 == b.duration()); + assert(200 == b.duration()); + }) +}) \ No newline at end of file diff --git a/node_modules/backoff/CHANGES.md b/node_modules/backoff/CHANGES.md new file mode 100644 index 0000000..c820200 --- /dev/null +++ b/node_modules/backoff/CHANGES.md @@ -0,0 +1,86 @@ +# Changelog + +## 2.5.0 + +Those changes are not released yet. + +- In the functional API, invoke the wrapped function callback on abort and emit + an `abort` event. This makes it possible to detect when abort is called. +- Add a method on the function API, `call.retryIf(predicate)`, which specifies + a predicate used to determine whether a given error is retriable or not. The + default behavior is unaffected, errors remain retriable by default. + +## 2.4.1 + +- Add support for specifying the factor to use in the `ExponentialStrategy`. + +## 2.4.0 + +- Replace `FunctionCall.getResults` by `FunctionCall.getLastResult` to avoid + storing intermediary results forever as this may lead to memory exhaustion + when used in conjunction with an infinite number of backoffs. +- Add `FunctionCall.getNumRetries` which returns the number of times the + wrapped function was retried. + +## 2.3.0 + +- Add four new methods to `FunctionCall` to query the state of the call. + - isPending + - isRunning + - isCompleted + - isAborted + +## 2.2.0 + +- To match `Backoff` default behavior, `FunctionCall` no longer sets a + default failAfter of 5, i.e. the maximum number of backoffs is now + unbounded by default. + +## 2.1.0 + +- `Backoff.backoff` now accepts an optional error argument that is re-emitted + as the last argument of the `backoff` and `fail` events. This provides some + context to the listeners as to why a given backoff operation was attempted. +- The `backoff` event emitted by the `FunctionCall` class now contains, as its + last argument, the error that caused the backoff operation to be attempted. + This provides some context to the listeners as to why a given backoff + operation was attempted. + +## 2.0.0 + +- `FunctionCall.call` renamed into `FunctionCall.start`. +- `backoff.call` no longer invokes the wrapped function on `nextTick`. That + way, the first attempt is not delayed until the end of the current event + loop. + +## 1.2.1 + +- Make `FunctionCall.backoffFactory` a private member. + +## 1.2.0 + +- Add `backoff.call` and the associated `FunctionCall` class. + +## 1.1.0 + +- Add a `Backoff.failAfter`. + +## 1.0.0 + +- Rename `start` and `done` events `backoff` and `ready`. +- Remove deprecated `backoff.fibonnaci`. + +## 0.2.1 + +- Create `backoff.fibonacci`. +- Deprecate `backoff.fibonnaci`. +- Expose fibonacci and exponential strategies. + +## 0.2.0 + +- Provide exponential and fibonacci backoffs. + +## 0.1.0 + +- Change `initialTimeout` and `maxTimeout` to `initialDelay` and `maxDelay`. +- Use fibonnaci backoff. diff --git a/node_modules/backoff/LICENSE b/node_modules/backoff/LICENSE new file mode 100644 index 0000000..8748698 --- /dev/null +++ b/node_modules/backoff/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012 Mathieu Turcotte + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/backoff/README.md b/node_modules/backoff/README.md new file mode 100644 index 0000000..f64a6e8 --- /dev/null +++ b/node_modules/backoff/README.md @@ -0,0 +1,382 @@ +# Backoff for Node.js +[![Build Status](https://secure.travis-ci.org/MathieuTurcotte/node-backoff.png?branch=master)](http://travis-ci.org/MathieuTurcotte/node-backoff) +[![NPM version](https://badge.fury.io/js/backoff.png)](http://badge.fury.io/js/backoff) + +Fibonacci and exponential backoffs for Node.js. + +## Installation + +``` +npm install backoff +``` + +## Unit tests + +``` +npm test +``` + +## Usage + +### Object Oriented + +The usual way to instantiate a new `Backoff` object is to use one predefined +factory method: `backoff.fibonacci([options])`, `backoff.exponential([options])`. + +`Backoff` inherits from `EventEmitter`. When a backoff starts, a `backoff` +event is emitted and, when a backoff ends, a `ready` event is emitted. +Handlers for these two events are called with the current backoff number and +delay. + +``` js +var backoff = require('backoff'); + +var fibonacciBackoff = backoff.fibonacci({ + randomisationFactor: 0, + initialDelay: 10, + maxDelay: 300 +}); + +fibonacciBackoff.failAfter(10); + +fibonacciBackoff.on('backoff', function(number, delay) { + // Do something when backoff starts, e.g. show to the + // user the delay before next reconnection attempt. + console.log(number + ' ' + delay + 'ms'); +}); + +fibonacciBackoff.on('ready', function(number, delay) { + // Do something when backoff ends, e.g. retry a failed + // operation (DNS lookup, API call, etc.). If it fails + // again then backoff, otherwise reset the backoff + // instance. + fibonacciBackoff.backoff(); +}); + +fibonacciBackoff.on('fail', function() { + // Do something when the maximum number of backoffs is + // reached, e.g. ask the user to check its connection. + console.log('fail'); +}); + +fibonacciBackoff.backoff(); +``` + +The previous example would print the following. + +``` +0 10ms +1 10ms +2 20ms +3 30ms +4 50ms +5 80ms +6 130ms +7 210ms +8 300ms +9 300ms +fail +``` + +Note that `Backoff` objects are meant to be instantiated once and reused +several times by calling `reset` after a successful "retry". + +### Functional + +It's also possible to avoid some boilerplate code when invoking an asynchronous +function in a backoff loop by using `backoff.call(fn, [args, ...], callback)`. + +Typical usage looks like the following. + +``` js +var call = backoff.call(get, 'https://duplika.ca/', function(err, res) { + console.log('Num retries: ' + call.getNumRetries()); + + if (err) { + console.log('Error: ' + err.message); + } else { + console.log('Status: ' + res.statusCode); + } +}); + +call.retryIf(function(err) { return err.status == 503; }); +call.setStrategy(new backoff.ExponentialStrategy()); +call.failAfter(10); +call.start(); +``` + +## API + +### backoff.fibonacci([options]) + +Constructs a Fibonacci backoff (10, 10, 20, 30, 50, etc.). + +The options are the following. + +- randomisationFactor: defaults to 0, must be between 0 and 1 +- initialDelay: defaults to 100 ms +- maxDelay: defaults to 10000 ms + +With these values, the backoff delay will increase from 100 ms to 10000 ms. The +randomisation factor controls the range of randomness and must be between 0 +and 1. By default, no randomisation is applied on the backoff delay. + +### backoff.exponential([options]) + +Constructs an exponential backoff (10, 20, 40, 80, etc.). + +The options are the following. + +- randomisationFactor: defaults to 0, must be between 0 and 1 +- initialDelay: defaults to 100 ms +- maxDelay: defaults to 10000 ms +- factor: defaults to 2, must be greater than 1 + +With these values, the backoff delay will increase from 100 ms to 10000 ms. The +randomisation factor controls the range of randomness and must be between 0 +and 1. By default, no randomisation is applied on the backoff delay. + +### backoff.call(fn, [args, ...], callback) + +- fn: function to call in a backoff handler, i.e. the wrapped function +- args: function's arguments +- callback: function's callback accepting an error as its first argument + +Constructs a `FunctionCall` instance for the given function. The wrapped +function will get retried until it succeds or reaches the maximum number +of backoffs. In both cases, the callback function will be invoked with the +last result returned by the wrapped function. + +It is the caller's responsability to initiate the call by invoking the +`start` method on the returned `FunctionCall` instance. + +### Class Backoff + +#### new Backoff(strategy) + +- strategy: the backoff strategy to use + +Constructs a new backoff object from a specific backoff strategy. The backoff +strategy must implement the `BackoffStrategy`interface defined bellow. + +#### backoff.failAfter(numberOfBackoffs) + +- numberOfBackoffs: maximum number of backoffs before the fail event gets +emitted, must be greater than 0 + +Sets a limit on the maximum number of backoffs that can be performed before +a fail event gets emitted and the backoff instance is reset. By default, there +is no limit on the number of backoffs that can be performed. + +#### backoff.backoff([err]) + +Starts a backoff operation. If provided, the error parameter will be emitted +as the last argument of the `backoff` and `fail` events to let the listeners +know why the backoff operation was attempted. + +An error will be thrown if a backoff operation is already in progress. + +In practice, this method should be called after a failed attempt to perform a +sensitive operation (connecting to a database, downloading a resource over the +network, etc.). + +#### backoff.reset() + +Resets the backoff delay to the initial backoff delay and stop any backoff +operation in progress. After reset, a backoff instance can and should be +reused. + +In practice, this method should be called after having successfully completed +the sensitive operation guarded by the backoff instance or if the client code +request to stop any reconnection attempt. + +#### Event: 'backoff' + +- number: number of backoffs since last reset, starting at 0 +- delay: backoff delay in milliseconds +- err: optional error parameter passed to `backoff.backoff([err])` + +Emitted when a backoff operation is started. Signals to the client how long +the next backoff delay will be. + +#### Event: 'ready' + +- number: number of backoffs since last reset, starting at 0 +- delay: backoff delay in milliseconds + +Emitted when a backoff operation is done. Signals that the failing operation +should be retried. + +#### Event: 'fail' + +- err: optional error parameter passed to `backoff.backoff([err])` + +Emitted when the maximum number of backoffs is reached. This event will only +be emitted if the client has set a limit on the number of backoffs by calling +`backoff.failAfter(numberOfBackoffs)`. The backoff instance is automatically +reset after this event is emitted. + +### Interface BackoffStrategy + +A backoff strategy must provide the following methods. + +#### strategy.next() + +Computes and returns the next backoff delay. + +#### strategy.reset() + +Resets the backoff delay to its initial value. + +### Class ExponentialStrategy + +Exponential (10, 20, 40, 80, etc.) backoff strategy implementation. + +#### new ExponentialStrategy([options]) + +The options are the following. + +- randomisationFactor: defaults to 0, must be between 0 and 1 +- initialDelay: defaults to 100 ms +- maxDelay: defaults to 10000 ms +- factor: defaults to 2, must be greater than 1 + +### Class FibonacciStrategy + +Fibonnaci (10, 10, 20, 30, 50, etc.) backoff strategy implementation. + +#### new FibonacciStrategy([options]) + +The options are the following. + +- randomisationFactor: defaults to 0, must be between 0 and 1 +- initialDelay: defaults to 100 ms +- maxDelay: defaults to 10000 ms + +### Class FunctionCall + +This class manages the calling of an asynchronous function within a backoff +loop. + +This class should rarely be instantiated directly since the factory method +`backoff.call(fn, [args, ...], callback)` offers a more convenient and safer +way to create `FunctionCall` instances. + +#### new FunctionCall(fn, args, callback) + +- fn: asynchronous function to call +- args: an array containing fn's args +- callback: fn's callback + +Constructs a function handler for the given asynchronous function. + +#### call.isPending() + +Returns whether the call is pending, i.e. hasn't been started. + +#### call.isRunning() + +Returns whether the call is in progress. + +#### call.isCompleted() + +Returns whether the call is completed. + +#### call.isAborted() + +Returns whether the call is aborted. + +#### call.setStrategy(strategy) + +- strategy: strategy instance to use, defaults to `FibonacciStrategy`. + +Sets the backoff strategy to use. This method should be called before +`call.start()` otherwise an exception will be thrown. + +#### call.failAfter(maxNumberOfBackoffs) + +- maxNumberOfBackoffs: maximum number of backoffs before the call is aborted + +Sets the maximum number of backoffs before the call is aborted. By default, +there is no limit on the number of backoffs that can be performed. + +This method should be called before `call.start()` otherwise an exception will +be thrown.. + +#### call.retryIf(predicate) + +- predicate: a function which takes in as its argument the error returned +by the wrapped function and determines whether it is retriable. + +Sets the predicate which will be invoked to determine whether a given error +should be retried or not, e.g. a network error would be retriable while a type +error would stop the function call. By default, all errors are considered to be +retriable. + +This method should be called before `call.start()` otherwise an exception will +be thrown. + +#### call.getLastResult() + +Returns an array containing the last arguments passed to the completion callback +of the wrapped function. For example, to get the error code returned by the last +call, one would do the following. + +``` js +var results = call.getLastResult(); +// The error code is the first parameter of the callback. +var error = results[0]; +``` + +Note that if the call was aborted, it will contain the abort error and not the +last error returned by the wrapped function. + +#### call.getNumRetries() + +Returns the number of times the wrapped function call was retried. For a +wrapped function that succeeded immediately, this would return 0. This +method can be called at any point in time during the call life cycle, i.e. +before, during and after the wrapped function invocation. + +#### call.start() + +Initiates the call the wrapped function. This method should only be called +once otherwise an exception will be thrown. + +#### call.abort() + +Aborts the call and causes the completion callback to be invoked with an abort +error if the call was pending or running; does nothing otherwise. This method +can safely be called mutliple times. + +#### Event: 'call' + +- args: wrapped function's arguments + +Emitted each time the wrapped function is called. + +#### Event: 'callback' + +- results: wrapped function's return values + +Emitted each time the wrapped function invokes its callback. + +#### Event: 'backoff' + +- number: backoff number, starts at 0 +- delay: backoff delay in milliseconds +- err: the error that triggered the backoff operation + +Emitted each time a backoff operation is started. + +#### Event: 'abort' + +Emitted when a call is aborted. + +## Annotated source code + +The annotated source code can be found at [mathieuturcotte.github.io/node-backoff/docs](http://mathieuturcotte.github.io/node-backoff/docs/). + +## License + +This code is free to use under the terms of the [MIT license](http://mturcotte.mit-license.org/). diff --git a/node_modules/backoff/index.js b/node_modules/backoff/index.js new file mode 100644 index 0000000..6281fa6 --- /dev/null +++ b/node_modules/backoff/index.js @@ -0,0 +1,31 @@ +// Copyright (c) 2012 Mathieu Turcotte +// Licensed under the MIT license. + +var Backoff = require('./lib/backoff'); +var ExponentialBackoffStrategy = require('./lib/strategy/exponential'); +var FibonacciBackoffStrategy = require('./lib/strategy/fibonacci'); +var FunctionCall = require('./lib/function_call.js'); + +module.exports.Backoff = Backoff; +module.exports.FunctionCall = FunctionCall; +module.exports.FibonacciStrategy = FibonacciBackoffStrategy; +module.exports.ExponentialStrategy = ExponentialBackoffStrategy; + +// Constructs a Fibonacci backoff. +module.exports.fibonacci = function(options) { + return new Backoff(new FibonacciBackoffStrategy(options)); +}; + +// Constructs an exponential backoff. +module.exports.exponential = function(options) { + return new Backoff(new ExponentialBackoffStrategy(options)); +}; + +// Constructs a FunctionCall for the given function and arguments. +module.exports.call = function(fn, vargs, callback) { + var args = Array.prototype.slice.call(arguments); + fn = args[0]; + vargs = args.slice(1, args.length - 1); + callback = args[args.length - 1]; + return new FunctionCall(fn, vargs, callback); +}; diff --git a/node_modules/backoff/lib/backoff.js b/node_modules/backoff/lib/backoff.js new file mode 100644 index 0000000..202a280 --- /dev/null +++ b/node_modules/backoff/lib/backoff.js @@ -0,0 +1,65 @@ +// Copyright (c) 2012 Mathieu Turcotte +// Licensed under the MIT license. + +var events = require('events'); +var precond = require('precond'); +var util = require('util'); + +// A class to hold the state of a backoff operation. Accepts a backoff strategy +// to generate the backoff delays. +function Backoff(backoffStrategy) { + events.EventEmitter.call(this); + + this.backoffStrategy_ = backoffStrategy; + this.maxNumberOfRetry_ = -1; + this.backoffNumber_ = 0; + this.backoffDelay_ = 0; + this.timeoutID_ = -1; + + this.handlers = { + backoff: this.onBackoff_.bind(this) + }; +} +util.inherits(Backoff, events.EventEmitter); + +// Sets a limit, greater than 0, on the maximum number of backoffs. A 'fail' +// event will be emitted when the limit is reached. +Backoff.prototype.failAfter = function(maxNumberOfRetry) { + precond.checkArgument(maxNumberOfRetry > 0, + 'Expected a maximum number of retry greater than 0 but got %s.', + maxNumberOfRetry); + + this.maxNumberOfRetry_ = maxNumberOfRetry; +}; + +// Starts a backoff operation. Accepts an optional parameter to let the +// listeners know why the backoff operation was started. +Backoff.prototype.backoff = function(err) { + precond.checkState(this.timeoutID_ === -1, 'Backoff in progress.'); + + if (this.backoffNumber_ === this.maxNumberOfRetry_) { + this.emit('fail', err); + this.reset(); + } else { + this.backoffDelay_ = this.backoffStrategy_.next(); + this.timeoutID_ = setTimeout(this.handlers.backoff, this.backoffDelay_); + this.emit('backoff', this.backoffNumber_, this.backoffDelay_, err); + } +}; + +// Handles the backoff timeout completion. +Backoff.prototype.onBackoff_ = function() { + this.timeoutID_ = -1; + this.emit('ready', this.backoffNumber_, this.backoffDelay_); + this.backoffNumber_++; +}; + +// Stops any backoff operation and resets the backoff delay to its inital value. +Backoff.prototype.reset = function() { + this.backoffNumber_ = 0; + this.backoffStrategy_.reset(); + clearTimeout(this.timeoutID_); + this.timeoutID_ = -1; +}; + +module.exports = Backoff; diff --git a/node_modules/backoff/lib/function_call.js b/node_modules/backoff/lib/function_call.js new file mode 100644 index 0000000..37319d7 --- /dev/null +++ b/node_modules/backoff/lib/function_call.js @@ -0,0 +1,190 @@ +// Copyright (c) 2012 Mathieu Turcotte +// Licensed under the MIT license. + +var events = require('events'); +var precond = require('precond'); +var util = require('util'); + +var Backoff = require('./backoff'); +var FibonacciBackoffStrategy = require('./strategy/fibonacci'); + +// Wraps a function to be called in a backoff loop. +function FunctionCall(fn, args, callback) { + events.EventEmitter.call(this); + + precond.checkIsFunction(fn, 'Expected fn to be a function.'); + precond.checkIsArray(args, 'Expected args to be an array.'); + precond.checkIsFunction(callback, 'Expected callback to be a function.'); + + this.function_ = fn; + this.arguments_ = args; + this.callback_ = callback; + this.lastResult_ = []; + this.numRetries_ = 0; + + this.backoff_ = null; + this.strategy_ = null; + this.failAfter_ = -1; + this.retryPredicate_ = FunctionCall.DEFAULT_RETRY_PREDICATE_; + + this.state_ = FunctionCall.State_.PENDING; +} +util.inherits(FunctionCall, events.EventEmitter); + +// States in which the call can be. +FunctionCall.State_ = { + // Call isn't started yet. + PENDING: 0, + // Call is in progress. + RUNNING: 1, + // Call completed successfully which means that either the wrapped function + // returned successfully or the maximal number of backoffs was reached. + COMPLETED: 2, + // The call was aborted. + ABORTED: 3 +}; + +// The default retry predicate which considers any error as retriable. +FunctionCall.DEFAULT_RETRY_PREDICATE_ = function(err) { + return true; +}; + +// Checks whether the call is pending. +FunctionCall.prototype.isPending = function() { + return this.state_ == FunctionCall.State_.PENDING; +}; + +// Checks whether the call is in progress. +FunctionCall.prototype.isRunning = function() { + return this.state_ == FunctionCall.State_.RUNNING; +}; + +// Checks whether the call is completed. +FunctionCall.prototype.isCompleted = function() { + return this.state_ == FunctionCall.State_.COMPLETED; +}; + +// Checks whether the call is aborted. +FunctionCall.prototype.isAborted = function() { + return this.state_ == FunctionCall.State_.ABORTED; +}; + +// Sets the backoff strategy to use. Can only be called before the call is +// started otherwise an exception will be thrown. +FunctionCall.prototype.setStrategy = function(strategy) { + precond.checkState(this.isPending(), 'FunctionCall in progress.'); + this.strategy_ = strategy; + return this; // Return this for chaining. +}; + +// Sets the predicate which will be used to determine whether the errors +// returned from the wrapped function should be retried or not, e.g. a +// network error would be retriable while a type error would stop the +// function call. +FunctionCall.prototype.retryIf = function(retryPredicate) { + precond.checkState(this.isPending(), 'FunctionCall in progress.'); + this.retryPredicate_ = retryPredicate; + return this; +}; + +// Returns all intermediary results returned by the wrapped function since +// the initial call. +FunctionCall.prototype.getLastResult = function() { + return this.lastResult_.concat(); +}; + +// Returns the number of times the wrapped function call was retried. +FunctionCall.prototype.getNumRetries = function() { + return this.numRetries_; +}; + +// Sets the backoff limit. +FunctionCall.prototype.failAfter = function(maxNumberOfRetry) { + precond.checkState(this.isPending(), 'FunctionCall in progress.'); + this.failAfter_ = maxNumberOfRetry; + return this; // Return this for chaining. +}; + +// Aborts the call. +FunctionCall.prototype.abort = function() { + if (this.isCompleted() || this.isAborted()) { + return; + } + + if (this.isRunning()) { + this.backoff_.reset(); + } + + this.state_ = FunctionCall.State_.ABORTED; + this.lastResult_ = [new Error('Backoff aborted.')]; + this.emit('abort'); + this.doCallback_(); +}; + +// Initiates the call to the wrapped function. Accepts an optional factory +// function used to create the backoff instance; used when testing. +FunctionCall.prototype.start = function(backoffFactory) { + precond.checkState(!this.isAborted(), 'FunctionCall is aborted.'); + precond.checkState(this.isPending(), 'FunctionCall already started.'); + + var strategy = this.strategy_ || new FibonacciBackoffStrategy(); + + this.backoff_ = backoffFactory ? + backoffFactory(strategy) : + new Backoff(strategy); + + this.backoff_.on('ready', this.doCall_.bind(this, true /* isRetry */)); + this.backoff_.on('fail', this.doCallback_.bind(this)); + this.backoff_.on('backoff', this.handleBackoff_.bind(this)); + + if (this.failAfter_ > 0) { + this.backoff_.failAfter(this.failAfter_); + } + + this.state_ = FunctionCall.State_.RUNNING; + this.doCall_(false /* isRetry */); +}; + +// Calls the wrapped function. +FunctionCall.prototype.doCall_ = function(isRetry) { + if (isRetry) { + this.numRetries_++; + } + var eventArgs = ['call'].concat(this.arguments_); + events.EventEmitter.prototype.emit.apply(this, eventArgs); + var callback = this.handleFunctionCallback_.bind(this); + this.function_.apply(null, this.arguments_.concat(callback)); +}; + +// Calls the wrapped function's callback with the last result returned by the +// wrapped function. +FunctionCall.prototype.doCallback_ = function() { + this.callback_.apply(null, this.lastResult_); +}; + +// Handles wrapped function's completion. This method acts as a replacement +// for the original callback function. +FunctionCall.prototype.handleFunctionCallback_ = function() { + if (this.isAborted()) { + return; + } + + var args = Array.prototype.slice.call(arguments); + this.lastResult_ = args; // Save last callback arguments. + events.EventEmitter.prototype.emit.apply(this, ['callback'].concat(args)); + + var err = args[0]; + if (err && this.retryPredicate_(err)) { + this.backoff_.backoff(err); + } else { + this.state_ = FunctionCall.State_.COMPLETED; + this.doCallback_(); + } +}; + +// Handles the backoff event by reemitting it. +FunctionCall.prototype.handleBackoff_ = function(number, delay, err) { + this.emit('backoff', number, delay, err); +}; + +module.exports = FunctionCall; diff --git a/node_modules/backoff/lib/strategy/exponential.js b/node_modules/backoff/lib/strategy/exponential.js new file mode 100644 index 0000000..8074a40 --- /dev/null +++ b/node_modules/backoff/lib/strategy/exponential.js @@ -0,0 +1,41 @@ +// Copyright (c) 2012 Mathieu Turcotte +// Licensed under the MIT license. + +var util = require('util'); +var precond = require('precond'); + +var BackoffStrategy = require('./strategy'); + +// Exponential backoff strategy. +function ExponentialBackoffStrategy(options) { + BackoffStrategy.call(this, options); + this.backoffDelay_ = 0; + this.nextBackoffDelay_ = this.getInitialDelay(); + this.factor_ = ExponentialBackoffStrategy.DEFAULT_FACTOR; + + if (options && options.factor !== undefined) { + precond.checkArgument(options.factor > 1, + 'Exponential factor should be greater than 1 but got %s.', + options.factor); + this.factor_ = options.factor; + } +} +util.inherits(ExponentialBackoffStrategy, BackoffStrategy); + +// Default multiplication factor used to compute the next backoff delay from +// the current one. The value can be overridden by passing a custom factor as +// part of the options. +ExponentialBackoffStrategy.DEFAULT_FACTOR = 2; + +ExponentialBackoffStrategy.prototype.next_ = function() { + this.backoffDelay_ = Math.min(this.nextBackoffDelay_, this.getMaxDelay()); + this.nextBackoffDelay_ = this.backoffDelay_ * this.factor_; + return this.backoffDelay_; +}; + +ExponentialBackoffStrategy.prototype.reset_ = function() { + this.backoffDelay_ = 0; + this.nextBackoffDelay_ = this.getInitialDelay(); +}; + +module.exports = ExponentialBackoffStrategy; diff --git a/node_modules/backoff/lib/strategy/fibonacci.js b/node_modules/backoff/lib/strategy/fibonacci.js new file mode 100644 index 0000000..7c71c03 --- /dev/null +++ b/node_modules/backoff/lib/strategy/fibonacci.js @@ -0,0 +1,28 @@ +// Copyright (c) 2012 Mathieu Turcotte +// Licensed under the MIT license. + +var util = require('util'); + +var BackoffStrategy = require('./strategy'); + +// Fibonacci backoff strategy. +function FibonacciBackoffStrategy(options) { + BackoffStrategy.call(this, options); + this.backoffDelay_ = 0; + this.nextBackoffDelay_ = this.getInitialDelay(); +} +util.inherits(FibonacciBackoffStrategy, BackoffStrategy); + +FibonacciBackoffStrategy.prototype.next_ = function() { + var backoffDelay = Math.min(this.nextBackoffDelay_, this.getMaxDelay()); + this.nextBackoffDelay_ += this.backoffDelay_; + this.backoffDelay_ = backoffDelay; + return backoffDelay; +}; + +FibonacciBackoffStrategy.prototype.reset_ = function() { + this.nextBackoffDelay_ = this.getInitialDelay(); + this.backoffDelay_ = 0; +}; + +module.exports = FibonacciBackoffStrategy; diff --git a/node_modules/backoff/lib/strategy/strategy.js b/node_modules/backoff/lib/strategy/strategy.js new file mode 100644 index 0000000..7adfd75 --- /dev/null +++ b/node_modules/backoff/lib/strategy/strategy.js @@ -0,0 +1,80 @@ +// Copyright (c) 2012 Mathieu Turcotte +// Licensed under the MIT license. + +var events = require('events'); +var util = require('util'); + +function isDef(value) { + return value !== undefined && value !== null; +} + +// Abstract class defining the skeleton for the backoff strategies. Accepts an +// object holding the options for the backoff strategy: +// +// * `randomisationFactor`: The randomisation factor which must be between 0 +// and 1 where 1 equates to a randomization factor of 100% and 0 to no +// randomization. +// * `initialDelay`: The backoff initial delay in milliseconds. +// * `maxDelay`: The backoff maximal delay in milliseconds. +function BackoffStrategy(options) { + options = options || {}; + + if (isDef(options.initialDelay) && options.initialDelay < 1) { + throw new Error('The initial timeout must be greater than 0.'); + } else if (isDef(options.maxDelay) && options.maxDelay < 1) { + throw new Error('The maximal timeout must be greater than 0.'); + } + + this.initialDelay_ = options.initialDelay || 100; + this.maxDelay_ = options.maxDelay || 10000; + + if (this.maxDelay_ <= this.initialDelay_) { + throw new Error('The maximal backoff delay must be ' + + 'greater than the initial backoff delay.'); + } + + if (isDef(options.randomisationFactor) && + (options.randomisationFactor < 0 || options.randomisationFactor > 1)) { + throw new Error('The randomisation factor must be between 0 and 1.'); + } + + this.randomisationFactor_ = options.randomisationFactor || 0; +} + +// Gets the maximal backoff delay. +BackoffStrategy.prototype.getMaxDelay = function() { + return this.maxDelay_; +}; + +// Gets the initial backoff delay. +BackoffStrategy.prototype.getInitialDelay = function() { + return this.initialDelay_; +}; + +// Template method that computes and returns the next backoff delay in +// milliseconds. +BackoffStrategy.prototype.next = function() { + var backoffDelay = this.next_(); + var randomisationMultiple = 1 + Math.random() * this.randomisationFactor_; + var randomizedDelay = Math.round(backoffDelay * randomisationMultiple); + return randomizedDelay; +}; + +// Computes and returns the next backoff delay. Intended to be overridden by +// subclasses. +BackoffStrategy.prototype.next_ = function() { + throw new Error('BackoffStrategy.next_() unimplemented.'); +}; + +// Template method that resets the backoff delay to its initial value. +BackoffStrategy.prototype.reset = function() { + this.reset_(); +}; + +// Resets the backoff delay to its initial value. Intended to be overridden by +// subclasses. +BackoffStrategy.prototype.reset_ = function() { + throw new Error('BackoffStrategy.reset_() unimplemented.'); +}; + +module.exports = BackoffStrategy; diff --git a/node_modules/backoff/package.json b/node_modules/backoff/package.json new file mode 100644 index 0000000..483c1a8 --- /dev/null +++ b/node_modules/backoff/package.json @@ -0,0 +1,69 @@ +{ + "_from": "backoff@~2.5.0", + "_id": "backoff@2.5.0", + "_inBundle": false, + "_integrity": "sha1-9hbtqdPktmuMp/ynn2lXIsX44m8=", + "_location": "/backoff", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "backoff@~2.5.0", + "name": "backoff", + "escapedName": "backoff", + "rawSpec": "~2.5.0", + "saveSpec": null, + "fetchSpec": "~2.5.0" + }, + "_requiredBy": [ + "/reconnect-core" + ], + "_resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", + "_shasum": "f616eda9d3e4b66b8ca7fca79f695722c5f8e26f", + "_spec": "backoff@~2.5.0", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/reconnect-core", + "author": { + "name": "Mathieu Turcotte", + "email": "turcotte.mat@gmail.com" + }, + "bugs": { + "url": "https://github.com/MathieuTurcotte/node-backoff/issues" + }, + "bundleDependencies": false, + "dependencies": { + "precond": "0.2" + }, + "deprecated": false, + "description": "Fibonacci and exponential backoffs.", + "devDependencies": { + "nodeunit": "0.9", + "sinon": "1.10" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "index.js", + "lib", + "tests" + ], + "homepage": "https://github.com/MathieuTurcotte/node-backoff#readme", + "keywords": [ + "backoff", + "retry", + "fibonacci", + "exponential" + ], + "license": "MIT", + "name": "backoff", + "repository": { + "type": "git", + "url": "git+https://github.com/MathieuTurcotte/node-backoff.git" + }, + "scripts": { + "docco": "docco lib/*.js lib/strategy/* index.js", + "pretest": "jshint lib/ tests/ examples/ index.js", + "test": "node_modules/nodeunit/bin/nodeunit tests/" + }, + "version": "2.5.0" +} diff --git a/node_modules/backoff/tests/api.js b/node_modules/backoff/tests/api.js new file mode 100644 index 0000000..835c412 --- /dev/null +++ b/node_modules/backoff/tests/api.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2012 Mathieu Turcotte + * Licensed under the MIT license. + */ + +var sinon = require('sinon'); + +var backoff = require('../index'); + +exports["API"] = { + "backoff.fibonnaci should be a function that returns a backoff instance": function(test) { + test.ok(backoff.fibonacci, 'backoff.fibonacci should be defined.'); + test.equal(typeof backoff.fibonacci, 'function', + 'backoff.fibonacci should be a function.'); + test.equal(backoff.fibonacci().constructor.name, 'Backoff'); + test.done(); + }, + + "backoff.exponential should be a function that returns a backoff instance": function(test) { + test.ok(backoff.exponential, 'backoff.exponential should be defined.'); + test.equal(typeof backoff.exponential, 'function', + 'backoff.exponential should be a function.'); + test.equal(backoff.exponential().constructor.name, 'Backoff'); + test.done(); + }, + + "backoff.call should be a function that returns a FunctionCall instance": function(test) { + var fn = function() {}; + var callback = function() {}; + test.ok(backoff.Backoff, 'backoff.call should be defined.'); + test.equal(typeof backoff.call, 'function', + 'backoff.call should be a function.'); + test.equal(backoff.call(fn, 1, 2, 3, callback).constructor.name, + 'FunctionCall'); + test.done(); + }, + + "backoff.Backoff should be defined and a function": function(test) { + test.ok(backoff.Backoff, 'backoff.Backoff should be defined.'); + test.equal(typeof backoff.Backoff, 'function', + 'backoff.Backoff should be a function.'); + test.done(); + }, + + "backoff.FunctionCall should be defined and a function": function(test) { + test.ok(backoff.FunctionCall, + 'backoff.FunctionCall should be defined.'); + test.equal(typeof backoff.FunctionCall, 'function', + 'backoff.FunctionCall should be a function.'); + test.done(); + }, + + "backoff.FibonacciStrategy should be defined and a function": function(test) { + test.ok(backoff.FibonacciStrategy, + 'backoff.FibonacciStrategy should be defined.'); + test.equal(typeof backoff.FibonacciStrategy, 'function', + 'backoff.FibonacciStrategy should be a function.'); + test.done(); + }, + + "backoff.ExponentialStrategy should be defined and a function": function(test) { + test.ok(backoff.ExponentialStrategy, + 'backoff.ExponentialStrategy should be defined.'); + test.equal(typeof backoff.ExponentialStrategy, 'function', + 'backoff.ExponentialStrategy should be a function.'); + test.done(); + } +}; diff --git a/node_modules/backoff/tests/backoff.js b/node_modules/backoff/tests/backoff.js new file mode 100644 index 0000000..84bbd16 --- /dev/null +++ b/node_modules/backoff/tests/backoff.js @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2012 Mathieu Turcotte + * Licensed under the MIT license. + */ + +var sinon = require('sinon'); + +var Backoff = require('../lib/backoff'); +var BackoffStrategy = require('../lib/strategy/strategy'); + +exports["Backoff"] = { + setUp: function(callback) { + this.backoffStrategy = sinon.stub(new BackoffStrategy()); + this.backoff = new Backoff(this.backoffStrategy); + this.clock = sinon.useFakeTimers(); + this.spy = new sinon.spy(); + callback(); + }, + + tearDown: function(callback) { + this.clock.restore(); + callback(); + }, + + "the backoff event should be emitted when backoff starts": function(test) { + this.backoffStrategy.next.returns(10); + this.backoff.on('backoff', this.spy); + + this.backoff.backoff(); + + test.ok(this.spy.calledOnce, + 'Backoff event should be emitted when backoff starts.'); + test.done(); + }, + + "the ready event should be emitted on backoff completion": function(test) { + this.backoffStrategy.next.returns(10); + this.backoff.on('ready', this.spy); + + this.backoff.backoff(); + this.clock.tick(10); + + test.ok(this.spy.calledOnce, + 'Ready event should be emitted when backoff ends.'); + test.done(); + }, + + "the backoff event should be passed the backoff delay": function(test) { + this.backoffStrategy.next.returns(989); + this.backoff.on('backoff', this.spy); + + this.backoff.backoff(); + + test.equal(this.spy.getCall(0).args[1], 989, 'Backoff event should ' + + 'carry the backoff delay as its second argument.'); + test.done(); + }, + + "the ready event should be passed the backoff delay": function(test) { + this.backoffStrategy.next.returns(989); + this.backoff.on('ready', this.spy); + + this.backoff.backoff(); + this.clock.tick(989); + + test.equal(this.spy.getCall(0).args[1], 989, 'Ready event should ' + + 'carry the backoff delay as its second argument.'); + test.done(); + }, + + "the fail event should be emitted when backoff limit is reached": function(test) { + var err = new Error('Fail'); + + this.backoffStrategy.next.returns(10); + this.backoff.on('fail', this.spy); + + this.backoff.failAfter(2); + + // Consume first 2 backoffs. + for (var i = 0; i < 2; i++) { + this.backoff.backoff(); + this.clock.tick(10); + } + + // Failure should occur on the third call, and not before. + test.ok(!this.spy.calledOnce, 'Fail event shouldn\'t have been emitted.'); + this.backoff.backoff(err); + test.ok(this.spy.calledOnce, 'Fail event should have been emitted.'); + test.equal(this.spy.getCall(0).args[0], err, 'Error should be passed'); + + test.done(); + }, + + "calling backoff while a backoff is in progress should throw an error": function(test) { + this.backoffStrategy.next.returns(10); + var backoff = this.backoff; + + backoff.backoff(); + + test.throws(function() { + backoff.backoff(); + }, /in progress/); + + test.done(); + }, + + "backoff limit should be greater than 0": function(test) { + var backoff = this.backoff; + test.throws(function() { + backoff.failAfter(0); + }, /greater than 0 but got 0/); + test.done(); + }, + + "reset should cancel any backoff in progress": function(test) { + this.backoffStrategy.next.returns(10); + this.backoff.on('ready', this.spy); + + this.backoff.backoff(); + + this.backoff.reset(); + this.clock.tick(100); // 'ready' should not be emitted. + + test.equals(this.spy.callCount, 0, 'Reset should have aborted the backoff.'); + test.done(); + }, + + "reset should reset the backoff strategy": function(test) { + this.backoff.reset(); + test.ok(this.backoffStrategy.reset.calledOnce, + 'The backoff strategy should have been resetted.'); + test.done(); + }, + + "backoff should be reset after fail": function(test) { + this.backoffStrategy.next.returns(10); + + this.backoff.failAfter(1); + + this.backoff.backoff(); + this.clock.tick(10); + this.backoff.backoff(); + + test.ok(this.backoffStrategy.reset.calledOnce, + 'Backoff should have been resetted after failure.'); + test.done(); + }, + + "the backoff number should increase from 0 to N - 1": function(test) { + this.backoffStrategy.next.returns(10); + this.backoff.on('backoff', this.spy); + + var expectedNumbers = [0, 1, 2, 3, 4]; + var actualNumbers = []; + + for (var i = 0; i < expectedNumbers.length; i++) { + this.backoff.backoff(); + this.clock.tick(10); + actualNumbers.push(this.spy.getCall(i).args[0]); + } + + test.deepEqual(expectedNumbers, actualNumbers, + 'Backoff number should increase from 0 to N - 1.'); + test.done(); + } +}; diff --git a/node_modules/backoff/tests/backoff_strategy.js b/node_modules/backoff/tests/backoff_strategy.js new file mode 100644 index 0000000..507f2a0 --- /dev/null +++ b/node_modules/backoff/tests/backoff_strategy.js @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2012 Mathieu Turcotte + * Licensed under the MIT license. + */ + +var sinon = require('sinon'); +var util = require('util'); + +var BackoffStrategy = require('../lib/strategy/strategy'); + +function SampleBackoffStrategy(options) { + BackoffStrategy.call(this, options); +} +util.inherits(SampleBackoffStrategy, BackoffStrategy); + +SampleBackoffStrategy.prototype.next_ = function() { + return this.getInitialDelay(); +}; + +SampleBackoffStrategy.prototype.reset_ = function() {}; + +exports["BackoffStrategy"] = { + setUp: function(callback) { + this.random = sinon.stub(Math, 'random'); + callback(); + }, + + tearDown: function(callback) { + this.random.restore(); + callback(); + }, + + "the randomisation factor should be between 0 and 1": function(test) { + test.throws(function() { + new BackoffStrategy({ + randomisationFactor: -0.1 + }); + }); + + test.throws(function() { + new BackoffStrategy({ + randomisationFactor: 1.1 + }); + }); + + test.doesNotThrow(function() { + new BackoffStrategy({ + randomisationFactor: 0.5 + }); + }); + + test.done(); + }, + + "the raw delay should be randomized based on the randomisation factor": function(test) { + var strategy = new SampleBackoffStrategy({ + randomisationFactor: 0.5, + initialDelay: 1000 + }); + this.random.returns(0.5); + + var backoffDelay = strategy.next(); + + test.equals(backoffDelay, 1000 + (1000 * 0.5 * 0.5)); + test.done(); + }, + + "the initial backoff delay should be greater than 0": function(test) { + test.throws(function() { + new BackoffStrategy({ + initialDelay: -1 + }); + }); + + test.throws(function() { + new BackoffStrategy({ + initialDelay: 0 + }); + }); + + test.doesNotThrow(function() { + new BackoffStrategy({ + initialDelay: 1 + }); + }); + + test.done(); + }, + + "the maximal backoff delay should be greater than 0": function(test) { + test.throws(function() { + new BackoffStrategy({ + maxDelay: -1 + }); + }); + + test.throws(function() { + new BackoffStrategy({ + maxDelay: 0 + }); + }); + + test.done(); + }, + + "the maximal backoff delay should be greater than the initial backoff delay": function(test) { + test.throws(function() { + new BackoffStrategy({ + initialDelay: 10, + maxDelay: 10 + }); + }); + + test.doesNotThrow(function() { + new BackoffStrategy({ + initialDelay: 10, + maxDelay: 11 + }); + }); + + test.done(); + } +}; diff --git a/node_modules/backoff/tests/exponential_backoff_strategy.js b/node_modules/backoff/tests/exponential_backoff_strategy.js new file mode 100644 index 0000000..3c83f50 --- /dev/null +++ b/node_modules/backoff/tests/exponential_backoff_strategy.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2012 Mathieu Turcotte + * Licensed under the MIT license. + */ + +var sinon = require('sinon'); + +var ExponentialBackoffStrategy = require('../lib/strategy/exponential'); + +exports["ExponentialBackoffStrategy"] = { + + "backoff delays should follow an exponential sequence": function(test) { + var strategy = new ExponentialBackoffStrategy({ + initialDelay: 10, + maxDelay: 1000 + }); + + // Exponential sequence: x[i] = x[i-1] * 2. + var expectedDelays = [10, 20, 40, 80, 160, 320, 640, 1000, 1000]; + var actualDelays = expectedDelays.map(function () { + return strategy.next(); + }); + + test.deepEqual(expectedDelays, actualDelays, + 'Generated delays should follow an exponential sequence.'); + test.done(); + }, + + "backoff delay factor should be configurable": function (test) { + var strategy = new ExponentialBackoffStrategy({ + initialDelay: 10, + maxDelay: 270, + factor: 3 + }); + + // Exponential sequence: x[i] = x[i-1] * 3. + var expectedDelays = [10, 30, 90, 270, 270]; + var actualDelays = expectedDelays.map(function () { + return strategy.next(); + }); + + test.deepEqual(expectedDelays, actualDelays, + 'Generated delays should follow a configurable exponential sequence.'); + test.done(); + }, + + "backoff delays should restart from the initial delay after reset": function(test) { + var strategy = new ExponentialBackoffStrategy({ + initialDelay: 10, + maxDelay: 1000 + }); + + strategy.next(); + strategy.reset(); + + var backoffDelay = strategy.next(); + test.equals(backoffDelay, 10, + 'Strategy should return the initial delay after reset.'); + test.done(); + } +}; diff --git a/node_modules/backoff/tests/fibonacci_backoff_strategy.js b/node_modules/backoff/tests/fibonacci_backoff_strategy.js new file mode 100644 index 0000000..cb15197 --- /dev/null +++ b/node_modules/backoff/tests/fibonacci_backoff_strategy.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2012 Mathieu Turcotte + * Licensed under the MIT license. + */ + +var sinon = require('sinon'); + +var FibonacciBackoffStrategy = require('../lib/strategy/fibonacci'); + +exports["FibonacciBackoffStrategy"] = { + setUp: function(callback) { + this.strategy = new FibonacciBackoffStrategy({ + initialDelay: 10, + maxDelay: 1000 + }); + callback(); + }, + + "backoff delays should follow a Fibonacci sequence": function(test) { + // Fibonacci sequence: x[i] = x[i-1] + x[i-2]. + var expectedDelays = [10, 10, 20, 30, 50, 80, 130, 210, 340, 550, 890, 1000]; + var actualDelays = []; + + for (var i = 0; i < expectedDelays.length; i++) { + actualDelays.push(this.strategy.next()); + } + + test.deepEqual(expectedDelays, actualDelays, + 'Generated delays should follow a Fibonacci sequence.'); + test.done(); + }, + + "backoff delays should restart from the initial delay after reset": function(test) { + var strategy = new FibonacciBackoffStrategy({ + initialDelay: 10, + maxDelay: 1000 + }); + + strategy.next(); + strategy.reset(); + + var backoffDelay = strategy.next(); + test.equals(backoffDelay, 10, + 'Strategy should return the initial delay after reset.'); + test.done(); + } +}; diff --git a/node_modules/backoff/tests/function_call.js b/node_modules/backoff/tests/function_call.js new file mode 100644 index 0000000..d54f4b0 --- /dev/null +++ b/node_modules/backoff/tests/function_call.js @@ -0,0 +1,406 @@ +/* + * Copyright (c) 2012 Mathieu Turcotte + * Licensed under the MIT license. + */ + +var assert = require('assert'); +var events = require('events'); +var sinon = require('sinon'); +var util = require('util'); + +var FunctionCall = require('../lib/function_call'); + +function MockBackoff() { + events.EventEmitter.call(this); + + this.reset = sinon.spy(); + this.backoff = sinon.spy(); + this.failAfter = sinon.spy(); +} +util.inherits(MockBackoff, events.EventEmitter); + +exports["FunctionCall"] = { + setUp: function(callback) { + this.wrappedFn = sinon.stub(); + this.callback = sinon.stub(); + this.backoff = new MockBackoff(); + this.backoffFactory = sinon.stub(); + this.backoffFactory.returns(this.backoff); + callback(); + }, + + tearDown: function(callback) { + callback(); + }, + + "constructor's first argument should be a function": function(test) { + test.throws(function() { + new FunctionCall(1, [], function() {}); + }, /Expected fn to be a function./); + test.done(); + }, + + "constructor's last argument should be a function": function(test) { + test.throws(function() { + new FunctionCall(function() {}, [], 3); + }, /Expected callback to be a function./); + test.done(); + }, + + "isPending should return false once the call is started": function(test) { + this.wrappedFn. + onFirstCall().yields(new Error()). + onSecondCall().yields(null, 'Success!'); + var call = new FunctionCall(this.wrappedFn, [], this.callback); + + test.ok(call.isPending()); + + call.start(this.backoffFactory); + test.ok(!call.isPending()); + + this.backoff.emit('ready'); + test.ok(!call.isPending()); + + test.done(); + }, + + "isRunning should return true when call is in progress": function(test) { + this.wrappedFn. + onFirstCall().yields(new Error()). + onSecondCall().yields(null, 'Success!'); + var call = new FunctionCall(this.wrappedFn, [], this.callback); + + test.ok(!call.isRunning()); + + call.start(this.backoffFactory); + test.ok(call.isRunning()); + + this.backoff.emit('ready'); + test.ok(!call.isRunning()); + + test.done(); + }, + + "isCompleted should return true once the call completes": function(test) { + this.wrappedFn. + onFirstCall().yields(new Error()). + onSecondCall().yields(null, 'Success!'); + var call = new FunctionCall(this.wrappedFn, [], this.callback); + + test.ok(!call.isCompleted()); + + call.start(this.backoffFactory); + test.ok(!call.isCompleted()); + + this.backoff.emit('ready'); + test.ok(call.isCompleted()); + + test.done(); + }, + + "isAborted should return true once the call is aborted": function(test) { + this.wrappedFn. + onFirstCall().yields(new Error()). + onSecondCall().yields(null, 'Success!'); + var call = new FunctionCall(this.wrappedFn, [], this.callback); + + test.ok(!call.isAborted()); + call.abort(); + test.ok(call.isAborted()); + + test.done(); + }, + + "setStrategy should overwrite the default strategy": function(test) { + var replacementStrategy = {}; + var call = new FunctionCall(this.wrappedFn, [], this.callback); + call.setStrategy(replacementStrategy); + call.start(this.backoffFactory); + test.ok(this.backoffFactory.calledWith(replacementStrategy), + 'User defined strategy should be used to instantiate ' + + 'the backoff instance.'); + test.done(); + }, + + "setStrategy should throw if the call is in progress": function(test) { + var call = new FunctionCall(this.wrappedFn, [], this.callback); + call.start(this.backoffFactory); + test.throws(function() { + call.setStrategy({}); + }, /in progress/); + test.done(); + }, + + "failAfter should not be set by default": function(test) { + var call = new FunctionCall(this.wrappedFn, [], this.callback); + call.start(this.backoffFactory); + test.equal(0, this.backoff.failAfter.callCount); + test.done(); + }, + + "failAfter should be used as the maximum number of backoffs": function(test) { + var failAfterValue = 99; + var call = new FunctionCall(this.wrappedFn, [], this.callback); + call.failAfter(failAfterValue); + call.start(this.backoffFactory); + test.ok(this.backoff.failAfter.calledWith(failAfterValue), + 'User defined maximum number of backoffs shoud be ' + + 'used to configure the backoff instance.'); + test.done(); + }, + + "failAfter should throw if the call is in progress": function(test) { + var call = new FunctionCall(this.wrappedFn, [], this.callback); + call.start(this.backoffFactory); + test.throws(function() { + call.failAfter(1234); + }, /in progress/); + test.done(); + }, + + "start shouldn't allow overlapping invocation": function(test) { + var call = new FunctionCall(this.wrappedFn, [], this.callback); + var backoffFactory = this.backoffFactory; + + call.start(backoffFactory); + test.throws(function() { + call.start(backoffFactory); + }, /already started/); + test.done(); + }, + + "start shouldn't allow invocation of aborted call": function(test) { + var call = new FunctionCall(this.wrappedFn, [], this.callback); + var backoffFactory = this.backoffFactory; + + call.abort(); + test.throws(function() { + call.start(backoffFactory); + }, /aborted/); + test.done(); + }, + + "call should forward its arguments to the wrapped function": function(test) { + var call = new FunctionCall(this.wrappedFn, [1, 2, 3], this.callback); + call.start(this.backoffFactory); + test.ok(this.wrappedFn.calledWith(1, 2, 3)); + test.done(); + }, + + "call should complete when the wrapped function succeeds": function(test) { + var call = new FunctionCall(this.wrappedFn, [1, 2, 3], this.callback); + this.wrappedFn. + onCall(0).yields(new Error()). + onCall(1).yields(new Error()). + onCall(2).yields(new Error()). + onCall(3).yields(null, 'Success!'); + + call.start(this.backoffFactory); + + for (var i = 0; i < 2; i++) { + this.backoff.emit('ready'); + } + + test.equals(this.callback.callCount, 0); + this.backoff.emit('ready'); + + test.ok(this.callback.calledWith(null, 'Success!')); + test.ok(this.wrappedFn.alwaysCalledWith(1, 2, 3)); + test.done(); + }, + + "call should fail when the backoff limit is reached": function(test) { + var call = new FunctionCall(this.wrappedFn, [1, 2, 3], this.callback); + var error = new Error(); + this.wrappedFn.yields(error); + call.start(this.backoffFactory); + + for (var i = 0; i < 3; i++) { + this.backoff.emit('ready'); + } + + test.equals(this.callback.callCount, 0); + + this.backoff.emit('fail'); + + test.ok(this.callback.calledWith(error)); + test.ok(this.wrappedFn.alwaysCalledWith(1, 2, 3)); + test.done(); + }, + + "call should fail when the retry predicate returns false": function(test) { + var call = new FunctionCall(this.wrappedFn, [1, 2, 3], this.callback); + call.retryIf(function(err) { return err.retriable; }); + + var retriableError = new Error(); + retriableError.retriable = true; + + var fatalError = new Error(); + fatalError.retriable = false; + + this.wrappedFn. + onCall(0).yields(retriableError). + onCall(1).yields(retriableError). + onCall(2).yields(fatalError); + + call.start(this.backoffFactory); + + for (var i = 0; i < 2; i++) { + this.backoff.emit('ready'); + } + + test.equals(this.callback.callCount, 1); + test.ok(this.callback.calledWith(fatalError)); + test.ok(this.wrappedFn.alwaysCalledWith(1, 2, 3)); + test.done(); + }, + + "wrapped function's callback shouldn't be called after abort": function(test) { + var call = new FunctionCall(function(callback) { + call.abort(); // Abort in middle of wrapped function's execution. + callback(null, 'ok'); + }, [], this.callback); + + call.start(this.backoffFactory); + + test.equals(this.callback.callCount, 1, + 'Wrapped function\'s callback shouldn\'t be called after abort.'); + test.ok(this.callback.calledWithMatch(sinon.match(function (err) { + return !!err.message.match(/Backoff aborted/); + }, "abort error"))); + test.done(); + }, + + "abort event is emitted once when abort is called": function(test) { + var call = new FunctionCall(this.wrappedFn, [], this.callback); + this.wrappedFn.yields(new Error()); + var callEventSpy = sinon.spy(); + + call.on('abort', callEventSpy); + call.start(this.backoffFactory); + + call.abort(); + call.abort(); + call.abort(); + + test.equals(callEventSpy.callCount, 1); + test.done(); + }, + + "getLastResult should return the last intermediary result": function(test) { + var call = new FunctionCall(this.wrappedFn, [], this.callback); + this.wrappedFn.yields(1); + call.start(this.backoffFactory); + + for (var i = 2; i < 5; i++) { + this.wrappedFn.yields(i); + this.backoff.emit('ready'); + test.deepEqual([i], call.getLastResult()); + } + + this.wrappedFn.yields(null); + this.backoff.emit('ready'); + test.deepEqual([null], call.getLastResult()); + + test.done(); + }, + + "getNumRetries should return the number of retries": function(test) { + var call = new FunctionCall(this.wrappedFn, [], this.callback); + + this.wrappedFn.yields(1); + call.start(this.backoffFactory); + // The inital call doesn't count as a retry. + test.equals(0, call.getNumRetries()); + + for (var i = 2; i < 5; i++) { + this.wrappedFn.yields(i); + this.backoff.emit('ready'); + test.equals(i - 1, call.getNumRetries()); + } + + this.wrappedFn.yields(null); + this.backoff.emit('ready'); + test.equals(4, call.getNumRetries()); + + test.done(); + }, + + "wrapped function's errors should be propagated": function(test) { + var call = new FunctionCall(this.wrappedFn, [1, 2, 3], this.callback); + this.wrappedFn.throws(new Error()); + test.throws(function() { + call.start(this.backoffFactory); + }, Error); + test.done(); + }, + + "wrapped callback's errors should be propagated": function(test) { + var call = new FunctionCall(this.wrappedFn, [1, 2, 3], this.callback); + this.wrappedFn.yields(null, 'Success!'); + this.callback.throws(new Error()); + test.throws(function() { + call.start(this.backoffFactory); + }, Error); + test.done(); + }, + + "call event should be emitted when wrapped function gets called": function(test) { + this.wrappedFn.yields(1); + var callEventSpy = sinon.spy(); + + var call = new FunctionCall(this.wrappedFn, [1, 'two'], this.callback); + call.on('call', callEventSpy); + call.start(this.backoffFactory); + + for (var i = 1; i < 5; i++) { + this.backoff.emit('ready'); + } + + test.equal(5, callEventSpy.callCount, + 'The call event should have been emitted 5 times.'); + test.deepEqual([1, 'two'], callEventSpy.getCall(0).args, + 'The call event should carry function\'s args.'); + test.done(); + }, + + "callback event should be emitted when callback is called": function(test) { + var call = new FunctionCall(this.wrappedFn, [1, 'two'], this.callback); + var callbackSpy = sinon.spy(); + call.on('callback', callbackSpy); + + this.wrappedFn.yields('error'); + call.start(this.backoffFactory); + + this.wrappedFn.yields(null, 'done'); + this.backoff.emit('ready'); + + test.equal(2, callbackSpy.callCount, + 'Callback event should have been emitted 2 times.'); + test.deepEqual(['error'], callbackSpy.firstCall.args, + 'First callback event should carry first call\'s results.'); + test.deepEqual([null, 'done'], callbackSpy.secondCall.args, + 'Second callback event should carry second call\'s results.'); + test.done(); + }, + + "backoff event should be emitted on backoff start": function(test) { + var err = new Error('backoff event error'); + var call = new FunctionCall(this.wrappedFn, [1, 'two'], this.callback); + var backoffSpy = sinon.spy(); + + call.on('backoff', backoffSpy); + + this.wrappedFn.yields(err); + call.start(this.backoffFactory); + this.backoff.emit('backoff', 3, 1234, err); + + test.ok(this.backoff.backoff.calledWith(err), + 'The backoff instance should have been called with the error.'); + test.equal(1, backoffSpy.callCount, + 'Backoff event should have been emitted 1 time.'); + test.deepEqual([3, 1234, err], backoffSpy.firstCall.args, + 'Backoff event should carry the backoff number, delay and error.'); + test.done(); + } +}; diff --git a/node_modules/balanced-match/.npmignore b/node_modules/balanced-match/.npmignore new file mode 100644 index 0000000..ae5d8c3 --- /dev/null +++ b/node_modules/balanced-match/.npmignore @@ -0,0 +1,5 @@ +test +.gitignore +.travis.yml +Makefile +example.js diff --git a/node_modules/balanced-match/LICENSE.md b/node_modules/balanced-match/LICENSE.md new file mode 100644 index 0000000..2cdc8e4 --- /dev/null +++ b/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/balanced-match/README.md b/node_modules/balanced-match/README.md new file mode 100644 index 0000000..08e918c --- /dev/null +++ b/node_modules/balanced-match/README.md @@ -0,0 +1,91 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/balanced-match/index.js b/node_modules/balanced-match/index.js new file mode 100644 index 0000000..1685a76 --- /dev/null +++ b/node_modules/balanced-match/index.js @@ -0,0 +1,59 @@ +'use strict'; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json new file mode 100644 index 0000000..7e0820d --- /dev/null +++ b/node_modules/balanced-match/package.json @@ -0,0 +1,77 @@ +{ + "_from": "balanced-match@^1.0.0", + "_id": "balanced-match@1.0.0", + "_inBundle": false, + "_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "_location": "/balanced-match", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "balanced-match@^1.0.0", + "name": "balanced-match", + "escapedName": "balanced-match", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767", + "_spec": "balanced-match@^1.0.0", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/brace-expansion", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "main": "index.js", + "name": "balanced-match", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "bench": "make bench", + "test": "make test" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.0.0" +} diff --git a/node_modules/base64-arraybuffer/.npmignore b/node_modules/base64-arraybuffer/.npmignore new file mode 100644 index 0000000..332ee5a --- /dev/null +++ b/node_modules/base64-arraybuffer/.npmignore @@ -0,0 +1,3 @@ +/node_modules/ +Gruntfile.js +/test/ diff --git a/node_modules/base64-arraybuffer/.travis.yml b/node_modules/base64-arraybuffer/.travis.yml new file mode 100644 index 0000000..19259a5 --- /dev/null +++ b/node_modules/base64-arraybuffer/.travis.yml @@ -0,0 +1,19 @@ +language: node_js +node_js: +- '0.12' +- iojs-1 +- iojs-2 +- iojs-3 +- '4.1' +before_script: +- npm install +before_install: npm install -g npm@'>=2.13.5' +deploy: + provider: npm + email: niklasvh@gmail.com + api_key: + secure: oHV9ArprTj5WOk7MP1UF7QMJ70huXw+y7xXb5wF4+V2H8Hyfa5TfE0DiOmqrube1WXTeH1FLgq54shp/sJWi47Hkg/GyeoB5NnsPhYEaJkaON9UG5blML+ODiNVsEnq/1kNBQ8e0+0JItMPLGySKyFmuZ3yflulXKS8O88mfINo= + on: + tags: true + branch: master + repo: niklasvh/base64-arraybuffer diff --git a/node_modules/base64-arraybuffer/LICENSE-MIT b/node_modules/base64-arraybuffer/LICENSE-MIT new file mode 100644 index 0000000..ed27b41 --- /dev/null +++ b/node_modules/base64-arraybuffer/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2012 Niklas von Hertzen + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/base64-arraybuffer/README.md b/node_modules/base64-arraybuffer/README.md new file mode 100644 index 0000000..50009e4 --- /dev/null +++ b/node_modules/base64-arraybuffer/README.md @@ -0,0 +1,20 @@ +# base64-arraybuffer + +[![Build Status](https://travis-ci.org/niklasvh/base64-arraybuffer.png)](https://travis-ci.org/niklasvh/base64-arraybuffer) +[![NPM Downloads](https://img.shields.io/npm/dm/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer) +[![NPM Version](https://img.shields.io/npm/v/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer) + +Encode/decode base64 data into ArrayBuffers + +## Getting Started +Install the module with: `npm install base64-arraybuffer` + +## API +The library encodes and decodes base64 to and from ArrayBuffers + + - __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string + - __decode(str)__ - Decodes base64 string to `ArrayBuffer` + +## License +Copyright (c) 2012 Niklas von Hertzen +Licensed under the MIT license. diff --git a/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js b/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js new file mode 100644 index 0000000..e6b6306 --- /dev/null +++ b/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js @@ -0,0 +1,67 @@ +/* + * base64-arraybuffer + * https://github.com/niklasvh/base64-arraybuffer + * + * Copyright (c) 2012 Niklas von Hertzen + * Licensed under the MIT license. + */ +(function(){ + "use strict"; + + var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + // Use a lookup table to find the index. + var lookup = new Uint8Array(256); + for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; + } + + exports.encode = function(arraybuffer) { + var bytes = new Uint8Array(arraybuffer), + i, len = bytes.length, base64 = ""; + + for (i = 0; i < len; i+=3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + + if ((len % 3) === 2) { + base64 = base64.substring(0, base64.length - 1) + "="; + } else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + "=="; + } + + return base64; + }; + + exports.decode = function(base64) { + var bufferLength = base64.length * 0.75, + len = base64.length, i, p = 0, + encoded1, encoded2, encoded3, encoded4; + + if (base64[base64.length - 1] === "=") { + bufferLength--; + if (base64[base64.length - 2] === "=") { + bufferLength--; + } + } + + var arraybuffer = new ArrayBuffer(bufferLength), + bytes = new Uint8Array(arraybuffer); + + for (i = 0; i < len; i+=4) { + encoded1 = lookup[base64.charCodeAt(i)]; + encoded2 = lookup[base64.charCodeAt(i+1)]; + encoded3 = lookup[base64.charCodeAt(i+2)]; + encoded4 = lookup[base64.charCodeAt(i+3)]; + + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); + } + + return arraybuffer; + }; +})(); diff --git a/node_modules/base64-arraybuffer/package.json b/node_modules/base64-arraybuffer/package.json new file mode 100644 index 0000000..13e0940 --- /dev/null +++ b/node_modules/base64-arraybuffer/package.json @@ -0,0 +1,65 @@ +{ + "_from": "base64-arraybuffer@0.1.5", + "_id": "base64-arraybuffer@0.1.5", + "_inBundle": false, + "_integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", + "_location": "/base64-arraybuffer", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "base64-arraybuffer@0.1.5", + "name": "base64-arraybuffer", + "escapedName": "base64-arraybuffer", + "rawSpec": "0.1.5", + "saveSpec": null, + "fetchSpec": "0.1.5" + }, + "_requiredBy": [ + "/engine.io-parser", + "/socket.io-client" + ], + "_resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "_shasum": "73926771923b5a19747ad666aa5cd4bf9c6e9ce8", + "_spec": "base64-arraybuffer@0.1.5", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/socket.io-client", + "author": { + "name": "Niklas von Hertzen", + "email": "niklasvh@gmail.com", + "url": "http://hertzen.com" + }, + "bugs": { + "url": "https://github.com/niklasvh/base64-arraybuffer/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Encode/decode base64 data into ArrayBuffers", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-cli": "^0.1.13", + "grunt-contrib-jshint": "^0.11.2", + "grunt-contrib-nodeunit": "^0.4.1", + "grunt-contrib-watch": "^0.6.1" + }, + "engines": { + "node": ">= 0.6.0" + }, + "homepage": "https://github.com/niklasvh/base64-arraybuffer", + "keywords": [], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/niklasvh/base64-arraybuffer/blob/master/LICENSE-MIT" + } + ], + "main": "lib/base64-arraybuffer", + "name": "base64-arraybuffer", + "repository": { + "type": "git", + "url": "git+https://github.com/niklasvh/base64-arraybuffer.git" + }, + "scripts": { + "test": "grunt nodeunit" + }, + "version": "0.1.5" +} diff --git a/node_modules/bcrypt-pbkdf/CONTRIBUTING.md b/node_modules/bcrypt-pbkdf/CONTRIBUTING.md new file mode 100644 index 0000000..401d34e --- /dev/null +++ b/node_modules/bcrypt-pbkdf/CONTRIBUTING.md @@ -0,0 +1,13 @@ +# Contributing + +This repository uses [cr.joyent.us](https://cr.joyent.us) (Gerrit) for new +changes. Anyone can submit changes. To get started, see the [cr.joyent.us user +guide](https://github.com/joyent/joyent-gerrit/blob/master/docs/user/README.md). +This repo does not use GitHub pull requests. + +See the [Joyent Engineering +Guidelines](https://github.com/joyent/eng/blob/master/docs/index.md) for general +best practices expected in this repository. + +If you're changing something non-trivial or user-facing, you may want to submit +an issue first. diff --git a/node_modules/bcrypt-pbkdf/LICENSE b/node_modules/bcrypt-pbkdf/LICENSE new file mode 100644 index 0000000..fc58d2a --- /dev/null +++ b/node_modules/bcrypt-pbkdf/LICENSE @@ -0,0 +1,66 @@ +The Blowfish portions are under the following license: + +Blowfish block cipher for OpenBSD +Copyright 1997 Niels Provos +All rights reserved. + +Implementation advice by David Mazieres . + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +The bcrypt_pbkdf portions are under the following license: + +Copyright (c) 2013 Ted Unangst + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + + +Performance improvements (Javascript-specific): + +Copyright 2016, Joyent Inc +Author: Alex Wilson + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/bcrypt-pbkdf/README.md b/node_modules/bcrypt-pbkdf/README.md new file mode 100644 index 0000000..7551f33 --- /dev/null +++ b/node_modules/bcrypt-pbkdf/README.md @@ -0,0 +1,45 @@ +Port of the OpenBSD `bcrypt_pbkdf` function to pure Javascript. `npm`-ified +version of [Devi Mandiri's port](https://github.com/devi/tmp/blob/master/js/bcrypt_pbkdf.js), +with some minor performance improvements. The code is copied verbatim (and +un-styled) from Devi's work. + +This product includes software developed by Niels Provos. + +## API + +### `bcrypt_pbkdf.pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds)` + +Derive a cryptographic key of arbitrary length from a given password and salt, +using the OpenBSD `bcrypt_pbkdf` function. This is a combination of Blowfish and +SHA-512. + +See [this article](http://www.tedunangst.com/flak/post/bcrypt-pbkdf) for +further information. + +Parameters: + + * `pass`, a Uint8Array of length `passlen` + * `passlen`, an integer Number + * `salt`, a Uint8Array of length `saltlen` + * `saltlen`, an integer Number + * `key`, a Uint8Array of length `keylen`, will be filled with output + * `keylen`, an integer Number + * `rounds`, an integer Number, number of rounds of the PBKDF to run + +### `bcrypt_pbkdf.hash(sha2pass, sha2salt, out)` + +Calculate a Blowfish hash, given SHA2-512 output of a password and salt. Used as +part of the inner round function in the PBKDF. + +Parameters: + + * `sha2pass`, a Uint8Array of length 64 + * `sha2salt`, a Uint8Array of length 64 + * `out`, a Uint8Array of length 32, will be filled with output + +## License + +This source form is a 1:1 port from the OpenBSD `blowfish.c` and `bcrypt_pbkdf.c`. +As a result, it retains the original copyright and license. The two files are +under slightly different (but compatible) licenses, and are here combined in +one file. For each of the full license texts see `LICENSE`. diff --git a/node_modules/bcrypt-pbkdf/index.js b/node_modules/bcrypt-pbkdf/index.js new file mode 100644 index 0000000..b1b5ad4 --- /dev/null +++ b/node_modules/bcrypt-pbkdf/index.js @@ -0,0 +1,556 @@ +'use strict'; + +var crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash; + +/* + * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a + * result, it retains the original copyright and license. The two files are + * under slightly different (but compatible) licenses, and are here combined in + * one file. + * + * Credit for the actual porting work goes to: + * Devi Mandiri + */ + +/* + * The Blowfish portions are under the following license: + * + * Blowfish block cipher for OpenBSD + * Copyright 1997 Niels Provos + * All rights reserved. + * + * Implementation advice by David Mazieres . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * The bcrypt_pbkdf portions are under the following license: + * + * Copyright (c) 2013 Ted Unangst + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Performance improvements (Javascript-specific): + * + * Copyright 2016, Joyent Inc + * Author: Alex Wilson + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +// Ported from OpenBSD bcrypt_pbkdf.c v1.9 + +var BLF_J = 0; + +var Blowfish = function() { + this.S = [ + new Uint32Array([ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]), + new Uint32Array([ + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]), + new Uint32Array([ + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]), + new Uint32Array([ + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6]) + ]; + this.P = new Uint32Array([ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b]); +}; + +function F(S, x8, i) { + return (((S[0][x8[i+3]] + + S[1][x8[i+2]]) ^ + S[2][x8[i+1]]) + + S[3][x8[i]]); +}; + +Blowfish.prototype.encipher = function(x, x8) { + if (x8 === undefined) { + x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + } + x[0] ^= this.P[0]; + for (var i = 1; i < 16; i += 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i+1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[17]; + x[1] = t; +}; + +Blowfish.prototype.decipher = function(x) { + var x8 = new Uint8Array(x.buffer); + if (x.byteOffset !== 0) + x8 = x8.subarray(x.byteOffset); + x[0] ^= this.P[17]; + for (var i = 16; i > 0; i -= 2) { + x[1] ^= F(this.S, x8, 0) ^ this.P[i]; + x[0] ^= F(this.S, x8, 4) ^ this.P[i-1]; + } + var t = x[0]; + x[0] = x[1] ^ this.P[0]; + x[1] = t; +}; + +function stream2word(data, databytes){ + var i, temp = 0; + for (i = 0; i < 4; i++, BLF_J++) { + if (BLF_J >= databytes) BLF_J = 0; + temp = (temp << 8) | data[BLF_J]; + } + return temp; +}; + +Blowfish.prototype.expand0state = function(key, keybytes) { + var d = new Uint32Array(2), i, k; + var d8 = new Uint8Array(d.buffer); + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + BLF_J = 0; + + for (i = 0; i < 18; i += 2) { + this.encipher(d, d8); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + this.encipher(d, d8); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } +}; + +Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) { + var d = new Uint32Array(2), i, k; + + for (i = 0, BLF_J = 0; i < 18; i++) { + this.P[i] ^= stream2word(key, keybytes); + } + + for (i = 0, BLF_J = 0; i < 18; i += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.P[i] = d[0]; + this.P[i+1] = d[1]; + } + + for (i = 0; i < 4; i++) { + for (k = 0; k < 256; k += 2) { + d[0] ^= stream2word(data, databytes); + d[1] ^= stream2word(data, databytes); + this.encipher(d); + this.S[i][k] = d[0]; + this.S[i][k+1] = d[1]; + } + } + BLF_J = 0; +}; + +Blowfish.prototype.enc = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.encipher(data.subarray(i*2)); + } +}; + +Blowfish.prototype.dec = function(data, blocks) { + for (var i = 0; i < blocks; i++) { + this.decipher(data.subarray(i*2)); + } +}; + +var BCRYPT_BLOCKS = 8, + BCRYPT_HASHSIZE = 32; + +function bcrypt_hash(sha2pass, sha2salt, out) { + var state = new Blowfish(), + cdata = new Uint32Array(BCRYPT_BLOCKS), i, + ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105, + 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109, + 105,116,101]); //"OxychromaticBlowfishSwatDynamite" + + state.expandstate(sha2salt, 64, sha2pass, 64); + for (i = 0; i < 64; i++) { + state.expand0state(sha2salt, 64); + state.expand0state(sha2pass, 64); + } + + for (i = 0; i < BCRYPT_BLOCKS; i++) + cdata[i] = stream2word(ciphertext, ciphertext.byteLength); + for (i = 0; i < 64; i++) + state.enc(cdata, cdata.byteLength / 8); + + for (i = 0; i < BCRYPT_BLOCKS; i++) { + out[4*i+3] = cdata[i] >>> 24; + out[4*i+2] = cdata[i] >>> 16; + out[4*i+1] = cdata[i] >>> 8; + out[4*i+0] = cdata[i]; + } +}; + +function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) { + var sha2pass = new Uint8Array(64), + sha2salt = new Uint8Array(64), + out = new Uint8Array(BCRYPT_HASHSIZE), + tmpout = new Uint8Array(BCRYPT_HASHSIZE), + countsalt = new Uint8Array(saltlen+4), + i, j, amt, stride, dest, count, + origkeylen = keylen; + + if (rounds < 1) + return -1; + if (passlen === 0 || saltlen === 0 || keylen === 0 || + keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20)) + return -1; + + stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength); + amt = Math.floor((keylen + stride - 1) / stride); + + for (i = 0; i < saltlen; i++) + countsalt[i] = salt[i]; + + crypto_hash_sha512(sha2pass, pass, passlen); + + for (count = 1; keylen > 0; count++) { + countsalt[saltlen+0] = count >>> 24; + countsalt[saltlen+1] = count >>> 16; + countsalt[saltlen+2] = count >>> 8; + countsalt[saltlen+3] = count; + + crypto_hash_sha512(sha2salt, countsalt, saltlen + 4); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (i = out.byteLength; i--;) + out[i] = tmpout[i]; + + for (i = 1; i < rounds; i++) { + crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength); + bcrypt_hash(sha2pass, sha2salt, tmpout); + for (j = 0; j < out.byteLength; j++) + out[j] ^= tmpout[j]; + } + + amt = Math.min(amt, keylen); + for (i = 0; i < amt; i++) { + dest = i * stride + (count - 1); + if (dest >= origkeylen) + break; + key[dest] = out[i]; + } + keylen -= i; + } + + return 0; +}; + +module.exports = { + BLOCKS: BCRYPT_BLOCKS, + HASHSIZE: BCRYPT_HASHSIZE, + hash: bcrypt_hash, + pbkdf: bcrypt_pbkdf +}; diff --git a/node_modules/bcrypt-pbkdf/package.json b/node_modules/bcrypt-pbkdf/package.json new file mode 100644 index 0000000..7f12291 --- /dev/null +++ b/node_modules/bcrypt-pbkdf/package.json @@ -0,0 +1,44 @@ +{ + "_from": "bcrypt-pbkdf@^1.0.0", + "_id": "bcrypt-pbkdf@1.0.2", + "_inBundle": false, + "_integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "_location": "/bcrypt-pbkdf", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bcrypt-pbkdf@^1.0.0", + "name": "bcrypt-pbkdf", + "escapedName": "bcrypt-pbkdf", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/sshpk" + ], + "_resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "_shasum": "a4301d389b6a43f9b67ff3ca11a3f6637e360e9e", + "_spec": "bcrypt-pbkdf@^1.0.0", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/sshpk", + "bugs": { + "url": "https://github.com/joyent/node-bcrypt-pbkdf/issues" + }, + "bundleDependencies": false, + "dependencies": { + "tweetnacl": "^0.14.3" + }, + "deprecated": false, + "description": "Port of the OpenBSD bcrypt_pbkdf function to pure JS", + "devDependencies": {}, + "homepage": "https://github.com/joyent/node-bcrypt-pbkdf#readme", + "license": "BSD-3-Clause", + "main": "index.js", + "name": "bcrypt-pbkdf", + "repository": { + "type": "git", + "url": "git://github.com/joyent/node-bcrypt-pbkdf.git" + }, + "version": "1.0.2" +} diff --git a/node_modules/better-assert/.npmignore b/node_modules/better-assert/.npmignore new file mode 100644 index 0000000..f1250e5 --- /dev/null +++ b/node_modules/better-assert/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/node_modules/better-assert/History.md b/node_modules/better-assert/History.md new file mode 100644 index 0000000..cbb579b --- /dev/null +++ b/node_modules/better-assert/History.md @@ -0,0 +1,15 @@ + +1.0.0 / 2013-02-03 +================== + + * Stop using the removed magic __stack global getter + +0.1.0 / 2012-10-04 +================== + + * add throwing of AssertionError for test frameworks etc + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/better-assert/Makefile b/node_modules/better-assert/Makefile new file mode 100644 index 0000000..36a3ed7 --- /dev/null +++ b/node_modules/better-assert/Makefile @@ -0,0 +1,5 @@ + +test: + @echo "populate me" + +.PHONY: test \ No newline at end of file diff --git a/node_modules/better-assert/Readme.md b/node_modules/better-assert/Readme.md new file mode 100644 index 0000000..d8d3a63 --- /dev/null +++ b/node_modules/better-assert/Readme.md @@ -0,0 +1,61 @@ + +# better-assert + + Better c-style assertions using [callsite](https://github.com/visionmedia/callsite) for + self-documenting failure messages. + +## Installation + + $ npm install better-assert + +## Example + + By default assertions are enabled, however the __NO_ASSERT__ environment variable + will deactivate them when truthy. + +```js +var assert = require('better-assert'); + +test(); + +function test() { + var user = { name: 'tobi' }; + assert('tobi' == user.name); + assert('number' == typeof user.age); +} + +AssertionError: 'number' == typeof user.age + at test (/Users/tj/projects/better-assert/example.js:9:3) + at Object. (/Users/tj/projects/better-assert/example.js:4:1) + at Module._compile (module.js:449:26) + at Object.Module._extensions..js (module.js:467:10) + at Module.load (module.js:356:32) + at Function.Module._load (module.js:312:12) + at Module.runMain (module.js:492:10) + at process.startup.processNextTick.process._tickCallback (node.js:244:9) +``` + +## License + +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/better-assert/example.js b/node_modules/better-assert/example.js new file mode 100644 index 0000000..688c29e --- /dev/null +++ b/node_modules/better-assert/example.js @@ -0,0 +1,10 @@ + +var assert = require('./'); + +test(); + +function test() { + var user = { name: 'tobi' }; + assert('tobi' == user.name); + assert('number' == typeof user.age); +} \ No newline at end of file diff --git a/node_modules/better-assert/index.js b/node_modules/better-assert/index.js new file mode 100644 index 0000000..fd1c9b7 --- /dev/null +++ b/node_modules/better-assert/index.js @@ -0,0 +1,38 @@ +/** + * Module dependencies. + */ + +var AssertionError = require('assert').AssertionError + , callsite = require('callsite') + , fs = require('fs') + +/** + * Expose `assert`. + */ + +module.exports = process.env.NO_ASSERT + ? function(){} + : assert; + +/** + * Assert the given `expr`. + */ + +function assert(expr) { + if (expr) return; + + var stack = callsite(); + var call = stack[1]; + var file = call.getFileName(); + var lineno = call.getLineNumber(); + var src = fs.readFileSync(file, 'utf8'); + var line = src.split('\n')[lineno-1]; + var src = line.match(/assert\((.*)\)/)[1]; + + var err = new AssertionError({ + message: src, + stackStartFunction: stack[0].getFunction() + }); + + throw err; +} diff --git a/node_modules/better-assert/package.json b/node_modules/better-assert/package.json new file mode 100644 index 0000000..bae9f95 --- /dev/null +++ b/node_modules/better-assert/package.json @@ -0,0 +1,65 @@ +{ + "_from": "better-assert@~1.0.0", + "_id": "better-assert@1.0.2", + "_inBundle": false, + "_integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "_location": "/better-assert", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "better-assert@~1.0.0", + "name": "better-assert", + "escapedName": "better-assert", + "rawSpec": "~1.0.0", + "saveSpec": null, + "fetchSpec": "~1.0.0" + }, + "_requiredBy": [ + "/parseqs", + "/parseuri" + ], + "_resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "_shasum": "40866b9e1b9e0b55b481894311e68faffaebc522", + "_spec": "better-assert@~1.0.0", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/parseqs", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "bugs": { + "url": "https://github.com/visionmedia/better-assert/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "TonyHe", + "email": "coolhzb@163.com" + }, + { + "name": "ForbesLindesay" + } + ], + "dependencies": { + "callsite": "1.0.0" + }, + "deprecated": false, + "description": "Better assertions for node, reporting the expr, filename, lineno etc", + "engines": { + "node": "*" + }, + "homepage": "https://github.com/visionmedia/better-assert#readme", + "keywords": [ + "assert", + "stack", + "trace", + "debug" + ], + "main": "index", + "name": "better-assert", + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/better-assert.git" + }, + "version": "1.0.2" +} diff --git a/node_modules/bindings/LICENSE.md b/node_modules/bindings/LICENSE.md new file mode 100644 index 0000000..5a92289 --- /dev/null +++ b/node_modules/bindings/LICENSE.md @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/bindings/README.md b/node_modules/bindings/README.md new file mode 100644 index 0000000..5b3e7a8 --- /dev/null +++ b/node_modules/bindings/README.md @@ -0,0 +1,98 @@ +node-bindings +============= +### Helper module for loading your native module's `.node` file + +This is a helper module for authors of Node.js native addon modules. +It is basically the "swiss army knife" of `require()`ing your native module's +`.node` file. + +Throughout the course of Node's native addon history, addons have ended up being +compiled in a variety of different places, depending on which build tool and which +version of node was used. To make matters worse, now the `gyp` build tool can +produce either a __Release__ or __Debug__ build, each being built into different +locations. + +This module checks _all_ the possible locations that a native addon would be built +at, and returns the first one that loads successfully. + + +Installation +------------ + +Install with `npm`: + +``` bash +$ npm install --save bindings +``` + +Or add it to the `"dependencies"` section of your `package.json` file. + + +Example +------- + +`require()`ing the proper bindings file for the current node version, platform +and architecture is as simple as: + +``` js +var bindings = require('bindings')('binding.node') + +// Use your bindings defined in your C files +bindings.your_c_function() +``` + + +Nice Error Output +----------------- + +When the `.node` file could not be loaded, `node-bindings` throws an Error with +a nice error message telling you exactly what was tried. You can also check the +`err.tries` Array property. + +``` +Error: Could not load the bindings file. Tried: + → /Users/nrajlich/ref/build/binding.node + → /Users/nrajlich/ref/build/Debug/binding.node + → /Users/nrajlich/ref/build/Release/binding.node + → /Users/nrajlich/ref/out/Debug/binding.node + → /Users/nrajlich/ref/Debug/binding.node + → /Users/nrajlich/ref/out/Release/binding.node + → /Users/nrajlich/ref/Release/binding.node + → /Users/nrajlich/ref/build/default/binding.node + → /Users/nrajlich/ref/compiled/0.8.2/darwin/x64/binding.node + at bindings (/Users/nrajlich/ref/node_modules/bindings/bindings.js:84:13) + at Object. (/Users/nrajlich/ref/lib/ref.js:5:47) + at Module._compile (module.js:449:26) + at Object.Module._extensions..js (module.js:467:10) + at Module.load (module.js:356:32) + at Function.Module._load (module.js:312:12) + ... +``` + +The searching for the `.node` file will originate from the first directory in which has a `package.json` file is found. + +License +------- + +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/bindings/bindings.js b/node_modules/bindings/bindings.js new file mode 100644 index 0000000..727413a --- /dev/null +++ b/node_modules/bindings/bindings.js @@ -0,0 +1,221 @@ +/** + * Module dependencies. + */ + +var fs = require('fs'), + path = require('path'), + fileURLToPath = require('file-uri-to-path'), + join = path.join, + dirname = path.dirname, + exists = + (fs.accessSync && + function(path) { + try { + fs.accessSync(path); + } catch (e) { + return false; + } + return true; + }) || + fs.existsSync || + path.existsSync, + defaults = { + arrow: process.env.NODE_BINDINGS_ARROW || ' → ', + compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled', + platform: process.platform, + arch: process.arch, + nodePreGyp: + 'node-v' + + process.versions.modules + + '-' + + process.platform + + '-' + + process.arch, + version: process.versions.node, + bindings: 'bindings.node', + try: [ + // node-gyp's linked version in the "build" dir + ['module_root', 'build', 'bindings'], + // node-waf and gyp_addon (a.k.a node-gyp) + ['module_root', 'build', 'Debug', 'bindings'], + ['module_root', 'build', 'Release', 'bindings'], + // Debug files, for development (legacy behavior, remove for node v0.9) + ['module_root', 'out', 'Debug', 'bindings'], + ['module_root', 'Debug', 'bindings'], + // Release files, but manually compiled (legacy behavior, remove for node v0.9) + ['module_root', 'out', 'Release', 'bindings'], + ['module_root', 'Release', 'bindings'], + // Legacy from node-waf, node <= 0.4.x + ['module_root', 'build', 'default', 'bindings'], + // Production "Release" buildtype binary (meh...) + ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'], + // node-qbs builds + ['module_root', 'addon-build', 'release', 'install-root', 'bindings'], + ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'], + ['module_root', 'addon-build', 'default', 'install-root', 'bindings'], + // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch} + ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings'] + ] + }; + +/** + * The main `bindings()` function loads the compiled bindings for a given module. + * It uses V8's Error API to determine the parent filename that this function is + * being invoked from, which is then used to find the root directory. + */ + +function bindings(opts) { + // Argument surgery + if (typeof opts == 'string') { + opts = { bindings: opts }; + } else if (!opts) { + opts = {}; + } + + // maps `defaults` onto `opts` object + Object.keys(defaults).map(function(i) { + if (!(i in opts)) opts[i] = defaults[i]; + }); + + // Get the module root + if (!opts.module_root) { + opts.module_root = exports.getRoot(exports.getFileName()); + } + + // Ensure the given bindings name ends with .node + if (path.extname(opts.bindings) != '.node') { + opts.bindings += '.node'; + } + + // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035 + var requireFunc = + typeof __webpack_require__ === 'function' + ? __non_webpack_require__ + : require; + + var tries = [], + i = 0, + l = opts.try.length, + n, + b, + err; + + for (; i < l; i++) { + n = join.apply( + null, + opts.try[i].map(function(p) { + return opts[p] || p; + }) + ); + tries.push(n); + try { + b = opts.path ? requireFunc.resolve(n) : requireFunc(n); + if (!opts.path) { + b.path = n; + } + return b; + } catch (e) { + if (e.code !== 'MODULE_NOT_FOUND' && + e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' && + !/not find/i.test(e.message)) { + throw e; + } + } + } + + err = new Error( + 'Could not locate the bindings file. Tried:\n' + + tries + .map(function(a) { + return opts.arrow + a; + }) + .join('\n') + ); + err.tries = tries; + throw err; +} +module.exports = exports = bindings; + +/** + * Gets the filename of the JavaScript file that invokes this function. + * Used to help find the root directory of a module. + * Optionally accepts an filename argument to skip when searching for the invoking filename + */ + +exports.getFileName = function getFileName(calling_file) { + var origPST = Error.prepareStackTrace, + origSTL = Error.stackTraceLimit, + dummy = {}, + fileName; + + Error.stackTraceLimit = 10; + + Error.prepareStackTrace = function(e, st) { + for (var i = 0, l = st.length; i < l; i++) { + fileName = st[i].getFileName(); + if (fileName !== __filename) { + if (calling_file) { + if (fileName !== calling_file) { + return; + } + } else { + return; + } + } + } + }; + + // run the 'prepareStackTrace' function above + Error.captureStackTrace(dummy); + dummy.stack; + + // cleanup + Error.prepareStackTrace = origPST; + Error.stackTraceLimit = origSTL; + + // handle filename that starts with "file://" + var fileSchema = 'file://'; + if (fileName.indexOf(fileSchema) === 0) { + fileName = fileURLToPath(fileName); + } + + return fileName; +}; + +/** + * Gets the root directory of a module, given an arbitrary filename + * somewhere in the module tree. The "root directory" is the directory + * containing the `package.json` file. + * + * In: /home/nate/node-native-module/lib/index.js + * Out: /home/nate/node-native-module + */ + +exports.getRoot = function getRoot(file) { + var dir = dirname(file), + prev; + while (true) { + if (dir === '.') { + // Avoids an infinite loop in rare cases, like the REPL + dir = process.cwd(); + } + if ( + exists(join(dir, 'package.json')) || + exists(join(dir, 'node_modules')) + ) { + // Found the 'package.json' file or 'node_modules' dir; we're done + return dir; + } + if (prev === dir) { + // Got to the top + throw new Error( + 'Could not find module root given file: "' + + file + + '". Do you have a `package.json` file? ' + ); + } + // Try the parent dir next + prev = dir; + dir = join(dir, '..'); + } +}; diff --git a/node_modules/bindings/package.json b/node_modules/bindings/package.json new file mode 100644 index 0000000..5198ddc --- /dev/null +++ b/node_modules/bindings/package.json @@ -0,0 +1,59 @@ +{ + "_from": "bindings@^1.2.1", + "_id": "bindings@1.5.0", + "_inBundle": false, + "_integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "_location": "/bindings", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bindings@^1.2.1", + "name": "bindings", + "escapedName": "bindings", + "rawSpec": "^1.2.1", + "saveSpec": null, + "fetchSpec": "^1.2.1" + }, + "_requiredBy": [ + "/lame", + "/ref", + "/speaker" + ], + "_resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "_shasum": "10353c9e945334bc0511a6d90b38fbc7c9c504df", + "_spec": "bindings@^1.2.1", + "_where": "/home/sergiu/linx-audio-simulator/node_modules/lame", + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://tootallnate.net" + }, + "bugs": { + "url": "https://github.com/TooTallNate/node-bindings/issues" + }, + "bundleDependencies": false, + "dependencies": { + "file-uri-to-path": "1.0.0" + }, + "deprecated": false, + "description": "Helper module for loading your native module's .node file", + "homepage": "https://github.com/TooTallNate/node-bindings", + "keywords": [ + "native", + "addon", + "bindings", + "gyp", + "waf", + "c", + "c++" + ], + "license": "MIT", + "main": "./bindings.js", + "name": "bindings", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-bindings.git" + }, + "version": "1.5.0" +} diff --git a/node_modules/blob/.idea/blob.iml b/node_modules/blob/.idea/blob.iml new file mode 100644 index 0000000..0b872d8 --- /dev/null +++ b/node_modules/blob/.idea/blob.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/blob/.idea/inspectionProfiles/profiles_settings.xml b/node_modules/blob/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..0eefe32 --- /dev/null +++ b/node_modules/blob/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/node_modules/blob/.idea/markdown-navigator.xml b/node_modules/blob/.idea/markdown-navigator.xml new file mode 100644 index 0000000..24281af --- /dev/null +++ b/node_modules/blob/.idea/markdown-navigator.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/blob/.idea/markdown-navigator/profiles_settings.xml b/node_modules/blob/.idea/markdown-navigator/profiles_settings.xml new file mode 100644 index 0000000..9c51dfe --- /dev/null +++ b/node_modules/blob/.idea/markdown-navigator/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/node_modules/blob/.idea/modules.xml b/node_modules/blob/.idea/modules.xml new file mode 100644 index 0000000..a24a2af --- /dev/null +++ b/node_modules/blob/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/node_modules/blob/.idea/vcs.xml b/node_modules/blob/.idea/vcs.xml new file mode 100644 index 0000000..9661ac7 --- /dev/null +++ b/node_modules/blob/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/node_modules/blob/.idea/workspace.xml b/node_modules/blob/.idea/workspace.xml new file mode 100644 index 0000000..31e803b --- /dev/null +++ b/node_modules/blob/.idea/workspace.xml @@ -0,0 +1,390 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + esprima-six + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \"\n" + " or \"--preset cbr 192 \"\n" + " or \"--preset 172 \"\n" + " or \"--preset extreme \"\n" "\n" "\n"); + fprintf(msgfp, + "A few aliases are also available for ABR mode:\n" + "phone => 16kbps/mono phon+/lw/mw-eu/sw => 24kbps/mono\n" + "mw-us => 40kbps/mono voice => 56kbps/mono\n" + "fm/radio/tape => 112kbps hifi => 160kbps\n" + "cd => 192kbps studio => 256kbps\n"); +} + + +static int +presets_set(lame_t gfp, int fast, int cbr, const char *preset_name, const char *ProgramName) +{ + int mono = 0; + + if ((strcmp(preset_name, "help") == 0) && (fast < 1) + && (cbr < 1)) { + lame_version_print(stdout); + presets_longinfo_dm(stdout); + return -1; + } + + /*aliases for compatibility with old presets */ + + if (strcmp(preset_name, "phone") == 0) { + preset_name = "16"; + mono = 1; + } + if ((strcmp(preset_name, "phon+") == 0) || + (strcmp(preset_name, "lw") == 0) || + (strcmp(preset_name, "mw-eu") == 0) || (strcmp(preset_name, "sw") == 0)) { + preset_name = "24"; + mono = 1; + } + if (strcmp(preset_name, "mw-us") == 0) { + preset_name = "40"; + mono = 1; + } + if (strcmp(preset_name, "voice") == 0) { + preset_name = "56"; + mono = 1; + } + if (strcmp(preset_name, "fm") == 0) { + preset_name = "112"; + } + if ((strcmp(preset_name, "radio") == 0) || (strcmp(preset_name, "tape") == 0)) { + preset_name = "112"; + } + if (strcmp(preset_name, "hifi") == 0) { + preset_name = "160"; + } + if (strcmp(preset_name, "cd") == 0) { + preset_name = "192"; + } + if (strcmp(preset_name, "studio") == 0) { + preset_name = "256"; + } + + if (strcmp(preset_name, "medium") == 0) { + lame_set_VBR_q(gfp, 4); + lame_set_VBR(gfp, vbr_default); + return 0; + } + + if (strcmp(preset_name, "standard") == 0) { + lame_set_VBR_q(gfp, 2); + lame_set_VBR(gfp, vbr_default); + return 0; + } + + else if (strcmp(preset_name, "extreme") == 0) { + lame_set_VBR_q(gfp, 0); + lame_set_VBR(gfp, vbr_default); + return 0; + } + + else if ((strcmp(preset_name, "insane") == 0) && (fast < 1)) { + + lame_set_preset(gfp, INSANE); + + return 0; + } + + /* Generic ABR Preset */ + if (((atoi(preset_name)) > 0) && (fast < 1)) { + if ((atoi(preset_name)) >= 8 && (atoi(preset_name)) <= 320) { + lame_set_preset(gfp, atoi(preset_name)); + + if (cbr == 1) + lame_set_VBR(gfp, vbr_off); + + if (mono == 1) { + lame_set_mode(gfp, MONO); + } + + return 0; + + } + else { + lame_version_print(Console_IO.Error_fp); + error_printf("Error: The bitrate specified is out of the valid range for this preset\n" + "\n" + "When using this mode you must enter a value between \"32\" and \"320\"\n" + "\n" "For further information try: \"%s --preset help\"\n", ProgramName); + return -1; + } + } + + lame_version_print(Console_IO.Error_fp); + error_printf("Error: You did not enter a valid profile and/or options with --preset\n" + "\n" + "Available profiles are:\n" + "\n" + " medium\n" + " standard\n" + " extreme\n" + " insane\n" + " (ABR Mode) - The ABR Mode is implied. To use it,\n" + " simply specify a bitrate. For example:\n" + " \"--preset 185\" activates this\n" + " preset and uses 185 as an average kbps.\n" "\n"); + error_printf(" Some examples:\n" + "\n" + " or \"%s --preset standard \"\n" + " or \"%s --preset cbr 192 \"\n" + " or \"%s --preset 172 \"\n" + " or \"%s --preset extreme \"\n" + "\n" + "For further information try: \"%s --preset help\"\n", ProgramName, ProgramName, + ProgramName, ProgramName, ProgramName); + return -1; +} + +static void +genre_list_handler(int num, const char *name, void *cookie) +{ + (void) cookie; + console_printf("%3d %s\n", num, name); +} + + +/************************************************************************ +* +* parse_args +* +* PURPOSE: Sets encoding parameters to the specifications of the +* command line. Default settings are used for parameters +* not specified in the command line. +* +* If the input file is in WAVE or AIFF format, the sampling frequency is read +* from the AIFF header. +* +* The input and output filenames are read into #inpath# and #outpath#. +* +************************************************************************/ + +/* would use real "strcasecmp" but it isn't portable */ +static int +local_strcasecmp(const char *s1, const char *s2) +{ + unsigned char c1; + unsigned char c2; + + do { + c1 = (unsigned char) tolower(*s1); + c2 = (unsigned char) tolower(*s2); + if (!c1) { + break; + } + ++s1; + ++s2; + } while (c1 == c2); + return c1 - c2; +} + +static int +local_strncasecmp(const char *s1, const char *s2, int n) +{ + unsigned char c1 = 0; + unsigned char c2 = 0; + int cnt = 0; + + do { + if (cnt == n) { + break; + } + c1 = (unsigned char) tolower(*s1); + c2 = (unsigned char) tolower(*s2); + if (!c1) { + break; + } + ++s1; + ++s2; + ++cnt; + } while (c1 == c2); + return c1 - c2; +} + + + +/* LAME is a simple frontend which just uses the file extension */ +/* to determine the file type. Trying to analyze the file */ +/* contents is well beyond the scope of LAME and should not be added. */ +static int +filename_to_type(const char *FileName) +{ + size_t len = strlen(FileName); + + if (len < 4) + return sf_unknown; + + FileName += len - 4; + if (0 == local_strcasecmp(FileName, ".mpg")) + return sf_mp123; + if (0 == local_strcasecmp(FileName, ".mp1")) + return sf_mp123; + if (0 == local_strcasecmp(FileName, ".mp2")) + return sf_mp123; + if (0 == local_strcasecmp(FileName, ".mp3")) + return sf_mp123; + if (0 == local_strcasecmp(FileName, ".wav")) + return sf_wave; + if (0 == local_strcasecmp(FileName, ".aif")) + return sf_aiff; + if (0 == local_strcasecmp(FileName, ".raw")) + return sf_raw; + if (0 == local_strcasecmp(FileName, ".ogg")) + return sf_ogg; + return sf_unknown; +} + +static int +resample_rate(double freq) +{ + if (freq >= 1.e3) + freq *= 1.e-3; + + switch ((int) freq) { + case 8: + return 8000; + case 11: + return 11025; + case 12: + return 12000; + case 16: + return 16000; + case 22: + return 22050; + case 24: + return 24000; + case 32: + return 32000; + case 44: + return 44100; + case 48: + return 48000; + default: + error_printf("Illegal resample frequency: %.3f kHz\n", freq); + return 0; + } +} + +#ifdef _WIN32 +#define SLASH '\\' +#elif __OS2__ +#define SLASH '\\' +#else +#define SLASH '/' +#endif + +static +size_t scanPath(char const* s, char const** a, char const** b) +{ + char const* s1 = s; + char const* s2 = s; + if (s != 0) { + for (; *s; ++s) { + switch (*s) { + case SLASH: + case ':': + s2 = s; + break; + } + } + if (*s2 == ':') { + ++s2; + } + } + if (a) { + *a = s1; + } + if (b) { + *b = s2; + } + return s2-s1; +} + +static +size_t scanBasename(char const* s, char const** a, char const** b) +{ + char const* s1 = s; + char const* s2 = s; + if (s != 0) { + for (; *s; ++s) { + switch (*s) { + case SLASH: + case ':': + s1 = s2 = s; + break; + case '.': + s2 = s; + break; + } + } + if (s2 == s1) { + s2 = s; + } + if (*s1 == SLASH || *s1 == ':') { + ++s1; + } + } + if (a != 0) { + *a = s1; + } + if (b != 0) { + *b = s2; + } + return s2-s1; +} + +static +int isCommonSuffix(char const* s_ext) +{ + char const* suffixes[] = + { ".WAV", ".RAW", ".MP1", ".MP2" + , ".MP3", ".MPG", ".MPA", ".CDA" + , ".OGG", ".AIF", ".AIFF", ".AU" + , ".SND", ".FLAC", ".WV", ".OFR" + , ".TAK", ".MP4", ".M4A", ".PCM" + , ".W64" + }; + size_t i; + for (i = 0; i < dimension_of(suffixes); ++i) { + if (local_strcasecmp(s_ext, suffixes[i]) == 0) { + return 1; + } + } + return 0; +} + + +static +int generateOutPath(lame_t gfp, char const* inPath, char const* outDir, char* outPath) +{ + size_t const max_path = PATH_MAX; + char const* s_ext = lame_get_decode_only(gfp) ? ".wav" : ".mp3"; +#if 1 + size_t i = 0; + int out_dir_used = 0; + + if (outDir != 0 && outDir[0] != 0) { + out_dir_used = 1; + while (*outDir) { + outPath[i++] = *outDir++; + if (i >= max_path) { + goto err_generateOutPath; + } + } + if (i > 0 && outPath[i-1] != SLASH) { + outPath[i++] = SLASH; + if (i >= max_path) { + goto err_generateOutPath; + } + } + outPath[i] = 0; + } + else { + char const* pa; + char const* pb; + size_t j, n = scanPath(inPath, &pa, &pb); + if (i+n >= max_path) { + goto err_generateOutPath; + } + for (j = 0; j < n; ++j) { + outPath[i++] = pa[j]; + } + if (n > 0) { + outPath[i++] = SLASH; + if (i >= max_path) { + goto err_generateOutPath; + } + } + outPath[i] = 0; + } + { + int replace_suffix = 0; + char const* na; + char const* nb; + size_t j, n = scanBasename(inPath, &na, &nb); + if (i+n >= max_path) { + goto err_generateOutPath; + } + for (j = 0; j < n; ++j) { + outPath[i++] = na[j]; + } + outPath[i] = 0; + if (isCommonSuffix(nb) == 1) { + replace_suffix = 1; + if (out_dir_used == 0) { + if (local_strcasecmp(nb, s_ext) == 0) { + replace_suffix = 0; + } + } + } + if (replace_suffix == 0) { + while (*nb) { + outPath[i++] = *nb++; + if (i >= max_path) { + goto err_generateOutPath; + } + } + outPath[i] = 0; + } + } + if (i+5 >= max_path) { + goto err_generateOutPath; + } + while (*s_ext) { + outPath[i++] = *s_ext++; + } + outPath[i] = 0; + return 0; +err_generateOutPath: + error_printf( "error: output file name too long" ); + return 1; +#else + strncpy(outPath, inPath, PATH_MAX + 1 - 4); + strncat(outPath, s_ext, 4); + return 0; +#endif +} + + +static int +set_id3_albumart(lame_t gfp, char const* file_name) +{ + int ret = -1; + FILE *fpi = 0; + char *albumart = 0; + + if (file_name == 0) { + return 0; + } + fpi = lame_fopen(file_name, "rb"); + if (!fpi) { + ret = 1; + } + else { + size_t size; + + fseek(fpi, 0, SEEK_END); + size = ftell(fpi); + fseek(fpi, 0, SEEK_SET); + albumart = (char *)malloc(size); + if (!albumart) { + ret = 2; + } + else { + if (fread(albumart, 1, size, fpi) != size) { + ret = 3; + } + else { + ret = id3tag_set_albumart(gfp, albumart, size) ? 4 : 0; + } + free(albumart); + } + fclose(fpi); + } + switch (ret) { + case 1: error_printf("Could not find: '%s'.\n", file_name); break; + case 2: error_printf("Insufficient memory for reading the albumart.\n"); break; + case 3: error_printf("Read error: '%s'.\n", file_name); break; + case 4: error_printf("Unsupported image: '%s'.\nSpecify JPEG/PNG/GIF image\n", file_name); break; + default: break; + } + return ret; +} + + +enum ID3TAG_MODE +{ ID3TAG_MODE_DEFAULT +, ID3TAG_MODE_V1_ONLY +, ID3TAG_MODE_V2_ONLY +}; + +/* Ugly, NOT final version */ + +#define T_IF(str) if ( 0 == local_strcasecmp (token,str) ) { +#define T_ELIF(str) } else if ( 0 == local_strcasecmp (token,str) ) { +#define T_ELIF_INTERNAL(str) } else if (internal_opts_enabled && (0 == local_strcasecmp (token,str)) ) { +#define T_ELIF2(str1,str2) } else if ( 0 == local_strcasecmp (token,str1) || 0 == local_strcasecmp (token,str2) ) { +#define T_ELSE } else { +#define T_END } + +int +parse_args(lame_global_flags * gfp, int argc, char **argv, + char *const inPath, char *const outPath, char **nogap_inPath, int *num_nogap) +{ + char outDir[1024] = ""; + int input_file = 0; /* set to 1 if we parse an input file name */ + int i; + int autoconvert = 0; + double val; + int nogap = 0; + int nogap_tags = 0; /* set to 1 to use VBR tags in NOGAP mode */ + const char *ProgramName = argv[0]; + int count_nogap = 0; + int noreplaygain = 0; /* is RG explicitly disabled by the user */ + int id3tag_mode = ID3TAG_MODE_DEFAULT; + int ignore_tag_errors = 0; /* Ignore errors in values passed for tags */ +#ifdef ID3TAGS_EXTENDED + enum TextEncoding id3_tenc = TENC_UTF16; +#else + enum TextEncoding id3_tenc = TENC_LATIN1; +#endif + + inPath[0] = '\0'; + outPath[0] = '\0'; + /* turn on display options. user settings may turn them off below */ + global_ui_config.silent = 0; + global_ui_config.brhist = 1; + global_decoder.mp3_delay = 0; + global_decoder.mp3_delay_set = 0; + global_decoder.disable_wav_header = 0; + global_ui_config.print_clipping_info = 0; + id3tag_init(gfp); + + /* process args */ + for (i = 0; ++i < argc;) { + char c; + char *token; + char *arg; + char *nextArg; + int argUsed; + + token = argv[i]; + if (*token++ == '-') { + argUsed = 0; + nextArg = i + 1 < argc ? argv[i + 1] : ""; + + if (!*token) { /* The user wants to use stdin and/or stdout. */ + input_file = 1; + if (inPath[0] == '\0') + strncpy(inPath, argv[i], PATH_MAX + 1); + else if (outPath[0] == '\0') + strncpy(outPath, argv[i], PATH_MAX + 1); + } + if (*token == '-') { /* GNU style */ + token++; + + T_IF("resample") + argUsed = 1; + (void) lame_set_out_samplerate(gfp, resample_rate(atof(nextArg))); + + T_ELIF("vbr-old") + lame_set_VBR(gfp, vbr_rh); + + T_ELIF("vbr-new") + lame_set_VBR(gfp, vbr_mt); + + T_ELIF("vbr-mtrh") + lame_set_VBR(gfp, vbr_mtrh); + + T_ELIF("cbr") + lame_set_VBR(gfp, vbr_off); + + T_ELIF("abr") + /* values larger than 8000 are bps (like Fraunhofer), so it's strange to get 320000 bps MP3 when specifying 8000 bps MP3 */ + int m = atoi(nextArg); + argUsed = 1; + if (m >= 8000) { + m = (m + 500) / 1000; + } + if (m > 320) { + m = 320; + } + if (m < 8) { + m = 8; + } + lame_set_VBR(gfp, vbr_abr); + lame_set_VBR_mean_bitrate_kbps(gfp, m); + + T_ELIF("r3mix") + lame_set_preset(gfp, R3MIX); + + T_ELIF("bitwidth") + argUsed = 1; + global_raw_pcm.in_bitwidth = atoi(nextArg); + + T_ELIF("signed") + global_raw_pcm.in_signed = 1; + + T_ELIF("unsigned") + global_raw_pcm.in_signed = 0; + + T_ELIF("little-endian") + global_raw_pcm.in_endian = ByteOrderLittleEndian; + + T_ELIF("big-endian") + global_raw_pcm.in_endian = ByteOrderBigEndian; + + T_ELIF("mp1input") + global_reader.input_format = sf_mp1; + + T_ELIF("mp2input") + global_reader.input_format = sf_mp2; + + T_ELIF("mp3input") + global_reader.input_format = sf_mp3; + + T_ELIF("ogginput") + error_printf("sorry, vorbis support in LAME is deprecated.\n"); + return -1; +#if INTERNAL_OPTS + T_ELIF_INTERNAL("noshort") + (void) lame_set_no_short_blocks(gfp, 1); + + T_ELIF_INTERNAL("short") + (void) lame_set_no_short_blocks(gfp, 0); + + T_ELIF_INTERNAL("allshort") + (void) lame_set_force_short_blocks(gfp, 1); +#endif + + T_ELIF("decode") + (void) lame_set_decode_only(gfp, 1); + + T_ELIF("flush") + global_writer.flush_write = 1; + + T_ELIF("decode-mp3delay") + global_decoder.mp3_delay = atoi(nextArg); + global_decoder.mp3_delay_set = 1; + argUsed = 1; + + T_ELIF("nores") + lame_set_disable_reservoir(gfp, 1); + + T_ELIF("strictly-enforce-ISO") + lame_set_strict_ISO(gfp, MDB_STRICT_ISO); + + T_ELIF("buffer-constraint") + argUsed = 1; + if (strcmp(nextArg, "default") == 0) + (void) lame_set_strict_ISO(gfp, MDB_DEFAULT); + else if (strcmp(nextArg, "strict") == 0) + (void) lame_set_strict_ISO(gfp, MDB_STRICT_ISO); + else if (strcmp(nextArg, "maximum") == 0) + (void) lame_set_strict_ISO(gfp, MDB_MAXIMUM); + else { + error_printf("unknown buffer constraint '%s'\n", nextArg); + return -1; + } + + T_ELIF("scale") + argUsed = 1; + (void) lame_set_scale(gfp, (float) atof(nextArg)); + + T_ELIF("scale-l") + argUsed = 1; + (void) lame_set_scale_left(gfp, (float) atof(nextArg)); + + T_ELIF("scale-r") + argUsed = 1; + (void) lame_set_scale_right(gfp, (float) atof(nextArg)); + + T_ELIF("noasm") + argUsed = 1; + if (!strcmp(nextArg, "mmx")) + (void) lame_set_asm_optimizations(gfp, MMX, 0); + if (!strcmp(nextArg, "3dnow")) + (void) lame_set_asm_optimizations(gfp, AMD_3DNOW, 0); + if (!strcmp(nextArg, "sse")) + (void) lame_set_asm_optimizations(gfp, SSE, 0); + + T_ELIF("freeformat") + lame_set_free_format(gfp, 1); + + T_ELIF("replaygain-fast") + lame_set_findReplayGain(gfp, 1); + +#ifdef DECODE_ON_THE_FLY + T_ELIF("replaygain-accurate") + lame_set_decode_on_the_fly(gfp, 1); + lame_set_findReplayGain(gfp, 1); +#endif + + T_ELIF("noreplaygain") + noreplaygain = 1; + lame_set_findReplayGain(gfp, 0); + + +#ifdef DECODE_ON_THE_FLY + T_ELIF("clipdetect") + global_ui_config.print_clipping_info = 1; + lame_set_decode_on_the_fly(gfp, 1); +#endif + + T_ELIF("nohist") + global_ui_config.brhist = 0; + +#if defined(__OS2__) || defined(WIN32) + T_ELIF("priority") + char *endptr; + int priority = (int) strtol(nextArg, &endptr, 10); + if (endptr != nextArg) { + argUsed = 1; + } + setProcessPriority(priority); +#endif + + /* options for ID3 tag */ +#ifdef ID3TAGS_EXTENDED + T_ELIF2("id3v2-utf16","id3v2-ucs2") /* id3v2-ucs2 for compatibility only */ + id3_tenc = TENC_UTF16; + id3tag_add_v2(gfp); + + T_ELIF("id3v2-latin1") + id3_tenc = TENC_LATIN1; + id3tag_add_v2(gfp); +#endif + + T_ELIF("tt") + argUsed = 1; + id3_tag(gfp, 't', id3_tenc, nextArg); + + T_ELIF("ta") + argUsed = 1; + id3_tag(gfp, 'a', id3_tenc, nextArg); + + T_ELIF("tl") + argUsed = 1; + id3_tag(gfp, 'l', id3_tenc, nextArg); + + T_ELIF("ty") + argUsed = 1; + id3_tag(gfp, 'y', id3_tenc, nextArg); + + T_ELIF("tc") + argUsed = 1; + id3_tag(gfp, 'c', id3_tenc, nextArg); + + T_ELIF("tn") + int ret = id3_tag(gfp, 'n', id3_tenc, nextArg); + argUsed = 1; + if (ret != 0) { + if (0 == ignore_tag_errors) { + if (id3tag_mode == ID3TAG_MODE_V1_ONLY) { + if (global_ui_config.silent < 9) { + error_printf("The track number has to be between 1 and 255 for ID3v1.\n"); + } + return -1; + } + else if (id3tag_mode == ID3TAG_MODE_V2_ONLY) { + /* track will be stored as-is in ID3v2 case, so no problem here */ + } + else { + if (global_ui_config.silent < 9) { + error_printf("The track number has to be between 1 and 255 for ID3v1, ignored for ID3v1.\n"); + } + } + } + } + + T_ELIF("tg") + int ret = id3_tag(gfp, 'g', id3_tenc, nextArg); + argUsed = 1; + if (ret != 0) { + if (0 == ignore_tag_errors) { + if (ret == -1) { + error_printf("Unknown ID3v1 genre number: '%s'.\n", nextArg); + return -1; + } + else if (ret == -2) { + if (id3tag_mode == ID3TAG_MODE_V1_ONLY) { + error_printf("Unknown ID3v1 genre: '%s'.\n", nextArg); + return -1; + } + else if (id3tag_mode == ID3TAG_MODE_V2_ONLY) { + /* genre will be stored as-is in ID3v2 case, so no problem here */ + } + else { + if (global_ui_config.silent < 9) { + error_printf("Unknown ID3v1 genre: '%s'. Setting ID3v1 genre to 'Other'\n", nextArg); + } + } + } + else { + if (global_ui_config.silent < 10) + error_printf("Internal error.\n"); + return -1; + } + } + } + + T_ELIF("tv") + argUsed = 1; + if (id3_tag(gfp, 'v', id3_tenc, nextArg)) { + if (global_ui_config.silent < 9) { + error_printf("Invalid field value: '%s'. Ignored\n", nextArg); + } + } + + T_ELIF("ti") + argUsed = 1; + if (set_id3_albumart(gfp, nextArg) != 0) { + if (! ignore_tag_errors) { + return -1; + } + } + + T_ELIF("ignore-tag-errors") + ignore_tag_errors = 1; + + T_ELIF("add-id3v2") + id3tag_add_v2(gfp); + + T_ELIF("id3v1-only") + id3tag_v1_only(gfp); + id3tag_mode = ID3TAG_MODE_V1_ONLY; + + T_ELIF("id3v2-only") + id3tag_v2_only(gfp); + id3tag_mode = ID3TAG_MODE_V2_ONLY; + + T_ELIF("space-id3v1") + id3tag_space_v1(gfp); + + T_ELIF("pad-id3v2") + id3tag_pad_v2(gfp); + + T_ELIF("pad-id3v2-size") + int n = atoi(nextArg); + n = n <= 128000 ? n : 128000; + n = n >= 0 ? n : 0; + id3tag_set_pad(gfp, n); + argUsed = 1; + + + T_ELIF("genre-list") + id3tag_genre_list(genre_list_handler, NULL); + return -2; + + + T_ELIF("lowpass") + val = atof(nextArg); + argUsed = 1; + if (val < 0) { + lame_set_lowpassfreq(gfp, -1); + } + else { + /* useful are 0.001 kHz...50 kHz, 50 Hz...50000 Hz */ + if (val < 0.001 || val > 50000.) { + error_printf("Must specify lowpass with --lowpass freq, freq >= 0.001 kHz\n"); + return -1; + } + lame_set_lowpassfreq(gfp, (int) (val * (val < 50. ? 1.e3 : 1.e0) + 0.5)); + } + + T_ELIF("lowpass-width") + val = atof(nextArg); + argUsed = 1; + /* useful are 0.001 kHz...16 kHz, 16 Hz...50000 Hz */ + if (val < 0.001 || val > 50000.) { + error_printf + ("Must specify lowpass width with --lowpass-width freq, freq >= 0.001 kHz\n"); + return -1; + } + lame_set_lowpasswidth(gfp, (int) (val * (val < 16. ? 1.e3 : 1.e0) + 0.5)); + + T_ELIF("highpass") + val = atof(nextArg); + argUsed = 1; + if (val < 0.0) { + lame_set_highpassfreq(gfp, -1); + } + else { + /* useful are 0.001 kHz...16 kHz, 16 Hz...50000 Hz */ + if (val < 0.001 || val > 50000.) { + error_printf("Must specify highpass with --highpass freq, freq >= 0.001 kHz\n"); + return -1; + } + lame_set_highpassfreq(gfp, (int) (val * (val < 16. ? 1.e3 : 1.e0) + 0.5)); + } + + T_ELIF("highpass-width") + val = atof(nextArg); + argUsed = 1; + /* useful are 0.001 kHz...16 kHz, 16 Hz...50000 Hz */ + if (val < 0.001 || val > 50000.) { + error_printf + ("Must specify highpass width with --highpass-width freq, freq >= 0.001 kHz\n"); + return -1; + } + lame_set_highpasswidth(gfp, (int) val); + + T_ELIF("comp") + argUsed = 1; + val = atof(nextArg); + if (val < 1.0) { + error_printf("Must specify compression ratio >= 1.0\n"); + return -1; + } + lame_set_compression_ratio(gfp, (float) val); +#if INTERNAL_OPTS + T_ELIF_INTERNAL("notemp") + (void) lame_set_useTemporal(gfp, 0); + + T_ELIF_INTERNAL("interch") + argUsed = 1; + (void) lame_set_interChRatio(gfp, (float) atof(nextArg)); + + T_ELIF_INTERNAL("temporal-masking") + argUsed = 1; + (void) lame_set_useTemporal(gfp, atoi(nextArg) ? 1 : 0); + + T_ELIF_INTERNAL("nspsytune") + ; + + T_ELIF_INTERNAL("nssafejoint") + lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | 2); + + T_ELIF_INTERNAL("nsmsfix") + argUsed = 1; + (void) lame_set_msfix(gfp, atof(nextArg)); + + T_ELIF_INTERNAL("ns-bass") + argUsed = 1; + { + double d; + int k; + d = atof(nextArg); + k = (int) (d * 4); + if (k < -32) + k = -32; + if (k > 31) + k = 31; + if (k < 0) + k += 64; + lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | (k << 2)); + } + + T_ELIF_INTERNAL("ns-alto") + argUsed = 1; + { + double d; + int k; + d = atof(nextArg); + k = (int) (d * 4); + if (k < -32) + k = -32; + if (k > 31) + k = 31; + if (k < 0) + k += 64; + lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | (k << 8)); + } + + T_ELIF_INTERNAL("ns-treble") + argUsed = 1; + { + double d; + int k; + d = atof(nextArg); + k = (int) (d * 4); + if (k < -32) + k = -32; + if (k > 31) + k = 31; + if (k < 0) + k += 64; + lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | (k << 14)); + } + + T_ELIF_INTERNAL("ns-sfb21") + /* to be compatible with Naoki's original code, + * ns-sfb21 specifies how to change ns-treble for sfb21 */ + argUsed = 1; + { + double d; + int k; + d = atof(nextArg); + k = (int) (d * 4); + if (k < -32) + k = -32; + if (k > 31) + k = 31; + if (k < 0) + k += 64; + lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | (k << 20)); + } +#endif + /* some more GNU-ish options could be added + * brief => few messages on screen (name, status report) + * o/output file => specifies output filename + * O => stdout + * i/input file => specifies input filename + * I => stdin + */ + T_ELIF("quiet") + global_ui_config.silent = 10; /* on a scale from 1 to 10 be very silent */ + + T_ELIF("silent") + global_ui_config.silent = 9; + + T_ELIF("brief") + global_ui_config.silent = -5; /* print few info on screen */ + + T_ELIF("verbose") + global_ui_config.silent = -10; /* print a lot on screen */ + + T_ELIF2("version", "license") + print_license(stdout); + return -2; + + T_ELIF2("help", "usage") + if (0 == local_strncasecmp(nextArg, "id3", 3)) { + help_id3tag(stdout); + } + else if (0 == local_strncasecmp(nextArg, "dev", 3)) { + help_developer_switches(stdout); + } + else { + short_help(gfp, stdout, ProgramName); + } + return -2; + + T_ELIF("longhelp") + long_help(gfp, stdout, ProgramName, 0 /* lessmode=NO */ ); + return -2; + + T_ELIF("?") +#ifdef __unix__ + FILE *fp = popen("less -Mqc", "w"); + long_help(gfp, fp, ProgramName, 0 /* lessmode=NO */ ); + pclose(fp); +#else + long_help(gfp, stdout, ProgramName, 1 /* lessmode=YES */ ); +#endif + return -2; + + T_ELIF2("preset", "alt-preset") + argUsed = 1; + { + int fast = 0, cbr = 0; + + while ((strcmp(nextArg, "fast") == 0) || (strcmp(nextArg, "cbr") == 0)) { + + if ((strcmp(nextArg, "fast") == 0) && (fast < 1)) + fast = 1; + if ((strcmp(nextArg, "cbr") == 0) && (cbr < 1)) + cbr = 1; + + argUsed++; + nextArg = i + argUsed < argc ? argv[i + argUsed] : ""; + } + + if (presets_set(gfp, fast, cbr, nextArg, ProgramName) < 0) + return -1; + } + + T_ELIF("disptime") + argUsed = 1; + global_ui_config.update_interval = (float) atof(nextArg); + + T_ELIF("nogaptags") + nogap_tags = 1; + + T_ELIF("nogapout") + /* FIXME: replace strcpy by safer strncpy */ + strcpy(outPath, nextArg); + argUsed = 1; + + T_ELIF("out-dir") + /* FIXME: replace strcpy by safer strncpy */ + strcpy(outDir, nextArg); + argUsed = 1; + + T_ELIF("nogap") + nogap = 1; + + T_ELIF("swap-channel") + global_reader.swap_channel = 1; +#if INTERNAL_OPTS + T_ELIF_INTERNAL("tune") /*without helptext */ + argUsed = 1; + lame_set_tune(gfp, (float) atof(nextArg)); + + T_ELIF_INTERNAL("shortthreshold") { + float x, y; + int n = sscanf(nextArg, "%f,%f", &x, &y); + if (n == 1) { + y = x; + } + argUsed = 1; + (void) lame_set_short_threshold(gfp, x, y); + } + + T_ELIF_INTERNAL("maskingadjust") /*without helptext */ + argUsed = 1; + (void) lame_set_maskingadjust(gfp, (float) atof(nextArg)); + + T_ELIF_INTERNAL("maskingadjustshort") /*without helptext */ + argUsed = 1; + (void) lame_set_maskingadjust_short(gfp, (float) atof(nextArg)); + + T_ELIF_INTERNAL("athcurve") /*without helptext */ + argUsed = 1; + (void) lame_set_ATHcurve(gfp, (float) atof(nextArg)); + + T_ELIF_INTERNAL("no-preset-tune") /*without helptext */ + (void) lame_set_preset_notune(gfp, 0); + + T_ELIF_INTERNAL("substep") + argUsed = 1; + (void) lame_set_substep(gfp, atoi(nextArg)); + + T_ELIF_INTERNAL("sbgain") /*without helptext */ + argUsed = 1; + (void) lame_set_subblock_gain(gfp, atoi(nextArg)); + + T_ELIF_INTERNAL("sfscale") /*without helptext */ + (void) lame_set_sfscale(gfp, 1); + + T_ELIF_INTERNAL("noath") + (void) lame_set_noATH(gfp, 1); + + T_ELIF_INTERNAL("athonly") + (void) lame_set_ATHonly(gfp, 1); + + T_ELIF_INTERNAL("athshort") + (void) lame_set_ATHshort(gfp, 1); + + T_ELIF_INTERNAL("athlower") + argUsed = 1; + (void) lame_set_ATHlower(gfp, (float) atof(nextArg)); + + T_ELIF_INTERNAL("athtype") + argUsed = 1; + (void) lame_set_ATHtype(gfp, atoi(nextArg)); + + T_ELIF_INTERNAL("athaa-type") /* switch for developing, no DOCU */ + argUsed = 1; /* once was 1:Gaby, 2:Robert, 3:Jon, else:off */ + lame_set_athaa_type(gfp, atoi(nextArg)); /* now: 0:off else:Jon */ +#endif + T_ELIF ("athaa-sensitivity") + argUsed=1; + lame_set_athaa_sensitivity(gfp, (float) atof(nextArg)); + + T_ELIF_INTERNAL("debug-file") /* switch for developing, no DOCU */ + argUsed = 1; /* file name to print debug info into */ + { + set_debug_file(nextArg); + } + + T_ELSE { + error_printf("%s: unrecognized option --%s\n", ProgramName, token); + return -1; + } + T_END i += argUsed; + + } + else { + while ((c = *token++) != '\0') { + arg = *token ? token : nextArg; + switch (c) { + case 'm': + argUsed = 1; + + switch (*arg) { + case 's': + (void) lame_set_mode(gfp, STEREO); + break; + case 'd': + (void) lame_set_mode(gfp, DUAL_CHANNEL); + break; + case 'f': + lame_set_force_ms(gfp, 1); + /* FALLTHROUGH */ + case 'j': + (void) lame_set_mode(gfp, JOINT_STEREO); + break; + case 'm': + (void) lame_set_mode(gfp, MONO); + break; + case 'l': + (void) lame_set_mode(gfp, MONO); + (void) lame_set_scale_left(gfp, 2); + (void) lame_set_scale_right(gfp, 0); + break; + case 'r': + (void) lame_set_mode(gfp, MONO); + (void) lame_set_scale_left(gfp, 0); + (void) lame_set_scale_right(gfp, 2); + break; + case 'a': + (void) lame_set_mode(gfp, JOINT_STEREO); + break; + default: + error_printf("%s: -m mode must be s/d/j/f/m not %s\n", ProgramName, + arg); + return -1; + } + break; + + case 'V': + argUsed = 1; + /* to change VBR default look in lame.h */ + if (lame_get_VBR(gfp) == vbr_off) + lame_set_VBR(gfp, vbr_default); + lame_set_VBR_quality(gfp, (float)atof(arg)); + break; + case 'v': + /* to change VBR default look in lame.h */ + if (lame_get_VBR(gfp) == vbr_off) + lame_set_VBR(gfp, vbr_default); + break; + + case 'q': + argUsed = 1; + (void) lame_set_quality(gfp, atoi(arg)); + break; + case 'f': + (void) lame_set_quality(gfp, 7); + break; + case 'h': + (void) lame_set_quality(gfp, 2); + break; + + case 's': + argUsed = 1; + val = atof(arg); + val = (int) (val * (val <= 192 ? 1.e3 : 1.e0) + 0.5); + global_reader.input_samplerate = (int)val; + (void) lame_set_in_samplerate(gfp, (int)val); + break; + case 'b': + argUsed = 1; + lame_set_brate(gfp, atoi(arg)); + lame_set_VBR_min_bitrate_kbps(gfp, lame_get_brate(gfp)); + break; + case 'B': + argUsed = 1; + lame_set_VBR_max_bitrate_kbps(gfp, atoi(arg)); + break; + case 'F': + lame_set_VBR_hard_min(gfp, 1); + break; + case 't': /* dont write VBR tag */ + (void) lame_set_bWriteVbrTag(gfp, 0); + global_decoder.disable_wav_header = 1; + break; + case 'T': /* do write VBR tag */ + (void) lame_set_bWriteVbrTag(gfp, 1); + nogap_tags = 1; + global_decoder.disable_wav_header = 0; + break; + case 'r': /* force raw pcm input file */ +#if defined(LIBSNDFILE) + error_printf + ("WARNING: libsndfile may ignore -r and perform fseek's on the input.\n" + "Compile without libsndfile if this is a problem.\n"); +#endif + global_reader.input_format = sf_raw; + break; + case 'x': /* force byte swapping */ + global_reader.swapbytes = 1; + break; + case 'p': /* (jo) error_protection: add crc16 information to stream */ + lame_set_error_protection(gfp, 1); + break; + case 'a': /* autoconvert input file from stereo to mono - for mono mp3 encoding */ + autoconvert = 1; + (void) lame_set_mode(gfp, MONO); + break; + case 'd': /*(void) lame_set_allow_diff_short( gfp, 1 ); */ + case 'k': /*lame_set_lowpassfreq(gfp, -1); + lame_set_highpassfreq(gfp, -1); */ + error_printf("WARNING: -%c is obsolete.\n", c); + break; + case 'S': + global_ui_config.silent = 5; + break; + case 'X': + /* experimental switch -X: + the differnt types of quant compare are tough + to communicate to endusers, so they shouldn't + bother to toy around with them + */ + { + int x, y; + int n = sscanf(arg, "%d,%d", &x, &y); + if (n == 1) { + y = x; + } + argUsed = 1; + if (internal_opts_enabled) { + lame_set_quant_comp(gfp, x); + lame_set_quant_comp_short(gfp, y); + } + } + break; + case 'Y': + lame_set_experimentalY(gfp, 1); + break; + case 'Z': + /* experimental switch -Z: + */ + { + int n = 1; + argUsed = sscanf(arg, "%d", &n); + /*if (internal_opts_enabled)*/ + { + lame_set_experimentalZ(gfp, n); + } + } + break; + case 'e': + argUsed = 1; + + switch (*arg) { + case 'n': + lame_set_emphasis(gfp, 0); + break; + case '5': + lame_set_emphasis(gfp, 1); + break; + case 'c': + lame_set_emphasis(gfp, 3); + break; + default: + error_printf("%s: -e emp must be n/5/c not %s\n", ProgramName, arg); + return -1; + } + break; + case 'c': + lame_set_copyright(gfp, 1); + break; + case 'o': + lame_set_original(gfp, 0); + break; + + case '?': + long_help(gfp, stdout, ProgramName, 0 /* LESSMODE=NO */ ); + return -1; + + default: + error_printf("%s: unrecognized option -%c\n", ProgramName, c); + return -1; + } + if (argUsed) { + if (arg == token) + token = ""; /* no more from token */ + else + ++i; /* skip arg we used */ + arg = ""; + argUsed = 0; + } + } + } + } + else { + if (nogap) { + if ((num_nogap != NULL) && (count_nogap < *num_nogap)) { + strncpy(nogap_inPath[count_nogap++], argv[i], PATH_MAX + 1); + input_file = 1; + } + else { + /* sorry, calling program did not allocate enough space */ + error_printf + ("Error: 'nogap option'. Calling program does not allow nogap option, or\n" + "you have exceeded maximum number of input files for the nogap option\n"); + *num_nogap = -1; + return -1; + } + } + else { + /* normal options: inputfile [outputfile], and + either one can be a '-' for stdin/stdout */ + if (inPath[0] == '\0') { + strncpy(inPath, argv[i], PATH_MAX + 1); + input_file = 1; + } + else { + if (outPath[0] == '\0') + strncpy(outPath, argv[i], PATH_MAX + 1); + else { + error_printf("%s: excess arg %s\n", ProgramName, argv[i]); + return -1; + } + } + } + } + } /* loop over args */ + + if (!input_file) { + usage(Console_IO.Console_fp, ProgramName); + return -1; + } + + if (inPath[0] == '-') + global_ui_config.silent = (global_ui_config.silent <= 1 ? 1 : global_ui_config.silent); +#ifdef WIN32 + else + dosToLongFileName(inPath); +#endif + + if (outPath[0] == '\0' && count_nogap == 0) { + if (inPath[0] == '-') { + /* if input is stdin, default output is stdout */ + strcpy(outPath, "-"); + } + else { + if (generateOutPath(gfp, inPath, outDir, outPath) != 0) { + return -1; + } + } + } + + /* RG is enabled by default */ + if (!noreplaygain) + lame_set_findReplayGain(gfp, 1); + + /* disable VBR tags with nogap unless the VBR tags are forced */ + if (nogap && lame_get_bWriteVbrTag(gfp) && nogap_tags == 0) { + console_printf("Note: Disabling VBR Xing/Info tag since it interferes with --nogap\n"); + lame_set_bWriteVbrTag(gfp, 0); + } + + /* some file options not allowed with stdout */ + if (outPath[0] == '-') { + (void) lame_set_bWriteVbrTag(gfp, 0); /* turn off VBR tag */ + } + + /* if user did not explicitly specify input is mp3, check file name */ + if (global_reader.input_format == sf_unknown) + global_reader.input_format = filename_to_type(inPath); + +#if !(defined HAVE_MPGLIB || defined AMIGA_MPEGA) + if (is_mpeg_file_format(global_reader.input_format)) { + error_printf("Error: libmp3lame not compiled with mpg123 *decoding* support \n"); + return -1; + } +#endif + + /* default guess for number of channels */ + if (autoconvert) + (void) lame_set_num_channels(gfp, 2); + else if (MONO == lame_get_mode(gfp)) + (void) lame_set_num_channels(gfp, 1); + else + (void) lame_set_num_channels(gfp, 2); + + if (lame_get_free_format(gfp)) { + if (lame_get_brate(gfp) < 8 || lame_get_brate(gfp) > 640) { + error_printf("For free format, specify a bitrate between 8 and 640 kbps\n"); + error_printf("with the -b option\n"); + return -1; + } + } + if (num_nogap != NULL) + *num_nogap = count_nogap; + return 0; +} + + +/* end of parse.c */ diff --git a/node_modules/lame/deps/lame/frontend/parse.h b/node_modules/lame/deps/lame/frontend/parse.h new file mode 100644 index 0000000..e75eeb8 --- /dev/null +++ b/node_modules/lame/deps/lame/frontend/parse.h @@ -0,0 +1,24 @@ +#ifndef PARSE_H_INCLUDED +#define PARSE_H_INCLUDED + +#if defined(__cplusplus) +extern "C" { +#endif + +int usage(FILE * const fp, const char *ProgramName); +int short_help(const lame_global_flags * gfp, FILE * const fp, const char *ProgramName); +int long_help(const lame_global_flags * gfp, FILE * const fp, const char *ProgramName, + int lessmode); +int display_bitrates(FILE * const fp); + +int parse_args(lame_global_flags * gfp, int argc, char **argv, char *const inPath, + char *const outPath, char **nogap_inPath, int *max_nogap); + +void parse_close(); + +#if defined(__cplusplus) +} +#endif + +#endif +/* end of parse.h */ diff --git a/node_modules/lame/deps/lame/frontend/rtp.c b/node_modules/lame/deps/lame/frontend/rtp.c new file mode 100644 index 0000000..39718c8 --- /dev/null +++ b/node_modules/lame/deps/lame/frontend/rtp.c @@ -0,0 +1,366 @@ +/* + * rtp socket communication functions + * + * initially contributed by Felix von Leitner + * + * Copyright (c) 2000 Mark Taylor + * 2010 Robert Hegemann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: rtp.c,v 1.24 2011/05/07 16:05:17 rbrito Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef HAVE_STDINT_H +# include +#endif + +struct rtpbits { + int sequence:16; /* sequence number: random */ + int pt:7; /* payload type: 14 for MPEG audio */ + int m:1; /* marker: 0 */ + int cc:4; /* number of CSRC identifiers: 0 */ + int x:1; /* number of extension headers: 0 */ + int p:1; /* is there padding appended: 0 */ + int v:2; /* version: 2 */ +}; + +struct rtpheader { /* in network byte order */ + struct rtpbits b; + int timestamp; /* start: random */ + int ssrc; /* random */ + int iAudioHeader; /* =0?! */ +}; + + +#if !defined( _WIN32 ) && !defined(__MINGW32__) + +#ifdef STDC_HEADERS +# include +# include +# include +# include +#else +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# define memmove(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include +#include +#ifdef __int8_t_defined +#undef uint8_t +#undef uint16_t +#undef uint32_t +#undef uint64_t +#endif +#include +#include + +#ifdef WITH_DMALLOC +#include +#endif + +#include "rtp.h" +#include "console.h" + +typedef int SOCKET; + +struct rtpheader RTPheader; +SOCKET rtpsocket; + + +/* create a sender socket. */ +int +rtp_socket(char const *address, unsigned int port, unsigned int TTL) +{ + int iRet, iLoop = 1; + struct sockaddr_in sin; + unsigned char cTtl = TTL; + char cLoop = 0; + unsigned int tempaddr; + + int iSocket = socket(AF_INET, SOCK_DGRAM, 0); + if (iSocket < 0) { + error_printf("socket() failed.\n"); + return 1; + } + + memset(&sin, 0, sizeof(sin)); + tempaddr = inet_addr(address); + sin.sin_family = AF_INET; + sin.sin_port = htons(port); + sin.sin_addr.s_addr = tempaddr; + + iRet = setsockopt(iSocket, SOL_SOCKET, SO_REUSEADDR, &iLoop, sizeof(int)); + if (iRet < 0) { + error_printf("setsockopt SO_REUSEADDR failed\n"); + return 1; + } + + if ((ntohl(tempaddr) >> 28) == 0xe) { + /* only set multicast parameters for multicast destination IPs */ + iRet = setsockopt(iSocket, IPPROTO_IP, IP_MULTICAST_TTL, &cTtl, sizeof(char)); + if (iRet < 0) { + error_printf("setsockopt IP_MULTICAST_TTL failed. multicast in kernel?\n"); + return 1; + } + + cLoop = 1; /* !? */ + iRet = setsockopt(iSocket, IPPROTO_IP, IP_MULTICAST_LOOP, &cLoop, sizeof(char)); + if (iRet < 0) { + error_printf("setsockopt IP_MULTICAST_LOOP failed. multicast in kernel?\n"); + return 1; + } + } + iRet = connect(iSocket, (struct sockaddr *) &sin, sizeof(struct sockaddr_in)); + if (iRet < 0) { + error_printf("connect IP_MULTICAST_LOOP failed. multicast in kernel?\n"); + return 1; + } + + rtpsocket = iSocket; + + return 0; +} + + +static void +rtp_initialization_extra(void) +{ +} + +static void +rtp_close_extra(void) +{ +} + +#else + +#include +#ifndef IP_MULTICAST_TTL +#define IP_MULTICAST_TTL 3 +#endif +#include +#include + +#include "rtp.h" +#include "console.h" + + +struct rtpheader RTPheader; +SOCKET rtpsocket; + +static char * +last_error_message(int err_code) +{ + char *msg; + void *p_msg_buf; + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, + (void *) 0, + (DWORD) err_code, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR) & p_msg_buf, 0, NULL); + msg = strdup(p_msg_buf); + LocalFree(p_msg_buf); + return msg; +} + +static int +print_socket_error(int error) +{ + char *err_txt = last_error_message(error); + error_printf("error %d\n%s\n", error, err_txt); + free(err_txt); + return error; +} + +static int +on_socket_error(SOCKET s) +{ + int error = WSAGetLastError(); + print_socket_error(error); + if (s != INVALID_SOCKET) { + closesocket(s); + } + return error; +} + +/* create a sender socket. */ +int +rtp_socket(char const *address, unsigned int port, unsigned int TTL) +{ + char const True = 1; + char const *c = ""; + int error; + UINT ip; + PHOSTENT host; + SOCKET s; + SOCKADDR_IN source, dest; + + source.sin_family = AF_INET; + source.sin_addr.s_addr = htonl(INADDR_ANY); + source.sin_port = htons(0); + + dest.sin_family = AF_INET; + dest.sin_addr.s_addr = inet_addr(address); + + if (!strcmp(address, "255.255.255.255")) { + } + else if (dest.sin_addr.s_addr == INADDR_NONE) { + host = gethostbyname(address); + + if (host) { + dest.sin_addr = *(PIN_ADDR) host->h_addr; + } + else { + error_printf("Unknown host %s\r\n", address); + return 1; + } + } + + dest.sin_port = htons((u_short) port); + + ip = ntohl(dest.sin_addr.s_addr); + + if (IN_CLASSA(ip)) + c = "class A"; + if (IN_CLASSB(ip)) + c = "class B"; + if (IN_CLASSC(ip)) + c = "class C"; + if (IN_CLASSD(ip)) + c = "class D"; + if (ip == INADDR_LOOPBACK) + c = "loopback"; + if (ip == INADDR_BROADCAST) + c = "broadcast"; + + s = socket(AF_INET, SOCK_DGRAM, PF_UNSPEC); + if (s == INVALID_SOCKET) { + error_printf("socket () "); + return on_socket_error(s); + } + error = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &True, sizeof(True)); + error = bind(s, (struct sockaddr *) &source, sizeof(source)); + if (error == SOCKET_ERROR) { + error_printf("bind () "); + return on_socket_error(s); + } + if (ip == INADDR_BROADCAST) { + error_printf("broadcast %s:%u %s\r\n", inet_ntoa(dest.sin_addr), ntohs(dest.sin_port), c); + error = setsockopt(s, SOL_SOCKET, SO_BROADCAST, &True, sizeof(True)); + if (error == SOCKET_ERROR) { + error_printf("setsockopt (%u, SOL_SOCKET, SO_BROADCAST, ...) ", s); + return on_socket_error(s); + } + } + if (IN_CLASSD(ip)) { + error_printf("multicast %s:%u %s\r\n", inet_ntoa(dest.sin_addr), ntohs(dest.sin_port), c); + error = setsockopt(s, IPPROTO_IP, IP_MULTICAST_TTL, (const char *) &TTL, sizeof(TTL)); + if (error == SOCKET_ERROR) { + error_printf("setsockopt (%u, IPPROTO_IP, IP_MULTICAST_TTL, ...) ", s); + return on_socket_error(s); + } + } + error = connect(s, (PSOCKADDR) & dest, sizeof(SOCKADDR_IN)); + if (error == SOCKET_ERROR) { + error_printf("connect: "); + return on_socket_error(s); + } + rtpsocket = s; + return 0; +} + +static void +rtp_initialization_extra(void) +{ + WSADATA wsaData; + int rc = WSAStartup(MAKEWORD(2, 2), &wsaData); + if (rc != 0) { + print_socket_error(rc); + } +} + +static void +rtp_close_extra(void) +{ + WSACleanup(); +} + +#endif + + +static int +rtp_send(unsigned char const *data, int len) +{ + SOCKET s = rtpsocket; + struct rtpheader *foo = &RTPheader; + char *buffer = malloc(len + sizeof(struct rtpheader)); + int *cast = (int *) foo; + int *outcast = (int *) buffer; + int count, size; + + outcast[0] = htonl(cast[0]); + outcast[1] = htonl(cast[1]); + outcast[2] = htonl(cast[2]); + outcast[3] = htonl(cast[3]); + memmove(buffer + sizeof(struct rtpheader), data, len); + size = len + sizeof(*foo); + count = send(s, buffer, size, 0); + free(buffer); + + return count != size; +} + +void +rtp_output(unsigned char const *mp3buffer, int mp3size) +{ + rtp_send(mp3buffer, mp3size); + RTPheader.timestamp += 5; + RTPheader.b.sequence++; +} + +void +rtp_initialization(void) +{ + struct rtpheader *foo = &RTPheader; + foo->b.v = 2; + foo->b.p = 0; + foo->b.x = 0; + foo->b.cc = 0; + foo->b.m = 0; + foo->b.pt = 14; /* MPEG Audio */ + foo->b.sequence = rand() & 65535; + foo->timestamp = rand(); + foo->ssrc = rand(); + foo->iAudioHeader = 0; + rtp_initialization_extra(); +} + +void +rtp_deinitialization(void) +{ + rtp_close_extra(); +} diff --git a/node_modules/lame/deps/lame/frontend/rtp.h b/node_modules/lame/deps/lame/frontend/rtp.h new file mode 100644 index 0000000..9100feb --- /dev/null +++ b/node_modules/lame/deps/lame/frontend/rtp.h @@ -0,0 +1,44 @@ +/* + * rtp socket communication include file + * + * initially contributed by Felix von Leitner + * + * Copyright (c) 2000 Mark Taylor + * 2010 Robert Hegemann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_RTP_H +#define LAME_RTP_H + +#if defined(__cplusplus) +extern "C" { +#endif + + struct RtpStruct; + typedef struct RtpStruct *RtpHandle; + + void rtp_initialization(void); + void rtp_deinitialization(void); + int rtp_socket( /*RtpHandle rtp, */ char const *Address, unsigned int port, + unsigned int TTL); + void rtp_output( /*RtpHandle rtp, */ unsigned char const *mp3buffer, int mp3size); + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/node_modules/lame/deps/lame/frontend/timestatus.c b/node_modules/lame/deps/lame/frontend/timestatus.c new file mode 100644 index 0000000..ddfb625 --- /dev/null +++ b/node_modules/lame/deps/lame/frontend/timestatus.c @@ -0,0 +1,438 @@ +/* + * time status related function source file + * + * Copyright (c) 1999 Mark Taylor + * 2010 Robert Hegemann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: timestatus.c,v 1.60 2011/05/07 16:05:17 rbrito Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + + +#if 1 +# define SPEED_CHAR "x" /* character x */ +# define SPEED_MULT 1. +#else +# define SPEED_CHAR "%%" +# define SPEED_MULT 100. +#endif + +#include +#include +#include +#include + +#include "lame.h" +#include "main.h" +#include "lametime.h" +#include "timestatus.h" +#include "brhist.h" +#include "console.h" + +#ifdef WITH_DMALLOC +#include +#endif + +typedef struct time_status_struct { + double last_time; /* result of last call to clock */ + double elapsed_time; /* total time */ + double estimated_time; /* estimated total duration time [s] */ + double speed_index; /* speed relative to realtime coding [100%] */ +} timestatus_t; + +static struct EncoderProgress { + timestatus_t real_time; + timestatus_t proc_time; + double last_time; + int last_frame_num; + int time_status_init; +} global_encoder_progress; + + +/* + * Calculates from the input (see below) the following values: + * - total estimated time + * - a speed index + */ + +static void +ts_calc_times(timestatus_t * const tstime, /* tstime->elapsed_time: elapsed time */ + const int sample_freq, /* sample frequency [Hz/kHz] */ + const int frameNum, /* Number of the current Frame */ + const int totalframes, /* total umber of Frames */ + const int framesize) +{ /* Size of a frame [bps/kbps] */ + assert(sample_freq >= 8000 && sample_freq <= 48000); + + if (frameNum > 0 && tstime->elapsed_time > 0) { + tstime->estimated_time = tstime->elapsed_time * totalframes / frameNum; + tstime->speed_index = framesize * frameNum / (sample_freq * tstime->elapsed_time); + } + else { + tstime->estimated_time = 0.; + tstime->speed_index = 0.; + } +} + +/* Decomposes a given number of seconds into a easy to read hh:mm:ss format + * padded with an additional character + */ + +static void +ts_time_decompose(const double x, const char padded_char) +{ + const unsigned long time_in_sec = (unsigned long)x; + const unsigned long hour = time_in_sec / 3600; + const unsigned int min = time_in_sec / 60 % 60; + const unsigned int sec = time_in_sec % 60; + + if (hour == 0) + console_printf(" %2u:%02u%c", min, sec, padded_char); + else if (hour < 100) + console_printf("%2lu:%02u:%02u%c", hour, min, sec, padded_char); + else + console_printf("%6lu h%c", hour, padded_char); +} + +static void +timestatus(const lame_global_flags * const gfp) +{ + timestatus_t* real_time = &global_encoder_progress.real_time; + timestatus_t* proc_time = &global_encoder_progress.proc_time; + int percent; + double tmx, delta; + int samp_rate = lame_get_out_samplerate(gfp) + , frameNum = lame_get_frameNum(gfp) + , totalframes = lame_get_totalframes(gfp) + , framesize = lame_get_framesize(gfp) + ; + + if (totalframes < frameNum) { + totalframes = frameNum; + } + if (global_encoder_progress.time_status_init == 0) { + real_time->last_time = GetRealTime(); + proc_time->last_time = GetCPUTime(); + real_time->elapsed_time = 0; + proc_time->elapsed_time = 0; + } + + /* we need rollover protection for GetCPUTime, and maybe GetRealTime(): */ + tmx = GetRealTime(); + delta = tmx - real_time->last_time; + if (delta < 0) + delta = 0; /* ignore, clock has rolled over */ + real_time->elapsed_time += delta; + real_time->last_time = tmx; + + + tmx = GetCPUTime(); + delta = tmx - proc_time->last_time; + if (delta < 0) + delta = 0; /* ignore, clock has rolled over */ + proc_time->elapsed_time += delta; + proc_time->last_time = tmx; + + if (global_encoder_progress.time_status_init == 0) { + console_printf("\r" + " Frame | CPU time/estim | REAL time/estim | play/CPU | ETA \n" + " 0/ ( 0%%)| 0:00/ : | 0:00/ : | " + SPEED_CHAR "| : \r" + /* , Console_IO.str_clreoln, Console_IO.str_clreoln */ ); + global_encoder_progress.time_status_init = 1; + return; + } + + ts_calc_times(real_time, samp_rate, frameNum, totalframes, framesize); + ts_calc_times(proc_time, samp_rate, frameNum, totalframes, framesize); + + if (frameNum < totalframes) { + percent = (int) (100. * frameNum / totalframes + 0.5); + } + else { + percent = 100; + } + + console_printf("\r%6i/%-6i", frameNum, totalframes); + console_printf(percent < 100 ? " (%2d%%)|" : "(%3.3d%%)|", percent); + ts_time_decompose(proc_time->elapsed_time, '/'); + ts_time_decompose(proc_time->estimated_time, '|'); + ts_time_decompose(real_time->elapsed_time, '/'); + ts_time_decompose(real_time->estimated_time, '|'); + console_printf(proc_time->speed_index <= 1. ? + "%9.4f" SPEED_CHAR "|" : "%#9.5g" SPEED_CHAR "|", + SPEED_MULT * proc_time->speed_index); + ts_time_decompose((real_time->estimated_time - real_time->elapsed_time), ' '); +} + +static void +timestatus_finish(void) +{ + console_printf("\n"); +} + + +static void +brhist_init_package(lame_global_flags const* gf) +{ + if (global_ui_config.brhist) { + if (brhist_init(gf, lame_get_VBR_min_bitrate_kbps(gf), lame_get_VBR_max_bitrate_kbps(gf))) { + /* fail to initialize */ + global_ui_config.brhist = 0; + } + } + else { + brhist_init(gf, 128, 128); /* Dirty hack */ + } +} + + +void +encoder_progress_begin( lame_global_flags const* gf + , char const* inPath + , char const* outPath + ) +{ + brhist_init_package(gf); + global_encoder_progress.time_status_init = 0; + global_encoder_progress.last_time = 0; + global_encoder_progress.last_frame_num = 0; + if (global_ui_config.silent < 9) { + char* i_file = 0; + char* o_file = 0; +#if defined( _WIN32 ) && !defined(__MINGW32__) + inPath = i_file = utf8ToLocal8Bit(inPath); + outPath = o_file = utf8ToConsole8Bit(outPath); +#endif + lame_print_config(gf); /* print useful information about options being used */ + + console_printf("Encoding %s%s to %s\n", + strcmp(inPath, "-") ? inPath : "", + strlen(inPath) + strlen(outPath) < 66 ? "" : "\n ", + strcmp(outPath, "-") ? outPath : ""); + + free(i_file); + free(o_file); + + console_printf("Encoding as %g kHz ", 1.e-3 * lame_get_out_samplerate(gf)); + + { + static const char *mode_names[2][4] = { + {"stereo", "j-stereo", "dual-ch", "single-ch"}, + {"stereo", "force-ms", "dual-ch", "single-ch"} + }; + switch (lame_get_VBR(gf)) { + case vbr_rh: + console_printf("%s MPEG-%u%s Layer III VBR(q=%g) qval=%i\n", + mode_names[lame_get_force_ms(gf)][lame_get_mode(gf)], + 2 - lame_get_version(gf), + lame_get_out_samplerate(gf) < 16000 ? ".5" : "", + lame_get_VBR_quality(gf), + lame_get_quality(gf)); + break; + case vbr_mt: + case vbr_mtrh: + console_printf("%s MPEG-%u%s Layer III VBR(q=%g)\n", + mode_names[lame_get_force_ms(gf)][lame_get_mode(gf)], + 2 - lame_get_version(gf), + lame_get_out_samplerate(gf) < 16000 ? ".5" : "", + lame_get_VBR_quality(gf)); + break; + case vbr_abr: + console_printf("%s MPEG-%u%s Layer III (%gx) average %d kbps qval=%i\n", + mode_names[lame_get_force_ms(gf)][lame_get_mode(gf)], + 2 - lame_get_version(gf), + lame_get_out_samplerate(gf) < 16000 ? ".5" : "", + 0.1 * (int) (10. * lame_get_compression_ratio(gf) + 0.5), + lame_get_VBR_mean_bitrate_kbps(gf), + lame_get_quality(gf)); + break; + default: + console_printf("%s MPEG-%u%s Layer III (%gx) %3d kbps qval=%i\n", + mode_names[lame_get_force_ms(gf)][lame_get_mode(gf)], + 2 - lame_get_version(gf), + lame_get_out_samplerate(gf) < 16000 ? ".5" : "", + 0.1 * (int) (10. * lame_get_compression_ratio(gf) + 0.5), + lame_get_brate(gf), + lame_get_quality(gf)); + break; + } + } + + if (global_ui_config.silent <= -10) { + lame_print_internals(gf); + } + } +} + +void +encoder_progress( lame_global_flags const* gf ) +{ + if (global_ui_config.silent <= 0) { + int const frames = lame_get_frameNum(gf); + int const frames_diff = frames - global_encoder_progress.last_frame_num; + if (global_ui_config.update_interval <= 0) { /* most likely --disptime x not used */ + if (frames_diff < 100 && frames_diff != 0) { /* true, most of the time */ + return; + } + global_encoder_progress.last_frame_num = (frames/100)*100; + } + else { + if (frames != 0 && frames != 9) { + double const act = GetRealTime(); + double const dif = act - global_encoder_progress.last_time; + if (dif >= 0 && dif < global_ui_config.update_interval) { + return; + } + } + global_encoder_progress.last_time = GetRealTime(); /* from now! disp_time seconds */ + } + if (global_ui_config.brhist) { + brhist_jump_back(); + } + timestatus(gf); + if (global_ui_config.brhist) { + brhist_disp(gf); + } + console_flush(); + } +} + +void +encoder_progress_end( lame_global_flags const* gf ) +{ + if (global_ui_config.silent <= 0) { + if (global_ui_config.brhist) { + brhist_jump_back(); + } + timestatus(gf); + if (global_ui_config.brhist) { + brhist_disp(gf); + } + timestatus_finish(); + } +} + + +/* these functions are used in get_audio.c */ +static struct DecoderProgress { + int last_mode_ext; + int frames_total; + int frame_ctr; + int framesize; + unsigned long samples; +} global_decoder_progress; + +static +unsigned long calcEndPadding(unsigned long samples, int pcm_samples_per_frame) +{ + unsigned long end_padding; + samples += 576; + end_padding = pcm_samples_per_frame - (samples % pcm_samples_per_frame); + if (end_padding < 576) + end_padding += pcm_samples_per_frame; + return end_padding; +} + +static +unsigned long calcNumBlocks(unsigned long samples, int pcm_samples_per_frame) +{ + unsigned long end_padding; + samples += 576; + end_padding = pcm_samples_per_frame - (samples % pcm_samples_per_frame); + if (end_padding < 576) + end_padding += pcm_samples_per_frame; + return (samples + end_padding) / pcm_samples_per_frame; +} + +DecoderProgress +decoder_progress_init(unsigned long n, int framesize) +{ + DecoderProgress dp = &global_decoder_progress; + dp->last_mode_ext =0; + dp->frames_total = 0; + dp->frame_ctr = 0; + dp->framesize = framesize; + dp->samples = 0; + if (n != (0ul-1ul)) { + if (framesize == 576 || framesize == 1152) { + dp->frames_total = calcNumBlocks(n, framesize); + dp->samples = 576 + calcEndPadding(n, framesize); + } + else if (framesize > 0) { + dp->frames_total = n / framesize; + } + else { + dp->frames_total = n; + } + } + return dp; +} + +static void +addSamples(DecoderProgress dp, int iread) +{ + dp->samples += iread; + dp->frame_ctr += dp->samples / dp->framesize; + dp->samples %= dp->framesize; + if (dp->frames_total < dp->frame_ctr) { + dp->frames_total = dp->frame_ctr; + } +} + +void +decoder_progress(DecoderProgress dp, const mp3data_struct * mp3data, int iread) +{ + addSamples(dp, iread); + + console_printf("\rFrame#%6i/%-6i %3i kbps", + dp->frame_ctr, dp->frames_total, mp3data->bitrate); + + /* Programmed with a single frame hold delay */ + /* Attention: static data */ + + /* MP2 Playback is still buggy. */ + /* "'00' subbands 4-31 in intensity_stereo, bound==4" */ + /* is this really intensity_stereo or is it MS stereo? */ + + if (mp3data->mode == JOINT_STEREO) { + int curr = mp3data->mode_ext; + int last = dp->last_mode_ext; + console_printf(" %s %c", + curr & 2 ? last & 2 ? " MS " : "LMSR" : last & 2 ? "LMSR" : "L R", + curr & 1 ? last & 1 ? 'I' : 'i' : last & 1 ? 'i' : ' '); + dp->last_mode_ext = curr; + } + else { + console_printf(" "); + dp->last_mode_ext = 0; + } +/* console_printf ("%s", Console_IO.str_clreoln ); */ + console_printf(" \b\b\b\b\b\b\b\b"); + console_flush(); +} + +void +decoder_progress_finish(DecoderProgress dp) +{ + (void) dp; + console_printf("\n"); +} diff --git a/node_modules/lame/deps/lame/frontend/timestatus.h b/node_modules/lame/deps/lame/frontend/timestatus.h new file mode 100644 index 0000000..f5d343b --- /dev/null +++ b/node_modules/lame/deps/lame/frontend/timestatus.h @@ -0,0 +1,46 @@ +/* + * time status related function include file + * + * Copyright (c) 1999 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_TIMESTATUS_H +#define LAME_TIMESTATUS_H + +#if defined(__cplusplus) +extern "C" { +#endif + +void encoder_progress_begin( lame_global_flags const* gfp + , char const* inpath + , char const* outpath ); +void encoder_progress( lame_global_flags const* gfp ); +void encoder_progress_end(lame_global_flags const* gfp); + +struct DecoderProgress; +typedef struct DecoderProgress* DecoderProgress; + +DecoderProgress decoder_progress_init(unsigned long n, int framesize); +void decoder_progress(DecoderProgress dp, const mp3data_struct *, int iread); +void decoder_progress_finish(DecoderProgress dp); + +#if defined(__cplusplus) +} +#endif + +#endif /* LAME_TIMESTATUS_H */ diff --git a/node_modules/lame/deps/lame/include/Makefile.am b/node_modules/lame/deps/lame/include/Makefile.am new file mode 100644 index 0000000..e630495 --- /dev/null +++ b/node_modules/lame/deps/lame/include/Makefile.am @@ -0,0 +1,8 @@ +## $Id: Makefile.am,v 1.4 2010/03/14 17:23:35 robert Exp $ + +include $(top_srcdir)/Makefile.am.global + +pkginclude_HEADERS = lame.h + +EXTRA_DIST = lame.def libmp3lame.sym + diff --git a/node_modules/lame/deps/lame/include/Makefile.in b/node_modules/lame/deps/lame/include/Makefile.in new file mode 100644 index 0000000..0e6fd20 --- /dev/null +++ b/node_modules/lame/deps/lame/include/Makefile.in @@ -0,0 +1,484 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# global section for every Makefile.am + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.am.global +subdir = include +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.11 foreign $(top_srcdir)/ansi2knr +pkginclude_HEADERS = lame.h +EXTRA_DIST = lame.def libmp3lame.sym +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign include/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkgincludeHEADERS + + +# end global section + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/include/lame.def b/node_modules/lame/deps/lame/include/lame.def new file mode 100644 index 0000000..5242b5f --- /dev/null +++ b/node_modules/lame/deps/lame/include/lame.def @@ -0,0 +1,299 @@ +LIBRARY libmp3lame.DLL +EXPORTS + +lame_init @1 + +lame_set_num_samples @2 +lame_get_num_samples @3 + +lame_set_in_samplerate @4 +lame_get_in_samplerate @5 + +lame_set_num_channels @6 +lame_get_num_channels @7 + +lame_set_scale @8 +lame_get_scale @9 + +lame_set_scale_left @10 +lame_get_scale_left @11 + +lame_set_scale_right @12 +lame_get_scale_right @13 + +lame_set_out_samplerate @14 +lame_get_out_samplerate @15 + +lame_set_analysis @16 +lame_get_analysis @17 + +lame_set_bWriteVbrTag @18 +lame_get_bWriteVbrTag @19 + +lame_set_decode_only @20 +lame_get_decode_only @21 + +lame_set_quality @22 +lame_get_quality @23 + +lame_set_mode @24 +lame_get_mode @25 + +lame_set_force_ms @26 +lame_get_force_ms @27 + +lame_set_free_format @28 +lame_get_free_format @29 + + +lame_set_findReplayGain @30 +lame_get_findReplayGain @31 + +lame_set_decode_on_the_fly @32 +lame_get_decode_on_the_fly @33 + +lame_set_nogap_total @34 +lame_get_nogap_total @35 + +lame_set_nogap_currentindex @36 +lame_get_nogap_currentindex @37 + + +lame_set_errorf @38 +lame_set_debugf @39 +lame_set_msgf @40 + +lame_set_brate @41 +lame_get_brate @42 + +lame_set_compression_ratio @43 +lame_get_compression_ratio @44 + +lame_set_preset @45 + +lame_set_asm_optimizations @46 + + +lame_set_copyright @47 +lame_get_copyright @48 + +lame_set_original @49 +lame_get_original @50 + +lame_set_error_protection @51 +lame_get_error_protection @52 + +lame_set_padding_type @53 +lame_get_padding_type @54 + +lame_set_extension @55 +lame_get_extension @56 + +lame_set_strict_ISO @57 +lame_get_strict_ISO @58 + +lame_set_disable_reservoir @59 +lame_get_disable_reservoir @60 + +lame_set_quant_comp @61 +lame_get_quant_comp @62 +lame_set_quant_comp_short @63 +lame_get_quant_comp_short @64 + +lame_set_experimentalX @65 +lame_get_experimentalX @66 + +lame_set_experimentalY @67 +lame_get_experimentalY @68 + +lame_set_experimentalZ @69 +lame_get_experimentalZ @70 + +lame_set_exp_nspsytune @71 +lame_get_exp_nspsytune @72 + +lame_set_msfix @73 +lame_get_msfix @74 + +lame_set_VBR @75 +lame_get_VBR @76 + +lame_set_VBR_q @77 +lame_get_VBR_q @78 + +lame_set_VBR_mean_bitrate_kbps @79 +lame_get_VBR_mean_bitrate_kbps @80 + +lame_set_VBR_min_bitrate_kbps @81 +lame_get_VBR_min_bitrate_kbps @82 + +lame_set_VBR_max_bitrate_kbps @83 +lame_get_VBR_max_bitrate_kbps @84 + +lame_set_VBR_hard_min @85 +lame_get_VBR_hard_min @86 + +lame_set_preset_expopts @87 + +lame_set_lowpassfreq @88 +lame_get_lowpassfreq @89 + +lame_set_lowpasswidth @90 +lame_get_lowpasswidth @91 + +lame_set_highpassfreq @92 +lame_get_highpassfreq @93 + +lame_set_highpasswidth @94 +lame_get_highpasswidth @95 + +lame_set_ATHonly @96 +lame_get_ATHonly @97 + +lame_set_ATHshort @98 +lame_get_ATHshort @99 + +lame_set_noATH @100 +lame_get_noATH @101 + +lame_set_ATHtype @102 +lame_get_ATHtype @103 + +lame_set_ATHlower @104 +lame_get_ATHlower @105 + +lame_set_athaa_type @106 +lame_get_athaa_type @107 + +lame_set_athaa_loudapprox @108 +lame_get_athaa_loudapprox @109 + +lame_set_athaa_sensitivity @110 +lame_get_athaa_sensitivity @111 + +lame_set_cwlimit @112 +lame_get_cwlimit @113 + +lame_set_useTemporal @114 +lame_get_useTemporal @115 + +lame_set_interChRatio @116 +lame_get_interChRatio @117 + +lame_set_no_short_blocks @118 +lame_get_no_short_blocks @119 +lame_set_force_short_blocks @120 +lame_get_force_short_blocks @121 +lame_set_allow_diff_short @122 +lame_get_allow_diff_short @123 + +lame_set_emphasis @124 +lame_get_emphasis @125 + +lame_get_version @126 +lame_get_encoder_delay @127 +lame_get_encoder_padding @128 +lame_get_framesize @129 + +lame_get_mf_samples_to_encode @130 +lame_get_size_mp3buffer @131 +lame_get_frameNum @132 +lame_get_totalframes @133 + +lame_get_RadioGain @134 +lame_get_AudiophileGain @135 +lame_get_PeakSample @136 +lame_get_noclipGainChange @137 +lame_get_noclipScale @138 + +lame_init_params @139 + +get_lame_version @140 +get_lame_short_version @141 +get_lame_very_short_version @142 +get_psy_version @143 +get_lame_url @144 + +get_lame_version_numerical @145 + +lame_print_config @146 +lame_print_internals @147 + +lame_encode_buffer @148 +lame_encode_buffer_interleaved @149 +lame_encode_buffer_float @150 +lame_encode_buffer_long @151 +lame_encode_buffer_long2 @152 +lame_encode_buffer_int @153 +lame_encode_flush @154 +lame_encode_flush_nogap @155 + +lame_init_bitstream @156 + +lame_bitrate_hist @157 +lame_bitrate_kbps @158 +lame_stereo_mode_hist @159 +lame_bitrate_stereo_mode_hist @160 +lame_block_type_hist @161 +lame_bitrate_block_type_hist @162 +lame_mp3_tags_fid @163 +lame_close @164 +lame_get_lametag_frame @165 +get_lame_os_bitness @166 +lame_set_VBR_quality @167 +lame_get_VBR_quality @168 + +lame_encode_buffer_ieee_float @169 +lame_encode_buffer_interleaved_ieee_float @170 +lame_encode_buffer_ieee_double @171 +lame_encode_buffer_interleaved_ieee_double @172 + +lame_get_bitrate @502 +lame_get_samplerate @503 + +lame_decode_init @1000 +lame_decode @1001 +lame_decode_headers @1002 +lame_decode1 @1003 +lame_decode1_headers @1004 +lame_decode1_headersB @1005 +lame_decode_exit @1006 + +hip_decode_init @1100 +hip_decode_exit @1101 +hip_decode @1102 +hip_decode_headers @1103 +hip_decode1 @1104 +hip_decode1_headers @1105 +hip_decode1_headersB @1106 +hip_set_debugf @1107 +hip_set_errorf @1108 +hip_set_msgf @1109 + +id3tag_genre_list @2000 +id3tag_init @2001 +id3tag_add_v2 @2002 +id3tag_v1_only @2003 +id3tag_v2_only @2004 +id3tag_space_v1 @2005 +id3tag_pad_v2 @2006 +id3tag_set_title @2007 +id3tag_set_artist @2008 +id3tag_set_album @2009 +id3tag_set_year @2010 +id3tag_set_comment @2011 +id3tag_set_track @2012 +id3tag_set_genre @2013 +id3tag_set_fieldvalue @2014 +id3tag_set_albumart @2015 +lame_get_id3v1_tag @2016 +lame_get_id3v2_tag @2017 +lame_set_write_id3tag_automatic @2018 +lame_get_write_id3tag_automatic @2019 +id3tag_set_pad @2020 +id3tag_set_comment_ucs2 @2021 +id3tag_set_textinfo_ucs2 @2022 +id3tag_set_fieldvalue_ucs2 @2023 +id3tag_set_comment_utf16 @2024 +id3tag_set_textinfo_utf16 @2025 +id3tag_set_fieldvalue_utf16 @2026 \ No newline at end of file diff --git a/node_modules/lame/deps/lame/include/lame.h b/node_modules/lame/deps/lame/include/lame.h new file mode 100644 index 0000000..791d491 --- /dev/null +++ b/node_modules/lame/deps/lame/include/lame.h @@ -0,0 +1,1323 @@ +/* + * Interface to MP3 LAME encoding engine + * + * Copyright (c) 1999 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: lame.h,v 1.189.2.1 2012/01/08 23:49:58 robert Exp $ */ + +#ifndef LAME_LAME_H +#define LAME_LAME_H + +/* for size_t typedef */ +#include +/* for va_list typedef */ +#include +/* for FILE typedef, TODO: remove when removing lame_mp3_tags_fid */ +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +typedef void (*lame_report_function)(const char *format, va_list ap); + +#if defined(WIN32) || defined(_WIN32) +#undef CDECL +#define CDECL __cdecl +#else +#define CDECL +#endif + +#define DEPRECATED_OR_OBSOLETE_CODE_REMOVED 1 + +typedef enum vbr_mode_e { + vbr_off=0, + vbr_mt, /* obsolete, same as vbr_mtrh */ + vbr_rh, + vbr_abr, + vbr_mtrh, + vbr_max_indicator, /* Don't use this! It's used for sanity checks. */ + vbr_default=vbr_mtrh /* change this to change the default VBR mode of LAME */ +} vbr_mode; + + +/* MPEG modes */ +typedef enum MPEG_mode_e { + STEREO = 0, + JOINT_STEREO, + DUAL_CHANNEL, /* LAME doesn't supports this! */ + MONO, + NOT_SET, + MAX_INDICATOR /* Don't use this! It's used for sanity checks. */ +} MPEG_mode; + +/* Padding types */ +typedef enum Padding_type_e { + PAD_NO = 0, + PAD_ALL, + PAD_ADJUST, + PAD_MAX_INDICATOR /* Don't use this! It's used for sanity checks. */ +} Padding_type; + + + +/*presets*/ +typedef enum preset_mode_e { + /*values from 8 to 320 should be reserved for abr bitrates*/ + /*for abr I'd suggest to directly use the targeted bitrate as a value*/ + ABR_8 = 8, + ABR_320 = 320, + + V9 = 410, /*Vx to match Lame and VBR_xx to match FhG*/ + VBR_10 = 410, + V8 = 420, + VBR_20 = 420, + V7 = 430, + VBR_30 = 430, + V6 = 440, + VBR_40 = 440, + V5 = 450, + VBR_50 = 450, + V4 = 460, + VBR_60 = 460, + V3 = 470, + VBR_70 = 470, + V2 = 480, + VBR_80 = 480, + V1 = 490, + VBR_90 = 490, + V0 = 500, + VBR_100 = 500, + + + + /*still there for compatibility*/ + R3MIX = 1000, + STANDARD = 1001, + EXTREME = 1002, + INSANE = 1003, + STANDARD_FAST = 1004, + EXTREME_FAST = 1005, + MEDIUM = 1006, + MEDIUM_FAST = 1007 +} preset_mode; + + +/*asm optimizations*/ +typedef enum asm_optimizations_e { + MMX = 1, + AMD_3DNOW = 2, + SSE = 3 +} asm_optimizations; + + +/* psychoacoustic model */ +typedef enum Psy_model_e { + PSY_GPSYCHO = 1, + PSY_NSPSYTUNE = 2 +} Psy_model; + + +/* buffer considerations */ +typedef enum buffer_constraint_e { + MDB_DEFAULT=0, + MDB_STRICT_ISO=1, + MDB_MAXIMUM=2 +} buffer_constraint; + + +struct lame_global_struct; +typedef struct lame_global_struct lame_global_flags; +typedef lame_global_flags *lame_t; + + + + +/*********************************************************************** + * + * The LAME API + * These functions should be called, in this order, for each + * MP3 file to be encoded. See the file "API" for more documentation + * + ***********************************************************************/ + + +/* + * REQUIRED: + * initialize the encoder. sets default for all encoder parameters, + * returns NULL if some malloc()'s failed + * otherwise returns pointer to structure needed for all future + * API calls. + */ +lame_global_flags * CDECL lame_init(void); +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +/* obsolete version */ +int CDECL lame_init_old(lame_global_flags *); +#endif + +/* + * OPTIONAL: + * set as needed to override defaults + */ + +/******************************************************************** + * input stream description + ***********************************************************************/ +/* number of samples. default = 2^32-1 */ +int CDECL lame_set_num_samples(lame_global_flags *, unsigned long); +unsigned long CDECL lame_get_num_samples(const lame_global_flags *); + +/* input sample rate in Hz. default = 44100hz */ +int CDECL lame_set_in_samplerate(lame_global_flags *, int); +int CDECL lame_get_in_samplerate(const lame_global_flags *); + +/* number of channels in input stream. default=2 */ +int CDECL lame_set_num_channels(lame_global_flags *, int); +int CDECL lame_get_num_channels(const lame_global_flags *); + +/* + scale the input by this amount before encoding. default=1 + (not used by decoding routines) +*/ +int CDECL lame_set_scale(lame_global_flags *, float); +float CDECL lame_get_scale(const lame_global_flags *); + +/* + scale the channel 0 (left) input by this amount before encoding. default=1 + (not used by decoding routines) +*/ +int CDECL lame_set_scale_left(lame_global_flags *, float); +float CDECL lame_get_scale_left(const lame_global_flags *); + +/* + scale the channel 1 (right) input by this amount before encoding. default=1 + (not used by decoding routines) +*/ +int CDECL lame_set_scale_right(lame_global_flags *, float); +float CDECL lame_get_scale_right(const lame_global_flags *); + +/* + output sample rate in Hz. default = 0, which means LAME picks best value + based on the amount of compression. MPEG only allows: + MPEG1 32, 44.1, 48khz + MPEG2 16, 22.05, 24 + MPEG2.5 8, 11.025, 12 + (not used by decoding routines) +*/ +int CDECL lame_set_out_samplerate(lame_global_flags *, int); +int CDECL lame_get_out_samplerate(const lame_global_flags *); + + +/******************************************************************** + * general control parameters + ***********************************************************************/ +/* 1=cause LAME to collect data for an MP3 frame analyzer. default=0 */ +int CDECL lame_set_analysis(lame_global_flags *, int); +int CDECL lame_get_analysis(const lame_global_flags *); + +/* + 1 = write a Xing VBR header frame. + default = 1 + this variable must have been added by a Hungarian notation Windows programmer :-) +*/ +int CDECL lame_set_bWriteVbrTag(lame_global_flags *, int); +int CDECL lame_get_bWriteVbrTag(const lame_global_flags *); + +/* 1=decode only. use lame/mpglib to convert mp3/ogg to wav. default=0 */ +int CDECL lame_set_decode_only(lame_global_flags *, int); +int CDECL lame_get_decode_only(const lame_global_flags *); + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +/* 1=encode a Vorbis .ogg file. default=0 */ +/* DEPRECATED */ +int CDECL lame_set_ogg(lame_global_flags *, int); +int CDECL lame_get_ogg(const lame_global_flags *); +#endif + +/* + internal algorithm selection. True quality is determined by the bitrate + but this variable will effect quality by selecting expensive or cheap algorithms. + quality=0..9. 0=best (very slow). 9=worst. + recommended: 2 near-best quality, not too slow + 5 good quality, fast + 7 ok quality, really fast +*/ +int CDECL lame_set_quality(lame_global_flags *, int); +int CDECL lame_get_quality(const lame_global_flags *); + +/* + mode = 0,1,2,3 = stereo, jstereo, dual channel (not supported), mono + default: lame picks based on compression ration and input channels +*/ +int CDECL lame_set_mode(lame_global_flags *, MPEG_mode); +MPEG_mode CDECL lame_get_mode(const lame_global_flags *); + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +/* + mode_automs. Use a M/S mode with a switching threshold based on + compression ratio + DEPRECATED +*/ +int CDECL lame_set_mode_automs(lame_global_flags *, int); +int CDECL lame_get_mode_automs(const lame_global_flags *); +#endif + +/* + force_ms. Force M/S for all frames. For testing only. + default = 0 (disabled) +*/ +int CDECL lame_set_force_ms(lame_global_flags *, int); +int CDECL lame_get_force_ms(const lame_global_flags *); + +/* use free_format? default = 0 (disabled) */ +int CDECL lame_set_free_format(lame_global_flags *, int); +int CDECL lame_get_free_format(const lame_global_flags *); + +/* perform ReplayGain analysis? default = 0 (disabled) */ +int CDECL lame_set_findReplayGain(lame_global_flags *, int); +int CDECL lame_get_findReplayGain(const lame_global_flags *); + +/* decode on the fly. Search for the peak sample. If the ReplayGain + * analysis is enabled then perform the analysis on the decoded data + * stream. default = 0 (disabled) + * NOTE: if this option is set the build-in decoder should not be used */ +int CDECL lame_set_decode_on_the_fly(lame_global_flags *, int); +int CDECL lame_get_decode_on_the_fly(const lame_global_flags *); + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +/* DEPRECATED: now does the same as lame_set_findReplayGain() + default = 0 (disabled) */ +int CDECL lame_set_ReplayGain_input(lame_global_flags *, int); +int CDECL lame_get_ReplayGain_input(const lame_global_flags *); + +/* DEPRECATED: now does the same as + lame_set_decode_on_the_fly() && lame_set_findReplayGain() + default = 0 (disabled) */ +int CDECL lame_set_ReplayGain_decode(lame_global_flags *, int); +int CDECL lame_get_ReplayGain_decode(const lame_global_flags *); + +/* DEPRECATED: now does the same as lame_set_decode_on_the_fly() + default = 0 (disabled) */ +int CDECL lame_set_findPeakSample(lame_global_flags *, int); +int CDECL lame_get_findPeakSample(const lame_global_flags *); +#endif + +/* counters for gapless encoding */ +int CDECL lame_set_nogap_total(lame_global_flags*, int); +int CDECL lame_get_nogap_total(const lame_global_flags*); + +int CDECL lame_set_nogap_currentindex(lame_global_flags* , int); +int CDECL lame_get_nogap_currentindex(const lame_global_flags*); + + +/* + * OPTIONAL: + * Set printf like error/debug/message reporting functions. + * The second argument has to be a pointer to a function which looks like + * void my_debugf(const char *format, va_list ap) + * { + * (void) vfprintf(stdout, format, ap); + * } + * If you use NULL as the value of the pointer in the set function, the + * lame buildin function will be used (prints to stderr). + * To quiet any output you have to replace the body of the example function + * with just "return;" and use it in the set function. + */ +int CDECL lame_set_errorf(lame_global_flags *, lame_report_function); +int CDECL lame_set_debugf(lame_global_flags *, lame_report_function); +int CDECL lame_set_msgf (lame_global_flags *, lame_report_function); + + + +/* set one of brate compression ratio. default is compression ratio of 11. */ +int CDECL lame_set_brate(lame_global_flags *, int); +int CDECL lame_get_brate(const lame_global_flags *); +int CDECL lame_set_compression_ratio(lame_global_flags *, float); +float CDECL lame_get_compression_ratio(const lame_global_flags *); + + +int CDECL lame_set_preset( lame_global_flags* gfp, int ); +int CDECL lame_set_asm_optimizations( lame_global_flags* gfp, int, int ); + + + +/******************************************************************** + * frame params + ***********************************************************************/ +/* mark as copyright. default=0 */ +int CDECL lame_set_copyright(lame_global_flags *, int); +int CDECL lame_get_copyright(const lame_global_flags *); + +/* mark as original. default=1 */ +int CDECL lame_set_original(lame_global_flags *, int); +int CDECL lame_get_original(const lame_global_flags *); + +/* error_protection. Use 2 bytes from each frame for CRC checksum. default=0 */ +int CDECL lame_set_error_protection(lame_global_flags *, int); +int CDECL lame_get_error_protection(const lame_global_flags *); + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +/* padding_type. 0=pad no frames 1=pad all frames 2=adjust padding(default) */ +int CDECL lame_set_padding_type(lame_global_flags *, Padding_type); +Padding_type CDECL lame_get_padding_type(const lame_global_flags *); +#endif + +/* MP3 'private extension' bit Meaningless. default=0 */ +int CDECL lame_set_extension(lame_global_flags *, int); +int CDECL lame_get_extension(const lame_global_flags *); + +/* enforce strict ISO compliance. default=0 */ +int CDECL lame_set_strict_ISO(lame_global_flags *, int); +int CDECL lame_get_strict_ISO(const lame_global_flags *); + + +/******************************************************************** + * quantization/noise shaping + ***********************************************************************/ + +/* disable the bit reservoir. For testing only. default=0 */ +int CDECL lame_set_disable_reservoir(lame_global_flags *, int); +int CDECL lame_get_disable_reservoir(const lame_global_flags *); + +/* select a different "best quantization" function. default=0 */ +int CDECL lame_set_quant_comp(lame_global_flags *, int); +int CDECL lame_get_quant_comp(const lame_global_flags *); +int CDECL lame_set_quant_comp_short(lame_global_flags *, int); +int CDECL lame_get_quant_comp_short(const lame_global_flags *); + +int CDECL lame_set_experimentalX(lame_global_flags *, int); /* compatibility*/ +int CDECL lame_get_experimentalX(const lame_global_flags *); + +/* another experimental option. for testing only */ +int CDECL lame_set_experimentalY(lame_global_flags *, int); +int CDECL lame_get_experimentalY(const lame_global_flags *); + +/* another experimental option. for testing only */ +int CDECL lame_set_experimentalZ(lame_global_flags *, int); +int CDECL lame_get_experimentalZ(const lame_global_flags *); + +/* Naoki's psycho acoustic model. default=0 */ +int CDECL lame_set_exp_nspsytune(lame_global_flags *, int); +int CDECL lame_get_exp_nspsytune(const lame_global_flags *); + +void CDECL lame_set_msfix(lame_global_flags *, double); +float CDECL lame_get_msfix(const lame_global_flags *); + + +/******************************************************************** + * VBR control + ***********************************************************************/ +/* Types of VBR. default = vbr_off = CBR */ +int CDECL lame_set_VBR(lame_global_flags *, vbr_mode); +vbr_mode CDECL lame_get_VBR(const lame_global_flags *); + +/* VBR quality level. 0=highest 9=lowest */ +int CDECL lame_set_VBR_q(lame_global_flags *, int); +int CDECL lame_get_VBR_q(const lame_global_flags *); + +/* VBR quality level. 0=highest 9=lowest, Range [0,...,10[ */ +int CDECL lame_set_VBR_quality(lame_global_flags *, float); +float CDECL lame_get_VBR_quality(const lame_global_flags *); + +/* Ignored except for VBR=vbr_abr (ABR mode) */ +int CDECL lame_set_VBR_mean_bitrate_kbps(lame_global_flags *, int); +int CDECL lame_get_VBR_mean_bitrate_kbps(const lame_global_flags *); + +int CDECL lame_set_VBR_min_bitrate_kbps(lame_global_flags *, int); +int CDECL lame_get_VBR_min_bitrate_kbps(const lame_global_flags *); + +int CDECL lame_set_VBR_max_bitrate_kbps(lame_global_flags *, int); +int CDECL lame_get_VBR_max_bitrate_kbps(const lame_global_flags *); + +/* + 1=strictly enforce VBR_min_bitrate. Normally it will be violated for + analog silence +*/ +int CDECL lame_set_VBR_hard_min(lame_global_flags *, int); +int CDECL lame_get_VBR_hard_min(const lame_global_flags *); + +/* for preset */ +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +int CDECL lame_set_preset_expopts(lame_global_flags *, int); +#endif + +/******************************************************************** + * Filtering control + ***********************************************************************/ +/* freq in Hz to apply lowpass. Default = 0 = lame chooses. -1 = disabled */ +int CDECL lame_set_lowpassfreq(lame_global_flags *, int); +int CDECL lame_get_lowpassfreq(const lame_global_flags *); +/* width of transition band, in Hz. Default = one polyphase filter band */ +int CDECL lame_set_lowpasswidth(lame_global_flags *, int); +int CDECL lame_get_lowpasswidth(const lame_global_flags *); + +/* freq in Hz to apply highpass. Default = 0 = lame chooses. -1 = disabled */ +int CDECL lame_set_highpassfreq(lame_global_flags *, int); +int CDECL lame_get_highpassfreq(const lame_global_flags *); +/* width of transition band, in Hz. Default = one polyphase filter band */ +int CDECL lame_set_highpasswidth(lame_global_flags *, int); +int CDECL lame_get_highpasswidth(const lame_global_flags *); + + +/******************************************************************** + * psycho acoustics and other arguments which you should not change + * unless you know what you are doing + ***********************************************************************/ + +/* only use ATH for masking */ +int CDECL lame_set_ATHonly(lame_global_flags *, int); +int CDECL lame_get_ATHonly(const lame_global_flags *); + +/* only use ATH for short blocks */ +int CDECL lame_set_ATHshort(lame_global_flags *, int); +int CDECL lame_get_ATHshort(const lame_global_flags *); + +/* disable ATH */ +int CDECL lame_set_noATH(lame_global_flags *, int); +int CDECL lame_get_noATH(const lame_global_flags *); + +/* select ATH formula */ +int CDECL lame_set_ATHtype(lame_global_flags *, int); +int CDECL lame_get_ATHtype(const lame_global_flags *); + +/* lower ATH by this many db */ +int CDECL lame_set_ATHlower(lame_global_flags *, float); +float CDECL lame_get_ATHlower(const lame_global_flags *); + +/* select ATH adaptive adjustment type */ +int CDECL lame_set_athaa_type( lame_global_flags *, int); +int CDECL lame_get_athaa_type( const lame_global_flags *); + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +/* select the loudness approximation used by the ATH adaptive auto-leveling */ +int CDECL lame_set_athaa_loudapprox( lame_global_flags *, int); +int CDECL lame_get_athaa_loudapprox( const lame_global_flags *); +#endif + +/* adjust (in dB) the point below which adaptive ATH level adjustment occurs */ +int CDECL lame_set_athaa_sensitivity( lame_global_flags *, float); +float CDECL lame_get_athaa_sensitivity( const lame_global_flags* ); + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +/* OBSOLETE: predictability limit (ISO tonality formula) */ +int CDECL lame_set_cwlimit(lame_global_flags *, int); +int CDECL lame_get_cwlimit(const lame_global_flags *); +#endif + +/* + allow blocktypes to differ between channels? + default: 0 for jstereo, 1 for stereo +*/ +int CDECL lame_set_allow_diff_short(lame_global_flags *, int); +int CDECL lame_get_allow_diff_short(const lame_global_flags *); + +/* use temporal masking effect (default = 1) */ +int CDECL lame_set_useTemporal(lame_global_flags *, int); +int CDECL lame_get_useTemporal(const lame_global_flags *); + +/* use temporal masking effect (default = 1) */ +int CDECL lame_set_interChRatio(lame_global_flags *, float); +float CDECL lame_get_interChRatio(const lame_global_flags *); + +/* disable short blocks */ +int CDECL lame_set_no_short_blocks(lame_global_flags *, int); +int CDECL lame_get_no_short_blocks(const lame_global_flags *); + +/* force short blocks */ +int CDECL lame_set_force_short_blocks(lame_global_flags *, int); +int CDECL lame_get_force_short_blocks(const lame_global_flags *); + +/* Input PCM is emphased PCM (for instance from one of the rarely + emphased CDs), it is STRONGLY not recommended to use this, because + psycho does not take it into account, and last but not least many decoders + ignore these bits */ +int CDECL lame_set_emphasis(lame_global_flags *, int); +int CDECL lame_get_emphasis(const lame_global_flags *); + + + +/************************************************************************/ +/* internal variables, cannot be set... */ +/* provided because they may be of use to calling application */ +/************************************************************************/ +/* version 0=MPEG-2 1=MPEG-1 (2=MPEG-2.5) */ +int CDECL lame_get_version(const lame_global_flags *); + +/* encoder delay */ +int CDECL lame_get_encoder_delay(const lame_global_flags *); + +/* + padding appended to the input to make sure decoder can fully decode + all input. Note that this value can only be calculated during the + call to lame_encoder_flush(). Before lame_encoder_flush() has + been called, the value of encoder_padding = 0. +*/ +int CDECL lame_get_encoder_padding(const lame_global_flags *); + +/* size of MPEG frame */ +int CDECL lame_get_framesize(const lame_global_flags *); + +/* number of PCM samples buffered, but not yet encoded to mp3 data. */ +int CDECL lame_get_mf_samples_to_encode( const lame_global_flags* gfp ); + +/* + size (bytes) of mp3 data buffered, but not yet encoded. + this is the number of bytes which would be output by a call to + lame_encode_flush_nogap. NOTE: lame_encode_flush() will return + more bytes than this because it will encode the reamining buffered + PCM samples before flushing the mp3 buffers. +*/ +int CDECL lame_get_size_mp3buffer( const lame_global_flags* gfp ); + +/* number of frames encoded so far */ +int CDECL lame_get_frameNum(const lame_global_flags *); + +/* + lame's estimate of the total number of frames to be encoded + only valid if calling program set num_samples +*/ +int CDECL lame_get_totalframes(const lame_global_flags *); + +/* RadioGain value. Multiplied by 10 and rounded to the nearest. */ +int CDECL lame_get_RadioGain(const lame_global_flags *); + +/* AudiophileGain value. Multipled by 10 and rounded to the nearest. */ +int CDECL lame_get_AudiophileGain(const lame_global_flags *); + +/* the peak sample */ +float CDECL lame_get_PeakSample(const lame_global_flags *); + +/* Gain change required for preventing clipping. The value is correct only if + peak sample searching was enabled. If negative then the waveform + already does not clip. The value is multiplied by 10 and rounded up. */ +int CDECL lame_get_noclipGainChange(const lame_global_flags *); + +/* user-specified scale factor required for preventing clipping. Value is + correct only if peak sample searching was enabled and no user-specified + scaling was performed. If negative then either the waveform already does + not clip or the value cannot be determined */ +float CDECL lame_get_noclipScale(const lame_global_flags *); + + + + + + + +/* + * REQUIRED: + * sets more internal configuration based on data provided above. + * returns -1 if something failed. + */ +int CDECL lame_init_params(lame_global_flags *); + + +/* + * OPTIONAL: + * get the version number, in a string. of the form: + * "3.63 (beta)" or just "3.63". + */ +const char* CDECL get_lame_version ( void ); +const char* CDECL get_lame_short_version ( void ); +const char* CDECL get_lame_very_short_version ( void ); +const char* CDECL get_psy_version ( void ); +const char* CDECL get_lame_url ( void ); +const char* CDECL get_lame_os_bitness ( void ); + +/* + * OPTIONAL: + * get the version numbers in numerical form. + */ +typedef struct { + /* generic LAME version */ + int major; + int minor; + int alpha; /* 0 if not an alpha version */ + int beta; /* 0 if not a beta version */ + + /* version of the psy model */ + int psy_major; + int psy_minor; + int psy_alpha; /* 0 if not an alpha version */ + int psy_beta; /* 0 if not a beta version */ + + /* compile time features */ + const char *features; /* Don't make assumptions about the contents! */ +} lame_version_t; +void CDECL get_lame_version_numerical(lame_version_t *); + + +/* + * OPTIONAL: + * print internal lame configuration to message handler + */ +void CDECL lame_print_config(const lame_global_flags* gfp); + +void CDECL lame_print_internals( const lame_global_flags *gfp); + + +/* + * input pcm data, output (maybe) mp3 frames. + * This routine handles all buffering, resampling and filtering for you. + * + * return code number of bytes output in mp3buf. Can be 0 + * -1: mp3buf was too small + * -2: malloc() problem + * -3: lame_init_params() not called + * -4: psycho acoustic problems + * + * The required mp3buf_size can be computed from num_samples, + * samplerate and encoding rate, but here is a worst case estimate: + * + * mp3buf_size in bytes = 1.25*num_samples + 7200 + * + * I think a tighter bound could be: (mt, March 2000) + * MPEG1: + * num_samples*(bitrate/8)/samplerate + 4*1152*(bitrate/8)/samplerate + 512 + * MPEG2: + * num_samples*(bitrate/8)/samplerate + 4*576*(bitrate/8)/samplerate + 256 + * + * but test first if you use that! + * + * set mp3buf_size = 0 and LAME will not check if mp3buf_size is + * large enough. + * + * NOTE: + * if gfp->num_channels=2, but gfp->mode = 3 (mono), the L & R channels + * will be averaged into the L channel before encoding only the L channel + * This will overwrite the data in buffer_l[] and buffer_r[]. + * +*/ +int CDECL lame_encode_buffer ( + lame_global_flags* gfp, /* global context handle */ + const short int buffer_l [], /* PCM data for left channel */ + const short int buffer_r [], /* PCM data for right channel */ + const int nsamples, /* number of samples per channel */ + unsigned char* mp3buf, /* pointer to encoded MP3 stream */ + const int mp3buf_size ); /* number of valid octets in this + stream */ + +/* + * as above, but input has L & R channel data interleaved. + * NOTE: + * num_samples = number of samples in the L (or R) + * channel, not the total number of samples in pcm[] + */ +int CDECL lame_encode_buffer_interleaved( + lame_global_flags* gfp, /* global context handlei */ + short int pcm[], /* PCM data for left and right + channel, interleaved */ + int num_samples, /* number of samples per channel, + _not_ number of samples in + pcm[] */ + unsigned char* mp3buf, /* pointer to encoded MP3 stream */ + int mp3buf_size ); /* number of valid octets in this + stream */ + + +/* as lame_encode_buffer, but for 'float's. + * !! NOTE: !! data must still be scaled to be in the same range as + * short int, +/- 32768 + */ +int CDECL lame_encode_buffer_float( + lame_global_flags* gfp, /* global context handle */ + const float pcm_l [], /* PCM data for left channel */ + const float pcm_r [], /* PCM data for right channel */ + const int nsamples, /* number of samples per channel */ + unsigned char* mp3buf, /* pointer to encoded MP3 stream */ + const int mp3buf_size ); /* number of valid octets in this + stream */ + +/* as lame_encode_buffer, but for 'float's. + * !! NOTE: !! data must be scaled to +/- 1 full scale + */ +int CDECL lame_encode_buffer_ieee_float( + lame_t gfp, + const float pcm_l [], /* PCM data for left channel */ + const float pcm_r [], /* PCM data for right channel */ + const int nsamples, + unsigned char * mp3buf, + const int mp3buf_size); +int CDECL lame_encode_buffer_interleaved_ieee_float( + lame_t gfp, + const float pcm[], /* PCM data for left and right + channel, interleaved */ + const int nsamples, + unsigned char * mp3buf, + const int mp3buf_size); + +/* as lame_encode_buffer, but for 'double's. + * !! NOTE: !! data must be scaled to +/- 1 full scale + */ +int CDECL lame_encode_buffer_ieee_double( + lame_t gfp, + const double pcm_l [], /* PCM data for left channel */ + const double pcm_r [], /* PCM data for right channel */ + const int nsamples, + unsigned char * mp3buf, + const int mp3buf_size); +int CDECL lame_encode_buffer_interleaved_ieee_double( + lame_t gfp, + const double pcm[], /* PCM data for left and right + channel, interleaved */ + const int nsamples, + unsigned char * mp3buf, + const int mp3buf_size); + +/* as lame_encode_buffer, but for long's + * !! NOTE: !! data must still be scaled to be in the same range as + * short int, +/- 32768 + * + * This scaling was a mistake (doesn't allow one to exploit full + * precision of type 'long'. Use lame_encode_buffer_long2() instead. + * + */ +int CDECL lame_encode_buffer_long( + lame_global_flags* gfp, /* global context handle */ + const long buffer_l [], /* PCM data for left channel */ + const long buffer_r [], /* PCM data for right channel */ + const int nsamples, /* number of samples per channel */ + unsigned char* mp3buf, /* pointer to encoded MP3 stream */ + const int mp3buf_size ); /* number of valid octets in this + stream */ + +/* Same as lame_encode_buffer_long(), but with correct scaling. + * !! NOTE: !! data must still be scaled to be in the same range as + * type 'long'. Data should be in the range: +/- 2^(8*size(long)-1) + * + */ +int CDECL lame_encode_buffer_long2( + lame_global_flags* gfp, /* global context handle */ + const long buffer_l [], /* PCM data for left channel */ + const long buffer_r [], /* PCM data for right channel */ + const int nsamples, /* number of samples per channel */ + unsigned char* mp3buf, /* pointer to encoded MP3 stream */ + const int mp3buf_size ); /* number of valid octets in this + stream */ + +/* as lame_encode_buffer, but for int's + * !! NOTE: !! input should be scaled to the maximum range of 'int' + * If int is 4 bytes, then the values should range from + * +/- 2147483648. + * + * This routine does not (and cannot, without loosing precision) use + * the same scaling as the rest of the lame_encode_buffer() routines. + * + */ +int CDECL lame_encode_buffer_int( + lame_global_flags* gfp, /* global context handle */ + const int buffer_l [], /* PCM data for left channel */ + const int buffer_r [], /* PCM data for right channel */ + const int nsamples, /* number of samples per channel */ + unsigned char* mp3buf, /* pointer to encoded MP3 stream */ + const int mp3buf_size ); /* number of valid octets in this + stream */ + + + + + +/* + * REQUIRED: + * lame_encode_flush will flush the intenal PCM buffers, padding with + * 0's to make sure the final frame is complete, and then flush + * the internal MP3 buffers, and thus may return a + * final few mp3 frames. 'mp3buf' should be at least 7200 bytes long + * to hold all possible emitted data. + * + * will also write id3v1 tags (if any) into the bitstream + * + * return code = number of bytes output to mp3buf. Can be 0 + */ +int CDECL lame_encode_flush( + lame_global_flags * gfp, /* global context handle */ + unsigned char* mp3buf, /* pointer to encoded MP3 stream */ + int size); /* number of valid octets in this stream */ + +/* + * OPTIONAL: + * lame_encode_flush_nogap will flush the internal mp3 buffers and pad + * the last frame with ancillary data so it is a complete mp3 frame. + * + * 'mp3buf' should be at least 7200 bytes long + * to hold all possible emitted data. + * + * After a call to this routine, the outputed mp3 data is complete, but + * you may continue to encode new PCM samples and write future mp3 data + * to a different file. The two mp3 files will play back with no gaps + * if they are concatenated together. + * + * This routine will NOT write id3v1 tags into the bitstream. + * + * return code = number of bytes output to mp3buf. Can be 0 + */ +int CDECL lame_encode_flush_nogap( + lame_global_flags * gfp, /* global context handle */ + unsigned char* mp3buf, /* pointer to encoded MP3 stream */ + int size); /* number of valid octets in this stream */ + +/* + * OPTIONAL: + * Normally, this is called by lame_init_params(). It writes id3v2 and + * Xing headers into the front of the bitstream, and sets frame counters + * and bitrate histogram data to 0. You can also call this after + * lame_encode_flush_nogap(). + */ +int CDECL lame_init_bitstream( + lame_global_flags * gfp); /* global context handle */ + + + +/* + * OPTIONAL: some simple statistics + * a bitrate histogram to visualize the distribution of used frame sizes + * a stereo mode histogram to visualize the distribution of used stereo + * modes, useful in joint-stereo mode only + * 0: LR left-right encoded + * 1: LR-I left-right and intensity encoded (currently not supported) + * 2: MS mid-side encoded + * 3: MS-I mid-side and intensity encoded (currently not supported) + * + * attention: don't call them after lame_encode_finish + * suggested: lame_encode_flush -> lame_*_hist -> lame_close + */ + +void CDECL lame_bitrate_hist( + const lame_global_flags * gfp, + int bitrate_count[14] ); +void CDECL lame_bitrate_kbps( + const lame_global_flags * gfp, + int bitrate_kbps [14] ); +void CDECL lame_stereo_mode_hist( + const lame_global_flags * gfp, + int stereo_mode_count[4] ); + +void CDECL lame_bitrate_stereo_mode_hist ( + const lame_global_flags * gfp, + int bitrate_stmode_count[14][4] ); + +void CDECL lame_block_type_hist ( + const lame_global_flags * gfp, + int btype_count[6] ); + +void CDECL lame_bitrate_block_type_hist ( + const lame_global_flags * gfp, + int bitrate_btype_count[14][6] ); + +#if (DEPRECATED_OR_OBSOLETE_CODE_REMOVED && 0) +#else +/* + * OPTIONAL: + * lame_mp3_tags_fid will rewrite a Xing VBR tag to the mp3 file with file + * pointer fid. These calls perform forward and backwards seeks, so make + * sure fid is a real file. Make sure lame_encode_flush has been called, + * and all mp3 data has been written to the file before calling this + * function. + * NOTE: + * if VBR tags are turned off by the user, or turned off by LAME because + * the output is not a regular file, this call does nothing + * NOTE: + * LAME wants to read from the file to skip an optional ID3v2 tag, so + * make sure you opened the file for writing and reading. + * NOTE: + * You can call lame_get_lametag_frame instead, if you want to insert + * the lametag yourself. +*/ +void CDECL lame_mp3_tags_fid(lame_global_flags *, FILE* fid); +#endif + +/* + * OPTIONAL: + * lame_get_lametag_frame copies the final LAME-tag into 'buffer'. + * The function returns the number of bytes copied into buffer, or + * the required buffer size, if the provided buffer is too small. + * Function failed, if the return value is larger than 'size'! + * Make sure lame_encode flush has been called before calling this function. + * NOTE: + * if VBR tags are turned off by the user, or turned off by LAME, + * this call does nothing and returns 0. + * NOTE: + * LAME inserted an empty frame in the beginning of mp3 audio data, + * which you have to replace by the final LAME-tag frame after encoding. + * In case there is no ID3v2 tag, usually this frame will be the very first + * data in your mp3 file. If you put some other leading data into your + * file, you'll have to do some bookkeeping about where to write this buffer. + */ +size_t CDECL lame_get_lametag_frame( + const lame_global_flags *, unsigned char* buffer, size_t size); + +/* + * REQUIRED: + * final call to free all remaining buffers + */ +int CDECL lame_close (lame_global_flags *); + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +/* + * OBSOLETE: + * lame_encode_finish combines lame_encode_flush() and lame_close() in + * one call. However, once this call is made, the statistics routines + * will no longer work because the data will have been cleared, and + * lame_mp3_tags_fid() cannot be called to add data to the VBR header + */ +int CDECL lame_encode_finish( + lame_global_flags* gfp, + unsigned char* mp3buf, + int size ); +#endif + + + + + + +/********************************************************************* + * + * decoding + * + * a simple interface to mpglib, part of mpg123, is also included if + * libmp3lame is compiled with HAVE_MPGLIB + * + *********************************************************************/ + +struct hip_global_struct; +typedef struct hip_global_struct hip_global_flags; +typedef hip_global_flags *hip_t; + + +typedef struct { + int header_parsed; /* 1 if header was parsed and following data was + computed */ + int stereo; /* number of channels */ + int samplerate; /* sample rate */ + int bitrate; /* bitrate */ + int mode; /* mp3 frame type */ + int mode_ext; /* mp3 frame type */ + int framesize; /* number of samples per mp3 frame */ + + /* this data is only computed if mpglib detects a Xing VBR header */ + unsigned long nsamp; /* number of samples in mp3 file. */ + int totalframes; /* total number of frames in mp3 file */ + + /* this data is not currently computed by the mpglib routines */ + int framenum; /* frames decoded counter */ +} mp3data_struct; + +/* required call to initialize decoder */ +hip_t CDECL hip_decode_init(void); + +/* cleanup call to exit decoder */ +int CDECL hip_decode_exit(hip_t gfp); + +/* HIP reporting functions */ +void CDECL hip_set_errorf(hip_t gfp, lame_report_function f); +void CDECL hip_set_debugf(hip_t gfp, lame_report_function f); +void CDECL hip_set_msgf (hip_t gfp, lame_report_function f); + +/********************************************************************* + * input 1 mp3 frame, output (maybe) pcm data. + * + * nout = hip_decode(hip, mp3buf,len,pcm_l,pcm_r); + * + * input: + * len : number of bytes of mp3 data in mp3buf + * mp3buf[len] : mp3 data to be decoded + * + * output: + * nout: -1 : decoding error + * 0 : need more data before we can complete the decode + * >0 : returned 'nout' samples worth of data in pcm_l,pcm_r + * pcm_l[nout] : left channel data + * pcm_r[nout] : right channel data + * + *********************************************************************/ +int CDECL hip_decode( hip_t gfp + , unsigned char * mp3buf + , size_t len + , short pcm_l[] + , short pcm_r[] + ); + +/* same as hip_decode, and also returns mp3 header data */ +int CDECL hip_decode_headers( hip_t gfp + , unsigned char* mp3buf + , size_t len + , short pcm_l[] + , short pcm_r[] + , mp3data_struct* mp3data + ); + +/* same as hip_decode, but returns at most one frame */ +int CDECL hip_decode1( hip_t gfp + , unsigned char* mp3buf + , size_t len + , short pcm_l[] + , short pcm_r[] + ); + +/* same as hip_decode1, but returns at most one frame and mp3 header data */ +int CDECL hip_decode1_headers( hip_t gfp + , unsigned char* mp3buf + , size_t len + , short pcm_l[] + , short pcm_r[] + , mp3data_struct* mp3data + ); + +/* same as hip_decode1_headers, but also returns enc_delay and enc_padding + from VBR Info tag, (-1 if no info tag was found) */ +int CDECL hip_decode1_headersB( hip_t gfp + , unsigned char* mp3buf + , size_t len + , short pcm_l[] + , short pcm_r[] + , mp3data_struct* mp3data + , int *enc_delay + , int *enc_padding + ); + + + +/* OBSOLETE: + * lame_decode... functions are there to keep old code working + * but it is strongly recommended to replace calls by hip_decode... + * function calls, see above. + */ +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +int CDECL lame_decode_init(void); +int CDECL lame_decode( + unsigned char * mp3buf, + int len, + short pcm_l[], + short pcm_r[] ); +int CDECL lame_decode_headers( + unsigned char* mp3buf, + int len, + short pcm_l[], + short pcm_r[], + mp3data_struct* mp3data ); +int CDECL lame_decode1( + unsigned char* mp3buf, + int len, + short pcm_l[], + short pcm_r[] ); +int CDECL lame_decode1_headers( + unsigned char* mp3buf, + int len, + short pcm_l[], + short pcm_r[], + mp3data_struct* mp3data ); +int CDECL lame_decode1_headersB( + unsigned char* mp3buf, + int len, + short pcm_l[], + short pcm_r[], + mp3data_struct* mp3data, + int *enc_delay, + int *enc_padding ); +int CDECL lame_decode_exit(void); + +#endif /* obsolete lame_decode API calls */ + + +/********************************************************************* + * + * id3tag stuff + * + *********************************************************************/ + +/* + * id3tag.h -- Interface to write ID3 version 1 and 2 tags. + * + * Copyright (C) 2000 Don Melton. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +/* utility to obtain alphabetically sorted list of genre names with numbers */ +void CDECL id3tag_genre_list( + void (*handler)(int, const char *, void *), + void* cookie); + +void CDECL id3tag_init (lame_t gfp); + +/* force addition of version 2 tag */ +void CDECL id3tag_add_v2 (lame_t gfp); + +/* add only a version 1 tag */ +void CDECL id3tag_v1_only (lame_t gfp); + +/* add only a version 2 tag */ +void CDECL id3tag_v2_only (lame_t gfp); + +/* pad version 1 tag with spaces instead of nulls */ +void CDECL id3tag_space_v1 (lame_t gfp); + +/* pad version 2 tag with extra 128 bytes */ +void CDECL id3tag_pad_v2 (lame_t gfp); + +/* pad version 2 tag with extra n bytes */ +void CDECL id3tag_set_pad (lame_t gfp, size_t n); + +void CDECL id3tag_set_title(lame_t gfp, const char* title); +void CDECL id3tag_set_artist(lame_t gfp, const char* artist); +void CDECL id3tag_set_album(lame_t gfp, const char* album); +void CDECL id3tag_set_year(lame_t gfp, const char* year); +void CDECL id3tag_set_comment(lame_t gfp, const char* comment); + +/* return -1 result if track number is out of ID3v1 range + and ignored for ID3v1 */ +int CDECL id3tag_set_track(lame_t gfp, const char* track); + +/* return non-zero result if genre name or number is invalid + result 0: OK + result -1: genre number out of range + result -2: no valid ID3v1 genre name, mapped to ID3v1 'Other' + but taken as-is for ID3v2 genre tag */ +int CDECL id3tag_set_genre(lame_t gfp, const char* genre); + +/* return non-zero result if field name is invalid */ +int CDECL id3tag_set_fieldvalue(lame_t gfp, const char* fieldvalue); + +/* return non-zero result if image type is invalid */ +int CDECL id3tag_set_albumart(lame_t gfp, const char* image, size_t size); + +/* lame_get_id3v1_tag copies ID3v1 tag into buffer. + * Function returns number of bytes copied into buffer, or number + * of bytes rquired if buffer 'size' is too small. + * Function fails, if returned value is larger than 'size'. + * NOTE: + * This functions does nothing, if user/LAME disabled ID3v1 tag. + */ +size_t CDECL lame_get_id3v1_tag(lame_t gfp, unsigned char* buffer, size_t size); + +/* lame_get_id3v2_tag copies ID3v2 tag into buffer. + * Function returns number of bytes copied into buffer, or number + * of bytes rquired if buffer 'size' is too small. + * Function fails, if returned value is larger than 'size'. + * NOTE: + * This functions does nothing, if user/LAME disabled ID3v2 tag. + */ +size_t CDECL lame_get_id3v2_tag(lame_t gfp, unsigned char* buffer, size_t size); + +/* normaly lame_init_param writes ID3v2 tags into the audio stream + * Call lame_set_write_id3tag_automatic(gfp, 0) before lame_init_param + * to turn off this behaviour and get ID3v2 tag with above function + * write it yourself into your file. + */ +void CDECL lame_set_write_id3tag_automatic(lame_global_flags * gfp, int); +int CDECL lame_get_write_id3tag_automatic(lame_global_flags const* gfp); + +/* experimental */ +int CDECL id3tag_set_textinfo_latin1(lame_t gfp, char const *id, char const *text); + +/* experimental */ +int CDECL id3tag_set_comment_latin1(lame_t gfp, char const *lang, char const *desc, char const *text); + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +#else +/* experimental */ +int CDECL id3tag_set_textinfo_ucs2(lame_t gfp, char const *id, unsigned short const *text); + +/* experimental */ +int CDECL id3tag_set_comment_ucs2(lame_t gfp, char const *lang, + unsigned short const *desc, unsigned short const *text); + +/* experimental */ +int CDECL id3tag_set_fieldvalue_ucs2(lame_t gfp, const unsigned short *fieldvalue); +#endif + +/* experimental */ +int CDECL id3tag_set_fieldvalue_utf16(lame_t gfp, const unsigned short *fieldvalue); + +/* experimental */ +int CDECL id3tag_set_textinfo_utf16(lame_t gfp, char const *id, unsigned short const *text); + +/* experimental */ +int CDECL id3tag_set_comment_utf16(lame_t gfp, char const *lang, unsigned short const *desc, unsigned short const *text); + + +/*********************************************************************** +* +* list of valid bitrates [kbps] & sample frequencies [Hz]. +* first index: 0: MPEG-2 values (sample frequencies 16...24 kHz) +* 1: MPEG-1 values (sample frequencies 32...48 kHz) +* 2: MPEG-2.5 values (sample frequencies 8...12 kHz) +***********************************************************************/ + +extern const int bitrate_table [3][16]; +extern const int samplerate_table [3][ 4]; + +/* access functions for use in DLL, global vars are not exported */ +int CDECL lame_get_bitrate(int mpeg_version, int table_index); +int CDECL lame_get_samplerate(int mpeg_version, int table_index); + + +/* maximum size of albumart image (128KB), which affects LAME_MAXMP3BUFFER + as well since lame_encode_buffer() also returns ID3v2 tag data */ +#define LAME_MAXALBUMART (128 * 1024) + +/* maximum size of mp3buffer needed if you encode at most 1152 samples for + each call to lame_encode_buffer. see lame_encode_buffer() below + (LAME_MAXMP3BUFFER is now obsolete) */ +#define LAME_MAXMP3BUFFER (16384 + LAME_MAXALBUMART) + + +typedef enum { + LAME_OKAY = 0, + LAME_NOERROR = 0, + LAME_GENERICERROR = -1, + LAME_NOMEM = -10, + LAME_BADBITRATE = -11, + LAME_BADSAMPFREQ = -12, + LAME_INTERNALERROR = -13, + + FRONTEND_READERROR = -80, + FRONTEND_WRITEERROR = -81, + FRONTEND_FILETOOLARGE = -82 + +} lame_errorcodes_t; + +#if defined(__cplusplus) +} +#endif +#endif /* LAME_LAME_H */ + diff --git a/node_modules/lame/deps/lame/include/libmp3lame.sym b/node_modules/lame/deps/lame/include/libmp3lame.sym new file mode 100644 index 0000000..aa6aefc --- /dev/null +++ b/node_modules/lame/deps/lame/include/libmp3lame.sym @@ -0,0 +1,289 @@ +lame_init + +lame_set_num_samples +lame_get_num_samples + +lame_set_in_samplerate +lame_get_in_samplerate + +lame_set_num_channels +lame_get_num_channels + +lame_set_scale +lame_get_scale + +lame_set_scale_left +lame_get_scale_left + +lame_set_scale_right +lame_get_scale_right + +lame_set_out_samplerate +lame_get_out_samplerate + +lame_set_analysis +lame_get_analysis + +lame_set_bWriteVbrTag +lame_get_bWriteVbrTag + +lame_set_decode_only +lame_get_decode_only + +lame_set_quality +lame_get_quality + +lame_set_mode +lame_get_mode + +lame_set_force_ms +lame_get_force_ms + +lame_set_free_format +lame_get_free_format + + +lame_set_findReplayGain +lame_get_findReplayGain + +lame_set_decode_on_the_fly +lame_get_decode_on_the_fly + +lame_set_nogap_total +lame_get_nogap_total + +lame_set_nogap_currentindex +lame_get_nogap_currentindex + + +lame_set_errorf +lame_set_debugf +lame_set_msgf + +lame_set_brate +lame_get_brate + +lame_set_compression_ratio +lame_get_compression_ratio + +lame_set_preset + +lame_set_asm_optimizations + + +lame_set_copyright +lame_get_copyright + +lame_set_original +lame_get_original + +lame_set_error_protection +lame_get_error_protection + +lame_set_padding_type +lame_get_padding_type + +lame_set_extension +lame_get_extension + +lame_set_strict_ISO +lame_get_strict_ISO + +lame_set_disable_reservoir +lame_get_disable_reservoir + +lame_set_quant_comp +lame_get_quant_comp +lame_set_quant_comp_short +lame_get_quant_comp_short + +lame_set_experimentalX +lame_get_experimentalX + +lame_set_experimentalY +lame_get_experimentalY + +lame_set_experimentalZ +lame_get_experimentalZ + +lame_set_exp_nspsytune +lame_get_exp_nspsytune + +lame_set_msfix +lame_get_msfix + +lame_set_VBR +lame_get_VBR + +lame_set_VBR_q +lame_get_VBR_q + +lame_set_VBR_mean_bitrate_kbps +lame_get_VBR_mean_bitrate_kbps + +lame_set_VBR_min_bitrate_kbps +lame_get_VBR_min_bitrate_kbps + +lame_set_VBR_max_bitrate_kbps +lame_get_VBR_max_bitrate_kbps + +lame_set_VBR_hard_min +lame_get_VBR_hard_min + +lame_set_preset_expopts + +lame_set_lowpassfreq +lame_get_lowpassfreq + +lame_set_lowpasswidth +lame_get_lowpasswidth + +lame_set_highpassfreq +lame_get_highpassfreq + +lame_set_highpasswidth +lame_get_highpasswidth + +lame_set_ATHonly +lame_get_ATHonly + +lame_set_ATHshort +lame_get_ATHshort + +lame_set_noATH +lame_get_noATH + +lame_set_ATHtype +lame_get_ATHtype + +lame_set_ATHlower +lame_get_ATHlower + +lame_set_athaa_type +lame_get_athaa_type + +lame_set_athaa_loudapprox +lame_get_athaa_loudapprox + +lame_set_athaa_sensitivity +lame_get_athaa_sensitivity + +lame_set_cwlimit +lame_get_cwlimit + +lame_set_useTemporal +lame_get_useTemporal + +lame_set_interChRatio +lame_get_interChRatio + +lame_set_no_short_blocks +lame_get_no_short_blocks +lame_set_force_short_blocks +lame_get_force_short_blocks +lame_set_allow_diff_short +lame_get_allow_diff_short + +lame_set_emphasis +lame_get_emphasis + +lame_get_version +lame_get_encoder_delay +lame_get_encoder_padding +lame_get_framesize + +lame_get_mf_samples_to_encode +lame_get_size_mp3buffer +lame_get_frameNum +lame_get_totalframes + +lame_get_RadioGain +lame_get_AudiophileGain +lame_get_PeakSample +lame_get_noclipGainChange +lame_get_noclipScale + +lame_init_params + +get_lame_version +get_lame_short_version +get_lame_very_short_version +get_psy_version +get_lame_url +get_lame_version_numerical +get_lame_os_bitness + +lame_print_config +lame_print_internals + +lame_encode_buffer +lame_encode_buffer_interleaved +lame_encode_buffer_float +lame_encode_buffer_long +lame_encode_buffer_long2 +lame_encode_buffer_int +lame_encode_flush +lame_encode_flush_nogap + +lame_init_bitstream + +lame_bitrate_hist +lame_bitrate_kbps +lame_stereo_mode_hist +lame_bitrate_stereo_mode_hist +lame_block_type_hist +lame_bitrate_block_type_hist +lame_mp3_tags_fid +lame_close +lame_get_lametag_frame +lame_set_VBR_quality +lame_get_VBR_quality + + +bitrate_table +samplerate_table + +lame_decode_init +lame_decode +lame_decode_headers +lame_decode1 +lame_decode1_headers +lame_decode1_headersB +lame_decode_exit + +lame_get_id3v1_tag +lame_get_id3v2_tag +lame_set_write_id3tag_automatic +lame_get_write_id3tag_automatic + +hip_decode_init +hip_decode_exit +hip_decode +hip_decode_headers +hip_decode1 +hip_decode1_headers +hip_decode1_headersB +hip_set_debugf +hip_set_errorf +hip_set_msgf + +id3tag_genre_list +id3tag_init +id3tag_add_v2 +id3tag_v1_only +id3tag_v2_only +id3tag_space_v1 +id3tag_pad_v2 +id3tag_set_title +id3tag_set_artist +id3tag_set_album +id3tag_set_year +id3tag_set_comment +id3tag_set_track +id3tag_set_genre +id3tag_set_fieldvalue +id3tag_set_albumart +id3tag_set_pad +id3tag_set_comment_ucs2 +id3tag_set_textinfo_ucs2 + diff --git a/node_modules/lame/deps/lame/install-sh b/node_modules/lame/deps/lame/install-sh new file mode 100755 index 0000000..6781b98 --- /dev/null +++ b/node_modules/lame/deps/lame/install-sh @@ -0,0 +1,520 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2009-04-28.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/node_modules/lame/deps/lame/lame.bat b/node_modules/lame/deps/lame/lame.bat new file mode 100755 index 0000000..8b31774 --- /dev/null +++ b/node_modules/lame/deps/lame/lame.bat @@ -0,0 +1,41 @@ +@echo off +rem --------------------------------------------- +rem PURPOSE: +rem - put this Batch-Command on your Desktop, +rem so you can drag and drop wave files on it +rem and LAME will encode them to mp3 format. +rem - put this Batch-Command in a place mentioned +rem in your PATH environment, start the DOS-BOX +rem and change to a directory where your wave +rem files are located. the following line will +rem encode all your wave files to mp3 +rem "lame.bat *.wav" +rem --------------------------------------------- +rem C2000 Robert Hegemann +rem --------------------------------------------- +rem please set LAME and LAMEOPTS +rem LAME - where the executeable is +rem OPTS - options you like LAME to use + + set LAME=lame.exe + set OPTS=--preset cd + +rem --------------------------------------------- + + set thecmd=%LAME% %OPTS% + lfnfor on +:processArgs + if "%1"=="" goto endmark + for %%f in (%1) do %thecmd% "%%f" + if errorlevel 1 goto errormark + shift + goto processArgs +:errormark + echo. + echo. + echo ERROR processing %1 + echo. +:endmark +rem +rem finished +rem diff --git a/node_modules/lame/deps/lame/lame.spec b/node_modules/lame/deps/lame/lame.spec new file mode 100644 index 0000000..9a8df79 --- /dev/null +++ b/node_modules/lame/deps/lame/lame.spec @@ -0,0 +1,188 @@ +%define name lame +%define ver 3.99.5 +%define rel 1 +%define prefix %{_usr} +%define docdir %{_defaultdocdir} + +Summary : LAME Ain't an MP3 Encoder... but it's the best. +Summary(fr) : LAME n'est pas un encodeur MP3 ;-> +Name: %{name} +Version: %{ver} +Release: %{rel} +License: LGPL +Vendor: The LAME Project +Packager: Yosi Markovich +URL: http://www.mp3dev.org +Group: Applications/Multimedia +Source: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-root +Requires: ncurses >= 5.0 +BuildRequires: gcc => 3.0.1, /usr/bin/find, ncurses-devel +%ifarch %{ix86} x86_64 +BuildRequires: nasm +%endif +Provides: mp3encoder + +%description +LAME is an educational tool to be used for learning about MP3 encoding. The +goal of the LAME project is to use the open source model to improve the +psycho acoustics, noise shaping and speed of MP3. + +%description -l fr +LAME est un outil d'enseignement pour l'apprentissage de l'encodage MP3. +Le but du projet LAME est d'utiliser un mod�le "open source" afin +d'am�liorer la qualit� et la vitesse du MP3. + + + +%package devel +Summary: Shared and static libraries for LAME. +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +LAME is an educational tool to be used for learning about MP3 encoding. +This package contains both the shared and the static libraries from the +LAME project. + +You will also need to install the main lame package in order to install +these libraries. + +%prep +%setup + +%build + +# Vorbis makes the build fail for now. . . +rm -f config.cache + +%configure \ +%ifarch %{ix86} x86_64 + --enable-nasm \ +%endif + --enable-decoder \ + --without-vorbis \ + --enable-analyzer=no \ + --enable-brhist \ + --disable-debug +%{__make} %{?_smp_mflags} test CFLAGS="%{optflags}" + +%install +%{__rm} -rf %{buildroot} +%makeinstall + +### Some apps still expect to find +%{__ln_s} -f lame/lame.h %{buildroot}%{_includedir}/lame.h + + +find doc/html -name "Makefile*" | xargs rm -f +### make install really shouldn't install these +%{__rm} -rf %{buildroot}%{_docdir}/lame/ + + +%post +/sbin/ldconfig 2>/dev/null + +%postun +/sbin/ldconfig 2>/dev/null + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr (-,root,root) +%doc COPYING ChangeLog README TODO USAGE doc/html +%doc doc/html +%{_bindir}/lame +%{_libdir}/libmp3lame.so.* +%{_mandir}/man1/lame.1* + +%files devel +%defattr (-, root, root) +%doc API HACKING STYLEGUIDE +%{_libdir}/libmp3lame.a +%{_libdir}/libmp3lame.la +%{_libdir}/libmp3lame.so +%{_includedir}/* + +%changelog + +* Sun May 14 2006 Kyle VanderBeek +- Remove requirements for specific gcc versions, since modern ones "just work". +- Remove out-dated hyper-optimizations (some of which weren't valid compiler + flags anymore). +- Update to current RPM techniques and macros (inspired by freshrpms.net spec). + +* Sat May 11 2002 Yosi Markovich +- Fixes to the spec file that include: +- Making sure the compiler is gcc version 3.0.1. Lame compiled with a version + greater than 3.0.1 is broken. +- Optimization flags for i686 will use i686 for march and mcpu, and not + athlon. +- Fix the dates in this Changelog section. +- Various small fixes merged from Matthias Saou. +- Thanks Fred Maciel for his useful comments. + +- +* Tue Jan 22 2002 Mark Taylor +- replaced lame.spec.in with Yosi's version. Merged some stuff from + the prevous lame.spec.in file, and appended changelog below. + +* Tue Jan 22 2002 Yosi Markovich +- Rewrote lame.spec.in to create a correct and nice spec file. + imho, this spec file is not good for anyone who wants to build + daily cvs snapshots. Closes bug #495975 + +* Tue Dec 11 2001 Yosi Markovich +- Shamelessly stole Matthias Saou's excellent spec file to create daily + CVS snapshots of Lame. Other than that, nothing is new. + +* Tue Oct 23 2001 Matthias Saou +- Fixed the %pre and %post that should have been %post and %postun, silly me! +- Removed -malign-double (it's evil, Yosi told me and I tested, brrr ;-)). +- Now build with gcc3, VBR encoding gets a hell of a boost, impressive! + I recommend you now use "lame --r3mix", it's the best. +- Tried to re-enable vorbis, but it's a no-go. + +* Thu Jul 26 2001 Matthias Saou +- Build with kgcc to have VBR working. + +* Wed Jul 25 2001 Matthias Saou +- Update to 3.89beta : Must be built with a non-patched version of nasm + to work! + +* Mon May 7 2001 Matthias Saou +- Rebuilt for Red Hat 7.1. +- Disabled the vorbis support since it fails to build with it. +- Added a big optimisation section, thanks to Yosi Markovich + for this and other pointers. + +* Sun Feb 11 2001 Matthias Saou +- Split the package, there is now a -devel + +* Thu Nov 26 2000 Matthias Saou +- Initial RPM release for RedHat 7.0 from scratch + +* Wed Nov 21 2000 Eric Lassauge +- Updated and corrected RPM to 3.89beta. +- Added french translations + +* Sat Aug 04 2000 Markus Linnala �maage@cs.tut.fi� +- Build and include docs and libs correctly +- Build extra programs + +* Tue Aug 01 2000 Stuart Young �cefiar1@optushome.com.au� +- Updated RPM to 3.85beta. +- Modified spec file (merged George and Keitaro's specs) +- Added reasonable info to the specs to reflect the maintainer +- Renamed lame.spec (plain spec is bad, mmkay?). + +* Fri Jun 30 2000 Keitaro Yosimura �ramsy@linux.or.jp� +- Updated RPM to 3.84alpha. +- Better attempt at an RPM, independant of 3.83 release. +- (This is all surmise as there was no changelog). + +* Thu May 30 2000 Georges Seguin �crow@planete.net� +- First RPM build around 3.83beta + + diff --git a/node_modules/lame/deps/lame/lame.spec.in b/node_modules/lame/deps/lame/lame.spec.in new file mode 100644 index 0000000..5a21562 --- /dev/null +++ b/node_modules/lame/deps/lame/lame.spec.in @@ -0,0 +1,188 @@ +%define name @PACKAGE@ +%define ver @VERSION@ +%define rel 1 +%define prefix %{_usr} +%define docdir %{_defaultdocdir} + +Summary : LAME Ain't an MP3 Encoder... but it's the best. +Summary(fr) : LAME n'est pas un encodeur MP3 ;-> +Name: %{name} +Version: %{ver} +Release: %{rel} +License: LGPL +Vendor: The LAME Project +Packager: Yosi Markovich +URL: http://www.mp3dev.org +Group: Applications/Multimedia +Source: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-root +Requires: ncurses >= 5.0 +BuildRequires: gcc => 3.0.1, /usr/bin/find, ncurses-devel +%ifarch %{ix86} x86_64 +BuildRequires: nasm +%endif +Provides: mp3encoder + +%description +LAME is an educational tool to be used for learning about MP3 encoding. The +goal of the LAME project is to use the open source model to improve the +psycho acoustics, noise shaping and speed of MP3. + +%description -l fr +LAME est un outil d'enseignement pour l'apprentissage de l'encodage MP3. +Le but du projet LAME est d'utiliser un mod�le "open source" afin +d'am�liorer la qualit� et la vitesse du MP3. + + + +%package devel +Summary: Shared and static libraries for LAME. +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +LAME is an educational tool to be used for learning about MP3 encoding. +This package contains both the shared and the static libraries from the +LAME project. + +You will also need to install the main lame package in order to install +these libraries. + +%prep +%setup + +%build + +# Vorbis makes the build fail for now. . . +rm -f config.cache + +%configure \ +%ifarch %{ix86} x86_64 + --enable-nasm \ +%endif + --enable-decoder \ + --without-vorbis \ + --enable-analyzer=no \ + --enable-brhist \ + --disable-debug +%{__make} %{?_smp_mflags} test CFLAGS="%{optflags}" + +%install +%{__rm} -rf %{buildroot} +%makeinstall + +### Some apps still expect to find +%{__ln_s} -f lame/lame.h %{buildroot}%{_includedir}/lame.h + + +find doc/html -name "Makefile*" | xargs rm -f +### make install really shouldn't install these +%{__rm} -rf %{buildroot}%{_docdir}/lame/ + + +%post +/sbin/ldconfig 2>/dev/null + +%postun +/sbin/ldconfig 2>/dev/null + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr (-,root,root) +%doc COPYING ChangeLog README TODO USAGE doc/html +%doc doc/html +%{_bindir}/lame +%{_libdir}/libmp3lame.so.* +%{_mandir}/man1/lame.1* + +%files devel +%defattr (-, root, root) +%doc API HACKING STYLEGUIDE +%{_libdir}/libmp3lame.a +%{_libdir}/libmp3lame.la +%{_libdir}/libmp3lame.so +%{_includedir}/* + +%changelog + +* Sun May 14 2006 Kyle VanderBeek +- Remove requirements for specific gcc versions, since modern ones "just work". +- Remove out-dated hyper-optimizations (some of which weren't valid compiler + flags anymore). +- Update to current RPM techniques and macros (inspired by freshrpms.net spec). + +* Sat May 11 2002 Yosi Markovich +- Fixes to the spec file that include: +- Making sure the compiler is gcc version 3.0.1. Lame compiled with a version + greater than 3.0.1 is broken. +- Optimization flags for i686 will use i686 for march and mcpu, and not + athlon. +- Fix the dates in this Changelog section. +- Various small fixes merged from Matthias Saou. +- Thanks Fred Maciel for his useful comments. + +- +* Tue Jan 22 2002 Mark Taylor +- replaced lame.spec.in with Yosi's version. Merged some stuff from + the prevous lame.spec.in file, and appended changelog below. + +* Tue Jan 22 2002 Yosi Markovich +- Rewrote lame.spec.in to create a correct and nice spec file. + imho, this spec file is not good for anyone who wants to build + daily cvs snapshots. Closes bug #495975 + +* Tue Dec 11 2001 Yosi Markovich +- Shamelessly stole Matthias Saou's excellent spec file to create daily + CVS snapshots of Lame. Other than that, nothing is new. + +* Tue Oct 23 2001 Matthias Saou +- Fixed the %pre and %post that should have been %post and %postun, silly me! +- Removed -malign-double (it's evil, Yosi told me and I tested, brrr ;-)). +- Now build with gcc3, VBR encoding gets a hell of a boost, impressive! + I recommend you now use "lame --r3mix", it's the best. +- Tried to re-enable vorbis, but it's a no-go. + +* Thu Jul 26 2001 Matthias Saou +- Build with kgcc to have VBR working. + +* Wed Jul 25 2001 Matthias Saou +- Update to 3.89beta : Must be built with a non-patched version of nasm + to work! + +* Mon May 7 2001 Matthias Saou +- Rebuilt for Red Hat 7.1. +- Disabled the vorbis support since it fails to build with it. +- Added a big optimisation section, thanks to Yosi Markovich + for this and other pointers. + +* Sun Feb 11 2001 Matthias Saou +- Split the package, there is now a -devel + +* Thu Nov 26 2000 Matthias Saou +- Initial RPM release for RedHat 7.0 from scratch + +* Wed Nov 21 2000 Eric Lassauge +- Updated and corrected RPM to 3.89beta. +- Added french translations + +* Sat Aug 04 2000 Markus Linnala �maage@cs.tut.fi� +- Build and include docs and libs correctly +- Build extra programs + +* Tue Aug 01 2000 Stuart Young �cefiar1@optushome.com.au� +- Updated RPM to 3.85beta. +- Modified spec file (merged George and Keitaro's specs) +- Added reasonable info to the specs to reflect the maintainer +- Renamed lame.spec (plain spec is bad, mmkay?). + +* Fri Jun 30 2000 Keitaro Yosimura �ramsy@linux.or.jp� +- Updated RPM to 3.84alpha. +- Better attempt at an RPM, independant of 3.83 release. +- (This is all surmise as there was no changelog). + +* Thu May 30 2000 Georges Seguin �crow@planete.net� +- First RPM build around 3.83beta + + diff --git a/node_modules/lame/deps/lame/libmp3lame.gyp b/node_modules/lame/deps/lame/libmp3lame.gyp new file mode 100644 index 0000000..75f0916 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame.gyp @@ -0,0 +1,122 @@ +# This file is used with the GYP meta build system. +# http://code.google.com/p/gyp +# To build try this: +# svn co http://gyp.googlecode.com/svn/trunk gyp +# ./gyp/gyp -f make --depth=`pwd` libmp3lame.gyp +# make +# ./out/Debug/test + +{ + 'variables': { 'target_arch%': 'ia32' }, # default for node v0.6.x + + 'target_defaults': { + 'default_configuration': 'Debug', + 'configurations': { + 'Debug': { + 'defines': [ 'DEBUG', '_DEBUG' ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 1, # static debug + }, + }, + }, + 'Release': { + 'defines': [ 'NDEBUG' ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 0, # static release + }, + }, + } + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + + # lame-specific stuff + 'defines': [ + 'PIC', + 'HAVE_CONFIG_H' + ], + 'include_dirs': [ + 'include', + 'libmp3lame', + 'libmp3lame/vector', + # platform and arch-specific headers + 'config/<(OS)/<(target_arch)' + ], + 'conditions': [ + ['OS=="win"', { + 'defines': [ + 'TAKEHIRO_IEEE754_HACK', + 'FLOAT8=float', + 'REAL_IS_FLOAT=1', + 'BS_FORMAT=BINARY', + ] + }] + ], + }, + + 'targets': [ + + # liblamevectorroutines + { + 'target_name': 'lamevectorroutines', + 'product_prefix': 'lib', + 'type': 'static_library', + 'sources': [ + 'libmp3lame/vector/xmm_quantize_sub.c' + ], + }, + + # libmp3lame + { + 'target_name': 'mp3lame', + 'product_prefix': 'lib', + 'type': 'static_library', + 'sources': [ + 'libmp3lame/VbrTag.c', + 'libmp3lame/bitstream.c', + 'libmp3lame/encoder.c', + 'libmp3lame/fft.c', + 'libmp3lame/gain_analysis.c', + 'libmp3lame/id3tag.c', + 'libmp3lame/lame.c', + 'libmp3lame/newmdct.c', + 'libmp3lame/presets.c', + 'libmp3lame/psymodel.c', + 'libmp3lame/quantize.c', + 'libmp3lame/quantize_pvt.c', + 'libmp3lame/reservoir.c', + 'libmp3lame/set_get.c', + 'libmp3lame/tables.c', + 'libmp3lame/takehiro.c', + 'libmp3lame/util.c', + 'libmp3lame/vbrquantize.c', + 'libmp3lame/version.c', + ], + 'dependencies': [ + 'lamevectorroutines', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'include', + 'libmp3lame', + 'libmp3lame/vector', + # platform and arch-specific headers + 'config/<(OS)/<(target_arch)' + ], + }, + }, + + # test program that prints the version number + { + 'target_name': 'test', + 'type': 'executable', + 'dependencies': [ 'mp3lame' ], + 'sources': [ 'test.c' ] + }, + ] +} diff --git a/node_modules/lame/deps/lame/libmp3lame/Makefile.am b/node_modules/lame/deps/lame/libmp3lame/Makefile.am new file mode 100644 index 0000000..b924c0d --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/Makefile.am @@ -0,0 +1,101 @@ +## $Id: Makefile.am,v 1.39 2010/10/30 13:21:02 robert Exp $ + +include $(top_srcdir)/Makefile.am.global + +SUBDIRS = i386 vector + +lib_LTLIBRARIES = libmp3lame.la + +if HAVE_NASM +cpu_ldadd = $(top_builddir)/libmp3lame/@CPUTYPE@/liblameasmroutines.la +endif +if WITH_VECTOR +vector_ldadd = $(top_builddir)/libmp3lame/vector/liblamevectorroutines.la +endif + +if LIB_WITH_DECODER +decoder_ldadd = $(top_builddir)/mpglib/libmpgdecoder.la +else +decoder_ldadd = +endif + +libmp3lame_la_LIBADD = $(cpu_ldadd) $(vector_ldadd) $(decoder_ldadd) \ + $(CONFIG_MATH_LIB) +libmp3lame_la_LDFLAGS = -version-info @LIB_MAJOR_VERSION@:@LIB_MINOR_VERSION@ \ + -no-undefined + +INCLUDES = @INCLUDES@ -I$(top_srcdir)/mpglib -I$(top_builddir) + +DEFS = @DEFS@ @CONFIG_DEFS@ + +EXTRA_DIST = \ + lame.rc \ + vbrquantize.h \ + logoe.ico + +libmp3lame_la_SOURCES = \ + VbrTag.c \ + bitstream.c \ + encoder.c \ + fft.c \ + gain_analysis.c \ + id3tag.c \ + lame.c \ + newmdct.c \ + presets.c \ + psymodel.c \ + quantize.c \ + quantize_pvt.c \ + reservoir.c \ + set_get.c \ + tables.c \ + takehiro.c \ + util.c \ + vbrquantize.c \ + version.c \ + mpglib_interface.c + +noinst_HEADERS= \ + VbrTag.h \ + bitstream.h \ + encoder.h \ + fft.h \ + gain_analysis.h \ + id3tag.h \ + l3side.h \ + lame-analysis.h \ + lame_global_flags.h \ + lameerror.h \ + machine.h \ + newmdct.h \ + psymodel.h \ + quantize.h \ + quantize_pvt.h \ + reservoir.h \ + set_get.h \ + tables.h \ + util.h \ + vbrquantize.h \ + version.h + +CLEANFILES = lclint.txt + +LCLINTFLAGS= \ + +posixlib \ + +showsummary \ + +showalluses \ + +whichlib \ + +forcehints \ + -fixedformalarray \ + +matchanyintegral \ + -Dlint + +lclint.txt: ${libmp3lame_la_SOURCES} ${noinst_HEADERS} + @lclint ${LCLINTFLAGS} ${INCLUDES} ${DEFS} ${libmp3lame_la_SOURCES} 2>&1 >lclint.txt || true + +lclint: lclint.txt + more lclint.txt + +#$(OBJECTS): libtool +#libtool: $(LIBTOOL_DEPS) +# $(SHELL) $(top_builddir)/config.status --recheck diff --git a/node_modules/lame/deps/lame/libmp3lame/Makefile.in b/node_modules/lame/deps/lame/libmp3lame/Makefile.in new file mode 100644 index 0000000..830d567 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/Makefile.in @@ -0,0 +1,873 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# global section for every Makefile.am + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +ANSI2KNR = $(top_srcdir)/ansi2knr +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.am.global depcomp +subdir = libmp3lame +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +@LIB_WITH_DECODER_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/mpglib/libmpgdecoder.la +am__DEPENDENCIES_2 = +libmp3lame_la_DEPENDENCIES = $(cpu_ldadd) $(vector_ldadd) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +am_libmp3lame_la_OBJECTS = VbrTag$U.lo bitstream$U.lo encoder$U.lo \ + fft$U.lo gain_analysis$U.lo id3tag$U.lo lame$U.lo newmdct$U.lo \ + presets$U.lo psymodel$U.lo quantize$U.lo quantize_pvt$U.lo \ + reservoir$U.lo set_get$U.lo tables$U.lo takehiro$U.lo \ + util$U.lo vbrquantize$U.lo version$U.lo mpglib_interface$U.lo +libmp3lame_la_OBJECTS = $(am_libmp3lame_la_OBJECTS) +libmp3lame_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libmp3lame_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libmp3lame_la_SOURCES) +DIST_SOURCES = $(libmp3lame_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +HEADERS = $(noinst_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ @CONFIG_DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ -I$(top_srcdir)/mpglib -I$(top_builddir) +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.11 foreign $(top_srcdir)/ansi2knr +SUBDIRS = i386 vector +lib_LTLIBRARIES = libmp3lame.la +@HAVE_NASM_TRUE@cpu_ldadd = $(top_builddir)/libmp3lame/@CPUTYPE@/liblameasmroutines.la +@WITH_VECTOR_TRUE@vector_ldadd = $(top_builddir)/libmp3lame/vector/liblamevectorroutines.la +@LIB_WITH_DECODER_FALSE@decoder_ldadd = +@LIB_WITH_DECODER_TRUE@decoder_ldadd = $(top_builddir)/mpglib/libmpgdecoder.la +libmp3lame_la_LIBADD = $(cpu_ldadd) $(vector_ldadd) $(decoder_ldadd) \ + $(CONFIG_MATH_LIB) + +libmp3lame_la_LDFLAGS = -version-info @LIB_MAJOR_VERSION@:@LIB_MINOR_VERSION@ \ + -no-undefined + +EXTRA_DIST = \ + lame.rc \ + vbrquantize.h \ + logoe.ico + +libmp3lame_la_SOURCES = \ + VbrTag.c \ + bitstream.c \ + encoder.c \ + fft.c \ + gain_analysis.c \ + id3tag.c \ + lame.c \ + newmdct.c \ + presets.c \ + psymodel.c \ + quantize.c \ + quantize_pvt.c \ + reservoir.c \ + set_get.c \ + tables.c \ + takehiro.c \ + util.c \ + vbrquantize.c \ + version.c \ + mpglib_interface.c + +noinst_HEADERS = \ + VbrTag.h \ + bitstream.h \ + encoder.h \ + fft.h \ + gain_analysis.h \ + id3tag.h \ + l3side.h \ + lame-analysis.h \ + lame_global_flags.h \ + lameerror.h \ + machine.h \ + newmdct.h \ + psymodel.h \ + quantize.h \ + quantize_pvt.h \ + reservoir.h \ + set_get.h \ + tables.h \ + util.h \ + vbrquantize.h \ + version.h + +CLEANFILES = lclint.txt +LCLINTFLAGS = \ + +posixlib \ + +showsummary \ + +showalluses \ + +whichlib \ + +forcehints \ + -fixedformalarray \ + +matchanyintegral \ + -Dlint + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libmp3lame/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign libmp3lame/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmp3lame.la: $(libmp3lame_la_OBJECTS) $(libmp3lame_la_DEPENDENCIES) + $(libmp3lame_la_LINK) -rpath $(libdir) $(libmp3lame_la_OBJECTS) $(libmp3lame_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c +$(top_srcdir)/ansi2knr: + $(am__cd) $(top_srcdir) && $(MAKE) $(AM_MAKEFLAGS) ./ansi2knr + +mostlyclean-kr: + -test "$U" = "" || rm -f *_.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VbrTag$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitstream$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encoder$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fft$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gain_analysis$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id3tag$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lame$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpglib_interface$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newmdct$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/presets$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psymodel$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quantize$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quantize_pvt$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reservoir$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_get$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tables$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/takehiro$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vbrquantize$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version$U.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +VbrTag_.c: VbrTag.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/VbrTag.c; then echo $(srcdir)/VbrTag.c; else echo VbrTag.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +bitstream_.c: bitstream.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/bitstream.c; then echo $(srcdir)/bitstream.c; else echo bitstream.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +encoder_.c: encoder.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/encoder.c; then echo $(srcdir)/encoder.c; else echo encoder.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +fft_.c: fft.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fft.c; then echo $(srcdir)/fft.c; else echo fft.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +gain_analysis_.c: gain_analysis.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gain_analysis.c; then echo $(srcdir)/gain_analysis.c; else echo gain_analysis.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +id3tag_.c: id3tag.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/id3tag.c; then echo $(srcdir)/id3tag.c; else echo id3tag.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +lame_.c: lame.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lame.c; then echo $(srcdir)/lame.c; else echo lame.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +mpglib_interface_.c: mpglib_interface.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mpglib_interface.c; then echo $(srcdir)/mpglib_interface.c; else echo mpglib_interface.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +newmdct_.c: newmdct.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/newmdct.c; then echo $(srcdir)/newmdct.c; else echo newmdct.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +presets_.c: presets.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/presets.c; then echo $(srcdir)/presets.c; else echo presets.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +psymodel_.c: psymodel.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/psymodel.c; then echo $(srcdir)/psymodel.c; else echo psymodel.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +quantize_.c: quantize.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quantize.c; then echo $(srcdir)/quantize.c; else echo quantize.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +quantize_pvt_.c: quantize_pvt.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quantize_pvt.c; then echo $(srcdir)/quantize_pvt.c; else echo quantize_pvt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +reservoir_.c: reservoir.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/reservoir.c; then echo $(srcdir)/reservoir.c; else echo reservoir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +set_get_.c: set_get.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/set_get.c; then echo $(srcdir)/set_get.c; else echo set_get.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +tables_.c: tables.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/tables.c; then echo $(srcdir)/tables.c; else echo tables.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +takehiro_.c: takehiro.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/takehiro.c; then echo $(srcdir)/takehiro.c; else echo takehiro.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +util_.c: util.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/util.c; then echo $(srcdir)/util.c; else echo util.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +vbrquantize_.c: vbrquantize.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/vbrquantize.c; then echo $(srcdir)/vbrquantize.c; else echo vbrquantize.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +version_.c: version.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/version.c; then echo $(srcdir)/version.c; else echo version.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +VbrTag_.$(OBJEXT) VbrTag_.lo bitstream_.$(OBJEXT) bitstream_.lo \ +encoder_.$(OBJEXT) encoder_.lo fft_.$(OBJEXT) fft_.lo \ +gain_analysis_.$(OBJEXT) gain_analysis_.lo id3tag_.$(OBJEXT) \ +id3tag_.lo lame_.$(OBJEXT) lame_.lo mpglib_interface_.$(OBJEXT) \ +mpglib_interface_.lo newmdct_.$(OBJEXT) newmdct_.lo presets_.$(OBJEXT) \ +presets_.lo psymodel_.$(OBJEXT) psymodel_.lo quantize_.$(OBJEXT) \ +quantize_.lo quantize_pvt_.$(OBJEXT) quantize_pvt_.lo \ +reservoir_.$(OBJEXT) reservoir_.lo set_get_.$(OBJEXT) set_get_.lo \ +tables_.$(OBJEXT) tables_.lo takehiro_.$(OBJEXT) takehiro_.lo \ +util_.$(OBJEXT) util_.lo vbrquantize_.$(OBJEXT) vbrquantize_.lo \ +version_.$(OBJEXT) version_.lo : $(ANSI2KNR) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + $(top_srcdir)/ansi2knr ctags-recursive install-am \ + install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-libLTLIBRARIES + + +# end global section + +lclint.txt: ${libmp3lame_la_SOURCES} ${noinst_HEADERS} + @lclint ${LCLINTFLAGS} ${INCLUDES} ${DEFS} ${libmp3lame_la_SOURCES} 2>&1 >lclint.txt || true + +lclint: lclint.txt + more lclint.txt + +#$(OBJECTS): libtool +#libtool: $(LIBTOOL_DEPS) +# $(SHELL) $(top_builddir)/config.status --recheck + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/libmp3lame/VbrTag.c b/node_modules/lame/deps/lame/libmp3lame/VbrTag.c new file mode 100644 index 0000000..3931a33 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/VbrTag.c @@ -0,0 +1,1082 @@ +/* + * Xing VBR tagging for LAME. + * + * Copyright (c) 1999 A.L. Faber + * Copyright (c) 2001 Jonathan Dee + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: VbrTag.c,v 1.103.2.1 2011/11/18 09:18:28 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "bitstream.h" +#include "VbrTag.h" +#include "lame_global_flags.h" +#include "tables.h" + +#ifdef __sun__ +/* woraround for SunOS 4.x, it has SEEK_* defined here */ +#include +#endif + + +#ifdef _DEBUG +/* #define DEBUG_VBRTAG */ +#endif + +/* + * 4 bytes for Header Tag + * 4 bytes for Header Flags + * 100 bytes for entry (NUMTOCENTRIES) + * 4 bytes for FRAME SIZE + * 4 bytes for STREAM_SIZE + * 4 bytes for VBR SCALE. a VBR quality indicator: 0=best 100=worst + * 20 bytes for LAME tag. for example, "LAME3.12 (beta 6)" + * ___________ + * 140 bytes +*/ +#define VBRHEADERSIZE (NUMTOCENTRIES+4+4+4+4+4) + +#define LAMEHEADERSIZE (VBRHEADERSIZE + 9 + 1 + 1 + 8 + 1 + 1 + 3 + 1 + 1 + 2 + 4 + 2 + 2) + +/* the size of the Xing header (MPEG1 and MPEG2) in kbps */ +#define XING_BITRATE1 128 +#define XING_BITRATE2 64 +#define XING_BITRATE25 32 + +extern const char* get_lame_tag_encoder_short_version(void); + +static const char VBRTag0[] = { "Xing" }; +static const char VBRTag1[] = { "Info" }; + + + + +/* Lookup table for fast CRC computation + * See 'CRC_update_lookup' + * Uses the polynomial x^16+x^15+x^2+1 */ + +static const unsigned int crc16_lookup[256] = { + 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, + 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, + 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, + 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, + 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, + 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, + 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, + 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, + 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, + 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, + 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, + 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, + 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, + 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, + 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, + 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, + 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, + 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, + 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, + 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, + 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, + 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, + 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, + 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, + 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, + 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, + 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, + 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, + 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, + 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, + 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, + 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 +}; + + + + + +/*********************************************************************** + * Robert Hegemann 2001-01-17 + ***********************************************************************/ + +static void +addVbr(VBR_seek_info_t * v, int bitrate) +{ + int i; + + v->nVbrNumFrames++; + v->sum += bitrate; + v->seen++; + + if (v->seen < v->want) { + return; + } + + if (v->pos < v->size) { + v->bag[v->pos] = v->sum; + v->pos++; + v->seen = 0; + } + if (v->pos == v->size) { + for (i = 1; i < v->size; i += 2) { + v->bag[i / 2] = v->bag[i]; + } + v->want *= 2; + v->pos /= 2; + } +} + +static void +Xing_seek_table(VBR_seek_info_t const* v, unsigned char *t) +{ + int i, indx; + int seek_point; + + if (v->pos <= 0) + return; + + for (i = 1; i < NUMTOCENTRIES; ++i) { + float j = i / (float) NUMTOCENTRIES, act, sum; + indx = (int) (floor(j * v->pos)); + if (indx > v->pos - 1) + indx = v->pos - 1; + act = v->bag[indx]; + sum = v->sum; + seek_point = (int) (256. * act / sum); + if (seek_point > 255) + seek_point = 255; + t[i] = seek_point; + } +} + +#ifdef DEBUG_VBR_SEEKING_TABLE +static void +print_seeking(unsigned char *t) +{ + int i; + + printf("seeking table "); + for (i = 0; i < NUMTOCENTRIES; ++i) { + printf(" %d ", t[i]); + } + printf("\n"); +} +#endif + + +/**************************************************************************** + * AddVbrFrame: Add VBR entry, used to fill the VBR the TOC entries + * Paramters: + * nStreamPos: how many bytes did we write to the bitstream so far + * (in Bytes NOT Bits) + **************************************************************************** +*/ +void +AddVbrFrame(lame_internal_flags * gfc) +{ + int kbps = bitrate_table[gfc->cfg.version][gfc->ov_enc.bitrate_index]; + assert(gfc->VBR_seek_table.bag); + addVbr(&gfc->VBR_seek_table, kbps); +} + + +/*-------------------------------------------------------------*/ +static int +ExtractI4(const unsigned char *buf) +{ + int x; + /* big endian extract */ + x = buf[0]; + x <<= 8; + x |= buf[1]; + x <<= 8; + x |= buf[2]; + x <<= 8; + x |= buf[3]; + return x; +} + +static void +CreateI4(unsigned char *buf, uint32_t nValue) +{ + /* big endian create */ + buf[0] = (nValue >> 24) & 0xff; + buf[1] = (nValue >> 16) & 0xff; + buf[2] = (nValue >> 8) & 0xff; + buf[3] = (nValue) & 0xff; +} + + + +static void +CreateI2(unsigned char *buf, int nValue) +{ + /* big endian create */ + buf[0] = (nValue >> 8) & 0xff; + buf[1] = (nValue) & 0xff; +} + +/* check for magic strings*/ +static int +IsVbrTag(const unsigned char *buf) +{ + int isTag0, isTag1; + + isTag0 = ((buf[0] == VBRTag0[0]) && (buf[1] == VBRTag0[1]) && (buf[2] == VBRTag0[2]) + && (buf[3] == VBRTag0[3])); + isTag1 = ((buf[0] == VBRTag1[0]) && (buf[1] == VBRTag1[1]) && (buf[2] == VBRTag1[2]) + && (buf[3] == VBRTag1[3])); + + return (isTag0 || isTag1); +} + +#define SHIFT_IN_BITS_VALUE(x,n,v) ( x = (x << (n)) | ( (v) & ~(-1 << (n)) ) ) + +static void +setLameTagFrameHeader(lame_internal_flags const *gfc, unsigned char *buffer) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t const *const eov = &gfc->ov_enc; + char abyte, bbyte; + + SHIFT_IN_BITS_VALUE(buffer[0], 8u, 0xffu); + + SHIFT_IN_BITS_VALUE(buffer[1], 3u, 7); + SHIFT_IN_BITS_VALUE(buffer[1], 1u, (cfg->samplerate_out < 16000) ? 0 : 1); + SHIFT_IN_BITS_VALUE(buffer[1], 1u, cfg->version); + SHIFT_IN_BITS_VALUE(buffer[1], 2u, 4 - 3); + SHIFT_IN_BITS_VALUE(buffer[1], 1u, (!cfg->error_protection) ? 1 : 0); + + SHIFT_IN_BITS_VALUE(buffer[2], 4u, eov->bitrate_index); + SHIFT_IN_BITS_VALUE(buffer[2], 2u, cfg->samplerate_index); + SHIFT_IN_BITS_VALUE(buffer[2], 1u, 0); + SHIFT_IN_BITS_VALUE(buffer[2], 1u, cfg->extension); + + SHIFT_IN_BITS_VALUE(buffer[3], 2u, cfg->mode); + SHIFT_IN_BITS_VALUE(buffer[3], 2u, eov->mode_ext); + SHIFT_IN_BITS_VALUE(buffer[3], 1u, cfg->copyright); + SHIFT_IN_BITS_VALUE(buffer[3], 1u, cfg->original); + SHIFT_IN_BITS_VALUE(buffer[3], 2u, cfg->emphasis); + + /* the default VBR header. 48 kbps layer III, no padding, no crc */ + /* but sampling freq, mode andy copyright/copy protection taken */ + /* from first valid frame */ + buffer[0] = (uint8_t) 0xff; + abyte = (buffer[1] & (unsigned char) 0xf1); + { + int bitrate; + if (1 == cfg->version) { + bitrate = XING_BITRATE1; + } + else { + if (cfg->samplerate_out < 16000) + bitrate = XING_BITRATE25; + else + bitrate = XING_BITRATE2; + } + + if (cfg->vbr == vbr_off) + bitrate = cfg->avg_bitrate; + + if (cfg->free_format) + bbyte = 0x00; + else + bbyte = 16 * BitrateIndex(bitrate, cfg->version, cfg->samplerate_out); + } + + /* Use as much of the info from the real frames in the + * Xing header: samplerate, channels, crc, etc... + */ + if (cfg->version == 1) { + /* MPEG1 */ + buffer[1] = abyte | (char) 0x0a; /* was 0x0b; */ + abyte = buffer[2] & (char) 0x0d; /* AF keep also private bit */ + buffer[2] = (char) bbyte | abyte; /* 64kbs MPEG1 frame */ + } + else { + /* MPEG2 */ + buffer[1] = abyte | (char) 0x02; /* was 0x03; */ + abyte = buffer[2] & (char) 0x0d; /* AF keep also private bit */ + buffer[2] = (char) bbyte | abyte; /* 64kbs MPEG2 frame */ + } +} + +#if 0 +static int CheckVbrTag(unsigned char *buf); + +/*-------------------------------------------------------------*/ +/* Same as GetVbrTag below, but only checks for the Xing tag. + requires buf to contain only 40 bytes */ +/*-------------------------------------------------------------*/ +int +CheckVbrTag(unsigned char *buf) +{ + int h_id, h_mode; + + /* get selected MPEG header data */ + h_id = (buf[1] >> 3) & 1; + h_mode = (buf[3] >> 6) & 3; + + /* determine offset of header */ + if (h_id) { + /* mpeg1 */ + if (h_mode != 3) + buf += (32 + 4); + else + buf += (17 + 4); + } + else { + /* mpeg2 */ + if (h_mode != 3) + buf += (17 + 4); + else + buf += (9 + 4); + } + + return IsVbrTag(buf); +} +#endif + +int +GetVbrTag(VBRTAGDATA * pTagData, const unsigned char *buf) +{ + int i, head_flags; + int h_bitrate, h_id, h_mode, h_sr_index, h_layer; + int enc_delay, enc_padding; + + /* get Vbr header data */ + pTagData->flags = 0; + + /* get selected MPEG header data */ + h_layer = (buf[1] >> 1) & 3; + if ( h_layer != 0x01 ) { + /* the following code assumes Layer-3, so give up here */ + return 0; + } + h_id = (buf[1] >> 3) & 1; + h_sr_index = (buf[2] >> 2) & 3; + h_mode = (buf[3] >> 6) & 3; + h_bitrate = ((buf[2] >> 4) & 0xf); + h_bitrate = bitrate_table[h_id][h_bitrate]; + + /* check for FFE syncword */ + if ((buf[1] >> 4) == 0xE) + pTagData->samprate = samplerate_table[2][h_sr_index]; + else + pTagData->samprate = samplerate_table[h_id][h_sr_index]; + /* if( h_id == 0 ) */ + /* pTagData->samprate >>= 1; */ + + + + /* determine offset of header */ + if (h_id) { + /* mpeg1 */ + if (h_mode != 3) + buf += (32 + 4); + else + buf += (17 + 4); + } + else { + /* mpeg2 */ + if (h_mode != 3) + buf += (17 + 4); + else + buf += (9 + 4); + } + + if (!IsVbrTag(buf)) + return 0; + + buf += 4; + + pTagData->h_id = h_id; + + head_flags = pTagData->flags = ExtractI4(buf); + buf += 4; /* get flags */ + + if (head_flags & FRAMES_FLAG) { + pTagData->frames = ExtractI4(buf); + buf += 4; + } + + if (head_flags & BYTES_FLAG) { + pTagData->bytes = ExtractI4(buf); + buf += 4; + } + + if (head_flags & TOC_FLAG) { + if (pTagData->toc != NULL) { + for (i = 0; i < NUMTOCENTRIES; i++) + pTagData->toc[i] = buf[i]; + } + buf += NUMTOCENTRIES; + } + + pTagData->vbr_scale = -1; + + if (head_flags & VBR_SCALE_FLAG) { + pTagData->vbr_scale = ExtractI4(buf); + buf += 4; + } + + pTagData->headersize = ((h_id + 1) * 72000 * h_bitrate) / pTagData->samprate; + + buf += 21; + enc_delay = buf[0] << 4; + enc_delay += buf[1] >> 4; + enc_padding = (buf[1] & 0x0F) << 8; + enc_padding += buf[2]; + /* check for reasonable values (this may be an old Xing header, */ + /* not a INFO tag) */ + if (enc_delay < 0 || enc_delay > 3000) + enc_delay = -1; + if (enc_padding < 0 || enc_padding > 3000) + enc_padding = -1; + + pTagData->enc_delay = enc_delay; + pTagData->enc_padding = enc_padding; + +#ifdef DEBUG_VBRTAG + fprintf(stderr, "\n\n********************* VBR TAG INFO *****************\n"); + fprintf(stderr, "tag :%s\n", VBRTag); + fprintf(stderr, "head_flags :%d\n", head_flags); + fprintf(stderr, "bytes :%d\n", pTagData->bytes); + fprintf(stderr, "frames :%d\n", pTagData->frames); + fprintf(stderr, "VBR Scale :%d\n", pTagData->vbr_scale); + fprintf(stderr, "enc_delay = %i \n", enc_delay); + fprintf(stderr, "enc_padding= %i \n", enc_padding); + fprintf(stderr, "toc:\n"); + if (pTagData->toc != NULL) { + for (i = 0; i < NUMTOCENTRIES; i++) { + if ((i % 10) == 0) + fprintf(stderr, "\n"); + fprintf(stderr, " %3d", (int) (pTagData->toc[i])); + } + } + fprintf(stderr, "\n***************** END OF VBR TAG INFO ***************\n"); +#endif + return 1; /* success */ +} + + +/**************************************************************************** + * InitVbrTag: Initializes the header, and write empty frame to stream + * Paramters: + * fpStream: pointer to output file stream + * nMode : Channel Mode: 0=STEREO 1=JS 2=DS 3=MONO + **************************************************************************** +*/ +int +InitVbrTag(lame_global_flags * gfp) +{ + lame_internal_flags *gfc = gfp->internal_flags; + SessionConfig_t const *const cfg = &gfc->cfg; + int kbps_header; + +#define MAXFRAMESIZE 2880 /* or 0xB40, the max freeformat 640 32kHz framesize */ + + /* + * Xing VBR pretends to be a 48kbs layer III frame. (at 44.1kHz). + * (at 48kHz they use 56kbs since 48kbs frame not big enough for + * table of contents) + * let's always embed Xing header inside a 64kbs layer III frame. + * this gives us enough room for a LAME version string too. + * size determined by sampling frequency (MPEG1) + * 32kHz: 216 bytes@48kbs 288bytes@ 64kbs + * 44.1kHz: 156 bytes 208bytes@64kbs (+1 if padding = 1) + * 48kHz: 144 bytes 192 + * + * MPEG 2 values are the same since the framesize and samplerate + * are each reduced by a factor of 2. + */ + + + if (1 == cfg->version) { + kbps_header = XING_BITRATE1; + } + else { + if (cfg->samplerate_out < 16000) + kbps_header = XING_BITRATE25; + else + kbps_header = XING_BITRATE2; + } + + if (cfg->vbr == vbr_off) + kbps_header = cfg->avg_bitrate; + + /** make sure LAME Header fits into Frame + */ + { + int total_frame_size = ((cfg->version + 1) * 72000 * kbps_header) / cfg->samplerate_out; + int header_size = (cfg->sideinfo_len + LAMEHEADERSIZE); + gfc->VBR_seek_table.TotalFrameSize = total_frame_size; + if (total_frame_size < header_size || total_frame_size > MAXFRAMESIZE) { + /* disable tag, it wont fit */ + gfc->cfg.write_lame_tag = 0; + return 0; + } + } + + gfc->VBR_seek_table.nVbrNumFrames = 0; + gfc->VBR_seek_table.nBytesWritten = 0; + gfc->VBR_seek_table.sum = 0; + + gfc->VBR_seek_table.seen = 0; + gfc->VBR_seek_table.want = 1; + gfc->VBR_seek_table.pos = 0; + + if (gfc->VBR_seek_table.bag == NULL) { + gfc->VBR_seek_table.bag = malloc(400 * sizeof(int)); + if (gfc->VBR_seek_table.bag != NULL) { + gfc->VBR_seek_table.size = 400; + } + else { + gfc->VBR_seek_table.size = 0; + ERRORF(gfc, "Error: can't allocate VbrFrames buffer\n"); + gfc->cfg.write_lame_tag = 0; + return -1; + } + } + + /* write dummy VBR tag of all 0's into bitstream */ + { + uint8_t buffer[MAXFRAMESIZE]; + size_t i, n; + + memset(buffer, 0, sizeof(buffer)); + setLameTagFrameHeader(gfc, buffer); + n = gfc->VBR_seek_table.TotalFrameSize; + for (i = 0; i < n; ++i) { + add_dummy_byte(gfc, buffer[i], 1); + } + } + /* Success */ + return 0; +} + + + +/* fast CRC-16 computation - uses table crc16_lookup 8*/ +static uint16_t +CRC_update_lookup(uint16_t value, uint16_t crc) +{ + uint16_t tmp; + tmp = crc ^ value; + crc = (crc >> 8) ^ crc16_lookup[tmp & 0xff]; + return crc; +} + +void +UpdateMusicCRC(uint16_t * crc, unsigned char const *buffer, int size) +{ + int i; + for (i = 0; i < size; ++i) + *crc = CRC_update_lookup(buffer[i], *crc); +} + + + + + +/**************************************************************************** + * Jonathan Dee 2001/08/31 + * + * PutLameVBR: Write LAME info: mini version + info on various switches used + * Paramters: + * pbtStreamBuffer : pointer to output buffer + * id3v2size : size of id3v2 tag in bytes + * crc : computation of crc-16 of Lame Tag so far (starting at frame sync) + * + **************************************************************************** +*/ +static int +PutLameVBR(lame_global_flags const *gfp, size_t nMusicLength, uint8_t * pbtStreamBuffer, uint16_t crc) +{ + lame_internal_flags const *gfc = gfp->internal_flags; + SessionConfig_t const *const cfg = &gfc->cfg; + + int nBytesWritten = 0; + int i; + + int enc_delay = gfc->ov_enc.encoder_delay; /* encoder delay */ + int enc_padding = gfc->ov_enc.encoder_padding; /* encoder padding */ + + /*recall: cfg->vbr_q is for example set by the switch -V */ + /* gfp->quality by -q, -h, -f, etc */ + + int nQuality = (100 - 10 * gfp->VBR_q - gfp->quality); + + + /* + NOTE: + Even though the specification for the LAME VBR tag + did explicitly mention other encoders than LAME, + many SW/HW decoder seem to be able to make use of + this tag only, if the encoder version starts with LAME. + To be compatible with such decoders, ANY encoder will + be forced to write a fake LAME version string! + As a result, the encoder version info becomes worthless. + */ + const char *szVersion = get_lame_tag_encoder_short_version(); + uint8_t nVBR; + uint8_t nRevision = 0x00; + uint8_t nRevMethod; + uint8_t vbr_type_translator[] = { 1, 5, 3, 2, 4, 0, 3 }; /*numbering different in vbr_mode vs. Lame tag */ + + uint8_t nLowpass = + (((cfg->lowpassfreq / 100.0) + .5) > 255 ? 255 : (cfg->lowpassfreq / 100.0) + .5); + + uint32_t nPeakSignalAmplitude = 0; + + uint16_t nRadioReplayGain = 0; + uint16_t nAudiophileReplayGain = 0; + + uint8_t nNoiseShaping = cfg->noise_shaping; + uint8_t nStereoMode = 0; + int bNonOptimal = 0; + uint8_t nSourceFreq = 0; + uint8_t nMisc = 0; + uint16_t nMusicCRC = 0; + + /*psy model type: Gpsycho or NsPsytune */ + unsigned char bExpNPsyTune = 1; /* only NsPsytune */ + unsigned char bSafeJoint = (cfg->use_safe_joint_stereo) != 0; + + unsigned char bNoGapMore = 0; + unsigned char bNoGapPrevious = 0; + + int nNoGapCount = gfp->nogap_total; + int nNoGapCurr = gfp->nogap_current; + + + uint8_t nAthType = cfg->ATHtype; /*4 bits. */ + + uint8_t nFlags = 0; + + /* if ABR, {store bitrate <=255} else { store "-b"} */ + int nABRBitrate; + switch (cfg->vbr) { + case vbr_abr:{ + nABRBitrate = cfg->vbr_avg_bitrate_kbps; + break; + } + case vbr_off:{ + nABRBitrate = cfg->avg_bitrate; + break; + } + default:{ /*vbr modes */ + nABRBitrate = bitrate_table[cfg->version][cfg->vbr_min_bitrate_index];; + } + } + + + /*revision and vbr method */ + if (cfg->vbr < sizeof(vbr_type_translator)) + nVBR = vbr_type_translator[cfg->vbr]; + else + nVBR = 0x00; /*unknown. */ + + nRevMethod = 0x10 * nRevision + nVBR; + + + /* ReplayGain */ + if (cfg->findReplayGain) { + int RadioGain = gfc->ov_rpg.RadioGain; + if (RadioGain > 0x1FE) + RadioGain = 0x1FE; + if (RadioGain < -0x1FE) + RadioGain = -0x1FE; + + nRadioReplayGain = 0x2000; /* set name code */ + nRadioReplayGain |= 0xC00; /* set originator code to `determined automatically' */ + + if (RadioGain >= 0) + nRadioReplayGain |= RadioGain; /* set gain adjustment */ + else { + nRadioReplayGain |= 0x200; /* set the sign bit */ + nRadioReplayGain |= -RadioGain; /* set gain adjustment */ + } + } + + /* peak sample */ + if (cfg->findPeakSample) + nPeakSignalAmplitude = + abs((int) ((((FLOAT) gfc->ov_rpg.PeakSample) / 32767.0) * pow(2, 23) + .5)); + + /*nogap */ + if (nNoGapCount != -1) { + if (nNoGapCurr > 0) + bNoGapPrevious = 1; + + if (nNoGapCurr < nNoGapCount - 1) + bNoGapMore = 1; + } + + /*flags */ + + nFlags = nAthType + (bExpNPsyTune << 4) + + (bSafeJoint << 5) + + (bNoGapMore << 6) + + (bNoGapPrevious << 7); + + + if (nQuality < 0) + nQuality = 0; + + /*stereo mode field... a bit ugly. */ + + switch (cfg->mode) { + case MONO: + nStereoMode = 0; + break; + case STEREO: + nStereoMode = 1; + break; + case DUAL_CHANNEL: + nStereoMode = 2; + break; + case JOINT_STEREO: + if (cfg->force_ms) + nStereoMode = 4; + else + nStereoMode = 3; + break; + case NOT_SET: + /* FALLTHROUGH */ + default: + nStereoMode = 7; + break; + } + + /*Intensity stereo : nStereoMode = 6. IS is not implemented */ + + if (cfg->samplerate_in <= 32000) + nSourceFreq = 0x00; + else if (cfg->samplerate_in == 48000) + nSourceFreq = 0x02; + else if (cfg->samplerate_in > 48000) + nSourceFreq = 0x03; + else + nSourceFreq = 0x01; /*default is 44100Hz. */ + + + /*Check if the user overrided the default LAME behaviour with some nasty options */ + + if (cfg->short_blocks == short_block_forced || cfg->short_blocks == short_block_dispensed || ((cfg->lowpassfreq == -1) && (cfg->highpassfreq == -1)) || /* "-k" */ + (cfg->disable_reservoir && cfg->avg_bitrate < 320) || + cfg->noATH || cfg->ATHonly || (nAthType == 0) || cfg->samplerate_in <= 32000) + bNonOptimal = 1; + + nMisc = nNoiseShaping + (nStereoMode << 2) + + (bNonOptimal << 5) + + (nSourceFreq << 6); + + + nMusicCRC = gfc->nMusicCRC; + + + /*Write all this information into the stream */ + CreateI4(&pbtStreamBuffer[nBytesWritten], nQuality); + nBytesWritten += 4; + + strncpy((char *) &pbtStreamBuffer[nBytesWritten], szVersion, 9); + nBytesWritten += 9; + + pbtStreamBuffer[nBytesWritten] = nRevMethod; + nBytesWritten++; + + pbtStreamBuffer[nBytesWritten] = nLowpass; + nBytesWritten++; + + CreateI4(&pbtStreamBuffer[nBytesWritten], nPeakSignalAmplitude); + nBytesWritten += 4; + + CreateI2(&pbtStreamBuffer[nBytesWritten], nRadioReplayGain); + nBytesWritten += 2; + + CreateI2(&pbtStreamBuffer[nBytesWritten], nAudiophileReplayGain); + nBytesWritten += 2; + + pbtStreamBuffer[nBytesWritten] = nFlags; + nBytesWritten++; + + if (nABRBitrate >= 255) + pbtStreamBuffer[nBytesWritten] = 0xFF; + else + pbtStreamBuffer[nBytesWritten] = nABRBitrate; + nBytesWritten++; + + pbtStreamBuffer[nBytesWritten] = enc_delay >> 4; /* works for win32, does it for unix? */ + pbtStreamBuffer[nBytesWritten + 1] = (enc_delay << 4) + (enc_padding >> 8); + pbtStreamBuffer[nBytesWritten + 2] = enc_padding; + + nBytesWritten += 3; + + pbtStreamBuffer[nBytesWritten] = nMisc; + nBytesWritten++; + + + pbtStreamBuffer[nBytesWritten++] = 0; /*unused in rev0 */ + + CreateI2(&pbtStreamBuffer[nBytesWritten], cfg->preset); + nBytesWritten += 2; + + CreateI4(&pbtStreamBuffer[nBytesWritten], (int) nMusicLength); + nBytesWritten += 4; + + CreateI2(&pbtStreamBuffer[nBytesWritten], nMusicCRC); + nBytesWritten += 2; + + /*Calculate tag CRC.... must be done here, since it includes + *previous information*/ + + for (i = 0; i < nBytesWritten; i++) + crc = CRC_update_lookup(pbtStreamBuffer[i], crc); + + CreateI2(&pbtStreamBuffer[nBytesWritten], crc); + nBytesWritten += 2; + + return nBytesWritten; +} + +static long +skipId3v2(FILE * fpStream) +{ + size_t nbytes; + long id3v2TagSize; + unsigned char id3v2Header[10]; + + /* seek to the beginning of the stream */ + if (fseek(fpStream, 0, SEEK_SET) != 0) { + return -2; /* not seekable, abort */ + } + /* read 10 bytes in case there's an ID3 version 2 header here */ + nbytes = fread(id3v2Header, 1, sizeof(id3v2Header), fpStream); + if (nbytes != sizeof(id3v2Header)) { + return -3; /* not readable, maybe opened Write-Only */ + } + /* does the stream begin with the ID3 version 2 file identifier? */ + if (!strncmp((char *) id3v2Header, "ID3", 3)) { + /* the tag size (minus the 10-byte header) is encoded into four + * bytes where the most significant bit is clear in each byte */ + id3v2TagSize = (((id3v2Header[6] & 0x7f) << 21) + | ((id3v2Header[7] & 0x7f) << 14) + | ((id3v2Header[8] & 0x7f) << 7) + | (id3v2Header[9] & 0x7f)) + + sizeof id3v2Header; + } + else { + /* no ID3 version 2 tag in this stream */ + id3v2TagSize = 0; + } + return id3v2TagSize; +} + + + +size_t +lame_get_lametag_frame(lame_global_flags const *gfp, unsigned char *buffer, size_t size) +{ + lame_internal_flags *gfc; + SessionConfig_t const *cfg; + unsigned long stream_size; + unsigned int nStreamIndex; + uint8_t btToc[NUMTOCENTRIES]; + + if (gfp == 0) { + return 0; + } + gfc = gfp->internal_flags; + if (gfc == 0) { + return 0; + } + if (gfc->class_id != LAME_ID) { + return 0; + } + cfg = &gfc->cfg; + if (cfg->write_lame_tag == 0) { + return 0; + } + if (gfc->VBR_seek_table.pos <= 0) { + return 0; + } + if (size < gfc->VBR_seek_table.TotalFrameSize) { + return gfc->VBR_seek_table.TotalFrameSize; + } + if (buffer == 0) { + return 0; + } + + memset(buffer, 0, gfc->VBR_seek_table.TotalFrameSize); + + /* 4 bytes frame header */ + + setLameTagFrameHeader(gfc, buffer); + + /* Clear all TOC entries */ + memset(btToc, 0, sizeof(btToc)); + + if (cfg->free_format) { + int i; + for (i = 1; i < NUMTOCENTRIES; ++i) + btToc[i] = 255 * i / 100; + } + else { + Xing_seek_table(&gfc->VBR_seek_table, btToc); + } +#ifdef DEBUG_VBR_SEEKING_TABLE + print_seeking(btToc); +#endif + + /* Start writing the tag after the zero frame */ + nStreamIndex = cfg->sideinfo_len; + /* note! Xing header specifies that Xing data goes in the + * ancillary data with NO ERROR PROTECTION. If error protecton + * in enabled, the Xing data still starts at the same offset, + * and now it is in sideinfo data block, and thus will not + * decode correctly by non-Xing tag aware players */ + if (cfg->error_protection) + nStreamIndex -= 2; + + /* Put Vbr tag */ + if (cfg->vbr == vbr_off) { + buffer[nStreamIndex++] = VBRTag1[0]; + buffer[nStreamIndex++] = VBRTag1[1]; + buffer[nStreamIndex++] = VBRTag1[2]; + buffer[nStreamIndex++] = VBRTag1[3]; + + } + else { + buffer[nStreamIndex++] = VBRTag0[0]; + buffer[nStreamIndex++] = VBRTag0[1]; + buffer[nStreamIndex++] = VBRTag0[2]; + buffer[nStreamIndex++] = VBRTag0[3]; + } + + /* Put header flags */ + CreateI4(&buffer[nStreamIndex], FRAMES_FLAG + BYTES_FLAG + TOC_FLAG + VBR_SCALE_FLAG); + nStreamIndex += 4; + + /* Put Total Number of frames */ + CreateI4(&buffer[nStreamIndex], gfc->VBR_seek_table.nVbrNumFrames); + nStreamIndex += 4; + + /* Put total audio stream size, including Xing/LAME Header */ + stream_size = gfc->VBR_seek_table.nBytesWritten + gfc->VBR_seek_table.TotalFrameSize; + CreateI4(&buffer[nStreamIndex], stream_size); + nStreamIndex += 4; + + /* Put TOC */ + memcpy(&buffer[nStreamIndex], btToc, sizeof(btToc)); + nStreamIndex += sizeof(btToc); + + + if (cfg->error_protection) { + /* (jo) error_protection: add crc16 information to header */ + CRC_writeheader(gfc, (char *) buffer); + } + { + /*work out CRC so far: initially crc = 0 */ + uint16_t crc = 0x00; + unsigned int i; + for (i = 0; i < nStreamIndex; i++) + crc = CRC_update_lookup(buffer[i], crc); + /*Put LAME VBR info */ + nStreamIndex += PutLameVBR(gfp, stream_size, buffer + nStreamIndex, crc); + } + +#ifdef DEBUG_VBRTAG + { + VBRTAGDATA TestHeader; + GetVbrTag(&TestHeader, buffer); + } +#endif + + return gfc->VBR_seek_table.TotalFrameSize; +} + +/*********************************************************************** + * + * PutVbrTag: Write final VBR tag to the file + * Paramters: + * lpszFileName: filename of MP3 bit stream + * nVbrScale : encoder quality indicator (0..100) + **************************************************************************** + */ + +int +PutVbrTag(lame_global_flags const *gfp, FILE * fpStream) +{ + lame_internal_flags *gfc = gfp->internal_flags; + + long lFileSize; + long id3v2TagSize; + size_t nbytes; + uint8_t buffer[MAXFRAMESIZE]; + + if (gfc->VBR_seek_table.pos <= 0) + return -1; + + /* Seek to end of file */ + fseek(fpStream, 0, SEEK_END); + + /* Get file size */ + lFileSize = ftell(fpStream); + + /* Abort if file has zero length. Yes, it can happen :) */ + if (lFileSize == 0) + return -1; + + /* + * The VBR tag may NOT be located at the beginning of the stream. + * If an ID3 version 2 tag was added, then it must be skipped to write + * the VBR tag data. + */ + + id3v2TagSize = skipId3v2(fpStream); + + if (id3v2TagSize < 0) { + return id3v2TagSize; + } + + /*Seek to the beginning of the stream */ + fseek(fpStream, id3v2TagSize, SEEK_SET); + + nbytes = lame_get_lametag_frame(gfp, buffer, sizeof(buffer)); + if (nbytes > sizeof(buffer)) { + return -1; + } + + if (nbytes < 1) { + return 0; + } + + /* Put it all to disk again */ + if (fwrite(buffer, nbytes, 1, fpStream) != 1) { + return -1; + } + + return 0; /* success */ +} diff --git a/node_modules/lame/deps/lame/libmp3lame/VbrTag.h b/node_modules/lame/deps/lame/libmp3lame/VbrTag.h new file mode 100644 index 0000000..406af36 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/VbrTag.h @@ -0,0 +1,79 @@ +/* + * Xing VBR tagging for LAME. + * + * Copyright (c) 1999 A.L. Faber + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_VRBTAG_H +#define LAME_VRBTAG_H + + +/* ----------------------------------------------------------- + * A Vbr header may be present in the ancillary + * data field of the first frame of an mp3 bitstream + * The Vbr header (optionally) contains + * frames total number of audio frames in the bitstream + * bytes total number of bytes in the bitstream + * toc table of contents + + * toc (table of contents) gives seek points + * for random access + * the ith entry determines the seek point for + * i-percent duration + * seek point in bytes = (toc[i]/256.0) * total_bitstream_bytes + * e.g. half duration seek point = (toc[50]/256.0) * total_bitstream_bytes + */ + + +#define FRAMES_FLAG 0x0001 +#define BYTES_FLAG 0x0002 +#define TOC_FLAG 0x0004 +#define VBR_SCALE_FLAG 0x0008 + +#define NUMTOCENTRIES 100 + +#ifndef lame_internal_flags_defined +#define lame_internal_flags_defined +struct lame_internal_flags; +typedef struct lame_internal_flags lame_internal_flags; +#endif + + +/*structure to receive extracted header */ +/* toc may be NULL*/ +typedef struct { + int h_id; /* from MPEG header, 0=MPEG2, 1=MPEG1 */ + int samprate; /* determined from MPEG header */ + int flags; /* from Vbr header data */ + int frames; /* total bit stream frames from Vbr header data */ + int bytes; /* total bit stream bytes from Vbr header data */ + int vbr_scale; /* encoded vbr scale from Vbr header data */ + unsigned char toc[NUMTOCENTRIES]; /* may be NULL if toc not desired */ + int headersize; /* size of VBR header, in bytes */ + int enc_delay; /* encoder delay */ + int enc_padding; /* encoder paddign added at end of stream */ +} VBRTAGDATA; + +int GetVbrTag(VBRTAGDATA * pTagData, const unsigned char *buf); + +int InitVbrTag(lame_global_flags * gfp); +int PutVbrTag(lame_global_flags const *gfp, FILE * fid); +void AddVbrFrame(lame_internal_flags * gfc); +void UpdateMusicCRC(uint16_t * crc, const unsigned char *buffer, int size); + +#endif diff --git a/node_modules/lame/deps/lame/libmp3lame/bitstream.c b/node_modules/lame/deps/lame/libmp3lame/bitstream.c new file mode 100644 index 0000000..b11edfb --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/bitstream.c @@ -0,0 +1,1111 @@ +/* + * MP3 bitstream Output interface for LAME + * + * Copyright (c) 1999-2000 Mark Taylor + * Copyright (c) 1999-2002 Takehiro Tominaga + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * $Id: bitstream.c,v 1.97 2011/05/07 16:05:17 rbrito Exp $ + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "tables.h" +#include "quantize_pvt.h" +#include "lame_global_flags.h" +#include "gain_analysis.h" +#include "VbrTag.h" +#include "bitstream.h" +#include "tables.h" + + + +/* unsigned int is at least this large: */ +/* we work with ints, so when doing bit manipulation, we limit + * ourselves to MAX_LENGTH-2 just to be on the safe side */ +#define MAX_LENGTH 32 + + + +#ifdef DEBUG +static int hogege; +#endif + + + +static int +calcFrameLength(SessionConfig_t const *const cfg, int kbps, int pad) +{ + return 8 * ((cfg->version + 1) * 72000 * kbps / cfg->samplerate_out + pad); +} + + +/*********************************************************************** + * compute bitsperframe and mean_bits for a layer III frame + **********************************************************************/ +int +getframebits(const lame_internal_flags * gfc) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t const *const eov = &gfc->ov_enc; + int bit_rate; + + /* get bitrate in kbps [?] */ + if (eov->bitrate_index) + bit_rate = bitrate_table[cfg->version][eov->bitrate_index]; + else + bit_rate = cfg->avg_bitrate; + /*assert(bit_rate <= 550); */ + assert(8 <= bit_rate && bit_rate <= 640); + + /* main encoding routine toggles padding on and off */ + /* one Layer3 Slot consists of 8 bits */ + return calcFrameLength(cfg, bit_rate, eov->padding); +} + +int +get_max_frame_buffer_size_by_constraint(SessionConfig_t const * cfg, int constraint) +{ + int maxmp3buf = 0; + if (cfg->avg_bitrate > 320) { + /* in freeformat the buffer is constant */ + if (constraint == MDB_STRICT_ISO) { + maxmp3buf = calcFrameLength(cfg, cfg->avg_bitrate, 0); + } + else { + /* maximum allowed bits per granule are 7680 */ + maxmp3buf = 7680 * (cfg->version + 1); + } + } + else { + int max_kbps; + if (cfg->samplerate_out < 16000) { + max_kbps = bitrate_table[cfg->version][8]; /* default: allow 64 kbps (MPEG-2.5) */ + } + else { + max_kbps = bitrate_table[cfg->version][14]; + } + switch (constraint) + { + default: + case MDB_DEFAULT: + /* Bouvigne suggests this more lax interpretation of the ISO doc instead of using 8*960. */ + /* All mp3 decoders should have enough buffer to handle this value: size of a 320kbps 32kHz frame */ + maxmp3buf = 8 * 1440; + break; + case MDB_STRICT_ISO: + maxmp3buf = calcFrameLength(cfg, max_kbps, 0); + break; + case MDB_MAXIMUM: + maxmp3buf = 7680 * (cfg->version + 1); + break; + } + } + return maxmp3buf; +} + + +static void +putheader_bits(lame_internal_flags * gfc) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t *const esv = &gfc->sv_enc; + Bit_stream_struc *bs = &gfc->bs; +#ifdef DEBUG + hogege += cfg->sideinfo_len * 8; +#endif + memcpy(&bs->buf[bs->buf_byte_idx], esv->header[esv->w_ptr].buf, cfg->sideinfo_len); + bs->buf_byte_idx += cfg->sideinfo_len; + bs->totbit += cfg->sideinfo_len * 8; + esv->w_ptr = (esv->w_ptr + 1) & (MAX_HEADER_BUF - 1); +} + + + + +/*write j bits into the bit stream */ +inline static void +putbits2(lame_internal_flags * gfc, int val, int j) +{ + EncStateVar_t const *const esv = &gfc->sv_enc; + Bit_stream_struc *bs; + bs = &gfc->bs; + + assert(j < MAX_LENGTH - 2); + + while (j > 0) { + int k; + if (bs->buf_bit_idx == 0) { + bs->buf_bit_idx = 8; + bs->buf_byte_idx++; + assert(bs->buf_byte_idx < BUFFER_SIZE); + assert(esv->header[esv->w_ptr].write_timing >= bs->totbit); + if (esv->header[esv->w_ptr].write_timing == bs->totbit) { + putheader_bits(gfc); + } + bs->buf[bs->buf_byte_idx] = 0; + } + + k = Min(j, bs->buf_bit_idx); + j -= k; + + bs->buf_bit_idx -= k; + + assert(j < MAX_LENGTH); /* 32 too large on 32 bit machines */ + assert(bs->buf_bit_idx < MAX_LENGTH); + + bs->buf[bs->buf_byte_idx] |= ((val >> j) << bs->buf_bit_idx); + bs->totbit += k; + } +} + +/*write j bits into the bit stream, ignoring frame headers */ +inline static void +putbits_noheaders(lame_internal_flags * gfc, int val, int j) +{ + Bit_stream_struc *bs; + bs = &gfc->bs; + + assert(j < MAX_LENGTH - 2); + + while (j > 0) { + int k; + if (bs->buf_bit_idx == 0) { + bs->buf_bit_idx = 8; + bs->buf_byte_idx++; + assert(bs->buf_byte_idx < BUFFER_SIZE); + bs->buf[bs->buf_byte_idx] = 0; + } + + k = Min(j, bs->buf_bit_idx); + j -= k; + + bs->buf_bit_idx -= k; + + assert(j < MAX_LENGTH); /* 32 too large on 32 bit machines */ + assert(bs->buf_bit_idx < MAX_LENGTH); + + bs->buf[bs->buf_byte_idx] |= ((val >> j) << bs->buf_bit_idx); + bs->totbit += k; + } +} + + +/* + Some combinations of bitrate, Fs, and stereo make it impossible to stuff + out a frame using just main_data, due to the limited number of bits to + indicate main_data_length. In these situations, we put stuffing bits into + the ancillary data... +*/ + +inline static void +drain_into_ancillary(lame_internal_flags * gfc, int remainingBits) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t *const esv = &gfc->sv_enc; + int i; + assert(remainingBits >= 0); + + if (remainingBits >= 8) { + putbits2(gfc, 0x4c, 8); + remainingBits -= 8; + } + if (remainingBits >= 8) { + putbits2(gfc, 0x41, 8); + remainingBits -= 8; + } + if (remainingBits >= 8) { + putbits2(gfc, 0x4d, 8); + remainingBits -= 8; + } + if (remainingBits >= 8) { + putbits2(gfc, 0x45, 8); + remainingBits -= 8; + } + + if (remainingBits >= 32) { + const char *const version = get_lame_short_version(); + if (remainingBits >= 32) + for (i = 0; i < (int) strlen(version) && remainingBits >= 8; ++i) { + remainingBits -= 8; + putbits2(gfc, version[i], 8); + } + } + + for (; remainingBits >= 1; remainingBits -= 1) { + putbits2(gfc, esv->ancillary_flag, 1); + esv->ancillary_flag ^= !cfg->disable_reservoir; + } + + assert(remainingBits == 0); + +} + +/*write N bits into the header */ +inline static void +writeheader(lame_internal_flags * gfc, int val, int j) +{ + EncStateVar_t *const esv = &gfc->sv_enc; + int ptr = esv->header[esv->h_ptr].ptr; + + while (j > 0) { + int const k = Min(j, 8 - (ptr & 7)); + j -= k; + assert(j < MAX_LENGTH); /* >> 32 too large for 32 bit machines */ + esv->header[esv->h_ptr].buf[ptr >> 3] + |= ((val >> j)) << (8 - (ptr & 7) - k); + ptr += k; + } + esv->header[esv->h_ptr].ptr = ptr; +} + + +static int +CRC_update(int value, int crc) +{ + int i; + value <<= 8; + for (i = 0; i < 8; i++) { + value <<= 1; + crc <<= 1; + + if (((crc ^ value) & 0x10000)) + crc ^= CRC16_POLYNOMIAL; + } + return crc; +} + + +void +CRC_writeheader(lame_internal_flags const *gfc, char *header) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int crc = 0xffff; /* (jo) init crc16 for error_protection */ + int i; + + crc = CRC_update(((unsigned char *) header)[2], crc); + crc = CRC_update(((unsigned char *) header)[3], crc); + for (i = 6; i < cfg->sideinfo_len; i++) { + crc = CRC_update(((unsigned char *) header)[i], crc); + } + + header[4] = crc >> 8; + header[5] = crc & 255; +} + +inline static void +encodeSideInfo2(lame_internal_flags * gfc, int bitsPerFrame) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t const *const eov = &gfc->ov_enc; + EncStateVar_t *const esv = &gfc->sv_enc; + III_side_info_t *l3_side; + int gr, ch; + + l3_side = &gfc->l3_side; + esv->header[esv->h_ptr].ptr = 0; + memset(esv->header[esv->h_ptr].buf, 0, cfg->sideinfo_len); + if (cfg->samplerate_out < 16000) + writeheader(gfc, 0xffe, 12); + else + writeheader(gfc, 0xfff, 12); + writeheader(gfc, (cfg->version), 1); + writeheader(gfc, 4 - 3, 2); + writeheader(gfc, (!cfg->error_protection), 1); + writeheader(gfc, (eov->bitrate_index), 4); + writeheader(gfc, (cfg->samplerate_index), 2); + writeheader(gfc, (eov->padding), 1); + writeheader(gfc, (cfg->extension), 1); + writeheader(gfc, (cfg->mode), 2); + writeheader(gfc, (eov->mode_ext), 2); + writeheader(gfc, (cfg->copyright), 1); + writeheader(gfc, (cfg->original), 1); + writeheader(gfc, (cfg->emphasis), 2); + if (cfg->error_protection) { + writeheader(gfc, 0, 16); /* dummy */ + } + + if (cfg->version == 1) { + /* MPEG1 */ + assert(l3_side->main_data_begin >= 0); + writeheader(gfc, (l3_side->main_data_begin), 9); + + if (cfg->channels_out == 2) + writeheader(gfc, l3_side->private_bits, 3); + else + writeheader(gfc, l3_side->private_bits, 5); + + for (ch = 0; ch < cfg->channels_out; ch++) { + int band; + for (band = 0; band < 4; band++) { + writeheader(gfc, l3_side->scfsi[ch][band], 1); + } + } + + for (gr = 0; gr < 2; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + gr_info *const gi = &l3_side->tt[gr][ch]; + writeheader(gfc, gi->part2_3_length + gi->part2_length, 12); + writeheader(gfc, gi->big_values / 2, 9); + writeheader(gfc, gi->global_gain, 8); + writeheader(gfc, gi->scalefac_compress, 4); + + if (gi->block_type != NORM_TYPE) { + writeheader(gfc, 1, 1); /* window_switching_flag */ + writeheader(gfc, gi->block_type, 2); + writeheader(gfc, gi->mixed_block_flag, 1); + + if (gi->table_select[0] == 14) + gi->table_select[0] = 16; + writeheader(gfc, gi->table_select[0], 5); + if (gi->table_select[1] == 14) + gi->table_select[1] = 16; + writeheader(gfc, gi->table_select[1], 5); + + writeheader(gfc, gi->subblock_gain[0], 3); + writeheader(gfc, gi->subblock_gain[1], 3); + writeheader(gfc, gi->subblock_gain[2], 3); + } + else { + writeheader(gfc, 0, 1); /* window_switching_flag */ + if (gi->table_select[0] == 14) + gi->table_select[0] = 16; + writeheader(gfc, gi->table_select[0], 5); + if (gi->table_select[1] == 14) + gi->table_select[1] = 16; + writeheader(gfc, gi->table_select[1], 5); + if (gi->table_select[2] == 14) + gi->table_select[2] = 16; + writeheader(gfc, gi->table_select[2], 5); + + assert(0 <= gi->region0_count && gi->region0_count < 16); + assert(0 <= gi->region1_count && gi->region1_count < 8); + writeheader(gfc, gi->region0_count, 4); + writeheader(gfc, gi->region1_count, 3); + } + writeheader(gfc, gi->preflag, 1); + writeheader(gfc, gi->scalefac_scale, 1); + writeheader(gfc, gi->count1table_select, 1); + } + } + } + else { + /* MPEG2 */ + assert(l3_side->main_data_begin >= 0); + writeheader(gfc, (l3_side->main_data_begin), 8); + writeheader(gfc, l3_side->private_bits, cfg->channels_out); + + gr = 0; + for (ch = 0; ch < cfg->channels_out; ch++) { + gr_info *const gi = &l3_side->tt[gr][ch]; + writeheader(gfc, gi->part2_3_length + gi->part2_length, 12); + writeheader(gfc, gi->big_values / 2, 9); + writeheader(gfc, gi->global_gain, 8); + writeheader(gfc, gi->scalefac_compress, 9); + + if (gi->block_type != NORM_TYPE) { + writeheader(gfc, 1, 1); /* window_switching_flag */ + writeheader(gfc, gi->block_type, 2); + writeheader(gfc, gi->mixed_block_flag, 1); + + if (gi->table_select[0] == 14) + gi->table_select[0] = 16; + writeheader(gfc, gi->table_select[0], 5); + if (gi->table_select[1] == 14) + gi->table_select[1] = 16; + writeheader(gfc, gi->table_select[1], 5); + + writeheader(gfc, gi->subblock_gain[0], 3); + writeheader(gfc, gi->subblock_gain[1], 3); + writeheader(gfc, gi->subblock_gain[2], 3); + } + else { + writeheader(gfc, 0, 1); /* window_switching_flag */ + if (gi->table_select[0] == 14) + gi->table_select[0] = 16; + writeheader(gfc, gi->table_select[0], 5); + if (gi->table_select[1] == 14) + gi->table_select[1] = 16; + writeheader(gfc, gi->table_select[1], 5); + if (gi->table_select[2] == 14) + gi->table_select[2] = 16; + writeheader(gfc, gi->table_select[2], 5); + + assert(0 <= gi->region0_count && gi->region0_count < 16); + assert(0 <= gi->region1_count && gi->region1_count < 8); + writeheader(gfc, gi->region0_count, 4); + writeheader(gfc, gi->region1_count, 3); + } + + writeheader(gfc, gi->scalefac_scale, 1); + writeheader(gfc, gi->count1table_select, 1); + } + } + + if (cfg->error_protection) { + /* (jo) error_protection: add crc16 information to header */ + CRC_writeheader(gfc, esv->header[esv->h_ptr].buf); + } + + { + int const old = esv->h_ptr; + assert(esv->header[old].ptr == cfg->sideinfo_len * 8); + + esv->h_ptr = (old + 1) & (MAX_HEADER_BUF - 1); + esv->header[esv->h_ptr].write_timing = esv->header[old].write_timing + bitsPerFrame; + + if (esv->h_ptr == esv->w_ptr) { + /* yikes! we are out of header buffer space */ + ERRORF(gfc, "Error: MAX_HEADER_BUF too small in bitstream.c \n"); + } + + } +} + + +inline static int +huffman_coder_count1(lame_internal_flags * gfc, gr_info const *gi) +{ + /* Write count1 area */ + struct huffcodetab const *const h = &ht[gi->count1table_select + 32]; + int i, bits = 0; +#ifdef DEBUG + int gegebo = gfc->bs.totbit; +#endif + + int const *ix = &gi->l3_enc[gi->big_values]; + FLOAT const *xr = &gi->xr[gi->big_values]; + assert(gi->count1table_select < 2); + + for (i = (gi->count1 - gi->big_values) / 4; i > 0; --i) { + int huffbits = 0; + int p = 0, v; + + v = ix[0]; + if (v) { + p += 8; + if (xr[0] < 0.0f) + huffbits++; + assert(v <= 1); + } + + v = ix[1]; + if (v) { + p += 4; + huffbits *= 2; + if (xr[1] < 0.0f) + huffbits++; + assert(v <= 1); + } + + v = ix[2]; + if (v) { + p += 2; + huffbits *= 2; + if (xr[2] < 0.0f) + huffbits++; + assert(v <= 1); + } + + v = ix[3]; + if (v) { + p++; + huffbits *= 2; + if (xr[3] < 0.0f) + huffbits++; + assert(v <= 1); + } + + ix += 4; + xr += 4; + putbits2(gfc, huffbits + h->table[p], h->hlen[p]); + bits += h->hlen[p]; + } +#ifdef DEBUG + DEBUGF(gfc, "count1: real: %ld counted:%d (bigv %d count1len %d)\n", + gfc->bs.totbit - gegebo, gi->count1bits, gi->big_values, gi->count1); +#endif + return bits; +} + + + +/* + Implements the pseudocode of page 98 of the IS + */ +inline static int +Huffmancode(lame_internal_flags * const gfc, const unsigned int tableindex, + int start, int end, gr_info const *gi) +{ + struct huffcodetab const *const h = &ht[tableindex]; + unsigned int const linbits = h->xlen; + int i, bits = 0; + + assert(tableindex < 32u); + if (!tableindex) + return bits; + + for (i = start; i < end; i += 2) { + int16_t cbits = 0; + uint16_t xbits = 0; + unsigned int xlen = h->xlen; + unsigned int ext = 0; + unsigned int x1 = gi->l3_enc[i]; + unsigned int x2 = gi->l3_enc[i + 1]; + + assert(gi->l3_enc[i] >= 0); + assert(gi->l3_enc[i+1] >= 0); + + if (x1 != 0u) { + if (gi->xr[i] < 0.0f) + ext++; + cbits--; + } + + if (tableindex > 15u) { + /* use ESC-words */ + if (x1 >= 15u) { + uint16_t const linbits_x1 = x1 - 15u; + assert(linbits_x1 <= h->linmax); + ext |= linbits_x1 << 1u; + xbits = linbits; + x1 = 15u; + } + + if (x2 >= 15u) { + uint16_t const linbits_x2 = x2 - 15u; + assert(linbits_x2 <= h->linmax); + ext <<= linbits; + ext |= linbits_x2; + xbits += linbits; + x2 = 15u; + } + xlen = 16; + } + + if (x2 != 0u) { + ext <<= 1; + if (gi->xr[i + 1] < 0.0f) + ext++; + cbits--; + } + + assert((x1 | x2) < 16u); + + x1 = x1 * xlen + x2; + xbits -= cbits; + cbits += h->hlen[x1]; + + assert(cbits <= MAX_LENGTH); + assert(xbits <= MAX_LENGTH); + + putbits2(gfc, h->table[x1], cbits); + putbits2(gfc, (int)ext, xbits); + bits += cbits + xbits; + } + return bits; +} + +/* + Note the discussion of huffmancodebits() on pages 28 + and 29 of the IS, as well as the definitions of the side + information on pages 26 and 27. + */ +static int +ShortHuffmancodebits(lame_internal_flags * gfc, gr_info const *gi) +{ + int bits; + int region1Start; + + region1Start = 3 * gfc->scalefac_band.s[3]; + if (region1Start > gi->big_values) + region1Start = gi->big_values; + + /* short blocks do not have a region2 */ + bits = Huffmancode(gfc, gi->table_select[0], 0, region1Start, gi); + bits += Huffmancode(gfc, gi->table_select[1], region1Start, gi->big_values, gi); + return bits; +} + +static int +LongHuffmancodebits(lame_internal_flags * gfc, gr_info const *gi) +{ + unsigned int i; + int bigvalues, bits; + int region1Start, region2Start; + + bigvalues = gi->big_values; + assert(0 <= bigvalues && bigvalues <= 576); + + assert(gi->region0_count >= -1); + assert(gi->region1_count >= -1); + i = gi->region0_count + 1; + assert((size_t) i < dimension_of(gfc->scalefac_band.l)); + region1Start = gfc->scalefac_band.l[i]; + i += gi->region1_count + 1; + assert((size_t) i < dimension_of(gfc->scalefac_band.l)); + region2Start = gfc->scalefac_band.l[i]; + + if (region1Start > bigvalues) + region1Start = bigvalues; + + if (region2Start > bigvalues) + region2Start = bigvalues; + + bits = Huffmancode(gfc, gi->table_select[0], 0, region1Start, gi); + bits += Huffmancode(gfc, gi->table_select[1], region1Start, region2Start, gi); + bits += Huffmancode(gfc, gi->table_select[2], region2Start, bigvalues, gi); + return bits; +} + +inline static int +writeMainData(lame_internal_flags * const gfc) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + III_side_info_t const *const l3_side = &gfc->l3_side; + int gr, ch, sfb, data_bits, tot_bits = 0; + + if (cfg->version == 1) { + /* MPEG 1 */ + for (gr = 0; gr < 2; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + gr_info const *const gi = &l3_side->tt[gr][ch]; + int const slen1 = slen1_tab[gi->scalefac_compress]; + int const slen2 = slen2_tab[gi->scalefac_compress]; + data_bits = 0; +#ifdef DEBUG + hogege = gfc->bs.totbit; +#endif + for (sfb = 0; sfb < gi->sfbdivide; sfb++) { + if (gi->scalefac[sfb] == -1) + continue; /* scfsi is used */ + putbits2(gfc, gi->scalefac[sfb], slen1); + data_bits += slen1; + } + for (; sfb < gi->sfbmax; sfb++) { + if (gi->scalefac[sfb] == -1) + continue; /* scfsi is used */ + putbits2(gfc, gi->scalefac[sfb], slen2); + data_bits += slen2; + } + assert(data_bits == gi->part2_length); + + if (gi->block_type == SHORT_TYPE) { + data_bits += ShortHuffmancodebits(gfc, gi); + } + else { + data_bits += LongHuffmancodebits(gfc, gi); + } + data_bits += huffman_coder_count1(gfc, gi); +#ifdef DEBUG + DEBUGF(gfc, "<%ld> ", gfc->bs.totbit - hogege); +#endif + /* does bitcount in quantize.c agree with actual bit count? */ + assert(data_bits == gi->part2_3_length + gi->part2_length); + tot_bits += data_bits; + } /* for ch */ + } /* for gr */ + } + else { + /* MPEG 2 */ + gr = 0; + for (ch = 0; ch < cfg->channels_out; ch++) { + gr_info const *const gi = &l3_side->tt[gr][ch]; + int i, sfb_partition, scale_bits = 0; + assert(gi->sfb_partition_table); + data_bits = 0; +#ifdef DEBUG + hogege = gfc->bs.totbit; +#endif + sfb = 0; + sfb_partition = 0; + + if (gi->block_type == SHORT_TYPE) { + for (; sfb_partition < 4; sfb_partition++) { + int const sfbs = gi->sfb_partition_table[sfb_partition] / 3; + int const slen = gi->slen[sfb_partition]; + for (i = 0; i < sfbs; i++, sfb++) { + putbits2(gfc, Max(gi->scalefac[sfb * 3 + 0], 0), slen); + putbits2(gfc, Max(gi->scalefac[sfb * 3 + 1], 0), slen); + putbits2(gfc, Max(gi->scalefac[sfb * 3 + 2], 0), slen); + scale_bits += 3 * slen; + } + } + data_bits += ShortHuffmancodebits(gfc, gi); + } + else { + for (; sfb_partition < 4; sfb_partition++) { + int const sfbs = gi->sfb_partition_table[sfb_partition]; + int const slen = gi->slen[sfb_partition]; + for (i = 0; i < sfbs; i++, sfb++) { + putbits2(gfc, Max(gi->scalefac[sfb], 0), slen); + scale_bits += slen; + } + } + data_bits += LongHuffmancodebits(gfc, gi); + } + data_bits += huffman_coder_count1(gfc, gi); +#ifdef DEBUG + DEBUGF(gfc, "<%ld> ", gfc->bs.totbit - hogege); +#endif + /* does bitcount in quantize.c agree with actual bit count? */ + assert(data_bits == gi->part2_3_length); + assert(scale_bits == gi->part2_length); + tot_bits += scale_bits + data_bits; + } /* for ch */ + } /* for gf */ + return tot_bits; +} /* main_data */ + + + +/* compute the number of bits required to flush all mp3 frames + currently in the buffer. This should be the same as the + reservoir size. Only call this routine between frames - i.e. + only after all headers and data have been added to the buffer + by format_bitstream(). + + Also compute total_bits_output = + size of mp3 buffer (including frame headers which may not + have yet been send to the mp3 buffer) + + number of bits needed to flush all mp3 frames. + + total_bytes_output is the size of the mp3 output buffer if + lame_encode_flush_nogap() was called right now. + + */ +int +compute_flushbits(const lame_internal_flags * gfc, int *total_bytes_output) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t const *const esv = &gfc->sv_enc; + int flushbits, remaining_headers; + int bitsPerFrame; + int last_ptr, first_ptr; + first_ptr = esv->w_ptr; /* first header to add to bitstream */ + last_ptr = esv->h_ptr - 1; /* last header to add to bitstream */ + if (last_ptr == -1) + last_ptr = MAX_HEADER_BUF - 1; + + /* add this many bits to bitstream so we can flush all headers */ + flushbits = esv->header[last_ptr].write_timing - gfc->bs.totbit; + *total_bytes_output = flushbits; + + if (flushbits >= 0) { + /* if flushbits >= 0, some headers have not yet been written */ + /* reduce flushbits by the size of the headers */ + remaining_headers = 1 + last_ptr - first_ptr; + if (last_ptr < first_ptr) + remaining_headers = 1 + last_ptr - first_ptr + MAX_HEADER_BUF; + flushbits -= remaining_headers * 8 * cfg->sideinfo_len; + } + + + /* finally, add some bits so that the last frame is complete + * these bits are not necessary to decode the last frame, but + * some decoders will ignore last frame if these bits are missing + */ + bitsPerFrame = getframebits(gfc); + flushbits += bitsPerFrame; + *total_bytes_output += bitsPerFrame; + /* round up: */ + if (*total_bytes_output % 8) + *total_bytes_output = 1 + (*total_bytes_output / 8); + else + *total_bytes_output = (*total_bytes_output / 8); + *total_bytes_output += gfc->bs.buf_byte_idx + 1; + + + if (flushbits < 0) { +#if 0 + /* if flushbits < 0, this would mean that the buffer looks like: + * (data...) last_header (data...) (extra data that should not be here...) + */ + DEBUGF(gfc, "last header write_timing = %i \n", esv->header[last_ptr].write_timing); + DEBUGF(gfc, "first header write_timing = %i \n", esv->header[first_ptr].write_timing); + DEBUGF(gfc, "bs.totbit: %i \n", gfc->bs.totbit); + DEBUGF(gfc, "first_ptr, last_ptr %i %i \n", first_ptr, last_ptr); + DEBUGF(gfc, "remaining_headers = %i \n", remaining_headers); + DEBUGF(gfc, "bitsperframe: %i \n", bitsPerFrame); + DEBUGF(gfc, "sidelen: %i \n", cfg->sideinfo_len); +#endif + ERRORF(gfc, "strange error flushing buffer ... \n"); + } + return flushbits; +} + + +void +flush_bitstream(lame_internal_flags * gfc) +{ + EncStateVar_t *const esv = &gfc->sv_enc; + III_side_info_t *l3_side; + int nbytes; + int flushbits; + int last_ptr = esv->h_ptr - 1; /* last header to add to bitstream */ + if (last_ptr == -1) + last_ptr = MAX_HEADER_BUF - 1; + l3_side = &gfc->l3_side; + + + if ((flushbits = compute_flushbits(gfc, &nbytes)) < 0) + return; + drain_into_ancillary(gfc, flushbits); + + /* check that the 100% of the last frame has been written to bitstream */ + assert(esv->header[last_ptr].write_timing + getframebits(gfc) + == gfc->bs.totbit); + + /* we have padded out all frames with ancillary data, which is the + same as filling the bitreservoir with ancillary data, so : */ + esv->ResvSize = 0; + l3_side->main_data_begin = 0; +} + + + + +void +add_dummy_byte(lame_internal_flags * gfc, unsigned char val, unsigned int n) +{ + EncStateVar_t *const esv = &gfc->sv_enc; + int i; + + while (n-- > 0u) { + putbits_noheaders(gfc, val, 8); + + for (i = 0; i < MAX_HEADER_BUF; ++i) + esv->header[i].write_timing += 8; + } +} + + +/* + format_bitstream() + + This is called after a frame of audio has been quantized and coded. + It will write the encoded audio to the bitstream. Note that + from a layer3 encoder's perspective the bit stream is primarily + a series of main_data() blocks, with header and side information + inserted at the proper locations to maintain framing. (See Figure A.7 + in the IS). + */ +int +format_bitstream(lame_internal_flags * gfc) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t *const esv = &gfc->sv_enc; + int bits, nbytes; + III_side_info_t *l3_side; + int bitsPerFrame; + l3_side = &gfc->l3_side; + + bitsPerFrame = getframebits(gfc); + drain_into_ancillary(gfc, l3_side->resvDrain_pre); + + encodeSideInfo2(gfc, bitsPerFrame); + bits = 8 * cfg->sideinfo_len; + bits += writeMainData(gfc); + drain_into_ancillary(gfc, l3_side->resvDrain_post); + bits += l3_side->resvDrain_post; + + l3_side->main_data_begin += (bitsPerFrame - bits) / 8; + + /* compare number of bits needed to clear all buffered mp3 frames + * with what we think the resvsize is: */ + if (compute_flushbits(gfc, &nbytes) != esv->ResvSize) { + ERRORF(gfc, "Internal buffer inconsistency. flushbits <> ResvSize"); + } + + + /* compare main_data_begin for the next frame with what we + * think the resvsize is: */ + if ((l3_side->main_data_begin * 8) != esv->ResvSize) { + ERRORF(gfc, "bit reservoir error: \n" + "l3_side->main_data_begin: %i \n" + "Resvoir size: %i \n" + "resv drain (post) %i \n" + "resv drain (pre) %i \n" + "header and sideinfo: %i \n" + "data bits: %i \n" + "total bits: %i (remainder: %i) \n" + "bitsperframe: %i \n", + 8 * l3_side->main_data_begin, + esv->ResvSize, + l3_side->resvDrain_post, + l3_side->resvDrain_pre, + 8 * cfg->sideinfo_len, + bits - l3_side->resvDrain_post - 8 * cfg->sideinfo_len, + bits, bits % 8, bitsPerFrame); + + ERRORF(gfc, "This is a fatal error. It has several possible causes:"); + ERRORF(gfc, "90%% LAME compiled with buggy version of gcc using advanced optimizations"); + ERRORF(gfc, " 9%% Your system is overclocked"); + ERRORF(gfc, " 1%% bug in LAME encoding library"); + + esv->ResvSize = l3_side->main_data_begin * 8; + }; + assert(gfc->bs.totbit % 8 == 0); + + if (gfc->bs.totbit > 1000000000) { + /* to avoid totbit overflow, (at 8h encoding at 128kbs) lets reset bit counter */ + int i; + for (i = 0; i < MAX_HEADER_BUF; ++i) + esv->header[i].write_timing -= gfc->bs.totbit; + gfc->bs.totbit = 0; + } + + + return 0; +} + + +static int +do_gain_analysis(lame_internal_flags * gfc, unsigned char* buffer, int minimum) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + RpgStateVar_t const *const rsv = &gfc->sv_rpg; + RpgResult_t *const rov = &gfc->ov_rpg; +#ifdef DECODE_ON_THE_FLY + if (cfg->decode_on_the_fly) { /* decode the frame */ + sample_t pcm_buf[2][1152]; + int mp3_in = minimum; + int samples_out = -1; + + /* re-synthesis to pcm. Repeat until we get a samples_out=0 */ + while (samples_out != 0) { + + samples_out = hip_decode1_unclipped(gfc->hip, buffer, mp3_in, pcm_buf[0], pcm_buf[1]); + /* samples_out = 0: need more data to decode + * samples_out = -1: error. Lets assume 0 pcm output + * samples_out = number of samples output */ + + /* set the lenght of the mp3 input buffer to zero, so that in the + * next iteration of the loop we will be querying mpglib about + * buffered data */ + mp3_in = 0; + + if (samples_out == -1) { + /* error decoding. Not fatal, but might screw up + * the ReplayGain tag. What should we do? Ignore for now */ + samples_out = 0; + } + if (samples_out > 0) { + /* process the PCM data */ + + /* this should not be possible, and indicates we have + * overflown the pcm_buf buffer */ + assert(samples_out <= 1152); + + if (cfg->findPeakSample) { + int i; + /* FIXME: is this correct? maybe Max(fabs(pcm),PeakSample) */ + for (i = 0; i < samples_out; i++) { + if (pcm_buf[0][i] > rov->PeakSample) + rov->PeakSample = pcm_buf[0][i]; + else if (-pcm_buf[0][i] > rov->PeakSample) + rov->PeakSample = -pcm_buf[0][i]; + } + if (cfg->channels_out > 1) + for (i = 0; i < samples_out; i++) { + if (pcm_buf[1][i] > rov->PeakSample) + rov->PeakSample = pcm_buf[1][i]; + else if (-pcm_buf[1][i] > rov->PeakSample) + rov->PeakSample = -pcm_buf[1][i]; + } + } + + if (cfg->findReplayGain) + if (AnalyzeSamples + (rsv->rgdata, pcm_buf[0], pcm_buf[1], samples_out, + cfg->channels_out) == GAIN_ANALYSIS_ERROR) + return -6; + + } /* if (samples_out>0) */ + } /* while (samples_out!=0) */ + } /* if (gfc->decode_on_the_fly) */ +#endif + return minimum; +} + +static int +do_copy_buffer(lame_internal_flags * gfc, unsigned char *buffer, int size) +{ + Bit_stream_struc *const bs = &gfc->bs; + int const minimum = bs->buf_byte_idx + 1; + if (minimum <= 0) + return 0; + if (size != 0 && minimum > size) + return -1; /* buffer is too small */ + memcpy(buffer, bs->buf, minimum); + bs->buf_byte_idx = -1; + bs->buf_bit_idx = 0; + return minimum; +} + +/* copy data out of the internal MP3 bit buffer into a user supplied + unsigned char buffer. + + mp3data=0 indicates data in buffer is an id3tags and VBR tags + mp3data=1 data is real mp3 frame data. + + +*/ +int +copy_buffer(lame_internal_flags * gfc, unsigned char *buffer, int size, int mp3data) +{ + int const minimum = do_copy_buffer(gfc, buffer, size); + if (minimum > 0 && mp3data) { + UpdateMusicCRC(&gfc->nMusicCRC, buffer, minimum); + + /** sum number of bytes belonging to the mp3 stream + * this info will be written into the Xing/LAME header for seeking + */ + gfc->VBR_seek_table.nBytesWritten += minimum; + + return do_gain_analysis(gfc, buffer, minimum); + } /* if (mp3data) */ + return minimum; +} + + +void +init_bit_stream_w(lame_internal_flags * gfc) +{ + EncStateVar_t *const esv = &gfc->sv_enc; + + esv->h_ptr = esv->w_ptr = 0; + esv->header[esv->h_ptr].write_timing = 0; + + gfc->bs.buf = (unsigned char *) malloc(BUFFER_SIZE); + gfc->bs.buf_size = BUFFER_SIZE; + gfc->bs.buf_byte_idx = -1; + gfc->bs.buf_bit_idx = 0; + gfc->bs.totbit = 0; +} + +/* end of bitstream.c */ diff --git a/node_modules/lame/deps/lame/libmp3lame/bitstream.h b/node_modules/lame/deps/lame/libmp3lame/bitstream.h new file mode 100644 index 0000000..3ae48d0 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/bitstream.h @@ -0,0 +1,40 @@ +/* + * MP3 bitstream Output interface for LAME + * + * Copyright (c) 1999 Takehiro TOMINAGA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_BITSTREAM_H +#define LAME_BITSTREAM_H + +int getframebits(const lame_internal_flags * gfc); + +int format_bitstream(lame_internal_flags * gfc); + +void flush_bitstream(lame_internal_flags * gfc); +void add_dummy_byte(lame_internal_flags * gfc, unsigned char val, unsigned int n); + +int copy_buffer(lame_internal_flags * gfc, unsigned char *buffer, int buffer_size, + int update_crc); +void init_bit_stream_w(lame_internal_flags * gfc); +void CRC_writeheader(lame_internal_flags const *gfc, char *buffer); +int compute_flushbits(const lame_internal_flags * gfp, int *nbytes); + +int get_max_frame_buffer_size_by_constraint(SessionConfig_t const * cfg, int constraint); + +#endif diff --git a/node_modules/lame/deps/lame/libmp3lame/depcomp b/node_modules/lame/deps/lame/libmp3lame/depcomp new file mode 100755 index 0000000..df8eea7 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/node_modules/lame/deps/lame/libmp3lame/encoder.c b/node_modules/lame/deps/lame/libmp3lame/encoder.c new file mode 100644 index 0000000..7d5b0b6 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/encoder.c @@ -0,0 +1,557 @@ +/* + * LAME MP3 encoding engine + * + * Copyright (c) 1999 Mark Taylor + * Copyright (c) 2000-2002 Takehiro Tominaga + * Copyright (c) 2000-2011 Robert Hegemann + * Copyright (c) 2001 Gabriel Bouvigne + * Copyright (c) 2001 John Dahlstrom + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: encoder.c,v 1.111 2011/05/07 16:05:17 rbrito Exp $ */ + +#ifdef HAVE_CONFIG_H +#include +#endif + + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "lame_global_flags.h" +#include "newmdct.h" +#include "psymodel.h" +#include "lame-analysis.h" +#include "bitstream.h" +#include "VbrTag.h" +#include "quantize_pvt.h" + + + +/* + * auto-adjust of ATH, useful for low volume + * Gabriel Bouvigne 3 feb 2001 + * + * modifies some values in + * gfp->internal_flags->ATH + * (gfc->ATH) + */ +static void +adjust_ATH(lame_internal_flags const *const gfc) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + FLOAT gr2_max, max_pow; + + if (gfc->ATH->use_adjust == 0) { + gfc->ATH->adjust_factor = 1.0; /* no adjustment */ + return; + } + + /* jd - 2001 mar 12, 27, jun 30 */ + /* loudness based on equal loudness curve; */ + /* use granule with maximum combined loudness */ + max_pow = gfc->ov_psy.loudness_sq[0][0]; + gr2_max = gfc->ov_psy.loudness_sq[1][0]; + if (cfg->channels_out == 2) { + max_pow += gfc->ov_psy.loudness_sq[0][1]; + gr2_max += gfc->ov_psy.loudness_sq[1][1]; + } + else { + max_pow += max_pow; + gr2_max += gr2_max; + } + if (cfg->mode_gr == 2) { + max_pow = Max(max_pow, gr2_max); + } + max_pow *= 0.5; /* max_pow approaches 1.0 for full band noise */ + + /* jd - 2001 mar 31, jun 30 */ + /* user tuning of ATH adjustment region */ + max_pow *= gfc->ATH->aa_sensitivity_p; + + /* adjust ATH depending on range of maximum value + */ + + /* jd - 2001 feb27, mar12,20, jun30, jul22 */ + /* continuous curves based on approximation */ + /* to GB's original values. */ + /* For an increase in approximate loudness, */ + /* set ATH adjust to adjust_limit immediately */ + /* after a delay of one frame. */ + /* For a loudness decrease, reduce ATH adjust */ + /* towards adjust_limit gradually. */ + /* max_pow is a loudness squared or a power. */ + if (max_pow > 0.03125) { /* ((1 - 0.000625)/ 31.98) from curve below */ + if (gfc->ATH->adjust_factor >= 1.0) { + gfc->ATH->adjust_factor = 1.0; + } + else { + /* preceding frame has lower ATH adjust; */ + /* ascend only to the preceding adjust_limit */ + /* in case there is leading low volume */ + if (gfc->ATH->adjust_factor < gfc->ATH->adjust_limit) { + gfc->ATH->adjust_factor = gfc->ATH->adjust_limit; + } + } + gfc->ATH->adjust_limit = 1.0; + } + else { /* adjustment curve */ + /* about 32 dB maximum adjust (0.000625) */ + FLOAT const adj_lim_new = 31.98 * max_pow + 0.000625; + if (gfc->ATH->adjust_factor >= adj_lim_new) { /* descend gradually */ + gfc->ATH->adjust_factor *= adj_lim_new * 0.075 + 0.925; + if (gfc->ATH->adjust_factor < adj_lim_new) { /* stop descent */ + gfc->ATH->adjust_factor = adj_lim_new; + } + } + else { /* ascend */ + if (gfc->ATH->adjust_limit >= adj_lim_new) { + gfc->ATH->adjust_factor = adj_lim_new; + } + else { /* preceding frame has lower ATH adjust; */ + /* ascend only to the preceding adjust_limit */ + if (gfc->ATH->adjust_factor < gfc->ATH->adjust_limit) { + gfc->ATH->adjust_factor = gfc->ATH->adjust_limit; + } + } + } + gfc->ATH->adjust_limit = adj_lim_new; + } +} + +/*********************************************************************** + * + * some simple statistics + * + * bitrate index 0: free bitrate -> not allowed in VBR mode + * : bitrates, kbps depending on MPEG version + * bitrate index 15: forbidden + * + * mode_ext: + * 0: LR + * 1: LR-i + * 2: MS + * 3: MS-i + * + ***********************************************************************/ + +static void +updateStats(lame_internal_flags * const gfc) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t *eov = &gfc->ov_enc; + int gr, ch; + assert(0 <= eov->bitrate_index && eov->bitrate_index < 16); + assert(0 <= eov->mode_ext && eov->mode_ext < 4); + + /* count bitrate indices */ + eov->bitrate_channelmode_hist[eov->bitrate_index][4]++; + eov->bitrate_channelmode_hist[15][4]++; + + /* count 'em for every mode extension in case of 2 channel encoding */ + if (cfg->channels_out == 2) { + eov->bitrate_channelmode_hist[eov->bitrate_index][eov->mode_ext]++; + eov->bitrate_channelmode_hist[15][eov->mode_ext]++; + } + for (gr = 0; gr < cfg->mode_gr; ++gr) { + for (ch = 0; ch < cfg->channels_out; ++ch) { + int bt = gfc->l3_side.tt[gr][ch].block_type; + if (gfc->l3_side.tt[gr][ch].mixed_block_flag) + bt = 4; + eov->bitrate_blocktype_hist[eov->bitrate_index][bt]++; + eov->bitrate_blocktype_hist[eov->bitrate_index][5]++; + eov->bitrate_blocktype_hist[15][bt]++; + eov->bitrate_blocktype_hist[15][5]++; + } + } +} + + + + +static void +lame_encode_frame_init(lame_internal_flags * gfc, const sample_t *const inbuf[2]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + + int ch, gr; + + if (gfc->lame_encode_frame_init == 0) { + sample_t primebuff0[286 + 1152 + 576]; + sample_t primebuff1[286 + 1152 + 576]; + int const framesize = 576 * cfg->mode_gr; + /* prime the MDCT/polyphase filterbank with a short block */ + int i, j; + gfc->lame_encode_frame_init = 1; + memset(primebuff0, 0, sizeof(primebuff0)); + memset(primebuff1, 0, sizeof(primebuff1)); + for (i = 0, j = 0; i < 286 + 576 * (1 + cfg->mode_gr); ++i) { + if (i < framesize) { + primebuff0[i] = 0; + if (cfg->channels_out == 2) + primebuff1[i] = 0; + } + else { + primebuff0[i] = inbuf[0][j]; + if (cfg->channels_out == 2) + primebuff1[i] = inbuf[1][j]; + ++j; + } + } + /* polyphase filtering / mdct */ + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + gfc->l3_side.tt[gr][ch].block_type = SHORT_TYPE; + } + } + mdct_sub48(gfc, primebuff0, primebuff1); + + /* check FFT will not use a negative starting offset */ +#if 576 < FFTOFFSET +# error FFTOFFSET greater than 576: FFT uses a negative offset +#endif + /* check if we have enough data for FFT */ + assert(gfc->sv_enc.mf_size >= (BLKSIZE + framesize - FFTOFFSET)); + /* check if we have enough data for polyphase filterbank */ + assert(gfc->sv_enc.mf_size >= (512 + framesize - 32)); + } + +} + + + + + + + +/************************************************************************ +* +* encodeframe() Layer 3 +* +* encode a single frame +* +************************************************************************ +lame_encode_frame() + + + gr 0 gr 1 +inbuf: |--------------|--------------|--------------| + + +Polyphase (18 windows, each shifted 32) +gr 0: +window1 <----512----> +window18 <----512----> + +gr 1: +window1 <----512----> +window18 <----512----> + + + +MDCT output: |--------------|--------------|--------------| + +FFT's <---------1024----------> + <---------1024--------> + + + + inbuf = buffer of PCM data size=MP3 framesize + encoder acts on inbuf[ch][0], but output is delayed by MDCTDELAY + so the MDCT coefficints are from inbuf[ch][-MDCTDELAY] + + psy-model FFT has a 1 granule delay, so we feed it data for the + next granule. + FFT is centered over granule: 224+576+224 + So FFT starts at: 576-224-MDCTDELAY + + MPEG2: FFT ends at: BLKSIZE+576-224-MDCTDELAY (1328) + MPEG1: FFT ends at: BLKSIZE+2*576-224-MDCTDELAY (1904) + + MPEG2: polyphase first window: [0..511] + 18th window: [544..1055] (1056) + MPEG1: 36th window: [1120..1631] (1632) + data needed: 512+framesize-32 + + A close look newmdct.c shows that the polyphase filterbank + only uses data from [0..510] for each window. Perhaps because the window + used by the filterbank is zero for the last point, so Takehiro's + code doesn't bother to compute with it. + + FFT starts at 576-224-MDCTDELAY (304) = 576-FFTOFFSET + +*/ + +typedef FLOAT chgrdata[2][2]; + + +int +lame_encode_mp3_frame( /* Output */ + lame_internal_flags * gfc, /* Context */ + sample_t const *inbuf_l, /* Input */ + sample_t const *inbuf_r, /* Input */ + unsigned char *mp3buf, /* Output */ + int mp3buf_size) +{ /* Output */ + SessionConfig_t const *const cfg = &gfc->cfg; + int mp3count; + III_psy_ratio masking_LR[2][2]; /*LR masking & energy */ + III_psy_ratio masking_MS[2][2]; /*MS masking & energy */ + const III_psy_ratio (*masking)[2]; /*pointer to selected maskings */ + const sample_t *inbuf[2]; + + FLOAT tot_ener[2][4]; + FLOAT ms_ener_ratio[2] = { .5, .5 }; + FLOAT pe[2][2] = { {0., 0.}, {0., 0.} }, pe_MS[2][2] = { { + 0., 0.}, { + 0., 0.}}; + FLOAT (*pe_use)[2]; + + int ch, gr; + + inbuf[0] = inbuf_l; + inbuf[1] = inbuf_r; + + if (gfc->lame_encode_frame_init == 0) { + /*first run? */ + lame_encode_frame_init(gfc, inbuf); + + } + + + /********************** padding *****************************/ + /* padding method as described in + * "MPEG-Layer3 / Bitstream Syntax and Decoding" + * by Martin Sieler, Ralph Sperschneider + * + * note: there is no padding for the very first frame + * + * Robert Hegemann 2000-06-22 + */ + gfc->ov_enc.padding = FALSE; + if ((gfc->sv_enc.slot_lag -= gfc->sv_enc.frac_SpF) < 0) { + gfc->sv_enc.slot_lag += cfg->samplerate_out; + gfc->ov_enc.padding = TRUE; + } + + + + /**************************************** + * Stage 1: psychoacoustic model * + ****************************************/ + + { + /* psychoacoustic model + * psy model has a 1 granule (576) delay that we must compensate for + * (mt 6/99). + */ + int ret; + const sample_t *bufp[2] = {0, 0}; /* address of beginning of left & right granule */ + int blocktype[2]; + + for (gr = 0; gr < cfg->mode_gr; gr++) { + + for (ch = 0; ch < cfg->channels_out; ch++) { + bufp[ch] = &inbuf[ch][576 + gr * 576 - FFTOFFSET]; + } + ret = L3psycho_anal_vbr(gfc, bufp, gr, + masking_LR, masking_MS, + pe[gr], pe_MS[gr], tot_ener[gr], blocktype); + if (ret != 0) + return -4; + + if (cfg->mode == JOINT_STEREO) { + ms_ener_ratio[gr] = tot_ener[gr][2] + tot_ener[gr][3]; + if (ms_ener_ratio[gr] > 0) + ms_ener_ratio[gr] = tot_ener[gr][3] / ms_ener_ratio[gr]; + } + + /* block type flags */ + for (ch = 0; ch < cfg->channels_out; ch++) { + gr_info *const cod_info = &gfc->l3_side.tt[gr][ch]; + cod_info->block_type = blocktype[ch]; + cod_info->mixed_block_flag = 0; + } + } + } + + + /* auto-adjust of ATH, useful for low volume */ + adjust_ATH(gfc); + + + /**************************************** + * Stage 2: MDCT * + ****************************************/ + + /* polyphase filtering / mdct */ + mdct_sub48(gfc, inbuf[0], inbuf[1]); + + + /**************************************** + * Stage 3: MS/LR decision * + ****************************************/ + + /* Here will be selected MS or LR coding of the 2 stereo channels */ + gfc->ov_enc.mode_ext = MPG_MD_LR_LR; + + if (cfg->force_ms) { + gfc->ov_enc.mode_ext = MPG_MD_MS_LR; + } + else if (cfg->mode == JOINT_STEREO) { + /* ms_ratio = is scaled, for historical reasons, to look like + a ratio of side_channel / total. + 0 = signal is 100% mono + .5 = L & R uncorrelated + */ + + /* [0] and [1] are the results for the two granules in MPEG-1, + * in MPEG-2 it's only a faked averaging of the same value + * _prev is the value of the last granule of the previous frame + * _next is the value of the first granule of the next frame + */ + + FLOAT sum_pe_MS = 0; + FLOAT sum_pe_LR = 0; + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + sum_pe_MS += pe_MS[gr][ch]; + sum_pe_LR += pe[gr][ch]; + } + } + + /* based on PE: M/S coding would not use much more bits than L/R */ + if (sum_pe_MS <= 1.00 * sum_pe_LR) { + + gr_info const *const gi0 = &gfc->l3_side.tt[0][0]; + gr_info const *const gi1 = &gfc->l3_side.tt[cfg->mode_gr - 1][0]; + + if (gi0[0].block_type == gi0[1].block_type && gi1[0].block_type == gi1[1].block_type) { + + gfc->ov_enc.mode_ext = MPG_MD_MS_LR; + } + } + } + + /* bit and noise allocation */ + if (gfc->ov_enc.mode_ext == MPG_MD_MS_LR) { + masking = (const III_psy_ratio (*)[2])masking_MS; /* use MS masking */ + pe_use = pe_MS; + } + else { + masking = (const III_psy_ratio (*)[2])masking_LR; /* use LR masking */ + pe_use = pe; + } + + + /* copy data for MP3 frame analyzer */ + if (cfg->analysis && gfc->pinfo != NULL) { + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + gfc->pinfo->ms_ratio[gr] = 0; + gfc->pinfo->ms_ener_ratio[gr] = ms_ener_ratio[gr]; + gfc->pinfo->blocktype[gr][ch] = gfc->l3_side.tt[gr][ch].block_type; + gfc->pinfo->pe[gr][ch] = pe_use[gr][ch]; + memcpy(gfc->pinfo->xr[gr][ch], &gfc->l3_side.tt[gr][ch].xr[0], sizeof(FLOAT) * 576); + /* in psymodel, LR and MS data was stored in pinfo. + switch to MS data: */ + if (gfc->ov_enc.mode_ext == MPG_MD_MS_LR) { + gfc->pinfo->ers[gr][ch] = gfc->pinfo->ers[gr][ch + 2]; + memcpy(gfc->pinfo->energy[gr][ch], gfc->pinfo->energy[gr][ch + 2], + sizeof(gfc->pinfo->energy[gr][ch])); + } + } + } + } + + + /**************************************** + * Stage 4: quantization loop * + ****************************************/ + + if (cfg->vbr == vbr_off || cfg->vbr == vbr_abr) { + static FLOAT const fircoef[9] = { + -0.0207887 * 5, -0.0378413 * 5, -0.0432472 * 5, -0.031183 * 5, + 7.79609e-18 * 5, 0.0467745 * 5, 0.10091 * 5, 0.151365 * 5, + 0.187098 * 5 + }; + + int i; + FLOAT f; + + for (i = 0; i < 18; i++) + gfc->sv_enc.pefirbuf[i] = gfc->sv_enc.pefirbuf[i + 1]; + + f = 0.0; + for (gr = 0; gr < cfg->mode_gr; gr++) + for (ch = 0; ch < cfg->channels_out; ch++) + f += pe_use[gr][ch]; + gfc->sv_enc.pefirbuf[18] = f; + + f = gfc->sv_enc.pefirbuf[9]; + for (i = 0; i < 9; i++) + f += (gfc->sv_enc.pefirbuf[i] + gfc->sv_enc.pefirbuf[18 - i]) * fircoef[i]; + + f = (670 * 5 * cfg->mode_gr * cfg->channels_out) / f; + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + pe_use[gr][ch] *= f; + } + } + } + gfc->iteration_loop(gfc, (const FLOAT (*)[2])pe_use, ms_ener_ratio, masking); + + + /**************************************** + * Stage 5: bitstream formatting * + ****************************************/ + + + /* write the frame to the bitstream */ + (void) format_bitstream(gfc); + + /* copy mp3 bit buffer into array */ + mp3count = copy_buffer(gfc, mp3buf, mp3buf_size, 1); + + + if (cfg->write_lame_tag) { + AddVbrFrame(gfc); + } + + if (cfg->analysis && gfc->pinfo != NULL) { + int framesize = 576 * cfg->mode_gr; + for (ch = 0; ch < cfg->channels_out; ch++) { + int j; + for (j = 0; j < FFTOFFSET; j++) + gfc->pinfo->pcmdata[ch][j] = gfc->pinfo->pcmdata[ch][j + framesize]; + for (j = FFTOFFSET; j < 1600; j++) { + gfc->pinfo->pcmdata[ch][j] = inbuf[ch][j - FFTOFFSET]; + } + } + gfc->sv_qnt.masking_lower = 1.0; + + set_frame_pinfo(gfc, masking); + } + + ++gfc->ov_enc.frame_number; + + updateStats(gfc); + + return mp3count; +} diff --git a/node_modules/lame/deps/lame/libmp3lame/encoder.h b/node_modules/lame/deps/lame/libmp3lame/encoder.h new file mode 100644 index 0000000..b06a7c6 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/encoder.h @@ -0,0 +1,156 @@ +/* + * encoder.h include file + * + * Copyright (c) 2000 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#ifndef LAME_ENCODER_H +#define LAME_ENCODER_H + +/*********************************************************************** +* +* encoder and decoder delays +* +***********************************************************************/ + +/* + * layer III enc->dec delay: 1056 (1057?) (observed) + * layer II enc->dec delay: 480 (481?) (observed) + * + * polyphase 256-16 (dec or enc) = 240 + * mdct 256+32 (9*32) (dec or enc) = 288 + * total: 512+16 + * + * My guess is that delay of polyphase filterbank is actualy 240.5 + * (there are technical reasons for this, see postings in mp3encoder). + * So total Encode+Decode delay = ENCDELAY + 528 + 1 + */ + +/* + * ENCDELAY The encoder delay. + * + * Minimum allowed is MDCTDELAY (see below) + * + * The first 96 samples will be attenuated, so using a value less than 96 + * will result in corrupt data for the first 96-ENCDELAY samples. + * + * suggested: 576 + * set to 1160 to sync with FhG. + */ + +#define ENCDELAY 576 + + + +/* + * make sure there is at least one complete frame after the + * last frame containing real data + * + * Using a value of 288 would be sufficient for a + * a very sophisticated decoder that can decode granule-by-granule instead + * of frame by frame. But lets not assume this, and assume the decoder + * will not decode frame N unless it also has data for frame N+1 + * + */ +/*#define POSTDELAY 288*/ +#define POSTDELAY 1152 + + + +/* + * delay of the MDCT used in mdct.c + * original ISO routines had a delay of 528! + * Takehiro's routines: + */ + +#define MDCTDELAY 48 +#define FFTOFFSET (224+MDCTDELAY) + +/* + * Most decoders, including the one we use, have a delay of 528 samples. + */ + +#define DECDELAY 528 + + +/* number of subbands */ +#define SBLIMIT 32 + +/* parition bands bands */ +#define CBANDS 64 + +/* number of critical bands/scale factor bands where masking is computed*/ +#define SBPSY_l 21 +#define SBPSY_s 12 + +/* total number of scalefactor bands encoded */ +#define SBMAX_l 22 +#define SBMAX_s 13 +#define PSFB21 6 +#define PSFB12 6 + + + +/* FFT sizes */ +#define BLKSIZE 1024 +#define HBLKSIZE (BLKSIZE/2 + 1) +#define BLKSIZE_s 256 +#define HBLKSIZE_s (BLKSIZE_s/2 + 1) + + +/* #define switch_pe 1800 */ +#define NORM_TYPE 0 +#define START_TYPE 1 +#define SHORT_TYPE 2 +#define STOP_TYPE 3 + +/* + * Mode Extention: + * When we are in stereo mode, there are 4 possible methods to store these + * two channels. The stereo modes -m? are using a subset of them. + * + * -ms: MPG_MD_LR_LR + * -mj: MPG_MD_LR_LR and MPG_MD_MS_LR + * -mf: MPG_MD_MS_LR + * -mi: all + */ +#if 0 +#define MPG_MD_LR_LR 0 +#define MPG_MD_LR_I 1 +#define MPG_MD_MS_LR 2 +#define MPG_MD_MS_I 3 +#endif +enum MPEGChannelMode +{ MPG_MD_LR_LR = 0 +, MPG_MD_LR_I = 1 +, MPG_MD_MS_LR = 2 +, MPG_MD_MS_I = 3 +}; + +#ifndef lame_internal_flags_defined +#define lame_internal_flags_defined +struct lame_internal_flags; +typedef struct lame_internal_flags lame_internal_flags; +#endif + +int lame_encode_mp3_frame(lame_internal_flags * gfc, + sample_t const *inbuf_l, + sample_t const *inbuf_r, unsigned char *mp3buf, int mp3buf_size); + +#endif /* LAME_ENCODER_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/fft.c b/node_modules/lame/deps/lame/libmp3lame/fft.c new file mode 100644 index 0000000..e8c59d9 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/fft.c @@ -0,0 +1,329 @@ +/* +** FFT and FHT routines +** Copyright 1988, 1993; Ron Mayer +** Copyright (c) 1999-2000 Takehiro Tominaga +** +** fht(fz,n); +** Does a hartley transform of "n" points in the array "fz". +** +** NOTE: This routine uses at least 2 patented algorithms, and may be +** under the restrictions of a bunch of different organizations. +** Although I wrote it completely myself; it is kind of a derivative +** of a routine I once authored and released under the GPL, so it +** may fall under the free software foundation's restrictions; +** it was worked on as a Stanford Univ project, so they claim +** some rights to it; it was further optimized at work here, so +** I think this company claims parts of it. The patents are +** held by R. Bracewell (the FHT algorithm) and O. Buneman (the +** trig generator), both at Stanford Univ. +** If it were up to me, I'd say go do whatever you want with it; +** but it would be polite to give credit to the following people +** if you use this anywhere: +** Euler - probable inventor of the fourier transform. +** Gauss - probable inventor of the FFT. +** Hartley - probable inventor of the hartley transform. +** Buneman - for a really cool trig generator +** Mayer(me) - for authoring this particular version and +** including all the optimizations in one package. +** Thanks, +** Ron Mayer; mayer@acuson.com +** and added some optimization by +** Mather - idea of using lookup table +** Takehiro - some dirty hack for speed up +*/ + +/* $Id: fft.c,v 1.38 2009/04/20 21:48:00 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "fft.h" + +#include "vector/lame_intrin.h" + + + +#define TRI_SIZE (5-1) /* 1024 = 4**5 */ + +/* fft.c */ +static FLOAT window[BLKSIZE], window_s[BLKSIZE_s / 2]; + +static const FLOAT costab[TRI_SIZE * 2] = { + 9.238795325112867e-01, 3.826834323650898e-01, + 9.951847266721969e-01, 9.801714032956060e-02, + 9.996988186962042e-01, 2.454122852291229e-02, + 9.999811752826011e-01, 6.135884649154475e-03 +}; + +static void +fht(FLOAT * fz, int n) +{ + const FLOAT *tri = costab; + int k4; + FLOAT *fi, *gi; + FLOAT const *fn; + + n <<= 1; /* to get BLKSIZE, because of 3DNow! ASM routine */ + fn = fz + n; + k4 = 4; + do { + FLOAT s1, c1; + int i, k1, k2, k3, kx; + kx = k4 >> 1; + k1 = k4; + k2 = k4 << 1; + k3 = k2 + k1; + k4 = k2 << 1; + fi = fz; + gi = fi + kx; + do { + FLOAT f0, f1, f2, f3; + f1 = fi[0] - fi[k1]; + f0 = fi[0] + fi[k1]; + f3 = fi[k2] - fi[k3]; + f2 = fi[k2] + fi[k3]; + fi[k2] = f0 - f2; + fi[0] = f0 + f2; + fi[k3] = f1 - f3; + fi[k1] = f1 + f3; + f1 = gi[0] - gi[k1]; + f0 = gi[0] + gi[k1]; + f3 = SQRT2 * gi[k3]; + f2 = SQRT2 * gi[k2]; + gi[k2] = f0 - f2; + gi[0] = f0 + f2; + gi[k3] = f1 - f3; + gi[k1] = f1 + f3; + gi += k4; + fi += k4; + } while (fi < fn); + c1 = tri[0]; + s1 = tri[1]; + for (i = 1; i < kx; i++) { + FLOAT c2, s2; + c2 = 1 - (2 * s1) * s1; + s2 = (2 * s1) * c1; + fi = fz + i; + gi = fz + k1 - i; + do { + FLOAT a, b, g0, f0, f1, g1, f2, g2, f3, g3; + b = s2 * fi[k1] - c2 * gi[k1]; + a = c2 * fi[k1] + s2 * gi[k1]; + f1 = fi[0] - a; + f0 = fi[0] + a; + g1 = gi[0] - b; + g0 = gi[0] + b; + b = s2 * fi[k3] - c2 * gi[k3]; + a = c2 * fi[k3] + s2 * gi[k3]; + f3 = fi[k2] - a; + f2 = fi[k2] + a; + g3 = gi[k2] - b; + g2 = gi[k2] + b; + b = s1 * f2 - c1 * g3; + a = c1 * f2 + s1 * g3; + fi[k2] = f0 - a; + fi[0] = f0 + a; + gi[k3] = g1 - b; + gi[k1] = g1 + b; + b = c1 * g2 - s1 * f3; + a = s1 * g2 + c1 * f3; + gi[k2] = g0 - a; + gi[0] = g0 + a; + fi[k3] = f1 - b; + fi[k1] = f1 + b; + gi += k4; + fi += k4; + } while (fi < fn); + c2 = c1; + c1 = c2 * tri[0] - s1 * tri[1]; + s1 = c2 * tri[1] + s1 * tri[0]; + } + tri += 2; + } while (k4 < n); +} + + +static const unsigned char rv_tbl[] = { + 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, + 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, + 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, + 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, + 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, + 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, + 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, + 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, + 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, + 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, + 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, + 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, + 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, + 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, + 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, + 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe +}; + +#define ch01(index) (buffer[chn][index]) + +#define ml00(f) (window[i ] * f(i)) +#define ml10(f) (window[i + 0x200] * f(i + 0x200)) +#define ml20(f) (window[i + 0x100] * f(i + 0x100)) +#define ml30(f) (window[i + 0x300] * f(i + 0x300)) + +#define ml01(f) (window[i + 0x001] * f(i + 0x001)) +#define ml11(f) (window[i + 0x201] * f(i + 0x201)) +#define ml21(f) (window[i + 0x101] * f(i + 0x101)) +#define ml31(f) (window[i + 0x301] * f(i + 0x301)) + +#define ms00(f) (window_s[i ] * f(i + k)) +#define ms10(f) (window_s[0x7f - i] * f(i + k + 0x80)) +#define ms20(f) (window_s[i + 0x40] * f(i + k + 0x40)) +#define ms30(f) (window_s[0x3f - i] * f(i + k + 0xc0)) + +#define ms01(f) (window_s[i + 0x01] * f(i + k + 0x01)) +#define ms11(f) (window_s[0x7e - i] * f(i + k + 0x81)) +#define ms21(f) (window_s[i + 0x41] * f(i + k + 0x41)) +#define ms31(f) (window_s[0x3e - i] * f(i + k + 0xc1)) + + +void +fft_short(lame_internal_flags const *const gfc, + FLOAT x_real[3][BLKSIZE_s], int chn, const sample_t *const buffer[2]) +{ + int i; + int j; + int b; + + for (b = 0; b < 3; b++) { + FLOAT *x = &x_real[b][BLKSIZE_s / 2]; + short const k = (576 / 3) * (b + 1); + j = BLKSIZE_s / 8 - 1; + do { + FLOAT f0, f1, f2, f3, w; + + i = rv_tbl[j << 2]; + + f0 = ms00(ch01); + w = ms10(ch01); + f1 = f0 - w; + f0 = f0 + w; + f2 = ms20(ch01); + w = ms30(ch01); + f3 = f2 - w; + f2 = f2 + w; + + x -= 4; + x[0] = f0 + f2; + x[2] = f0 - f2; + x[1] = f1 + f3; + x[3] = f1 - f3; + + f0 = ms01(ch01); + w = ms11(ch01); + f1 = f0 - w; + f0 = f0 + w; + f2 = ms21(ch01); + w = ms31(ch01); + f3 = f2 - w; + f2 = f2 + w; + + x[BLKSIZE_s / 2 + 0] = f0 + f2; + x[BLKSIZE_s / 2 + 2] = f0 - f2; + x[BLKSIZE_s / 2 + 1] = f1 + f3; + x[BLKSIZE_s / 2 + 3] = f1 - f3; + } while (--j >= 0); + + gfc->fft_fht(x, BLKSIZE_s / 2); + /* BLKSIZE_s/2 because of 3DNow! ASM routine */ + } +} + +void +fft_long(lame_internal_flags const *const gfc, + FLOAT x[BLKSIZE], int chn, const sample_t *const buffer[2]) +{ + int i; + int jj = BLKSIZE / 8 - 1; + x += BLKSIZE / 2; + + do { + FLOAT f0, f1, f2, f3, w; + + i = rv_tbl[jj]; + f0 = ml00(ch01); + w = ml10(ch01); + f1 = f0 - w; + f0 = f0 + w; + f2 = ml20(ch01); + w = ml30(ch01); + f3 = f2 - w; + f2 = f2 + w; + + x -= 4; + x[0] = f0 + f2; + x[2] = f0 - f2; + x[1] = f1 + f3; + x[3] = f1 - f3; + + f0 = ml01(ch01); + w = ml11(ch01); + f1 = f0 - w; + f0 = f0 + w; + f2 = ml21(ch01); + w = ml31(ch01); + f3 = f2 - w; + f2 = f2 + w; + + x[BLKSIZE / 2 + 0] = f0 + f2; + x[BLKSIZE / 2 + 2] = f0 - f2; + x[BLKSIZE / 2 + 1] = f1 + f3; + x[BLKSIZE / 2 + 3] = f1 - f3; + } while (--jj >= 0); + + gfc->fft_fht(x, BLKSIZE / 2); + /* BLKSIZE/2 because of 3DNow! ASM routine */ +} + +#ifdef HAVE_NASM +extern void fht_3DN(FLOAT * fz, int n); +extern void fht_SSE(FLOAT * fz, int n); +#endif + +void +init_fft(lame_internal_flags * const gfc) +{ + int i; + + /* The type of window used here will make no real difference, but */ + /* in the interest of merging nspsytune stuff - switch to blackman window */ + for (i = 0; i < BLKSIZE; i++) + /* blackman window */ + window[i] = 0.42 - 0.5 * cos(2 * PI * (i + .5) / BLKSIZE) + + 0.08 * cos(4 * PI * (i + .5) / BLKSIZE); + + for (i = 0; i < BLKSIZE_s / 2; i++) + window_s[i] = 0.5 * (1.0 - cos(2.0 * PI * (i + 0.5) / BLKSIZE_s)); + + gfc->fft_fht = fht; +#ifdef HAVE_NASM + if (gfc->CPU_features.AMD_3DNow) { + gfc->fft_fht = fht_3DN; + } + else if (gfc->CPU_features.SSE) { + gfc->fft_fht = fht_SSE; + } + else { + gfc->fft_fht = fht; + } +#else +#ifdef HAVE_XMMINTRIN_H +#ifdef MIN_ARCH_SSE + gfc->fft_fht = fht_SSE2; +#endif +#endif +#endif +} diff --git a/node_modules/lame/deps/lame/libmp3lame/fft.h b/node_modules/lame/deps/lame/libmp3lame/fft.h new file mode 100644 index 0000000..258df88 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/fft.h @@ -0,0 +1,35 @@ +/* + * Fast Fourier Transform include file + * + * Copyright (c) 2000 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_FFT_H +#define LAME_FFT_H + +void fft_long(lame_internal_flags const *const gfc, FLOAT x_real[BLKSIZE], + int chn, const sample_t *const data[2]); + +void fft_short(lame_internal_flags const *const gfc, FLOAT x_real[3][BLKSIZE_s], + int chn, const sample_t *const data[2]); + +void init_fft(lame_internal_flags * const gfc); + +#endif + +/* End of fft.h */ diff --git a/node_modules/lame/deps/lame/libmp3lame/gain_analysis.c b/node_modules/lame/deps/lame/libmp3lame/gain_analysis.c new file mode 100644 index 0000000..145458b --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/gain_analysis.c @@ -0,0 +1,518 @@ +/* + * ReplayGainAnalysis - analyzes input samples and give the recommended dB change + * Copyright (C) 2001 David Robinson and Glen Sawyer + * Improvements and optimizations added by Frank Klemm, and by Marcel Muller + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * concept and filter values by David Robinson (David@Robinson.org) + * -- blame him if you think the idea is flawed + * original coding by Glen Sawyer (mp3gain@hotmail.com) + * -- blame him if you think this runs too slowly, or the coding is otherwise flawed + * + * lots of code improvements by Frank Klemm ( http://www.uni-jena.de/~pfk/mpp/ ) + * -- credit him for all the _good_ programming ;) + * + * + * For an explanation of the concepts and the basic algorithms involved, go to: + * http://www.replaygain.org/ + */ + +/* + * Here's the deal. Call + * + * InitGainAnalysis ( long samplefreq ); + * + * to initialize everything. Call + * + * AnalyzeSamples ( const Float_t* left_samples, + * const Float_t* right_samples, + * size_t num_samples, + * int num_channels ); + * + * as many times as you want, with as many or as few samples as you want. + * If mono, pass the sample buffer in through left_samples, leave + * right_samples NULL, and make sure num_channels = 1. + * + * GetTitleGain() + * + * will return the recommended dB level change for all samples analyzed + * SINCE THE LAST TIME you called GetTitleGain() OR InitGainAnalysis(). + * + * GetAlbumGain() + * + * will return the recommended dB level change for all samples analyzed + * since InitGainAnalysis() was called and finalized with GetTitleGain(). + * + * Pseudo-code to process an album: + * + * Float_t l_samples [4096]; + * Float_t r_samples [4096]; + * size_t num_samples; + * unsigned int num_songs; + * unsigned int i; + * + * InitGainAnalysis ( 44100 ); + * for ( i = 1; i <= num_songs; i++ ) { + * while ( ( num_samples = getSongSamples ( song[i], left_samples, right_samples ) ) > 0 ) + * AnalyzeSamples ( left_samples, right_samples, num_samples, 2 ); + * fprintf ("Recommended dB change for song %2d: %+6.2f dB\n", i, GetTitleGain() ); + * } + * fprintf ("Recommended dB change for whole album: %+6.2f dB\n", GetAlbumGain() ); + */ + +/* + * So here's the main source of potential code confusion: + * + * The filters applied to the incoming samples are IIR filters, + * meaning they rely on up to number of previous samples + * AND up to number of previous filtered samples. + * + * I set up the AnalyzeSamples routine to minimize memory usage and interface + * complexity. The speed isn't compromised too much (I don't think), but the + * internal complexity is higher than it should be for such a relatively + * simple routine. + * + * Optimization/clarity suggestions are welcome. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include "lame.h" +#include "machine.h" +#include "gain_analysis.h" + +/* for each filter: */ +/* [0] 48 kHz, [1] 44.1 kHz, [2] 32 kHz, [3] 24 kHz, [4] 22050 Hz, [5] 16 kHz, [6] 12 kHz, [7] is 11025 Hz, [8] 8 kHz */ + +#ifdef WIN32 +#pragma warning ( disable : 4305 ) +#endif + +/*lint -save -e736 loss of precision */ +static const Float_t ABYule[9][2 * YULE_ORDER + 1] = { + {0.03857599435200, -3.84664617118067, -0.02160367184185, 7.81501653005538, -0.00123395316851, + -11.34170355132042, -0.00009291677959, 13.05504219327545, -0.01655260341619, + -12.28759895145294, 0.02161526843274, 9.48293806319790, -0.02074045215285, -5.87257861775999, + 0.00594298065125, 2.75465861874613, 0.00306428023191, -0.86984376593551, 0.00012025322027, + 0.13919314567432, 0.00288463683916}, + {0.05418656406430, -3.47845948550071, -0.02911007808948, 6.36317777566148, -0.00848709379851, + -8.54751527471874, -0.00851165645469, 9.47693607801280, -0.00834990904936, -8.81498681370155, + 0.02245293253339, 6.85401540936998, -0.02596338512915, -4.39470996079559, 0.01624864962975, + 2.19611684890774, -0.00240879051584, -0.75104302451432, 0.00674613682247, 0.13149317958808, + -0.00187763777362}, + {0.15457299681924, -2.37898834973084, -0.09331049056315, 2.84868151156327, -0.06247880153653, + -2.64577170229825, 0.02163541888798, 2.23697657451713, -0.05588393329856, -1.67148153367602, + 0.04781476674921, 1.00595954808547, 0.00222312597743, -0.45953458054983, 0.03174092540049, + 0.16378164858596, -0.01390589421898, -0.05032077717131, 0.00651420667831, 0.02347897407020, + -0.00881362733839}, + {0.30296907319327, -1.61273165137247, -0.22613988682123, 1.07977492259970, -0.08587323730772, + -0.25656257754070, 0.03282930172664, -0.16276719120440, -0.00915702933434, -0.22638893773906, + -0.02364141202522, 0.39120800788284, -0.00584456039913, -0.22138138954925, 0.06276101321749, + 0.04500235387352, -0.00000828086748, 0.02005851806501, 0.00205861885564, 0.00302439095741, + -0.02950134983287}, + {0.33642304856132, -1.49858979367799, -0.25572241425570, 0.87350271418188, -0.11828570177555, + 0.12205022308084, 0.11921148675203, -0.80774944671438, -0.07834489609479, 0.47854794562326, + -0.00469977914380, -0.12453458140019, -0.00589500224440, -0.04067510197014, 0.05724228140351, + 0.08333755284107, 0.00832043980773, -0.04237348025746, -0.01635381384540, 0.02977207319925, + -0.01760176568150}, + {0.44915256608450, -0.62820619233671, -0.14351757464547, 0.29661783706366, -0.22784394429749, + -0.37256372942400, -0.01419140100551, 0.00213767857124, 0.04078262797139, -0.42029820170918, + -0.12398163381748, 0.22199650564824, 0.04097565135648, 0.00613424350682, 0.10478503600251, + 0.06747620744683, -0.01863887810927, 0.05784820375801, -0.03193428438915, 0.03222754072173, + 0.00541907748707}, + {0.56619470757641, -1.04800335126349, -0.75464456939302, 0.29156311971249, 0.16242137742230, + -0.26806001042947, 0.16744243493672, 0.00819999645858, -0.18901604199609, 0.45054734505008, + 0.30931782841830, -0.33032403314006, -0.27562961986224, 0.06739368333110, 0.00647310677246, + -0.04784254229033, 0.08647503780351, 0.01639907836189, -0.03788984554840, 0.01807364323573, + -0.00588215443421}, + {0.58100494960553, -0.51035327095184, -0.53174909058578, -0.31863563325245, -0.14289799034253, + -0.20256413484477, 0.17520704835522, 0.14728154134330, 0.02377945217615, 0.38952639978999, + 0.15558449135573, -0.23313271880868, -0.25344790059353, -0.05246019024463, 0.01628462406333, + -0.02505961724053, 0.06920467763959, 0.02442357316099, -0.03721611395801, 0.01818801111503, + -0.00749618797172}, + {0.53648789255105, -0.25049871956020, -0.42163034350696, -0.43193942311114, -0.00275953611929, + -0.03424681017675, 0.04267842219415, -0.04678328784242, -0.10214864179676, 0.26408300200955, + 0.14590772289388, 0.15113130533216, -0.02459864859345, -0.17556493366449, -0.11202315195388, + -0.18823009262115, -0.04060034127000, 0.05477720428674, 0.04788665548180, 0.04704409688120, + -0.02217936801134} +}; + +static const Float_t ABButter[9][2 * BUTTER_ORDER + 1] = { + {0.98621192462708, -1.97223372919527, -1.97242384925416, 0.97261396931306, 0.98621192462708}, + {0.98500175787242, -1.96977855582618, -1.97000351574484, 0.97022847566350, 0.98500175787242}, + {0.97938932735214, -1.95835380975398, -1.95877865470428, 0.95920349965459, 0.97938932735214}, + {0.97531843204928, -1.95002759149878, -1.95063686409857, 0.95124613669835, 0.97531843204928}, + {0.97316523498161, -1.94561023566527, -1.94633046996323, 0.94705070426118, 0.97316523498161}, + {0.96454515552826, -1.92783286977036, -1.92909031105652, 0.93034775234268, 0.96454515552826}, + {0.96009142950541, -1.91858953033784, -1.92018285901082, 0.92177618768381, 0.96009142950541}, + {0.95856916599601, -1.91542108074780, -1.91713833199203, 0.91885558323625, 0.95856916599601}, + {0.94597685600279, -1.88903307939452, -1.89195371200558, 0.89487434461664, 0.94597685600279} +}; + +/*lint -restore */ + +#ifdef WIN32 +#pragma warning ( default : 4305 ) +#endif + +/* When calling this procedure, make sure that ip[-order] and op[-order] point to real data! */ + +static void +filterYule(const Float_t * input, Float_t * output, size_t nSamples, const Float_t * const kernel) +{ + /*register double y; */ + + while (nSamples--) { + *output = 1e-10 /* 1e-10 is a hack to avoid slowdown because of denormals */ + + input[0] * kernel[0] + - output[-1] * kernel[1] + + input[-1] * kernel[2] + - output[-2] * kernel[3] + + input[-2] * kernel[4] + - output[-3] * kernel[5] + + input[-3] * kernel[6] + - output[-4] * kernel[7] + + input[-4] * kernel[8] + - output[-5] * kernel[9] + + input[-5] * kernel[10] + - output[-6] * kernel[11] + + input[-6] * kernel[12] + - output[-7] * kernel[13] + + input[-7] * kernel[14] + - output[-8] * kernel[15] + + input[-8] * kernel[16] + - output[-9] * kernel[17] + + input[-9] * kernel[18] + - output[-10] * kernel[19] + + input[-10] * kernel[20]; + ++output; + ++input; + /* *output++ = (Float_t)y; */ + } +} + +static void +filterButter(const Float_t * input, Float_t * output, size_t nSamples, const Float_t * const kernel) +{ /*register double y; */ + + while (nSamples--) { + *output = input[0] * kernel[0] + - output[-1] * kernel[1] + + input[-1] * kernel[2] + - output[-2] * kernel[3] + + input[-2] * kernel[4]; + ++output; + ++input; + /* *output++ = (Float_t)y; */ + } +} + + + +static int ResetSampleFrequency(replaygain_t * rgData, long samplefreq); + +/* returns a INIT_GAIN_ANALYSIS_OK if successful, INIT_GAIN_ANALYSIS_ERROR if not */ + +int +ResetSampleFrequency(replaygain_t * rgData, long samplefreq) +{ + int i; + + /* zero out initial values */ + for (i = 0; i < MAX_ORDER; i++) + rgData->linprebuf[i] = rgData->lstepbuf[i] + = rgData->loutbuf[i] + = rgData->rinprebuf[i] + = rgData->rstepbuf[i] + = rgData->routbuf[i] = 0.; + + switch ((int) (samplefreq)) { + case 48000: + rgData->freqindex = 0; + break; + case 44100: + rgData->freqindex = 1; + break; + case 32000: + rgData->freqindex = 2; + break; + case 24000: + rgData->freqindex = 3; + break; + case 22050: + rgData->freqindex = 4; + break; + case 16000: + rgData->freqindex = 5; + break; + case 12000: + rgData->freqindex = 6; + break; + case 11025: + rgData->freqindex = 7; + break; + case 8000: + rgData->freqindex = 8; + break; + default: + return INIT_GAIN_ANALYSIS_ERROR; + } + + rgData->sampleWindow = + (samplefreq * RMS_WINDOW_TIME_NUMERATOR + RMS_WINDOW_TIME_DENOMINATOR - + 1) / RMS_WINDOW_TIME_DENOMINATOR; + + rgData->lsum = 0.; + rgData->rsum = 0.; + rgData->totsamp = 0; + + memset(rgData->A, 0, sizeof(rgData->A)); + + return INIT_GAIN_ANALYSIS_OK; +} + +int +InitGainAnalysis(replaygain_t * rgData, long samplefreq) +{ + if (ResetSampleFrequency(rgData, samplefreq) != INIT_GAIN_ANALYSIS_OK) { + return INIT_GAIN_ANALYSIS_ERROR; + } + + rgData->linpre = rgData->linprebuf + MAX_ORDER; + rgData->rinpre = rgData->rinprebuf + MAX_ORDER; + rgData->lstep = rgData->lstepbuf + MAX_ORDER; + rgData->rstep = rgData->rstepbuf + MAX_ORDER; + rgData->lout = rgData->loutbuf + MAX_ORDER; + rgData->rout = rgData->routbuf + MAX_ORDER; + + memset(rgData->B, 0, sizeof(rgData->B)); + + return INIT_GAIN_ANALYSIS_OK; +} + +/* returns GAIN_ANALYSIS_OK if successful, GAIN_ANALYSIS_ERROR if not */ + +static inline double +fsqr(const double d) +{ + return d * d; +} + +int +AnalyzeSamples(replaygain_t * rgData, const Float_t * left_samples, const Float_t * right_samples, + size_t num_samples, int num_channels) +{ + const Float_t *curleft; + const Float_t *curright; + long batchsamples; + long cursamples; + long cursamplepos; + int i; + + if (num_samples == 0) + return GAIN_ANALYSIS_OK; + + cursamplepos = 0; + batchsamples = (long) num_samples; + + switch (num_channels) { + case 1: + right_samples = left_samples; + break; + case 2: + break; + default: + return GAIN_ANALYSIS_ERROR; + } + + if (num_samples < MAX_ORDER) { + memcpy(rgData->linprebuf + MAX_ORDER, left_samples, num_samples * sizeof(Float_t)); + memcpy(rgData->rinprebuf + MAX_ORDER, right_samples, num_samples * sizeof(Float_t)); + } + else { + memcpy(rgData->linprebuf + MAX_ORDER, left_samples, MAX_ORDER * sizeof(Float_t)); + memcpy(rgData->rinprebuf + MAX_ORDER, right_samples, MAX_ORDER * sizeof(Float_t)); + } + + while (batchsamples > 0) { + cursamples = batchsamples > rgData->sampleWindow - rgData->totsamp ? + rgData->sampleWindow - rgData->totsamp : batchsamples; + if (cursamplepos < MAX_ORDER) { + curleft = rgData->linpre + cursamplepos; + curright = rgData->rinpre + cursamplepos; + if (cursamples > MAX_ORDER - cursamplepos) + cursamples = MAX_ORDER - cursamplepos; + } + else { + curleft = left_samples + cursamplepos; + curright = right_samples + cursamplepos; + } + + YULE_FILTER(curleft, rgData->lstep + rgData->totsamp, cursamples, + ABYule[rgData->freqindex]); + YULE_FILTER(curright, rgData->rstep + rgData->totsamp, cursamples, + ABYule[rgData->freqindex]); + + BUTTER_FILTER(rgData->lstep + rgData->totsamp, rgData->lout + rgData->totsamp, cursamples, + ABButter[rgData->freqindex]); + BUTTER_FILTER(rgData->rstep + rgData->totsamp, rgData->rout + rgData->totsamp, cursamples, + ABButter[rgData->freqindex]); + + curleft = rgData->lout + rgData->totsamp; /* Get the squared values */ + curright = rgData->rout + rgData->totsamp; + + i = cursamples % 8; + while (i--) { + rgData->lsum += fsqr(*curleft++); + rgData->rsum += fsqr(*curright++); + } + i = cursamples / 8; + while (i--) { + rgData->lsum += fsqr(curleft[0]) + + fsqr(curleft[1]) + + fsqr(curleft[2]) + + fsqr(curleft[3]) + + fsqr(curleft[4]) + + fsqr(curleft[5]) + + fsqr(curleft[6]) + + fsqr(curleft[7]); + curleft += 8; + rgData->rsum += fsqr(curright[0]) + + fsqr(curright[1]) + + fsqr(curright[2]) + + fsqr(curright[3]) + + fsqr(curright[4]) + + fsqr(curright[5]) + + fsqr(curright[6]) + + fsqr(curright[7]); + curright += 8; + } + + batchsamples -= cursamples; + cursamplepos += cursamples; + rgData->totsamp += cursamples; + if (rgData->totsamp == rgData->sampleWindow) { /* Get the Root Mean Square (RMS) for this set of samples */ + double const val = + STEPS_per_dB * 10. * log10((rgData->lsum + rgData->rsum) / rgData->totsamp * 0.5 + + 1.e-37); + size_t ival = (val <= 0) ? 0 : (size_t) val; + if (ival >= sizeof(rgData->A) / sizeof(*(rgData->A))) + ival = sizeof(rgData->A) / sizeof(*(rgData->A)) - 1; + rgData->A[ival]++; + rgData->lsum = rgData->rsum = 0.; + memmove(rgData->loutbuf, rgData->loutbuf + rgData->totsamp, + MAX_ORDER * sizeof(Float_t)); + memmove(rgData->routbuf, rgData->routbuf + rgData->totsamp, + MAX_ORDER * sizeof(Float_t)); + memmove(rgData->lstepbuf, rgData->lstepbuf + rgData->totsamp, + MAX_ORDER * sizeof(Float_t)); + memmove(rgData->rstepbuf, rgData->rstepbuf + rgData->totsamp, + MAX_ORDER * sizeof(Float_t)); + rgData->totsamp = 0; + } + if (rgData->totsamp > rgData->sampleWindow) /* somehow I really screwed up: Error in programming! Contact author about totsamp > sampleWindow */ + return GAIN_ANALYSIS_ERROR; + } + if (num_samples < MAX_ORDER) { + memmove(rgData->linprebuf, rgData->linprebuf + num_samples, + (MAX_ORDER - num_samples) * sizeof(Float_t)); + memmove(rgData->rinprebuf, rgData->rinprebuf + num_samples, + (MAX_ORDER - num_samples) * sizeof(Float_t)); + memcpy(rgData->linprebuf + MAX_ORDER - num_samples, left_samples, + num_samples * sizeof(Float_t)); + memcpy(rgData->rinprebuf + MAX_ORDER - num_samples, right_samples, + num_samples * sizeof(Float_t)); + } + else { + memcpy(rgData->linprebuf, left_samples + num_samples - MAX_ORDER, + MAX_ORDER * sizeof(Float_t)); + memcpy(rgData->rinprebuf, right_samples + num_samples - MAX_ORDER, + MAX_ORDER * sizeof(Float_t)); + } + + return GAIN_ANALYSIS_OK; +} + + +static Float_t +analyzeResult(uint32_t const *Array, size_t len) +{ + uint32_t elems; + uint32_t upper; + uint32_t sum; + size_t i; + + elems = 0; + for (i = 0; i < len; i++) + elems += Array[i]; + if (elems == 0) + return GAIN_NOT_ENOUGH_SAMPLES; + + upper = (uint32_t) ceil(elems * (1. - RMS_PERCENTILE)); + sum = 0; + for (i = len; i-- > 0;) { + sum += Array[i]; + if (sum >= upper) { + break; + } + } + + return (Float_t) ((Float_t) PINK_REF - (Float_t) i / (Float_t) STEPS_per_dB); +} + + +Float_t +GetTitleGain(replaygain_t * rgData) +{ + Float_t retval; + unsigned int i; + + retval = analyzeResult(rgData->A, sizeof(rgData->A) / sizeof(*(rgData->A))); + + for (i = 0; i < sizeof(rgData->A) / sizeof(*(rgData->A)); i++) { + rgData->B[i] += rgData->A[i]; + rgData->A[i] = 0; + } + + for (i = 0; i < MAX_ORDER; i++) + rgData->linprebuf[i] = rgData->lstepbuf[i] + = rgData->loutbuf[i] + = rgData->rinprebuf[i] + = rgData->rstepbuf[i] + = rgData->routbuf[i] = 0.f; + + rgData->totsamp = 0; + rgData->lsum = rgData->rsum = 0.; + return retval; +} + +#if 0 +static Float_t GetAlbumGain(replaygain_t const* rgData); + +Float_t +GetAlbumGain(replaygain_t const* rgData) +{ + return analyzeResult(rgData->B, sizeof(rgData->B) / sizeof(*(rgData->B))); +} +#endif + +/* end of gain_analysis.c */ diff --git a/node_modules/lame/deps/lame/libmp3lame/gain_analysis.h b/node_modules/lame/deps/lame/libmp3lame/gain_analysis.h new file mode 100644 index 0000000..a6b56ab --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/gain_analysis.h @@ -0,0 +1,109 @@ +/* + * ReplayGainAnalysis - analyzes input samples and give the recommended dB change + * Copyright (C) 2001 David Robinson and Glen Sawyer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * concept and filter values by David Robinson (David@Robinson.org) + * -- blame him if you think the idea is flawed + * coding by Glen Sawyer (mp3gain@hotmail.com) 735 W 255 N, Orem, UT 84057-4505 USA + * -- blame him if you think this runs too slowly, or the coding is otherwise flawed + * + * For an explanation of the concepts and the basic algorithms involved, go to: + * http://www.replaygain.org/ + */ + +#ifndef GAIN_ANALYSIS_H +#define GAIN_ANALYSIS_H + +#ifdef HAVE_INTTYPES_H +# include +#else +# ifdef HAVE_STDINT_H +# include +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + + typedef sample_t Float_t; /* Type used for filtering */ + + +#define PINK_REF 64.82 /* 298640883795 */ /* calibration value for 89dB */ + + +#define YULE_ORDER 10 +#define BUTTER_ORDER 2 +#define YULE_FILTER filterYule +#define BUTTER_FILTER filterButter +#define RMS_PERCENTILE 0.95 /* percentile which is louder than the proposed level */ +#define MAX_SAMP_FREQ 48000L /* maximum allowed sample frequency [Hz] */ +#define RMS_WINDOW_TIME_NUMERATOR 1L +#define RMS_WINDOW_TIME_DENOMINATOR 20L /* numerator / denominator = time slice size [s] */ +#define STEPS_per_dB 100 /* Table entries per dB */ +#define MAX_dB 120 /* Table entries for 0...MAX_dB (normal max. values are 70...80 dB) */ + + enum { GAIN_NOT_ENOUGH_SAMPLES = -24601, GAIN_ANALYSIS_ERROR = 0, GAIN_ANALYSIS_OK = + 1, INIT_GAIN_ANALYSIS_ERROR = 0, INIT_GAIN_ANALYSIS_OK = 1 + }; + + enum { MAX_ORDER = (BUTTER_ORDER > YULE_ORDER ? BUTTER_ORDER : YULE_ORDER) + , MAX_SAMPLES_PER_WINDOW = ((MAX_SAMP_FREQ * RMS_WINDOW_TIME_NUMERATOR) / RMS_WINDOW_TIME_DENOMINATOR + 1) /* max. Samples per Time slice */ + }; + + struct replaygain_data { + Float_t linprebuf[MAX_ORDER * 2]; + Float_t *linpre; /* left input samples, with pre-buffer */ + Float_t lstepbuf[MAX_SAMPLES_PER_WINDOW + MAX_ORDER]; + Float_t *lstep; /* left "first step" (i.e. post first filter) samples */ + Float_t loutbuf[MAX_SAMPLES_PER_WINDOW + MAX_ORDER]; + Float_t *lout; /* left "out" (i.e. post second filter) samples */ + Float_t rinprebuf[MAX_ORDER * 2]; + Float_t *rinpre; /* right input samples ... */ + Float_t rstepbuf[MAX_SAMPLES_PER_WINDOW + MAX_ORDER]; + Float_t *rstep; + Float_t routbuf[MAX_SAMPLES_PER_WINDOW + MAX_ORDER]; + Float_t *rout; + long sampleWindow; /* number of samples required to reach number of milliseconds required for RMS window */ + long totsamp; + double lsum; + double rsum; + int freqindex; + int first; + uint32_t A[STEPS_per_dB * MAX_dB]; + uint32_t B[STEPS_per_dB * MAX_dB]; + + }; +#ifndef replaygain_data_defined +#define replaygain_data_defined + typedef struct replaygain_data replaygain_t; +#endif + + + + + int InitGainAnalysis(replaygain_t * rgData, long samplefreq); + int AnalyzeSamples(replaygain_t * rgData, const Float_t * left_samples, + const Float_t * right_samples, size_t num_samples, int num_channels); + Float_t GetTitleGain(replaygain_t * rgData); + + +#ifdef __cplusplus +} +#endif +#endif /* GAIN_ANALYSIS_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/i386/Makefile.am b/node_modules/lame/deps/lame/libmp3lame/i386/Makefile.am new file mode 100644 index 0000000..e49ad9c --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/i386/Makefile.am @@ -0,0 +1,73 @@ +## $Id: Makefile.am,v 1.26 2011/04/04 09:42:34 aleidinger Exp $ + +AUTOMAKE_OPTIONS = foreign $(top_srcdir)/ansi2knr + +DEFS = @DEFS@ @CONFIG_DEFS@ + +ECHO ?= echo + +nasm_sources = \ + choose_table.nas \ + cpu_feat.nas \ + fft3dn.nas \ + fftsse.nas + +if HAVE_NASM +noinst_LTLIBRARIES = liblameasmroutines.la +liblameasmroutines_la_SOURCES = $(nasm_sources) +am_liblameasmroutines_la_OBJECTS = \ + choose_table$U.lo \ + cpu_feat$U.lo \ + fft3dn$U.lo \ + fftsse$U.lo +endif + +noinst_HEADERS = nasm.h + +INCLUDES = @INCLUDES@ -I$(top_srcdir)/libmp3lame/@CPUTYPE@ + +SUFFIXES = .nas .lo + +EXTRA_liblameasmroutines_la_SOURCES = $(nasm_sources) + +CLEANFILES = \ + choose_table.o.lst \ + choose_table.lo.lst \ + cpu_feat.o.lst \ + cpu_feat.lo.lst \ + fft3dn.o.lst \ + fft3dn.lo.lst \ + fftsse.o.lst \ + fftsse.lo.lst + +EXTRA_DIST = \ + fft.nas \ + fftfpu.nas \ + ffttbl.nas \ + scalar.nas + +NASM = @NASM@ +NASMFLAGS=@NASM_FORMAT@ -i $(top_srcdir)/libmp3lame/@CPUTYPE@/ + +.nas.o: $< nasm.h + $(NASM) $(NASMFLAGS) $< -o $@ -l $@.lst + +.nas.lo: $< nasm.h + mkdir -p .libs + $(ECHO) '# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)' >$@ + $(ECHO) "pic_object='.libs/$*.o'" >>$@ + $(ECHO) "non_pic_object='.libs/$*.o'" >>$@ + $(NASM) $(NASMFLAGS) $< -o .libs/$*.o -l $@.lst + +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ + + +#$(OBJECTS): libtool +#libtool: $(LIBTOOL_DEPS) +# $(SHELL) $(top_builddir)/config.status --recheck diff --git a/node_modules/lame/deps/lame/libmp3lame/i386/Makefile.in b/node_modules/lame/deps/lame/libmp3lame/i386/Makefile.in new file mode 100644 index 0000000..50e4713 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/i386/Makefile.in @@ -0,0 +1,533 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +ANSI2KNR = $(top_srcdir)/ansi2knr +subdir = libmp3lame/i386 +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +liblameasmroutines_la_LIBADD = +am__liblameasmroutines_la_SOURCES_DIST = choose_table.nas cpu_feat.nas \ + fft3dn.nas fftsse.nas +am__objects_1 = choose_table.lo cpu_feat.lo fft3dn.lo fftsse.lo +liblameasmroutines_la_OBJECTS = $(am_liblameasmroutines_la_OBJECTS) +@HAVE_NASM_TRUE@am_liblameasmroutines_la_rpath = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +SOURCES = $(liblameasmroutines_la_SOURCES) \ + $(EXTRA_liblameasmroutines_la_SOURCES) +DIST_SOURCES = $(am__liblameasmroutines_la_SOURCES_DIST) \ + $(EXTRA_liblameasmroutines_la_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ @CONFIG_DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ -I$(top_srcdir)/libmp3lame/@CPUTYPE@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign $(top_srcdir)/ansi2knr +nasm_sources = \ + choose_table.nas \ + cpu_feat.nas \ + fft3dn.nas \ + fftsse.nas + +@HAVE_NASM_TRUE@noinst_LTLIBRARIES = liblameasmroutines.la +@HAVE_NASM_TRUE@liblameasmroutines_la_SOURCES = $(nasm_sources) +@HAVE_NASM_TRUE@am_liblameasmroutines_la_OBJECTS = \ +@HAVE_NASM_TRUE@ choose_table$U.lo \ +@HAVE_NASM_TRUE@ cpu_feat$U.lo \ +@HAVE_NASM_TRUE@ fft3dn$U.lo \ +@HAVE_NASM_TRUE@ fftsse$U.lo + +noinst_HEADERS = nasm.h +SUFFIXES = .nas .lo +EXTRA_liblameasmroutines_la_SOURCES = $(nasm_sources) +CLEANFILES = \ + choose_table.o.lst \ + choose_table.lo.lst \ + cpu_feat.o.lst \ + cpu_feat.lo.lst \ + fft3dn.o.lst \ + fft3dn.lo.lst \ + fftsse.o.lst \ + fftsse.lo.lst + +EXTRA_DIST = \ + fft.nas \ + fftfpu.nas \ + ffttbl.nas \ + scalar.nas + +NASMFLAGS = @NASM_FORMAT@ -i $(top_srcdir)/libmp3lame/@CPUTYPE@/ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ + +all: all-am + +.SUFFIXES: +.SUFFIXES: .nas .lo .o +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libmp3lame/i386/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign libmp3lame/i386/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +liblameasmroutines.la: $(liblameasmroutines_la_OBJECTS) $(liblameasmroutines_la_DEPENDENCIES) + $(LINK) $(am_liblameasmroutines_la_rpath) $(liblameasmroutines_la_OBJECTS) $(liblameasmroutines_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c +$(top_srcdir)/ansi2knr: + $(am__cd) $(top_srcdir) && $(MAKE) $(AM_MAKEFLAGS) ./ansi2knr + +mostlyclean-kr: + -test "$U" = "" || rm -f *_.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: $(top_srcdir)/ansi2knr install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + + +ECHO ?= echo + +.nas.o: $< nasm.h + $(NASM) $(NASMFLAGS) $< -o $@ -l $@.lst + +.nas.lo: $< nasm.h + mkdir -p .libs + $(ECHO) '# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)' >$@ + $(ECHO) "pic_object='.libs/$*.o'" >>$@ + $(ECHO) "non_pic_object='.libs/$*.o'" >>$@ + $(NASM) $(NASMFLAGS) $< -o .libs/$*.o -l $@.lst + +#$(OBJECTS): libtool +#libtool: $(LIBTOOL_DEPS) +# $(SHELL) $(top_builddir)/config.status --recheck + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/libmp3lame/i386/choose_table.nas b/node_modules/lame/deps/lame/libmp3lame/i386/choose_table.nas new file mode 100644 index 0000000..9217c8e --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/i386/choose_table.nas @@ -0,0 +1,447 @@ +; new count bit routine +; part of this code is origined from +; new GOGO-no-coda (1999, 2000) +; Copyright (C) 1999 shigeo +; modified by Keiichi SAKAI + +%include "nasm.h" + + globaldef choose_table_MMX + globaldef MMX_masking + + externdef largetbl + externdef t1l + externdef table23 + externdef table56 + + segment_data + align 16 +D14_14_14_14 dd 0x000E000E, 0x000E000E +D15_15_15_15 dd 0xfff0fff0, 0xfff0fff0 +mul_add dd 0x00010010, 0x00010010 +mul_add23 dd 0x00010003, 0x00010003 +mul_add56 dd 0x00010004, 0x00010004 +tableDEF + dd 0x00010003,0x01,0x00050005,0x05,0x00070006,0x07,0x00090008,0x08,0x000a0008, 0x09 + dd 0x000a0009,0x0a,0x000b000a,0x0a,0x000b000a,0x0b,0x000c000a,0x0a,0x000c000b, 0x0b + dd 0x000c000b,0x0c,0x000d000c,0x0c,0x000d000c,0x0d,0x000d000c,0x0d,0x000e000d, 0x0e + dd 0x000b000e,0x0e,0x00040005,0x04,0x00060005,0x06,0x00080007,0x08,0x00090008, 0x09 + dd 0x000a0009,0x0a,0x000b0009,0x0a,0x000b000a,0x0b,0x000b000a,0x0b,0x000c000a, 0x0b + dd 0x000c000b,0x0b,0x000c000b,0x0c,0x000d000c,0x0c,0x000e000c,0x0d,0x000d000c, 0x0e + dd 0x000e000d,0x0e,0x000b000d,0x0e,0x00070006,0x07,0x00080007,0x08,0x00090007, 0x09 + dd 0x000a0008,0x0a,0x000b0009,0x0b,0x000b0009,0x0b,0x000c000a,0x0c,0x000c000a, 0x0c + dd 0x000d000a,0x0b,0x000c000b,0x0c,0x000d000b,0x0c,0x000d000c,0x0d,0x000d000c, 0x0d + dd 0x000e000d,0x0e,0x000e000d,0x0f,0x000c000d,0x0f,0x00090007,0x08,0x00090008, 0x09 + dd 0x000a0008,0x0a,0x000b0009,0x0b,0x000b0009,0x0b,0x000c000a,0x0c,0x000c000a, 0x0c + dd 0x000c000b,0x0c,0x000d000b,0x0c,0x000d000b,0x0d,0x000e000c,0x0d,0x000e000c, 0x0d + dd 0x000e000c,0x0d,0x000f000d,0x0e,0x000f000d,0x0f,0x000d000d,0x0f,0x000a0008, 0x09 + dd 0x000a0008,0x09,0x000b0009,0x0b,0x000b0009,0x0b,0x000c000a,0x0c,0x000c000a, 0x0c + dd 0x000d000b,0x0d,0x000d000b,0x0d,0x000d000b,0x0c,0x000e000b,0x0d,0x000e000c, 0x0d + dd 0x000e000c,0x0e,0x000f000c,0x0e,0x000f000d,0x0f,0x000f000d,0x0f,0x000c000d, 0x10 + dd 0x000a0009,0x0a,0x000a0009,0x0a,0x000b0009,0x0b,0x000b000a,0x0c,0x000c000a, 0x0c + dd 0x000d000a,0x0c,0x000d000b,0x0d,0x000e000b,0x0d,0x000d000b,0x0d,0x000e000b, 0x0d + dd 0x000e000c,0x0e,0x000f000c,0x0d,0x000f000d,0x0f,0x000f000d,0x0f,0x0010000d, 0x10 + dd 0x000d000e,0x10,0x000b000a,0x0a,0x000b0009,0x0b,0x000b000a,0x0c,0x000c000a, 0x0c + dd 0x000d000a,0x0d,0x000d000b,0x0d,0x000d000b,0x0d,0x000d000b,0x0d,0x000e000b, 0x0d + dd 0x000e000c,0x0e,0x000e000c,0x0e,0x000e000c,0x0e,0x000f000d,0x0f,0x000f000d, 0x0f + dd 0x0010000e,0x10,0x000d000e,0x10,0x000b000a,0x0b,0x000b000a,0x0b,0x000c000a, 0x0c + dd 0x000c000b,0x0d,0x000d000b,0x0d,0x000d000b,0x0d,0x000d000b,0x0e,0x000e000c, 0x0e + dd 0x000e000c,0x0e,0x000f000c,0x0e,0x000f000c,0x0f,0x000f000c,0x0f,0x000f000d, 0x0f + dd 0x0011000d,0x10,0x0011000d,0x12,0x000d000e,0x12,0x000b000a,0x0a,0x000c000a, 0x0a + dd 0x000c000a,0x0b,0x000d000b,0x0c,0x000d000b,0x0c,0x000d000b,0x0d,0x000e000b, 0x0d + dd 0x000e000c,0x0e,0x000f000c,0x0e,0x000f000c,0x0e,0x000f000c,0x0e,0x000f000d, 0x0f + dd 0x0010000d,0x0f,0x0010000e,0x10,0x0010000e,0x11,0x000d000e,0x11,0x000c000a, 0x0b + dd 0x000c000a,0x0b,0x000c000b,0x0c,0x000d000b,0x0c,0x000d000b,0x0d,0x000e000b, 0x0d + dd 0x000e000c,0x0d,0x000f000c,0x0f,0x000f000c,0x0e,0x000f000d,0x0f,0x000f000d, 0x0f + dd 0x0010000d,0x10,0x000f000d,0x10,0x0010000e,0x10,0x000f000e,0x12,0x000e000e, 0x11 + dd 0x000c000b,0x0b,0x000d000b,0x0c,0x000c000b,0x0c,0x000d000b,0x0d,0x000e000c, 0x0d + dd 0x000e000c,0x0e,0x000e000c,0x0e,0x000e000c,0x0f,0x000f000c,0x0e,0x0010000d, 0x0f + dd 0x0010000d,0x10,0x0010000d,0x0f,0x0011000d,0x10,0x0011000e,0x11,0x0010000f, 0x12 + dd 0x000d000e,0x13,0x000d000b,0x0c,0x000d000b,0x0c,0x000d000b,0x0c,0x000d000b, 0x0d + dd 0x000e000c,0x0e,0x000e000c,0x0e,0x000f000c,0x0e,0x0010000c,0x0e,0x0010000d, 0x0f + dd 0x0010000d,0x0f,0x0010000d,0x0f,0x0010000d,0x10,0x0010000e,0x11,0x000f000e, 0x11 + dd 0x0010000e,0x11,0x000e000f,0x12,0x000d000c,0x0c,0x000e000c,0x0d,0x000e000b, 0x0d + dd 0x000e000c,0x0e,0x000e000c,0x0e,0x000f000c,0x0f,0x000f000d,0x0e,0x000f000d, 0x0f + dd 0x000f000d,0x10,0x0011000d,0x10,0x0010000d,0x11,0x0010000d,0x11,0x0010000e, 0x11 + dd 0x0010000e,0x12,0x0012000f,0x12,0x000e000f,0x12,0x000f000c,0x0d,0x000e000c, 0x0d + dd 0x000e000c,0x0e,0x000e000c,0x0f,0x000f000c,0x0f,0x000f000d,0x0f,0x0010000d, 0x10 + dd 0x0010000d,0x10,0x0010000d,0x10,0x0012000e,0x10,0x0011000e,0x10,0x0011000e, 0x11 + dd 0x0011000e,0x12,0x0013000e,0x11,0x0011000f,0x12,0x000e000f,0x12,0x000e000d, 0x0e + dd 0x000f000d,0x0e,0x000d000d,0x0e,0x000e000d,0x0f,0x0010000d,0x0f,0x0010000d, 0x0f + dd 0x000f000d,0x11,0x0010000d,0x10,0x0010000e,0x10,0x0011000e,0x13,0x0012000e, 0x11 + dd 0x0011000e,0x11,0x0013000f,0x11,0x0011000f,0x13,0x0010000e,0x12,0x000e000f, 0x12 + dd 0x000b000d,0x0d,0x000b000d,0x0e,0x000b000d,0x0f,0x000c000d,0x10,0x000c000d, 0x10 + dd 0x000d000d,0x10,0x000d000d,0x11,0x000d000e,0x10,0x000e000e,0x11,0x000e000e, 0x11 + dd 0x000e000e,0x12,0x000e000e,0x12,0x000e000f,0x15,0x000e000f,0x14,0x000e000f, 0x15 + dd 0x000c000f,0x12 + +tableABC + dd 0x00020004,0x1,0x00040004,0x4,0x00060006,0x7,0x00080008,0x9,0x00090009,0xa,0x000a000a,0xa + dd 0x0009000a,0xa,0x000a000a,0xb,0x00000000,0x0,0x00020003,0x1,0x00040004,0x4,0x00070006,0x7 + dd 0x00090007,0x9,0x00090009,0x9,0x000a000a,0xa,0x00000000,0x0,0x00040004,0x4,0x00050005,0x6 + dd 0x00060006,0x8,0x00080007,0x9,0x000a0009,0xa,0x000a0009,0xb,0x0009000a,0xa,0x000a000a,0xa + dd 0x00000000,0x0,0x00040004,0x4,0x00040005,0x6,0x00060006,0x8,0x000a0007,0x9,0x000a0008,0x9 + dd 0x000a000a,0xa,0x00000000,0x0,0x00060006,0x7,0x00070006,0x8,0x00080007,0x9,0x00090008,0xa + dd 0x000a0009,0xb,0x000b000a,0xc,0x000a0009,0xb,0x000a000a,0xb,0x00000000,0x0,0x00070005,0x7 + dd 0x00060006,0x7,0x00080007,0x9,0x000a0008,0xa,0x000a0009,0xa,0x000b000a,0xb,0x00000000,0x0 + dd 0x00080007,0x8,0x00080007,0x9,0x00090008,0xa,0x000b0008,0xb,0x000a0009,0xc,0x000c000a,0xc + dd 0x000a000a,0xb,0x000b000a,0xc,0x00000000,0x0,0x00090007,0x8,0x000a0007,0x9,0x000a0008,0xa + dd 0x000b0009,0xb,0x000b0009,0xb,0x000c000a,0xb,0x00000000,0x0,0x00090008,0x9,0x000a0008,0xa + dd 0x000a0009,0xb,0x000b0009,0xc,0x000b000a,0xc,0x000c000a,0xc,0x000b000a,0xc,0x000c000b,0xc + dd 0x00000000,0x0,0x00090008,0x8,0x00090008,0x9,0x000a0009,0xa,0x000b0009,0xb,0x000c000a,0xb + dd 0x000c000b,0xc,0x00000000,0x0,0x00090009,0xa,0x000a0009,0xb,0x000b000a,0xc,0x000c000a,0xc + dd 0x000c000a,0xd,0x000d000b,0xd,0x000c000a,0xc,0x000d000b,0xd,0x00000000,0x0,0x000a0009,0x9 + dd 0x000a0009,0xa,0x000b000a,0xb,0x000b000a,0xc,0x000d000b,0xc,0x000d000b,0xc,0x00000000,0x0 + dd 0x00090009,0x9,0x00090009,0xa,0x00090009,0xb,0x000a000a,0xc,0x000b000a,0xc,0x000c000b,0xc + dd 0x000c000b,0xd,0x000c000c,0xd,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0 + dd 0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x0009000a,0xa,0x0009000a,0xa + dd 0x000a000a,0xb,0x000b000b,0xc,0x000c000b,0xc,0x000c000b,0xd,0x000c000b,0xd,0x000c000c,0xd + dd 0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0 + dd 0x0,0x00000000, 0x0,0x00000000 + +linbits32 + dd 0x00040004,0x10001,0x00040004,0x20002,0x00040004,0x30003,0x00040004,0x40004 + dd 0x00050005,0x60006,0x00060006,0x60006,0x00070007,0x80008,0x00080008,0x80008 + dd 0x00090009,0xa000a,0x000b000b,0xa000a,0x000b000b,0xd000d,0x000d000d,0xd000d + dd 0x000d000d,0xd000d + + +choose_table_H + dw 0x1810, 0x1811, 0x1812, 0x1813, 0x1914, 0x1a14, 0x1b15, 0x1c15 + dw 0x1d16, 0x1e16, 0x1e17, 0x1f17, 0x1f17 + +choose_jump_table_L: + dd table_MMX.L_case_0 - choose_table_MMX + dd table_MMX.L_case_1 - choose_table_MMX + dd table_MMX.L_case_2 - choose_table_MMX + dd table_MMX.L_case_3 - choose_table_MMX + dd table_MMX.L_case_45 - choose_table_MMX + dd table_MMX.L_case_45 - choose_table_MMX + dd table_MMX.L_case_67 - choose_table_MMX + dd table_MMX.L_case_67 - choose_table_MMX + dd table_MMX.L_case_8_15 - choose_table_MMX + dd table_MMX.L_case_8_15 - choose_table_MMX + dd table_MMX.L_case_8_15 - choose_table_MMX + dd table_MMX.L_case_8_15 - choose_table_MMX + dd table_MMX.L_case_8_15 - choose_table_MMX + dd table_MMX.L_case_8_15 - choose_table_MMX + dd table_MMX.L_case_8_15 - choose_table_MMX + dd table_MMX.L_case_8_15 - choose_table_MMX + + segment_code +; +; use MMX +; + +PIC_OFFSETTABLE + + align 16 +; int choose_table(int *ix, int *end, int *s) +choose_table_MMX: + push ebp + call get_pc.bp + add ebp, PIC_BASE() + + mov ecx,[esp+8] ;ecx = begin + mov edx,[esp+12] ;edx = end + sub ecx,edx ;ecx = begin-end(should be minus) + test ecx,8 + pxor mm0,mm0 ;mm0=[0:0] + movq mm1,[edx+ecx] + jz .lp + + add ecx,8 + jz .exit + + align 4 +.lp: + movq mm4,[edx+ecx] + movq mm5,[edx+ecx+8] + add ecx,16 + psubusw mm4,mm0 ; $BK\Ev$O(B dword $B$G$J$$$H$$$1$J$$$N$@$,(B + psubusw mm5,mm1 ; $B$=$s$J%3%^%s%I$O$J$$(B :-p + paddw mm0,mm4 ; $B$,(B, $B$3$3$G07$&CM$NHO0O$O(B 8191+15 $B0J2<$J$N$GLdBj$J$$(B + paddw mm1,mm5 + jnz .lp +.exit: + psubusw mm1,mm0 ; $B$3$l$bK\Ev$O(B dword $B$G$J$$$H$$$1$J$$(B + paddw mm0,mm1 + + movq mm4,mm0 + punpckhdq mm4,mm4 + psubusw mm4,mm0 ; $B$3$l$bK\Ev$O(B dword $B$G$J$$$H$$$1$J$$(B + paddw mm0,mm4 + movd eax,mm0 + + cmp eax,15 + ja .with_ESC + lea ecx,[PIC_EBP_REL(choose_table_MMX)] + add ecx,[PIC_EBP_REL(choose_jump_table_L+eax*4)] + jmp ecx + +.with_ESC1: + emms + mov ecx, [esp+16] ; *s + mov [ecx], eax + or eax,-1 + pop ebp + ret + +.with_ESC: + cmp eax, 8191+15 + ja .with_ESC1 + + sub eax,15 + push ebx + push esi + bsr eax, eax +%assign _P 4*2 + movq mm5, [PIC_EBP_REL(D15_15_15_15)] + movq mm6, [PIC_EBP_REL(D14_14_14_14)] + movq mm3, [PIC_EBP_REL(mul_add)] + + mov ecx, [esp+_P+8] ; = ix +; mov edx, [esp+_P+12] ; = end + sub ecx, edx + + xor esi, esi ; sum = 0 + test ecx, 8 + pxor mm7, mm7 ; linbits_sum, 14$B$r1[$($?$b$N$N?t(B + jz .H_dual_lp1 + + movq mm0, [edx+ecx] + add ecx,8 + packssdw mm0,mm7 + movq mm2, mm0 + paddusw mm0, mm5 ; mm0 = min(ix, 15)+0xfff0 + pcmpgtw mm2, mm6 ; 14$B$h$jBg$-$$$+!)(B + psubw mm7, mm2 ; 14$B$h$jBg$-$$$H$-(B linbits_sum++; + pmaddwd mm0, mm3 ; {0, 0, y, x}*{1, 16, 1, 16} + movd ebx, mm0 + mov esi, [PIC_EBP_REL(largetbl+ebx*4+(16*16+16)*4)] + + jz .H_dual_exit + + align 4 +.H_dual_lp1: + movq mm0, [edx+ecx] + movq mm1, [edx+ecx+8] + packssdw mm0,mm1 + movq mm2, mm0 + paddusw mm0, mm5 ; mm0 = min(ix, 15)+0xfff0 + pcmpgtw mm2, mm6 ; 14$B$h$jBg$-$$$+!)(B + pmaddwd mm0, mm3 ; {y, x, y, x}*{1, 16, 1, 16} + movd ebx, mm0 + punpckhdq mm0,mm0 + add esi, [PIC_EBP_REL(largetbl+ebx*4+(16*16+16)*4)] + movd ebx, mm0 + add esi, [PIC_EBP_REL(largetbl+ebx*4+(16*16+16)*4)] + add ecx, 16 + psubw mm7, mm2 ; 14$B$h$jBg$-$$$H$-(B linbits_sum++; + jnz .H_dual_lp1 + +.H_dual_exit: + pmov mm1,mm7 + punpckhdq mm7,mm7 + paddd mm7,mm1 + punpckldq mm7,mm7 + + pmaddwd mm7, [PIC_EBP_REL(linbits32+eax*8)] ; linbits + mov ax, [PIC_EBP_REL(choose_table_H+eax*2)] + + movd ecx, mm7 + punpckhdq mm7,mm7 + movd edx,mm7 + emms + shl edx, 16 + add ecx, edx + + add ecx, esi + + pop esi + pop ebx + + mov edx, ecx + and ecx, 0xffff ; ecx = sum2 + shr edx, 16 ; edx = sum + + cmp edx, ecx + jle .chooseE_s1 + mov edx, ecx + shr eax, 8 +.chooseE_s1: + mov ecx, [esp+16] ; *s + and eax, 0xff + add [ecx], edx + pop ebp + ret + +table_MMX.L_case_0: + emms + pop ebp + ret + +table_MMX.L_case_1: + emms + mov eax, [esp+16] ; *s + mov ecx, [esp+8] ; *ix + sub ecx, edx + push ebx +.lp: + mov ebx, [edx+ecx] + add ebx, ebx + add ebx, [edx+ecx+4] + movzx ebx, byte [PIC_EBP_REL(ebx+t1l)] + add [eax], ebx + add ecx, 8 + jnz .lp + pop ebx + mov eax, 1 + pop ebp + ret + +table_MMX.L_case_45: + push dword 7 + lea ecx, [PIC_EBP_REL(tableABC+9*8)] + jmp from3 + +table_MMX.L_case_67: + push dword 10 + lea ecx, [PIC_EBP_REL(tableABC)] + jmp from3 + +table_MMX.L_case_8_15: + push dword 13 + lea ecx, [PIC_EBP_REL(tableDEF)] +from3: + mov eax,[esp+12] ;eax = *begin +; mov edx,[esp+16] ;edx = *end + + push ebx + sub eax, edx + + movq mm5,[PIC_EBP_REL(mul_add)] + pxor mm2,mm2 ;mm2 = sum + + test eax, 8 + jz .choose3_lp1 +; odd length + movq mm0,[edx+eax] ;mm0 = ix[0] | ix[1] + add eax,8 + packssdw mm0,mm2 + + pmaddwd mm0,mm5 + movd ebx,mm0 + + movq mm2, [ecx+ebx*8] + + jz .choose3_exit + + align 4 +.choose3_lp1 + movq mm0,[edx+eax] + movq mm1,[edx+eax+8] + add eax,16 + packssdw mm0,mm1 ;mm0 = ix[0]|ix[1]|ix[2]|ix[3] + pmaddwd mm0,mm5 + movd ebx,mm0 + punpckhdq mm0,mm0 + paddd mm2, [ecx+ebx*8] + movd ebx,mm0 + paddd mm2, [ecx+ebx*8] + jnz .choose3_lp1 +.choose3_exit +; xor eax,eax + movd ebx, mm2 + punpckhdq mm2,mm2 + mov ecx, ebx + and ecx, 0xffff ; ecx = sum2 + shr ebx, 16 ; ebx = sum1 + movd edx, mm2 ; edx = sum + + cmp edx, ebx + jle .choose3_s1 + mov edx, ebx + inc eax +.choose3_s1: + emms + pop ebx + cmp edx, ecx + jle .choose3_s2 + mov edx, ecx + mov eax, 2 +.choose3_s2: + pop ecx + add eax, ecx + mov ecx, [esp+16] ; *s + add [ecx], edx + pop ebp + ret + +table_MMX.L_case_2: + push dword 2 + lea ecx,[PIC_EBP_REL(table23)] + pmov mm5,[PIC_EBP_REL(mul_add23)] + jmp from2 +table_MMX.L_case_3: + push dword 5 + lea ecx,[PIC_EBP_REL(table56)] + pmov mm5,[PIC_EBP_REL(mul_add56)] +from2: + mov eax,[esp+12] ;eax = *begin +; mov edx,[esp+16] ;edx = *end + push ebx + push edi + + sub eax, edx + xor edi, edi + test eax, 8 + jz .choose2_lp1 +; odd length + movq mm0,[edx+eax] ;mm0 = ix[0] | ix[1] + pxor mm2,mm2 ;mm2 = sum + packssdw mm0,mm2 + + pmaddwd mm0,mm5 + movd ebx,mm0 + + mov edi, [ecx+ebx*4] + + add eax,8 + jz .choose2_exit + + align 4 +.choose2_lp1 + movq mm0,[edx+eax] + movq mm1,[edx+eax+8] + packssdw mm0,mm1 ;mm0 = ix[0]|ix[1]|ix[2]|ix[3] + pmaddwd mm0,mm5 + movd ebx,mm0 + punpckhdq mm0,mm0 + add edi, [ecx+ebx*4] + movd ebx, mm0 + add edi, [ecx+ebx*4] + add eax,16 + jnc .choose2_lp1 +.choose2_exit + mov ecx, edi + pop edi + pop ebx + pop eax ; table num. + emms + + mov edx, ecx + and ecx, 0xffff ; ecx = sum2 + shr edx, 16 ; edx = sum1 + + cmp edx, ecx + jle .choose2_s1 + mov edx, ecx + inc eax +.choose2_s1: + mov ecx, [esp+16] ; *s + add [ecx], edx + pop ebp + ret + + end diff --git a/node_modules/lame/deps/lame/libmp3lame/i386/cpu_feat.nas b/node_modules/lame/deps/lame/libmp3lame/i386/cpu_feat.nas new file mode 100644 index 0000000..b5b09c1 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/i386/cpu_feat.nas @@ -0,0 +1,107 @@ +; +; +; assembler routines to detect CPU-features +; +; MMX / 3DNow! / SSE / SSE2 +; +; for the LAME project +; Frank Klemm, Robert Hegemann 2000-10-12 +; + +%include "nasm.h" + + globaldef has_MMX_nasm + globaldef has_3DNow_nasm + globaldef has_SSE_nasm + globaldef has_SSE2_nasm + + segment_code + +testCPUID: + pushfd + pop eax + mov ecx,eax + xor eax,0x200000 + push eax + popfd + pushfd + pop eax + cmp eax,ecx + ret + +;--------------------------------------- +; int has_MMX_nasm (void) +;--------------------------------------- + +has_MMX_nasm: + pushad + call testCPUID + jz return0 ; no CPUID command, so no MMX + + mov eax,0x1 + CPUID + test edx,0x800000 + jz return0 ; no MMX support + jmp return1 ; MMX support + +;--------------------------------------- +; int has_SSE_nasm (void) +;--------------------------------------- + +has_SSE_nasm: + pushad + call testCPUID + jz return0 ; no CPUID command, so no SSE + + mov eax,0x1 + CPUID + test edx,0x02000000 + jz return0 ; no SSE support + jmp return1 ; SSE support + +;--------------------------------------- +; int has_SSE2_nasm (void) +;--------------------------------------- + +has_SSE2_nasm: + pushad + call testCPUID + jz return0 ; no CPUID command, so no SSE2 + + mov eax,0x1 + CPUID + test edx,0x04000000 + jz return0 ; no SSE2 support + jmp return1 ; SSE2 support + +;--------------------------------------- +; int has_3DNow_nasm (void) +;--------------------------------------- + +has_3DNow_nasm: + pushad + call testCPUID + jz return0 ; no CPUID command, so no 3DNow! + + mov eax,0x80000000 + CPUID + cmp eax,0x80000000 + jbe return0 ; no extended MSR(1), so no 3DNow! + + mov eax,0x80000001 + CPUID + test edx,0x80000000 + jz return0 ; no 3DNow! support + ; 3DNow! support +return1: + popad + xor eax,eax + inc eax + ret + +return0: + popad + xor eax,eax + ret + + end diff --git a/node_modules/lame/deps/lame/libmp3lame/i386/fft.nas b/node_modules/lame/deps/lame/libmp3lame/i386/fft.nas new file mode 100644 index 0000000..7928b33 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/i386/fft.nas @@ -0,0 +1,267 @@ + +; for new GOGO-no-coda (1999/09) +; Copyright (C) 1999 shigeo +; special thanks to Keiichi SAKAI, URURI +%include "nasm.h" + + globaldef fht_3DN + globaldef fht + externdef costab_fft + externdef sintab_fft + externdef gray_index + + segment_data + align 16 +D_MSB1_0 dd 0 ,0x80000000 +D_SQRT2 dd 1.414213562,1.414213562 +t_s0 dd 0 ;[ t_c:t_s] +t_c0 dd 0 +t_c1 dd 0 ;[-t_s:t_c] +t_s1 dd 0 +D_s1c1 dd 0, 0 +D_Mc1s1 dd 0, 0 +D_s2c2 dd 0, 0 +D_Mc2s2 dd 0, 0 +D_0_1 dd 1.0, 0.0 +S_05 DD 0.5 +S_00005 DD 0.0005 +fht dd 0 ;ؿݥ + + segment_code + +;************************************************************************ + +; by shigeo +; 99/08/16 +; 23000clk ɤä +; 18500clk bit reversal from gogo1 by URURI + +;void fht(float *fz, int n); + align 16 +fht_3DN: + push ebx + push esi + push edi + push ebp +%assign _P 4*4 + ;ޤǽΥ롼... fht()γذư + + mov esi,[esp+_P+4] ;esi=fz + mov ecx,[esp+_P+8] ;ecx=n + + ;ᥤ롼 + movq mm7,[D_MSB1_0] ;mm7=[1<<31:0] + +%assign LOCAL_STACK 16 + sub esp,LOCAL_STACK +%assign _P (_P+LOCAL_STACK) + xor eax,eax + mov [esp],eax ;k=0 +%define k dword [esp] +%define kx dword [esp+4] +%define fn dword [esp+8] + +.lp30: ;k=0; do{ + mov ecx,k + add ecx,2 + mov k,ecx + mov eax,1 + shl eax,cl ;eax=k1 = 1<>1 + mov kx,esi ;¸(ǻȤ) + mov edi,[esp+_P+4] ;edi=fi=fz + lea ebp,[edi+esi*4] ;ebp=gi=fz+kx + mov esi,[esp+_P+8] ;esi=n + lea esi,[edi+esi*4] ;esi=fn=fz+n + movq mm6,[D_SQRT2] ;mm6=[2:2] + +.lp31: ;fn=fz+n; do{ FLOAT g0,f0,f1,... + movd mm0,[edi] ;mm0=[0:fi[ 0]] + movd mm1,[edi+eax*4] ;mm1=[0:fi[k1]] + punpckldq mm0,mm0 ;mm0=[fi_0 :fi_0 ] + punpckldq mm1,mm1 ;mm1=[fi_k1:fi_k1] + movd mm2,[edi+ebx*4] + movd mm3,[edi+ecx*4] + punpckldq mm2,mm2 ;mm2=[fi_k2:fi_k2] + punpckldq mm3,mm3 ;mm3=[fi_k3:fi_k3] + pxor mm1,mm7 ;mm1=[-fi_k1:fi_k1] + pxor mm3,mm7 ;mm3=[-fi_k3:fi_k3] + pfadd mm0,mm1 ;mm0=[f1:f0]=[fi_0 -fi_k1 : fi_0 +fi_k1] + pfadd mm2,mm3 ;mm2=[f3:f2]=[fi_k2-fi_k3 : fi_k2+fi_k3] + movq mm3,mm0 ;mm3=[f1:f0] + pfadd mm0,mm2 ;mm0=[f1+f3:f0+f2] + movd [edi],mm0 ;fi[0]=f0+f2 + psrlq mm0,32 ;mm0=[0:f1+f3] + pfsub mm3,mm2 ;mm3=[f1-f3:f0-f2] + movd [edi+eax*4],mm0 ;fi[k1]=f1+f3 + movd [edi+ebx*4],mm3 ;fi[k2]=f0-f2 + psrlq mm3,32 ;mm3=[0:f1-f3] + movd [edi+ecx*4],mm3 ;fi[k3]=f1-f3 + + movd mm0,[ebp] ;mm0=[0:gi_0] + movd mm1,[ebp+eax*4] ;mm1=[0:gi_k1] + punpckldq mm0,mm0 ;mm0=[gi_0 :gi_0 ] + punpckldq mm1,mm1 ;mm1=[gi_k1:gi_k1] + movd mm2,[ebp+ebx*4] ;mm2=[0:gi_k2] + pxor mm1,mm7 ;mm1=[-gi_k1:gi_k1] + punpckldq mm2,[ebp+ecx*4] ;mm2=[gi_k3:gi_k2] + pfadd mm0,mm1 ;mm0=[g1:g0]=[gi_0 -gi_k1:gi_0 +gi_k1] + pfmul mm2,mm6 ;mm2=[g3:g2]=sqrt2 * [gi_k3:gi_k2] + movq mm1,mm0 ;mm1=[g1:g0] + pfadd mm0,mm2 ;mm0=[g1+g3:g0+g2] + movd [ebp],mm0 ;gi[0]=g0+g2 + psrlq mm0,32 ;mm0=[0:g1+g3] + pfsub mm1,mm2 ;mm1=[g1-g3:g0-g2] + movd [ebp+eax*4],mm0 ;gi[k1]=g1+g3 + movd [ebp+ebx*4],mm1 ;gi[k2]=g0-g2 + psrlq mm1,32 ;mm1=[0:g1-g3] + movd [ebp+ecx*4],mm1 ;gi[k3]=g1-g3 + lea edi,[edi+edx*4] ;fi += k4 + lea ebp,[ebp+edx*4] ;gi += k4 + cmp edi,esi + jc near .lp31 ;}while(fi ɬ +; c2 = c1*c1 - s1*s1 = 1 - (2*s1)*s1; +; s2 = c1*s1 + s1*c1 = 2*s1*c1; + shufps xmm7,xmm7,R4(1,0,0,1) + movss xmm5,xmm7 ; = { --, --, --, s1} + xorps xmm7,[PIC_EBP_REL(Q_MMPP)] ; = {-s1, -c1, +c1, +s1} -> ɬ + + addss xmm5,xmm5 ; = (--, --, --, 2*s1) + add esi,4 ; esi = fi = fz + i + shufps xmm5,xmm5,R4(0,0,0,0) ; = (2*s1, 2*s1, 2*s1, 2*s1) + mulps xmm5,xmm6 ; = (2*s1*c1, 2*s1*s1, 2*s1*s1, 2*s1*c1) + subps xmm5,[PIC_EBP_REL(D_1100)] ; = (--, 2*s1*s1-1, --, 2*s1*c1) = {-- -c2 -- s2} + movaps xmm4,xmm5 + shufps xmm5,xmm5,R4(2,0,2,0) ; = {-c2, s2, -c2, s2} -> ɬ + + xorps xmm4,[PIC_EBP_REL(Q_MMPP)] ; = {--, c2, --, s2} + shufps xmm4,xmm4,R4(0,2,0,2) ; = {s2, c2, s2, c2} -> ɬ + + loopalign 16 +.lp21: ; do{ +; a = c2*fi[k1] + s2*gi[k1]; +; b = s2*fi[k1] - c2*gi[k1]; +; c = c2*fi[k3] + s2*gi[k3]; +; d = s2*fi[k3] - c2*gi[k3]; +; f0 = fi[0 ] + a; +; g0 = gi[0 ] + b; +; f2 = fi[k1 * 2] + c; +; g2 = gi[k1 * 2] + d; +; f1 = fi[0 ] - a; +; g1 = gi[0 ] - b; +; f3 = fi[k1 * 2] - c; +; g3 = gi[k1 * 2] - d; + lea edi,[esi + eax*2 - 8] ; edi = gi = fz +k1-i + + movss xmm0,[esi + eax*2] ; = fi[k1] + movss xmm2,[esi + edx*2] ; = fi[k3] + shufps xmm0,xmm2,0x00 ; = {fi[k3], fi[k3], fi[k1], fi[k1]} + movss xmm1,[edi + eax*2] ; = fi[k1] + movss xmm3,[edi + edx*2] ; = fi[k3] + shufps xmm1,xmm3,0x00 ; = {gi[k3], gi[k3], gi[k1], gi[k1]} + movss xmm2,[esi] ; = fi[0] + mulps xmm0,xmm4 ; *= {+s2, +c2, +s2, +c2} + movss xmm3,[esi + eax*4] ; = fi[k2] + unpcklps xmm2,xmm3 ; = {--, --, fi[k2], fi[0]} + mulps xmm1,xmm5 ; *= {-c2, +s2, -c2, +s2} + movss xmm3,[edi + eax*4] ; = gi[k2] + addps xmm0,xmm1 ; = {d, c, b, a} + movss xmm1,[edi] ; = gi[0] + unpcklps xmm1,xmm3 ; = {--, --, gi[k2], gi[0]} + unpcklps xmm2,xmm1 ; = {gi[k2], fi[k2], gi[0], fi[0]} + movaps xmm1,xmm2 + addps xmm1,xmm0 ; = {g2, f2, g0, f0} + subps xmm2,xmm0 ; = {g3, f3, g1, f1} + +; a = c1*f2 + s1*g3; +; c = s1*g2 + c1*f3; +; b = s1*f2 - c1*g3; +; d = c1*g2 - s1*f3; +; fi[0 ] = f0 + a; +; gi[0 ] = g0 + c; +; gi[k1] = g1 + b; +; fi[k1] = f1 + d; +; fi[k1 * 2] = f0 - a; +; gi[k1 * 2] = g0 - c; +; gi[k3] = g1 - b; +; fi[k3] = f1 - d; + movaps xmm3,xmm1 + movhlps xmm1,xmm1 ; = {g2, f2, g2, f2} + shufps xmm3,xmm2,0x14 ; = {f1, g1, g0, f0} + mulps xmm1,xmm6 ; *= {+c1, +s1, +s1, +c1} + shufps xmm2,xmm2,0xBB ; = {f3, g3, f3, g3} + mulps xmm2,xmm7 ; *= {-s1, -c1, +c1, +s1} + addps xmm1,xmm2 ; = {d, b, c, a} + movaps xmm2,xmm3 + addps xmm3,xmm1 ; = {fi[k1], gi[k1], gi[0], fi[0]} + subps xmm2,xmm1 ; = {fi[k3], gi[k3], gi[k1*2], fi[k1*2]} + movhlps xmm0,xmm3 + movss [esi],xmm3 + shufps xmm3,xmm3,0x55 + movss [edi+eax*2],xmm0 + shufps xmm0,xmm0,0x55 + movss [edi],xmm3 + movss [esi+eax*2],xmm0 + movhlps xmm0,xmm2 + movss [esi+eax*4],xmm2 + shufps xmm2,xmm2,0x55 + movss [edi+edx*2],xmm0 + shufps xmm0,xmm0,0x55 + movss [edi+eax*4],xmm2 + movss [esi+edx*2],xmm0 + lea esi,[esi + eax*8] ; fi += (k1 * 4); + cmp esi,[esp] + jl near .lp21 ; while (fi {c3, s3, s3, c3} + jl near .lp22 +; } +.F22: + shl eax,2 + add ecx, byte 8 + cmp eax,[esp+_P+8] ; while ((k1 * 4) define WIN32 +; Borland or cygwin -> WIN32 and COFF +; for FreeBSD 2.x -> AOUT +; for TownsOS -> __tos__ +; otherwise -> none + +;̾����դ��� + +BITS 32 + +section .note.GNU-stack noalloc noexec nowrite progbits + +%ifdef YASM + %define segment_code segment .text align=16 use32 + %define segment_data segment .data align=16 use32 + %define segment_bss segment .bss align=16 use32 +%elifdef WIN32 + %define segment_code segment .text align=16 class=CODE use32 + %define segment_data segment .data align=16 class=DATA use32 +%ifdef __BORLANDC__ + %define segment_bss segment .data align=16 class=DATA use32 +%else + %define segment_bss segment .bss align=16 class=DATA use32 +%endif +%elifdef AOUT + %define _NAMING + %define segment_code segment .text + %define segment_data segment .data + %define segment_bss segment .bss +%else +%ifidn __OUTPUT_FORMAT__,elf + section .note.GNU-stack progbits noalloc noexec nowrite align=1 +%endif + %define segment_code segment .text align=16 class=CODE use32 + %define segment_data segment .data align=16 class=DATA use32 + %define segment_bss segment .bss align=16 class=DATA use32 +%endif + +%ifdef WIN32 + %define _NAMING +%endif + +%ifdef __tos__ +group CGROUP text +group DGROUP data +%endif + +;ñ�����ư�������� + +%idefine float dword +%idefine fsize 4 +%idefine fsizen(a) (fsize*(a)) + +;��ɷ�� + +%idefine wsize 2 +%idefine wsizen(a) (wsize*(a)) +%idefine dwsize 4 +%idefine dwsizen(a) (dwsize*(a)) + +;REG + +%define r0 eax +%define r1 ebx +%define r2 ecx +%define r3 edx +%define r4 esi +%define r5 edi +%define r6 ebp +%define r7 esp + +;MMX,3DNow!,SSE + +%define pmov movq +%define pmovd movd + +%define pupldq punpckldq +%define puphdq punpckhdq +%define puplwd punpcklwd +%define puphwd punpckhwd + +%define xm0 xmm0 +%define xm1 xmm1 +%define xm2 xmm2 +%define xm3 xmm3 +%define xm4 xmm4 +%define xm5 xmm5 +%define xm6 xmm6 +%define xm7 xmm7 + +;�����åե��Ѥ�4�ʥޥ��� + +%define R4(a,b,c,d) (a*64+b*16+c*4+d) + +;C�饤���ʴʰץޥ��� + +%imacro globaldef 1 + %ifdef _NAMING + %define %1 _%1 + %endif + global %1 +%endmacro + +%imacro externdef 1 + %ifdef _NAMING + %define %1 _%1 + %endif + extern %1 +%endmacro + +%imacro proc 1 + %push proc + %ifdef _NAMING + global _%1 + %else + global %1 + %endif + + align 32 +%1: +_%1: + + %assign %$STACK 0 + %assign %$STACKN 0 + %assign %$ARG 4 +%endmacro + +%imacro endproc 0 + %ifnctx proc + %error expected 'proc' before 'endproc'. + %else + %if %$STACK > 0 + add esp, %$STACK + %endif + + %if %$STACK <> (-%$STACKN) + %error STACKLEVEL mismatch check 'local', 'alloc', 'pushd', 'popd' + %endif + + ret + %pop + %endif +%endmacro + +%idefine sp(a) esp+%$STACK+a + +%imacro arg 1 + %00 equ %$ARG + %assign %$ARG %$ARG+%1 +%endmacro + +%imacro local 1 + %assign %$STACKN %$STACKN-%1 + %00 equ %$STACKN +%endmacro + +%imacro alloc 0 + sub esp, (-%$STACKN)-%$STACK + %assign %$STACK (-%$STACKN) +%endmacro + +%imacro pushd 1-* + %rep %0 + push %1 + %assign %$STACK %$STACK+4 + %rotate 1 + %endrep +%endmacro + +%imacro popd 1-* + %rep %0 + %rotate -1 + pop %1 + %assign %$STACK %$STACK-4 + %endrep +%endmacro + +; bug of NASM-0.98 +%define pushf db 0x66, 0x9C +%define popf db 0x66, 0x9D + +%define ge16(n) ((((n) / 16)*0xFFFFFFFF) & 0xFFFFFFFF) +%define ge15(n) ((((n) / 15)*0xFFFFFFFF) & 0xFFFFFFFF) +%define ge14(n) ((((n) / 14)*0xFFFFFFFF) & 0xFFFFFFFF) +%define ge13(n) ((((n) / 13)*0xFFFFFFFF) & 0xFFFFFFFF) +%define ge12(n) ((((n) / 12)*0xFFFFFFFF) & 0xFFFFFFFF) +%define ge11(n) ((((n) / 11)*0xFFFFFFFF) & 0xFFFFFFFF) +%define ge10(n) ((((n) / 10)*0xFFFFFFFF) & 0xFFFFFFFF) +%define ge9(n) ((((n) / 9)*0xFFFFFFFF) & 0xFFFFFFFF) +%define ge8(n) (ge9(n) | ((((n) / 8)*0xFFFFFFFF) & 0xFFFFFFFF)) +%define ge7(n) (ge9(n) | ((((n) / 7)*0xFFFFFFFF) & 0xFFFFFFFF)) +%define ge6(n) (ge9(n) | ((((n) / 6)*0xFFFFFFFF) & 0xFFFFFFFF)) +%define ge5(n) (ge9(n) | ((((n) / 5)*0xFFFFFFFF) & 0xFFFFFFFF)) +%define ge4(n) (ge5(n) | ((((n) / 4)*0xFFFFFFFF) & 0xFFFFFFFF)) +%define ge3(n) (ge5(n) | ((((n) / 3)*0xFFFFFFFF) & 0xFFFFFFFF)) +%define ge2(n) (ge3(n) | ((((n) / 2)*0xFFFFFFFF) & 0xFFFFFFFF)) +%define ge1(n) (ge2(n) | ((((n) / 1)*0xFFFFFFFF) & 0xFFFFFFFF)) + +; macro to align for begining of loop +; %1 does not align if it LE bytes to next alignment +; 4..16 +; default is 12 + +%imacro loopalignK6 0-1 12 +%%here: + times (($$-%%here) & 15 & ge1(($$-%%here) & 15) & ~ge4(($$-%%here) & 15)) nop + times (1 & ge4(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) jmp short %%skip + times (((($$-%%here) & 15)-2) & ge4(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) nop +%%skip: +%endmacro + +%imacro loopalignK7 0-1 12 +%%here: + times (1 & ge1(($$-%%here) & 15) & ~ge2(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) nop + times (1 & ge2(($$-%%here) & 15) & ~ge3(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 08Bh,0C0h + times (1 & ge3(($$-%%here) & 15) & ~ge4(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 08Dh,004h,020h + times (1 & ge4(($$-%%here) & 15) & ~ge5(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 08Dh,044h,020h,000h + times (1 & ge5(($$-%%here) & 15) & ~ge6(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 08Dh,044h,020h,000h,090h + times (1 & ge6(($$-%%here) & 15) & ~ge7(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 08Dh,080h,0,0,0,0 + times (1 & ge7(($$-%%here) & 15) & ~ge8(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 08Dh,004h,005h,0,0,0,0 + times (1 & ge8(($$-%%here) & 15) & ~ge9(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 08Dh,004h,005h,0,0,0,0,90h + times (1 & ge9(($$-%%here) & 15) & ~ge10(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 0EBh,007h,90h,90h,90h,90h,90h,90h,90h + times (1 & ge10(($$-%%here) & 15) & ~ge11(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 0EBh,008h,90h,90h,90h,90h,90h,90h,90h,90h + times (1 & ge11(($$-%%here) & 15) & ~ge12(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 0EBh,009h,90h,90h,90h,90h,90h,90h,90h,90h,90h + times (1 & ge12(($$-%%here) & 15) & ~ge13(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 0EBh,00Ah,90h,90h,90h,90h,90h,90h,90h,90h,90h,90h + times (1 & ge13(($$-%%here) & 15) & ~ge14(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 0EBh,00Bh,90h,90h,90h,90h,90h,90h,90h,90h,90h,90h,90h + times (1 & ge14(($$-%%here) & 15) & ~ge15(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 0EBh,00Ch,90h,90h,90h,90h,90h,90h,90h,90h,90h,90h,90h,90h + times (1 & ge15(($$-%%here) & 15) & ~ge16(($$-%%here) & 15) & ~ge%1(($$-%%here) & 15)) DB 0EBh,00Dh,90h,90h,90h,90h,90h,90h,90h,90h,90h,90h,90h,90h,90h +%%skip: +%endmacro + +%imacro loopalign 0-1 12 + loopalignK7 %1 +%endmacro +%define PACK(x,y,z,w) (x*64+y*16+z*4+w) + +%ifidn __OUTPUT_FORMAT__,elf + +%idefine PIC_BASE(A) _GLOBAL_OFFSET_TABLE_ + $$ - $ wrt ..gotpc +%idefine PIC_EBP_REL(A) ebp + A wrt ..gotoff +%macro PIC_OFFSETTABLE 0 +extern _GLOBAL_OFFSET_TABLE_ +get_pc.bp: + mov ebp, [esp] + retn +%endmacro + +%else + +%define PIC_BASE(A) (0) +%define PIC_EBP_REL(A) (A) +%macro PIC_OFFSETTABLE 0 +get_pc.bp: + mov ebp, [esp] + retn +%endmacro + +%endif diff --git a/node_modules/lame/deps/lame/libmp3lame/i386/scalar.nas b/node_modules/lame/deps/lame/libmp3lame/i386/scalar.nas new file mode 100644 index 0000000..6d69f42 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/i386/scalar.nas @@ -0,0 +1,1022 @@ +; +; (C) Frank Klemm 1995,99,2000 +; Dedicated to the LAME project +; +; + %include "nasm.h" + + segment_code + +; float_t scalar04_float32_i387 ( +; const float32_t* const p, +; const float32_t* const q ); + +proc scalar04_float32_i387 +%$p arg 4 +%$q arg 4 +;;; alloc + + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + fld dword [eax] + fmul dword [edx] + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + fld dword [eax + 8] + fmul dword [edx + 8] + faddp st1,st0 + fld dword [eax + 12] + fmul dword [edx + 12] + faddp st1,st0 +endproc + + +proc scalar08_float32_i387 +%$p arg 4 +%$q arg 4 +;;; alloc + + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + fld dword [eax] + fmul dword [edx] + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + fld dword [eax + 8] + fmul dword [edx + 8] + faddp st1,st0 + fld dword [eax + 12] + fmul dword [edx + 12] + faddp st1,st0 + fld dword [eax + 16] + fmul dword [edx + 16] + faddp st1,st0 + fld dword [eax + 20] + fmul dword [edx + 20] + faddp st1,st0 + fld dword [eax + 24] + fmul dword [edx + 24] + faddp st1,st0 + fld dword [eax + 28] + fmul dword [edx + 28] + faddp st1,st0 +endproc + + +proc scalar12_float32_i387 +%$p arg 4 +%$q arg 4 +;;; alloc + + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + fld dword [eax] + fmul dword [edx] + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + fld dword [eax + 8] + fmul dword [edx + 8] + faddp st1,st0 + fld dword [eax + 12] + fmul dword [edx + 12] + faddp st1,st0 + fld dword [eax + 16] + fmul dword [edx + 16] + faddp st1,st0 + fld dword [eax + 20] + fmul dword [edx + 20] + faddp st1,st0 + fld dword [eax + 24] + fmul dword [edx + 24] + faddp st1,st0 + fld dword [eax + 28] + fmul dword [edx + 28] + faddp st1,st0 + fld dword [eax + 32] + fmul dword [edx + 32] + faddp st1,st0 + fld dword [eax + 36] + fmul dword [edx + 36] + faddp st1,st0 + fld dword [eax + 40] + fmul dword [edx + 40] + faddp st1,st0 + fld dword [eax + 44] + fmul dword [edx + 44] + faddp st1,st0 +endproc + + +proc scalar16_float32_i387 +%$p arg 4 +%$q arg 4 +;;; alloc + + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + fld dword [eax] + fmul dword [edx] + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + fld dword [eax + 8] + fmul dword [edx + 8] + faddp st1,st0 + fld dword [eax + 12] + fmul dword [edx + 12] + faddp st1,st0 + fld dword [eax + 16] + fmul dword [edx + 16] + faddp st1,st0 + fld dword [eax + 20] + fmul dword [edx + 20] + faddp st1,st0 + fld dword [eax + 24] + fmul dword [edx + 24] + faddp st1,st0 + fld dword [eax + 28] + fmul dword [edx + 28] + faddp st1,st0 + fld dword [eax + 32] + fmul dword [edx + 32] + faddp st1,st0 + fld dword [eax + 36] + fmul dword [edx + 36] + faddp st1,st0 + fld dword [eax + 40] + fmul dword [edx + 40] + faddp st1,st0 + fld dword [eax + 44] + fmul dword [edx + 44] + faddp st1,st0 + fld dword [eax + 48] + fmul dword [edx + 48] + faddp st1,st0 + fld dword [eax + 52] + fmul dword [edx + 52] + faddp st1,st0 + fld dword [eax + 56] + fmul dword [edx + 56] + faddp st1,st0 + fld dword [eax + 60] + fmul dword [edx + 60] + faddp st1,st0 +endproc + + +proc scalar20_float32_i387 +%$p arg 4 +%$q arg 4 +;;; alloc + + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + fld dword [eax] + fmul dword [edx] + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + fld dword [eax + 8] + fmul dword [edx + 8] + faddp st1,st0 + fld dword [eax + 12] + fmul dword [edx + 12] + faddp st1,st0 + fld dword [eax + 16] + fmul dword [edx + 16] + faddp st1,st0 + fld dword [eax + 20] + fmul dword [edx + 20] + faddp st1,st0 + fld dword [eax + 24] + fmul dword [edx + 24] + faddp st1,st0 + fld dword [eax + 28] + fmul dword [edx + 28] + faddp st1,st0 + fld dword [eax + 32] + fmul dword [edx + 32] + faddp st1,st0 + fld dword [eax + 36] + fmul dword [edx + 36] + faddp st1,st0 + fld dword [eax + 40] + fmul dword [edx + 40] + faddp st1,st0 + fld dword [eax + 44] + fmul dword [edx + 44] + faddp st1,st0 + fld dword [eax + 48] + fmul dword [edx + 48] + faddp st1,st0 + fld dword [eax + 52] + fmul dword [edx + 52] + faddp st1,st0 + fld dword [eax + 56] + fmul dword [edx + 56] + faddp st1,st0 + fld dword [eax + 60] + fmul dword [edx + 60] + faddp st1,st0 + fld dword [eax + 64] + fmul dword [edx + 64] + faddp st1,st0 + fld dword [eax + 68] + fmul dword [edx + 68] + faddp st1,st0 + fld dword [eax + 72] + fmul dword [edx + 72] + faddp st1,st0 + fld dword [eax + 76] + fmul dword [edx + 76] + faddp st1,st0 +endproc + + +proc scalar24_float32_i387 +%$p arg 4 +%$q arg 4 +;;; alloc + + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + fld dword [eax] + fmul dword [edx] + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + fld dword [eax + 8] + fmul dword [edx + 8] + faddp st1,st0 + fld dword [eax + 12] + fmul dword [edx + 12] + faddp st1,st0 + fld dword [eax + 16] + fmul dword [edx + 16] + faddp st1,st0 + fld dword [eax + 20] + fmul dword [edx + 20] + faddp st1,st0 + fld dword [eax + 24] + fmul dword [edx + 24] + faddp st1,st0 + fld dword [eax + 28] + fmul dword [edx + 28] + faddp st1,st0 + fld dword [eax + 32] + fmul dword [edx + 32] + faddp st1,st0 + fld dword [eax + 36] + fmul dword [edx + 36] + faddp st1,st0 + fld dword [eax + 40] + fmul dword [edx + 40] + faddp st1,st0 + fld dword [eax + 44] + fmul dword [edx + 44] + faddp st1,st0 + fld dword [eax + 48] + fmul dword [edx + 48] + faddp st1,st0 + fld dword [eax + 52] + fmul dword [edx + 52] + faddp st1,st0 + fld dword [eax + 56] + fmul dword [edx + 56] + faddp st1,st0 + fld dword [eax + 60] + fmul dword [edx + 60] + faddp st1,st0 + fld dword [eax + 64] + fmul dword [edx + 64] + faddp st1,st0 + fld dword [eax + 68] + fmul dword [edx + 68] + faddp st1,st0 + fld dword [eax + 72] + fmul dword [edx + 72] + faddp st1,st0 + fld dword [eax + 76] + fmul dword [edx + 76] + faddp st1,st0 + fld dword [eax + 80] + fmul dword [edx + 80] + faddp st1,st0 + fld dword [eax + 84] + fmul dword [edx + 84] + faddp st1,st0 + fld dword [eax + 88] + fmul dword [edx + 88] + faddp st1,st0 + fld dword [eax + 92] + fmul dword [edx + 92] + faddp st1,st0 +endproc + + +proc scalar32_float32_i387 +%$p arg 4 +%$q arg 4 +;;; alloc + + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + fld dword [eax] + fmul dword [edx] + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + fld dword [eax + 8] + fmul dword [edx + 8] + faddp st1,st0 + fld dword [eax + 12] + fmul dword [edx + 12] + faddp st1,st0 + fld dword [eax + 16] + fmul dword [edx + 16] + faddp st1,st0 + fld dword [eax + 20] + fmul dword [edx + 20] + faddp st1,st0 + fld dword [eax + 24] + fmul dword [edx + 24] + faddp st1,st0 + fld dword [eax + 28] + fmul dword [edx + 28] + faddp st1,st0 + fld dword [eax + 32] + fmul dword [edx + 32] + faddp st1,st0 + fld dword [eax + 36] + fmul dword [edx + 36] + faddp st1,st0 + fld dword [eax + 40] + fmul dword [edx + 40] + faddp st1,st0 + fld dword [eax + 44] + fmul dword [edx + 44] + faddp st1,st0 + fld dword [eax + 48] + fmul dword [edx + 48] + faddp st1,st0 + fld dword [eax + 52] + fmul dword [edx + 52] + faddp st1,st0 + fld dword [eax + 56] + fmul dword [edx + 56] + faddp st1,st0 + fld dword [eax + 60] + fmul dword [edx + 60] + faddp st1,st0 + fld dword [eax + 64] + fmul dword [edx + 64] + faddp st1,st0 + fld dword [eax + 68] + fmul dword [edx + 68] + faddp st1,st0 + fld dword [eax + 72] + fmul dword [edx + 72] + faddp st1,st0 + fld dword [eax + 76] + fmul dword [edx + 76] + faddp st1,st0 + fld dword [eax + 80] + fmul dword [edx + 80] + faddp st1,st0 + fld dword [eax + 84] + fmul dword [edx + 84] + faddp st1,st0 + fld dword [eax + 88] + fmul dword [edx + 88] + faddp st1,st0 + fld dword [eax + 92] + fmul dword [edx + 92] + faddp st1,st0 + fld dword [eax + 96] + fmul dword [edx + 96] + faddp st1,st0 + fld dword [eax +100] + fmul dword [edx +100] + faddp st1,st0 + fld dword [eax +104] + fmul dword [edx +104] + faddp st1,st0 + fld dword [eax +108] + fmul dword [edx +108] + faddp st1,st0 + fld dword [eax +112] + fmul dword [edx +112] + faddp st1,st0 + fld dword [eax +116] + fmul dword [edx +116] + faddp st1,st0 + fld dword [eax +120] + fmul dword [edx +120] + faddp st1,st0 + fld dword [eax +124] + fmul dword [edx +124] + faddp st1,st0 +endproc + + +; float_t scalar4n_float32_i387 ( +; const float32_t* const p, +; const float32_t* const q, +; const size_t len ); + +proc scalar4n_float32_i387 +%$p arg 4 +%$q arg 4 +%$len arg 4 +;;; alloc + + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + mov ecx,[sp(%$len)] + fld dword [eax] + fmul dword [edx] + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + fld dword [eax + 8] + fmul dword [edx + 8] + faddp st1,st0 + fld dword [eax + 12] + fmul dword [edx + 12] + faddp st1,st0 + dec ecx + jz .ret1 + add eax,byte 16 + add edx,byte 16 +.lbl1 + fld dword [eax] + fmul dword [edx] + faddp st1,st0 + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + fld dword [eax + 8] + fmul dword [edx + 8] + faddp st1,st0 + fld dword [eax + 12] + fmul dword [edx + 12] + faddp st1,st0 + add eax,byte 16 + add edx,byte 16 + dec ecx + jnz .lbl1 +.ret1 +endproc + + +; float_t scalar1n_float32_i387 ( +; const float32_t* const p, +; const float32_t* const q, +; const size_t len ); + +proc scalar1n_float32_i387 +%$p arg 4 +%$q arg 4 +%$len arg 4 +;;; alloc + + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + mov ecx,[sp(%$len)] + fld0 + shr ecx,1 + jnc .lbl2 + fld dword [eax] + fmul dword [edx] + faddp st1,st0 + add eax,byte 4 + add edx,byte 4 +.lbl2 + shr ecx,1 + jnc .lbl3 + fld dword [eax] + fmul dword [edx] + faddp st1,st0 + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + add eax,byte 8 + add edx,byte 8 + and ecx,ecx +.lbl3 + jz .ret2 +.lbl4 + fld dword [eax] + fmul dword [edx] + faddp st1,st0 + fld dword [eax + 4] + fmul dword [edx + 4] + faddp st1,st0 + fld dword [eax + 8] + fmul dword [edx + 8] + faddp st1,st0 + fld dword [eax + 12] + fmul dword [edx + 12] + faddp st1,st0 + add eax,byte 16 + add edx,byte 16 + dec ecx + jnz .lbl4 +.ret2 +endproc + + +proc scalar04_float32_3DNow +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + pmov mm0,qword [eax] + pmov mm1,qword [eax+8] + pfmul mm0,qword [edx] + pfmul mm1,qword [edx+8] + + pfadd mm0,mm1 + pmov qword [sp(%$p)],mm0 + femms + fld dword [sp(%$p)] + fadd dword [sp(%$p)+4] +endproc + + +proc scalar08_float32_3DNow +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + pmov mm0,qword [eax] + pmov mm1,qword [eax+8] + pfmul mm0,qword [edx] + pfmul mm1,qword [edx+8] + + pmov mm2,qword [eax+16] + pmov mm3,qword [eax+24] + pfmul mm2,qword [edx+16] + pfmul mm3,qword [edx+24] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pfadd mm0,mm1 + pmov qword [sp(%$p)],mm0 + femms + fld dword [sp(%$p)] + fadd dword [sp(%$p)+4] +endproc + + +proc scalar12_float32_3DNow +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + pmov mm0,qword [eax] + pmov mm1,qword [eax+8] + pfmul mm0,qword [edx] + pfmul mm1,qword [edx+8] + + pmov mm2,qword [eax+16] + pmov mm3,qword [eax+24] + pfmul mm2,qword [edx+16] + pfmul mm3,qword [edx+24] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+32] + pmov mm3,qword [eax+40] + pfmul mm2,qword [edx+32] + pfmul mm3,qword [edx+40] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pfadd mm0,mm1 + pmov qword [sp(%$p)],mm0 + femms + fld dword [sp(%$p)] + fadd dword [sp(%$p)+4] +endproc + + +proc scalar16_float32_3DNow +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + pmov mm0,qword [eax] + pmov mm1,qword [eax+8] + pfmul mm0,qword [edx] + pfmul mm1,qword [edx+8] + + pmov mm2,qword [eax+16] + pmov mm3,qword [eax+24] + pfmul mm2,qword [edx+16] + pfmul mm3,qword [edx+24] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+32] + pmov mm3,qword [eax+40] + pfmul mm2,qword [edx+32] + pfmul mm3,qword [edx+40] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+48] + pmov mm3,qword [eax+56] + pfmul mm2,qword [edx+48] + pfmul mm3,qword [edx+56] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pfadd mm0,mm1 + pmov qword [sp(%$p)],mm0 + femms + fld dword [sp(%$p)] + fadd dword [sp(%$p)+4] +endproc + + +proc scalar20_float32_3DNow +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + pmov mm0,qword [eax] + pmov mm1,qword [eax+8] + pfmul mm0,qword [edx] + pfmul mm1,qword [edx+8] + + pmov mm2,qword [eax+16] + pmov mm3,qword [eax+24] + pfmul mm2,qword [edx+16] + pfmul mm3,qword [edx+24] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+32] + pmov mm3,qword [eax+40] + pfmul mm2,qword [edx+32] + pfmul mm3,qword [edx+40] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+48] + pmov mm3,qword [eax+56] + pfmul mm2,qword [edx+48] + pfmul mm3,qword [edx+56] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+64] + pmov mm3,qword [eax+72] + pfmul mm2,qword [edx+64] + pfmul mm3,qword [edx+72] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pfadd mm0,mm1 + pmov qword [sp(%$p)],mm0 + femms + fld dword [sp(%$p)] + fadd dword [sp(%$p)+4] +endproc + + +proc scalar24_float32_3DNow +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + pmov mm0,qword [eax] + pmov mm1,qword [eax+8] + pfmul mm0,qword [edx] + pfmul mm1,qword [edx+8] + + pmov mm2,qword [eax+16] + pmov mm3,qword [eax+24] + pfmul mm2,qword [edx+16] + pfmul mm3,qword [edx+24] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+32] + pmov mm3,qword [eax+40] + pfmul mm2,qword [edx+32] + pfmul mm3,qword [edx+40] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+48] + pmov mm3,qword [eax+56] + pfmul mm2,qword [edx+48] + pfmul mm3,qword [edx+56] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+64] + pmov mm3,qword [eax+72] + pfmul mm2,qword [edx+64] + pfmul mm3,qword [edx+72] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+80] + pmov mm3,qword [eax+88] + pfmul mm2,qword [edx+80] + pfmul mm3,qword [edx+88] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pfadd mm0,mm1 + pmov qword [sp(%$p)],mm0 + femms + fld dword [sp(%$p)] + fadd dword [sp(%$p)+4] +endproc + +proc scalar32_float32_3DNow +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + pmov mm0,qword [eax] + pmov mm1,qword [eax+8] + pfmul mm0,qword [edx] + pfmul mm1,qword [edx+8] + + pmov mm2,qword [eax+16] + pmov mm3,qword [eax+24] + pfmul mm2,qword [edx+16] + pfmul mm3,qword [edx+24] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+32] + pmov mm3,qword [eax+40] + pfmul mm2,qword [edx+32] + pfmul mm3,qword [edx+40] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+48] + pmov mm3,qword [eax+56] + pfmul mm2,qword [edx+48] + pfmul mm3,qword [edx+56] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+64] + pmov mm3,qword [eax+72] + pfmul mm2,qword [edx+64] + pfmul mm3,qword [edx+72] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+80] + pmov mm3,qword [eax+88] + pfmul mm2,qword [edx+80] + pfmul mm3,qword [edx+88] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+96] + pmov mm3,qword [eax+104] + pfmul mm2,qword [edx+96] + pfmul mm3,qword [edx+104] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pmov mm2,qword [eax+112] + pmov mm3,qword [eax+120] + pfmul mm2,qword [edx+112] + pfmul mm3,qword [edx+120] + pfadd mm0,mm2 + pfadd mm1,mm3 + + pfadd mm0,mm1 + pmov qword [sp(%$p)],mm0 + femms + fld dword [sp(%$p)] + fadd dword [sp(%$p)+4] +endproc + + +proc scalar4n_float32_3DNow +%$p arg 4 +%$q arg 4 +%$len arg 4 + + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + mov ecx,[sp(%$len)] + + pmov mm0,qword [eax] + pmov mm1,qword [eax+8] + pfmul mm0,qword [edx] + pfmul mm1,qword [edx+8] + dec ecx + jz .ret4 + + add eax,byte 16 + add edx,byte 16 +.lbl4: + pmov mm2,qword [eax] + pmov mm3,qword [eax+8] + pfmul mm2,qword [edx] + pfmul mm3,qword [edx+8] + add eax,byte 16 + add edx,byte 16 + pfadd mm0,mm2 + pfadd mm1,mm3 + dec ecx + jnz .lbl4 + +.ret4: pfadd mm0,mm1 + pmov qword [sp(%$p)],mm0 + femms + fld dword [sp(%$p)] + fadd dword [sp(%$p)+4] +endproc + + +proc scalar1n_float32_3DNow + jmp scalar24_float32_i387 +endproc + + +proc scalar04_float32_SIMD + jmp scalar04_float32_i387 +endproc + + +proc scalar08_float32_SIMD +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + movups xmm0, [eax] + movups xmm1, [eax+16] + mulps xmm0, [edx] + mulps xmm1, [edx+16] + + addps xmm0,xmm1 + sub esp,16 + movups [esp],xmm0 + fld dword [esp+ 0] + fadd dword [esp+ 4] + fadd dword [esp+ 8] + fadd dword [esp+12] + add esp,16 +endproc + + +proc scalar12_float32_SIMD + jmp scalar12_float32_i387 +endproc + + +proc scalar16_float32_SIMD +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + movups xmm0, [eax] + movups xmm1, [eax+16] + mulps xmm0, [edx] + mulps xmm1, [edx+16] + + movups xmm2, [eax+32] + movups xmm3, [eax+48] + mulps xmm2, [edx+32] + mulps xmm3, [edx+48] + addps xmm0,xmm2 + addps xmm1,xmm3 + + addps xmm0,xmm1 + sub esp,16 + movups [esp],xmm0 + fld dword [esp+ 0] + fadd dword [esp+ 4] + fadd dword [esp+ 8] + fadd dword [esp+12] + add esp,16 +endproc + + +proc scalar20_float32_SIMD + jmp scalar20_float32_i387 +endproc + + +proc scalar24_float32_SIMD +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + movups xmm0, [eax] + movups xmm1, [eax+16] + mulps xmm0, [edx] + mulps xmm1, [edx+16] + + movups xmm2, [eax+32] + movups xmm3, [eax+48] + mulps xmm2, [edx+32] + mulps xmm3, [edx+48] + addps xmm0,xmm2 + addps xmm1,xmm3 + + movups xmm2, [eax+64] + movups xmm3, [eax+80] + mulps xmm2, [edx+64] + mulps xmm3, [edx+80] + addps xmm0,xmm2 + addps xmm1,xmm3 + + addps xmm0,xmm1 + sub esp,16 + movups [esp],xmm0 + fld dword [esp+ 0] + fadd dword [esp+ 4] + fadd dword [esp+ 8] + fadd dword [esp+12] + add esp,16 +endproc + + +proc scalar32_float32_SIMD +%$p arg 4 +%$q arg 4 + mov eax,[sp(%$p)] + mov edx,[sp(%$q)] + + movups xmm0, [eax] + movups xmm1, [eax+16] + mulps xmm0, [edx] + mulps xmm1, [edx+16] + + movups xmm2, [eax+32] + movups xmm3, [eax+48] + mulps xmm2, [edx+32] + mulps xmm3, [edx+48] + addps xmm0,xmm2 + addps xmm1,xmm3 + + movups xmm2, [eax+64] + movups xmm3, [eax+80] + mulps xmm2, [edx+64] + mulps xmm3, [edx+80] + addps xmm0,xmm2 + addps xmm1,xmm3 + + movups xmm2, [eax+96] + movups xmm3, [eax+112] + mulps xmm2, [edx+96] + mulps xmm3, [edx+112] + addps xmm0,xmm2 + addps xmm1,xmm3 + + addps xmm0,xmm1 + + ;sub esp,16 + ;movups [esp],xmm0 + ;fld dword [esp+ 0] + ;fadd dword [esp+ 4] + ;fadd dword [esp+ 8] + ;fadd dword [esp+12] + ;add esp,16 + + movhlps xmm1,xmm0 + addps xmm0,xmm1 + movlps [sp(%$p)],xmm0 + fld dword [sp(%$p)] + fadd dword [sp(%$p)+4] +endproc + + +proc scalar4n_float32_SIMD + jmp scalar4n_float32_i387 +endproc + + +proc scalar1n_float32_SIMD + jmp scalar1n_float32_i387 +endproc + +; end of scalar.nas diff --git a/node_modules/lame/deps/lame/libmp3lame/id3tag.c b/node_modules/lame/deps/lame/libmp3lame/id3tag.c new file mode 100644 index 0000000..887f8ea --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/id3tag.c @@ -0,0 +1,1829 @@ +/* + * id3tag.c -- Write ID3 version 1 and 2 tags. + * + * Copyright (C) 2000 Don Melton + * Copyright (C) 2011-2012 Robert Hegemann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +/* + * HISTORY: This source file is part of LAME (see http://www.mp3dev.org) + * and was originally adapted by Conrad Sanderson + * from mp3info by Ricardo Cerqueira to write only ID3 version 1 + * tags. Don Melton COMPLETELY rewrote it to support version + * 2 tags and be more conformant to other standards while remaining flexible. + * + * NOTE: See http://id3.org/ for more information about ID3 tag formats. + */ + +/* $Id: id3tag.c,v 1.75.2.2 2012/01/08 23:49:58 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef STDC_HEADERS +# include +# include +# include +# include +#else +# ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex +# endif +char *strchr(), *strrchr(); +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "id3tag.h" +#include "lame_global_flags.h" +#include "util.h" +#include "bitstream.h" + +#define lame_calloc(TYPE, COUNT) ((TYPE*)calloc(COUNT, sizeof(TYPE))) + +static const char *const genre_names[] = { + /* + * NOTE: The spelling of these genre names is identical to those found in + * Winamp and mp3info. + */ + "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", + "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B", + "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska", + "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", + "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical", "Instrumental", + "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise", "Alternative Rock", + "Bass", "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", + "Instrumental Rock", "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", + "Electronic", "Pop-Folk", "Eurodance", "Dream", "Southern Rock", "Comedy", + "Cult", "Gangsta", "Top 40", "Christian Rap", "Pop/Funk", "Jungle", + "Native US", "Cabaret", "New Wave", "Psychedelic", "Rave", + "Showtunes", "Trailer", "Lo-Fi", "Tribal", "Acid Punk", "Acid Jazz", + "Polka", "Retro", "Musical", "Rock & Roll", "Hard Rock", "Folk", + "Folk-Rock", "National Folk", "Swing", "Fast Fusion", "Bebob", "Latin", + "Revival", "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", + "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", + "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", + "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", + "Primus", "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", + "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", + "Punk Rock", "Drum Solo", "A Cappella", "Euro-House", "Dance Hall", + "Goa", "Drum & Bass", "Club-House", "Hardcore", "Terror", "Indie", + "BritPop", "Negerpunk", "Polsk Punk", "Beat", "Christian Gangsta", + "Heavy Metal", "Black Metal", "Crossover", "Contemporary Christian", + "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop", + "SynthPop" +}; + +#define GENRE_NAME_COUNT \ + ((int)(sizeof genre_names / sizeof (const char *const))) + +static const int genre_alpha_map[] = { + 123, 34, 74, 73, 99, 20, 40, 26, 145, 90, 116, 41, 135, 85, 96, 138, 89, 0, + 107, 132, 65, 88, 104, 102, 97, 136, 61, 141, 32, 1, 112, 128, 57, 140, 2, + 139, 58, 3, 125, 50, 22, 4, 55, 127, 122, 120, 98, 52, 48, 54, 124, 25, 84, + 80, 115, 81, 119, 5, 30, 36, 59, 126, 38, 49, 91, 6, 129, 79, 137, 7, 35, + 100, 131, 19, 33, 46, 47, 8, 29, 146, 63, 86, 71, 45, 142, 9, 77, 82, 64, + 133, 10, 66, 39, 11, 103, 12, 75, 134, 13, 53, 62, 109, 117, 23, 108, 92, + 67, 93, 43, 121, 15, 68, 14, 16, 76, 87, 118, 17, 78, 143, 114, 110, 69, 21, + 111, 95, 105, 42, 37, 24, 56, 44, 101, 83, 94, 106, 147, 113, 18, 51, 130, + 144, 60, 70, 31, 72, 27, 28 +}; + +#define GENRE_ALPHA_COUNT ((int)(sizeof genre_alpha_map / sizeof (int))) + +#define GENRE_INDEX_OTHER 12 + + +#define FRAME_ID(a, b, c, d) \ + ( ((unsigned long)(a) << 24) \ + | ((unsigned long)(b) << 16) \ + | ((unsigned long)(c) << 8) \ + | ((unsigned long)(d) << 0) ) + +typedef enum UsualStringIDs { ID_TITLE = FRAME_ID('T', 'I', 'T', '2') + , ID_ARTIST = FRAME_ID('T', 'P', 'E', '1') + , ID_ALBUM = FRAME_ID('T', 'A', 'L', 'B') + , ID_GENRE = FRAME_ID('T', 'C', 'O', 'N') + , ID_ENCODER = FRAME_ID('T', 'S', 'S', 'E') + , ID_PLAYLENGTH = FRAME_ID('T', 'L', 'E', 'N') + , ID_COMMENT = FRAME_ID('C', 'O', 'M', 'M') /* full text string */ +} UsualStringIDs; + +typedef enum NumericStringIDs { ID_DATE = FRAME_ID('T', 'D', 'A', 'T') /* "ddMM" */ + , ID_TIME = FRAME_ID('T', 'I', 'M', 'E') /* "hhmm" */ + , ID_TPOS = FRAME_ID('T', 'P', 'O', 'S') /* '0'-'9' and '/' allowed */ + , ID_TRACK = FRAME_ID('T', 'R', 'C', 'K') /* '0'-'9' and '/' allowed */ + , ID_YEAR = FRAME_ID('T', 'Y', 'E', 'R') /* "yyyy" */ +} NumericStringIDs; + +typedef enum MiscIDs { ID_TXXX = FRAME_ID('T', 'X', 'X', 'X') + , ID_WXXX = FRAME_ID('W', 'X', 'X', 'X') + , ID_SYLT = FRAME_ID('S', 'Y', 'L', 'T') + , ID_APIC = FRAME_ID('A', 'P', 'I', 'C') + , ID_GEOB = FRAME_ID('G', 'E', 'O', 'B') + , ID_PCNT = FRAME_ID('P', 'C', 'N', 'T') + , ID_AENC = FRAME_ID('A', 'E', 'N', 'C') + , ID_LINK = FRAME_ID('L', 'I', 'N', 'K') + , ID_ENCR = FRAME_ID('E', 'N', 'C', 'R') + , ID_GRID = FRAME_ID('G', 'R', 'I', 'D') + , ID_PRIV = FRAME_ID('P', 'R', 'I', 'V') + , ID_VSLT = FRAME_ID('V', 'S', 'L', 'T') /* full text string */ + , ID_USER = FRAME_ID('U', 'S', 'E', 'R') /* full text string */ + , ID_PCST = FRAME_ID('P', 'C', 'S', 'T') /* iTunes Podcast indicator, only presence important */ + , ID_WFED = FRAME_ID('W', 'F', 'E', 'D') /* iTunes Podcast URL as TEXT FRAME !!! violates standard */ +} MiscIDs; + + +static int +frame_id_matches(int id, int mask) +{ + int result = 0, i, window = 0xff; + for (i = 0; i < 4; ++i, window <<= 8) { + int const mw = (mask & window); + int const iw = (id & window); + if (mw != 0 && mw != iw) { + result |= iw; + } + } + return result; +} + +static int +isFrameIdMatching(int id, int mask) +{ + return frame_id_matches(id, mask) == 0 ? 1 : 0; +} + +static int +test_tag_spec_flags(lame_internal_flags const *gfc, unsigned int tst) +{ + return (gfc->tag_spec.flags & tst) != 0u ? 1 : 0; +} + +#if 0 +static void +debug_tag_spec_flags(lame_internal_flags * gfc, const char* info) +{ + MSGF(gfc, "%s\n", info); + MSGF(gfc, "CHANGED_FLAG : %d\n", test_tag_spec_flags(gfc, CHANGED_FLAG )); + MSGF(gfc, "ADD_V2_FLAG : %d\n", test_tag_spec_flags(gfc, ADD_V2_FLAG )); + MSGF(gfc, "V1_ONLY_FLAG : %d\n", test_tag_spec_flags(gfc, V1_ONLY_FLAG )); + MSGF(gfc, "V2_ONLY_FLAG : %d\n", test_tag_spec_flags(gfc, V2_ONLY_FLAG )); + MSGF(gfc, "SPACE_V1_FLAG : %d\n", test_tag_spec_flags(gfc, SPACE_V1_FLAG)); + MSGF(gfc, "PAD_V2_FLAG : %d\n", test_tag_spec_flags(gfc, PAD_V2_FLAG )); +} +#endif + + + +static int +id3v2_add_ucs2(lame_t gfp, uint32_t frame_id, char const *lang, unsigned short const *desc, unsigned short const *text); +static int +id3v2_add_latin1(lame_t gfp, uint32_t frame_id, char const *lang, char const *desc, char const *text); + +static void +copyV1ToV2(lame_t gfp, int frame_id, char const *s) +{ + lame_internal_flags *gfc = gfp != 0 ? gfp->internal_flags : 0; + if (gfc != 0) { + unsigned int flags = gfc->tag_spec.flags; + id3v2_add_latin1(gfp, frame_id, "XXX", 0, s); + gfc->tag_spec.flags = flags; +#if 0 + debug_tag_spec_flags(gfc, "copyV1ToV2"); +#endif + } +} + + +static void +id3v2AddLameVersion(lame_t gfp) +{ + char buffer[1024]; + const char *b = get_lame_os_bitness(); + const char *v = get_lame_version(); + const char *u = get_lame_url(); + const size_t lenb = strlen(b); + + if (lenb > 0) { + sprintf(buffer, "LAME %s version %s (%s)", b, v, u); + } + else { + sprintf(buffer, "LAME version %s (%s)", v, u); + } + copyV1ToV2(gfp, ID_ENCODER, buffer); +} + +static void +id3v2AddAudioDuration(lame_t gfp, double ms) +{ + lame_internal_flags *gfc = gfp != 0 ? gfp->internal_flags : 0; + SessionConfig_t const *const cfg = &gfc->cfg; + char buffer[1024]; + double const max_ulong = MAX_U_32_NUM; + unsigned long playlength_ms; + + ms *= 1000; + ms /= cfg->samplerate_in; + if (ms > max_ulong) { + playlength_ms = max_ulong; + } + else if (ms < 0) { + playlength_ms = 0; + } + else { + playlength_ms = ms; + } + sprintf(buffer, "%lu", playlength_ms); + copyV1ToV2(gfp, ID_PLAYLENGTH, buffer); +} + +void +id3tag_genre_list(void (*handler) (int, const char *, void *), void *cookie) +{ + if (handler) { + int i; + for (i = 0; i < GENRE_NAME_COUNT; ++i) { + if (i < GENRE_ALPHA_COUNT) { + int j = genre_alpha_map[i]; + handler(j, genre_names[j], cookie); + } + } + } +} + +#define GENRE_NUM_UNKNOWN 255 + + + +void +id3tag_init(lame_t gfp) +{ + lame_internal_flags *gfc = gfp->internal_flags; + free_id3tag(gfc); + memset(&gfc->tag_spec, 0, sizeof gfc->tag_spec); + gfc->tag_spec.genre_id3v1 = GENRE_NUM_UNKNOWN; + gfc->tag_spec.padding_size = 128; + id3v2AddLameVersion(gfp); +} + + + +void +id3tag_add_v2(lame_t gfp) +{ + lame_internal_flags *gfc = gfp->internal_flags; + gfc->tag_spec.flags &= ~V1_ONLY_FLAG; + gfc->tag_spec.flags |= ADD_V2_FLAG; +} + +void +id3tag_v1_only(lame_t gfp) +{ + lame_internal_flags *gfc = gfp->internal_flags; + gfc->tag_spec.flags &= ~(ADD_V2_FLAG | V2_ONLY_FLAG); + gfc->tag_spec.flags |= V1_ONLY_FLAG; +} + +void +id3tag_v2_only(lame_t gfp) +{ + lame_internal_flags *gfc = gfp->internal_flags; + gfc->tag_spec.flags &= ~V1_ONLY_FLAG; + gfc->tag_spec.flags |= V2_ONLY_FLAG; +} + +void +id3tag_space_v1(lame_t gfp) +{ + lame_internal_flags *gfc = gfp->internal_flags; + gfc->tag_spec.flags &= ~V2_ONLY_FLAG; + gfc->tag_spec.flags |= SPACE_V1_FLAG; +} + +void +id3tag_pad_v2(lame_t gfp) +{ + id3tag_set_pad(gfp, 128); +} + +void +id3tag_set_pad(lame_t gfp, size_t n) +{ + lame_internal_flags *gfc = gfp->internal_flags; + gfc->tag_spec.flags &= ~V1_ONLY_FLAG; + gfc->tag_spec.flags |= PAD_V2_FLAG; + gfc->tag_spec.flags |= ADD_V2_FLAG; + gfc->tag_spec.padding_size = (unsigned int)n; +} + +static int +hasUcs2ByteOrderMarker(unsigned short bom) +{ + if (bom == 0xFFFEu || bom == 0xFEFFu) { + return 1; + } + return 0; +} + + +static unsigned short +swap_bytes(unsigned short w) +{ + return (0xff00u & (w << 8)) | (0x00ffu & (w >> 8)); +} + + +static unsigned short +toLittleEndian(unsigned short bom, unsigned short c) +{ + if (bom == 0xFFFEu) { + return swap_bytes(c); + } + return c; +} + +static unsigned short +fromLatin1Char(const unsigned short* s, unsigned short c) +{ + if (s[0] == 0xFFFEu) { + return swap_bytes(c); + } + return c; +} + + +static size_t +local_strdup(char **dst, const char *src) +{ + if (dst == 0) { + return 0; + } + free(*dst); + *dst = 0; + if (src != 0) { + size_t n; + for (n = 0; src[n] != 0; ++n) { /* calc src string length */ + } + if (n > 0) { /* string length without zero termination */ + assert(sizeof(*src) == sizeof(**dst)); + *dst = lame_calloc(char, n + 1); + if (*dst != 0) { + memcpy(*dst, src, n * sizeof(**dst)); + (*dst)[n] = 0; + return n; + } + } + } + return 0; +} + +static size_t +local_ucs2_strdup(unsigned short **dst, unsigned short const *src) +{ + if (dst == 0) { + return 0; + } + free(*dst); /* free old string pointer */ + *dst = 0; + if (src != 0) { + size_t n; + for (n = 0; src[n] != 0; ++n) { /* calc src string length */ + } + if (n > 0) { /* string length without zero termination */ + assert(sizeof(*src) >= 2); + assert(sizeof(*src) == sizeof(**dst)); + *dst = lame_calloc(unsigned short, n + 1); + if (*dst != 0) { + memcpy(*dst, src, n * sizeof(**dst)); + (*dst)[n] = 0; + return n; + } + } + } + return 0; +} + + +static size_t +local_ucs2_strlen(unsigned short const *s) +{ + size_t n = 0; + if (s != 0) { + while (*s++) { + ++n; + } + } + return n; +} + + +static size_t +local_ucs2_substr(unsigned short** dst, unsigned short const* src, size_t start, size_t end) +{ + size_t const len = 1 + 1 + ((start < end) ? (end - start) : 0); + size_t n = 0; + unsigned short *ptr = lame_calloc(unsigned short, len); + *dst = ptr; + if (ptr == 0 || src == 0) { + return 0; + } + if (hasUcs2ByteOrderMarker(src[0])) { + ptr[n++] = src[0]; + if (start == 0) { + ++start; + } + } + while (start < end) { + ptr[n++] = src[start++]; + } + ptr[n] = 0; + return n; +} + +static int +local_ucs2_pos(unsigned short const* str, unsigned short c) +{ + int i; + for (i = 0; str != 0 && str[i] != 0; ++i) { + if (str[i] == c) { + return i; + } + } + return -1; +} + +static int +local_char_pos(char const* str, char c) +{ + int i; + for (i = 0; str != 0 && str[i] != 0; ++i) { + if (str[i] == c) { + return i; + } + } + return -1; +} + +static int +maybeLatin1(unsigned short const* text) +{ + if (text) { + unsigned short bom = *text++; + while (*text) { + unsigned short c = toLittleEndian(bom, *text++); + if (c > 0x00fe) return 0; + } + } + return 1; +} + +static int searchGenre(char const* genre); +static int sloppySearchGenre(char const* genre); + +static int +lookupGenre(char const* genre) +{ + char *str; + int num = strtol(genre, &str, 10); + /* is the input a string or a valid number? */ + if (*str) { + num = searchGenre(genre); + if (num == GENRE_NAME_COUNT) { + num = sloppySearchGenre(genre); + } + if (num == GENRE_NAME_COUNT) { + return -2; /* no common genre text found */ + } + } + else { + if ((num < 0) || (num >= GENRE_NAME_COUNT)) { + return -1; /* number unknown */ + } + } + return num; +} + +static unsigned char * +writeLoBytes(unsigned char *frame, unsigned short const *str, size_t n); + +static char* +local_strdup_utf16_to_latin1(unsigned short const* utf16) +{ + size_t len = local_ucs2_strlen(utf16); + unsigned char* latin1 = lame_calloc(unsigned char, len+1); + writeLoBytes(latin1, utf16, len); + return (char*)latin1; +} + + +static int +id3tag_set_genre_utf16(lame_t gfp, unsigned short const* text) +{ + lame_internal_flags* gfc = gfp->internal_flags; + int ret; + if (text == 0) { + return -3; + } + if (!hasUcs2ByteOrderMarker(text[0])) { + return -3; + } + if (maybeLatin1(text)) { + char* latin1 = local_strdup_utf16_to_latin1(text); + int num = lookupGenre(latin1); + free(latin1); + if (num == -1) return -1; /* number out of range */ + if (num >= 0) { /* common genre found */ + gfc->tag_spec.flags |= CHANGED_FLAG; + gfc->tag_spec.genre_id3v1 = num; + copyV1ToV2(gfp, ID_GENRE, genre_names[num]); + return 0; + } + } + ret = id3v2_add_ucs2(gfp, ID_GENRE, 0, 0, text); + if (ret == 0) { + gfc->tag_spec.flags |= CHANGED_FLAG; + gfc->tag_spec.genre_id3v1 = GENRE_INDEX_OTHER; + } + return ret; +} + +/* +Some existing options for ID3 tag can be specified by --tv option +as follows. +--tt , --tv TIT2=value +--ta , --tv TPE1=value +--tl , --tv TALB=value +--ty , --tv TYER=value +--tn , --tv TRCK=value +--tg , --tv TCON=value +(although some are not exactly same)*/ + +int +id3tag_set_albumart(lame_t gfp, const char *image, size_t size) +{ + int mimetype = 0; + unsigned char const *data = (unsigned char const *) image; + lame_internal_flags *gfc = gfp->internal_flags; + + /* determine MIME type from the actual image data */ + if (2 < size && data[0] == 0xFF && data[1] == 0xD8) { + mimetype = MIMETYPE_JPEG; + } + else if (4 < size && data[0] == 0x89 && strncmp((const char *) &data[1], "PNG", 3) == 0) { + mimetype = MIMETYPE_PNG; + } + else if (4 < size && strncmp((const char *) data, "GIF8", 4) == 0) { + mimetype = MIMETYPE_GIF; + } + else { + return -1; + } + if (gfc->tag_spec.albumart != 0) { + free(gfc->tag_spec.albumart); + gfc->tag_spec.albumart = 0; + gfc->tag_spec.albumart_size = 0; + gfc->tag_spec.albumart_mimetype = MIMETYPE_NONE; + } + if (size < 1) { + return 0; + } + gfc->tag_spec.albumart = lame_calloc(unsigned char, size); + if (gfc->tag_spec.albumart != 0) { + memcpy(gfc->tag_spec.albumart, image, size); + gfc->tag_spec.albumart_size = (unsigned int)size; + gfc->tag_spec.albumart_mimetype = mimetype; + gfc->tag_spec.flags |= CHANGED_FLAG; + id3tag_add_v2(gfp); + } + return 0; +} + +static unsigned char * +set_4_byte_value(unsigned char *bytes, uint32_t value) +{ + int i; + for (i = 3; i >= 0; --i) { + bytes[i] = value & 0xffUL; + value >>= 8; + } + return bytes + 4; +} + +static uint32_t +toID3v2TagId(char const *s) +{ + unsigned int i, x = 0; + if (s == 0) { + return 0; + } + for (i = 0; i < 4 && s[i] != 0; ++i) { + char const c = s[i]; + unsigned int const u = 0x0ff & c; + x <<= 8; + x |= u; + if (c < 'A' || 'Z' < c) { + if (c < '0' || '9' < c) { + return 0; + } + } + } + return x; +} + +static uint32_t +toID3v2TagId_ucs2(unsigned short const *s) +{ + unsigned int i, x = 0; + unsigned short bom = 0; + if (s == 0) { + return 0; + } + bom = s[0]; + if (hasUcs2ByteOrderMarker(bom)) { + ++s; + } + for (i = 0; i < 4 && s[i] != 0; ++i) { + unsigned short const c = toLittleEndian(bom, s[i]); + if (c < 'A' || 'Z' < c) { + if (c < '0' || '9' < c) { + return 0; + } + } + x <<= 8; + x |= c; + } + return x; +} + +#if 0 +static int +isNumericString(uint32_t frame_id) +{ + switch (frame_id) { + case ID_DATE: + case ID_TIME: + case ID_TPOS: + case ID_TRACK: + case ID_YEAR: + return 1; + } + return 0; +} +#endif + +static int +isMultiFrame(uint32_t frame_id) +{ + switch (frame_id) { + case ID_TXXX: + case ID_WXXX: + case ID_COMMENT: + case ID_SYLT: + case ID_APIC: + case ID_GEOB: + case ID_PCNT: + case ID_AENC: + case ID_LINK: + case ID_ENCR: + case ID_GRID: + case ID_PRIV: + return 1; + } + return 0; +} + +#if 0 +static int +isFullTextString(int frame_id) +{ + switch (frame_id) { + case ID_VSLT: + case ID_COMMENT: + return 1; + } + return 0; +} +#endif + +static FrameDataNode * +findNode(id3tag_spec const *tag, uint32_t frame_id, FrameDataNode const *last) +{ + FrameDataNode *node = last ? last->nxt : tag->v2_head; + while (node != 0) { + if (node->fid == frame_id) { + return node; + } + node = node->nxt; + } + return 0; +} + +static void +appendNode(id3tag_spec * tag, FrameDataNode * node) +{ + if (tag->v2_tail == 0 || tag->v2_head == 0) { + tag->v2_head = node; + tag->v2_tail = node; + } + else { + tag->v2_tail->nxt = node; + tag->v2_tail = node; + } +} + +static void +setLang(char *dst, char const *src) +{ + int i; + if (src == 0 || src[0] == 0) { + dst[0] = 'X'; + dst[1] = 'X'; + dst[2] = 'X'; + } + else { + for (i = 0; i < 3 && src && *src; ++i) { + dst[i] = src[i]; + } + for (; i < 3; ++i) { + dst[i] = ' '; + } + } +} + +static int +isSameLang(char const *l1, char const *l2) +{ + char d[3]; + int i; + setLang(d, l2); + for (i = 0; i < 3; ++i) { + char a = tolower(l1[i]); + char b = tolower(d[i]); + if (a < ' ') + a = ' '; + if (b < ' ') + b = ' '; + if (a != b) { + return 0; + } + } + return 1; +} + +static int +isSameDescriptor(FrameDataNode const *node, char const *dsc) +{ + size_t i; + if (node->dsc.enc == 1 && node->dsc.dim > 0) { + return 0; + } + for (i = 0; i < node->dsc.dim; ++i) { + if (!dsc || node->dsc.ptr.l[i] != dsc[i]) { + return 0; + } + } + return 1; +} + +static int +isSameDescriptorUcs2(FrameDataNode const *node, unsigned short const *dsc) +{ + size_t i; + if (node->dsc.enc != 1 && node->dsc.dim > 0) { + return 0; + } + for (i = 0; i < node->dsc.dim; ++i) { + if (!dsc || node->dsc.ptr.u[i] != dsc[i]) { + return 0; + } + } + return 1; +} + +static int +id3v2_add_ucs2(lame_t gfp, uint32_t frame_id, char const *lang, unsigned short const *desc, unsigned short const *text) +{ + lame_internal_flags *gfc = gfp != 0 ? gfp->internal_flags : 0; + if (gfc != 0) { + FrameDataNode *node = findNode(&gfc->tag_spec, frame_id, 0); + if (isMultiFrame(frame_id)) { + while (node) { + if (isSameLang(node->lng, lang)) { + if (isSameDescriptorUcs2(node, desc)) { + break; + } + } + node = findNode(&gfc->tag_spec, frame_id, node); + } + } + if (node == 0) { + node = lame_calloc(FrameDataNode, 1); + if (node == 0) { + return -254; /* memory problem */ + } + appendNode(&gfc->tag_spec, node); + } + node->fid = frame_id; + setLang(node->lng, lang); + node->dsc.dim = local_ucs2_strdup(&node->dsc.ptr.u, desc); + node->dsc.enc = 1; + node->txt.dim = local_ucs2_strdup(&node->txt.ptr.u, text); + node->txt.enc = 1; + gfc->tag_spec.flags |= (CHANGED_FLAG | ADD_V2_FLAG); + return 0; + } + return -255; +} + +static int +id3v2_add_latin1(lame_t gfp, uint32_t frame_id, char const *lang, char const *desc, char const *text) +{ + lame_internal_flags *gfc = gfp != 0 ? gfp->internal_flags : 0; + if (gfc != 0) { + FrameDataNode *node = findNode(&gfc->tag_spec, frame_id, 0); + if (isMultiFrame(frame_id)) { + while (node) { + if (isSameLang(node->lng, lang)) { + if (isSameDescriptor(node, desc)) { + break; + } + } + node = findNode(&gfc->tag_spec, frame_id, node); + } + } + if (node == 0) { + node = lame_calloc(FrameDataNode, 1); + if (node == 0) { + return -254; /* memory problem */ + } + appendNode(&gfc->tag_spec, node); + } + node->fid = frame_id; + setLang(node->lng, lang); + node->dsc.dim = local_strdup(&node->dsc.ptr.l, desc); + node->dsc.enc = 0; + node->txt.dim = local_strdup(&node->txt.ptr.l, text); + node->txt.enc = 0; + gfc->tag_spec.flags |= (CHANGED_FLAG | ADD_V2_FLAG); + return 0; + } + return -255; +} + + +static int +id3tag_set_userinfo_latin1(lame_t gfp, uint32_t id, char const *fieldvalue) +{ + char const separator = '='; + int rc = -7; + int a = local_char_pos(fieldvalue, separator); + if (a >= 0) { + char* dup = 0; + local_strdup(&dup, fieldvalue); + dup[a] = 0; + rc = id3v2_add_latin1(gfp, id, "XXX", dup, dup+a+1); + free(dup); + } + return rc; +} + +static int +id3tag_set_userinfo_ucs2(lame_t gfp, uint32_t id, unsigned short const *fieldvalue) +{ + unsigned short const separator = fromLatin1Char(fieldvalue,'='); + int rc = -7; + size_t b = local_ucs2_strlen(fieldvalue); + int a = local_ucs2_pos(fieldvalue, separator); + if (a >= 0) { + unsigned short* dsc = 0, *val = 0; + local_ucs2_substr(&dsc, fieldvalue, 0, a); + local_ucs2_substr(&val, fieldvalue, a+1, b); + rc = id3v2_add_ucs2(gfp, id, "XXX", dsc, val); + free(dsc); + free(val); + } + return rc; +} + +int +id3tag_set_textinfo_utf16(lame_t gfp, char const *id, unsigned short const *text) +{ + uint32_t const frame_id = toID3v2TagId(id); + if (frame_id == 0) { + return -1; + } + if (text == 0) { + return 0; + } + if (!hasUcs2ByteOrderMarker(text[0])) { + return -3; /* BOM missing */ + } + if (frame_id == ID_TXXX || frame_id == ID_WXXX || frame_id == ID_COMMENT) { + return id3tag_set_userinfo_ucs2(gfp, frame_id, text); + } + if (frame_id == ID_GENRE) { + return id3tag_set_genre_utf16(gfp, text); + } + if (frame_id == ID_PCST) { + return id3v2_add_ucs2(gfp, frame_id, 0, 0, text); + } + if (frame_id == ID_USER) { + return id3v2_add_ucs2(gfp, frame_id, "XXX", text, 0); + } + if (frame_id == ID_WFED) { + return id3v2_add_ucs2(gfp, frame_id, 0, text, 0); /* iTunes expects WFED to be a text frame */ + } + if (isFrameIdMatching(frame_id, FRAME_ID('T', 0, 0, 0)) + ||isFrameIdMatching(frame_id, FRAME_ID('W', 0, 0, 0))) { +#if 0 + if (isNumericString(frame_id)) { + return -2; /* must be Latin-1 encoded */ + } +#endif + return id3v2_add_ucs2(gfp, frame_id, 0, 0, text); + } + return -255; /* not supported by now */ +} + +extern int +id3tag_set_textinfo_ucs2(lame_t gfp, char const *id, unsigned short const *text); + +int +id3tag_set_textinfo_ucs2(lame_t gfp, char const *id, unsigned short const *text) +{ + return id3tag_set_textinfo_utf16(gfp, id, text); +} + +int +id3tag_set_textinfo_latin1(lame_t gfp, char const *id, char const *text) +{ + uint32_t const frame_id = toID3v2TagId(id); + if (frame_id == 0) { + return -1; + } + if (text == 0) { + return 0; + } + if (frame_id == ID_TXXX || frame_id == ID_WXXX || frame_id == ID_COMMENT) { + return id3tag_set_userinfo_latin1(gfp, frame_id, text); + } + if (frame_id == ID_GENRE) { + return id3tag_set_genre(gfp, text); + } + if (frame_id == ID_PCST) { + return id3v2_add_latin1(gfp, frame_id, 0, 0, text); + } + if (frame_id == ID_USER) { + return id3v2_add_latin1(gfp, frame_id, "XXX", text, 0); + } + if (frame_id == ID_WFED) { + return id3v2_add_latin1(gfp, frame_id, 0, text, 0); /* iTunes expects WFED to be a text frame */ + } + if (isFrameIdMatching(frame_id, FRAME_ID('T', 0, 0, 0)) + ||isFrameIdMatching(frame_id, FRAME_ID('W', 0, 0, 0))) { + return id3v2_add_latin1(gfp, frame_id, 0, 0, text); + } + return -255; /* not supported by now */ +} + + +int +id3tag_set_comment_latin1(lame_t gfp, char const *lang, char const *desc, char const *text) +{ + return id3v2_add_latin1(gfp, ID_COMMENT, lang, desc, text); +} + + +int +id3tag_set_comment_utf16(lame_t gfp, char const *lang, unsigned short const *desc, unsigned short const *text) +{ + return id3v2_add_ucs2(gfp, ID_COMMENT, lang, desc, text); +} + +extern int +id3tag_set_comment_ucs2(lame_t gfp, char const *lang, unsigned short const *desc, unsigned short const *text); + + +int +id3tag_set_comment_ucs2(lame_t gfp, char const *lang, unsigned short const *desc, unsigned short const *text) +{ + return id3tag_set_comment_utf16(gfp, lang, desc, text); +} + + +void +id3tag_set_title(lame_t gfp, const char *title) +{ + lame_internal_flags *gfc = gfp != 0 ? gfp->internal_flags : 0; + if (gfc && title && *title) { + local_strdup(&gfc->tag_spec.title, title); + gfc->tag_spec.flags |= CHANGED_FLAG; + copyV1ToV2(gfp, ID_TITLE, title); + } +} + +void +id3tag_set_artist(lame_t gfp, const char *artist) +{ + lame_internal_flags *gfc = gfp != 0 ? gfp->internal_flags : 0; + if (gfc && artist && *artist) { + local_strdup(&gfc->tag_spec.artist, artist); + gfc->tag_spec.flags |= CHANGED_FLAG; + copyV1ToV2(gfp, ID_ARTIST, artist); + } +} + +void +id3tag_set_album(lame_t gfp, const char *album) +{ + lame_internal_flags *gfc = gfp != 0 ? gfp->internal_flags : 0; + if (gfc && album && *album) { + local_strdup(&gfc->tag_spec.album, album); + gfc->tag_spec.flags |= CHANGED_FLAG; + copyV1ToV2(gfp, ID_ALBUM, album); + } +} + +void +id3tag_set_year(lame_t gfp, const char *year) +{ + lame_internal_flags *gfc = gfp != 0 ? gfp->internal_flags : 0; + if (gfc && year && *year) { + int num = atoi(year); + if (num < 0) { + num = 0; + } + /* limit a year to 4 digits so it fits in a version 1 tag */ + if (num > 9999) { + num = 9999; + } + if (num) { + gfc->tag_spec.year = num; + gfc->tag_spec.flags |= CHANGED_FLAG; + } + copyV1ToV2(gfp, ID_YEAR, year); + } +} + +void +id3tag_set_comment(lame_t gfp, const char *comment) +{ + lame_internal_flags *gfc = gfp != 0 ? gfp->internal_flags : 0; + if (gfc && comment && *comment) { + local_strdup(&gfc->tag_spec.comment, comment); + gfc->tag_spec.flags |= CHANGED_FLAG; + { + uint32_t const flags = gfc->tag_spec.flags; + id3v2_add_latin1(gfp, ID_COMMENT, "XXX", "", comment); + gfc->tag_spec.flags = flags; + } + } +} + +int +id3tag_set_track(lame_t gfp, const char *track) +{ + char const *trackcount; + lame_internal_flags *gfc = gfp != 0 ? gfp->internal_flags : 0; + int ret = 0; + + if (gfc && track && *track) { + int num = atoi(track); + /* check for valid ID3v1 track number range */ + if (num < 1 || num > 255) { + num = 0; + ret = -1; /* track number out of ID3v1 range, ignored for ID3v1 */ + gfc->tag_spec.flags |= (CHANGED_FLAG | ADD_V2_FLAG); + } + if (num) { + gfc->tag_spec.track_id3v1 = num; + gfc->tag_spec.flags |= CHANGED_FLAG; + } + /* Look for the total track count after a "/", same restrictions */ + trackcount = strchr(track, '/'); + if (trackcount && *trackcount) { + gfc->tag_spec.flags |= (CHANGED_FLAG | ADD_V2_FLAG); + } + copyV1ToV2(gfp, ID_TRACK, track); + } + return ret; +} + +/* would use real "strcasecmp" but it isn't portable */ +static int +local_strcasecmp(const char *s1, const char *s2) +{ + unsigned char c1; + unsigned char c2; + do { + c1 = tolower(*s1); + c2 = tolower(*s2); + if (!c1) { + break; + } + ++s1; + ++s2; + } while (c1 == c2); + return c1 - c2; +} + + +static +const char* nextUpperAlpha(const char* p, char x) +{ + char c; + for(c = toupper(*p); *p != 0; c = toupper(*++p)) { + if ('A' <= c && c <= 'Z') { + if (c != x) { + return p; + } + } + } + return p; +} + + +static int +sloppyCompared(const char* p, const char* q) +{ + char cp, cq; + p = nextUpperAlpha(p, 0); + q = nextUpperAlpha(q, 0); + cp = toupper(*p); + cq = toupper(*q); + while (cp == cq) { + if (cp == 0) { + return 1; + } + if (p[1] == '.') { /* some abbrevation */ + while (*q && *q++ != ' ') { + } + } + p = nextUpperAlpha(p, cp); + q = nextUpperAlpha(q, cq); + cp = toupper(*p); + cq = toupper(*q); + } + return 0; +} + + +static int +sloppySearchGenre(const char *genre) +{ + int i; + for (i = 0; i < GENRE_NAME_COUNT; ++i) { + if (sloppyCompared(genre, genre_names[i])) { + return i; + } + } + return GENRE_NAME_COUNT; +} + + +static int +searchGenre(const char* genre) +{ + int i; + for (i = 0; i < GENRE_NAME_COUNT; ++i) { + if (!local_strcasecmp(genre, genre_names[i])) { + return i; + } + } + return GENRE_NAME_COUNT; +} + + +int +id3tag_set_genre(lame_t gfp, const char *genre) +{ + lame_internal_flags *gfc = gfp->internal_flags; + int ret = 0; + if (genre && *genre) { + int const num = lookupGenre(genre); + if (num == -1) return num; + gfc->tag_spec.flags |= CHANGED_FLAG; + if (num >= 0) { + gfc->tag_spec.genre_id3v1 = num; + genre = genre_names[num]; + } + else { + gfc->tag_spec.genre_id3v1 = GENRE_INDEX_OTHER; + gfc->tag_spec.flags |= ADD_V2_FLAG; + } + copyV1ToV2(gfp, ID_GENRE, genre); + } + return ret; +} + + +static size_t +sizeOfNode(FrameDataNode const *node) +{ + size_t n = 0; + if (node) { + n = 10; /* header size */ + n += 1; /* text encoding flag */ + switch (node->txt.enc) { + default: + case 0: + if (node->dsc.dim > 0) { + n += node->dsc.dim + 1; + } + n += node->txt.dim; + break; + case 1: + if (node->dsc.dim > 0) { + n += (node->dsc.dim+1) * 2; + } + n += node->txt.dim * 2; + break; + } + } + return n; +} + +static size_t +sizeOfCommentNode(FrameDataNode const *node) +{ + size_t n = 0; + if (node) { + n = 10; /* header size */ + n += 1; /* text encoding flag */ + n += 3; /* language */ + switch (node->dsc.enc) { + default: + case 0: + n += 1 + node->dsc.dim; + break; + case 1: + n += 2 + node->dsc.dim * 2; + break; + } + switch (node->txt.enc) { + default: + case 0: + n += node->txt.dim; + break; + case 1: + n += node->txt.dim * 2; + break; + } + } + return n; +} + +static size_t +sizeOfWxxxNode(FrameDataNode const *node) +{ + size_t n = 0; + if (node) { + n = 10; /* header size */ + if (node->dsc.dim > 0) { + n += 1; /* text encoding flag */ + switch (node->dsc.enc) { + default: + case 0: + n += 1 + node->dsc.dim; + break; + case 1: + n += 2 + node->dsc.dim * 2; + break; + } + } + if (node->txt.dim > 0) { + switch (node->txt.enc) { + default: + case 0: + n += node->txt.dim; + break; + case 1: + n += node->txt.dim - 1; /* UCS2 -> Latin1, skip BOM */ + break; + } + } + } + return n; +} + +static unsigned char * +writeChars(unsigned char *frame, char const *str, size_t n) +{ + while (n--) { + *frame++ = *str++; + } + return frame; +} + +static unsigned char * +writeUcs2s(unsigned char *frame, unsigned short const *str, size_t n) +{ + if (n > 0) { + unsigned short const bom = *str; + while (n--) { + unsigned short const c = toLittleEndian(bom, *str++); + *frame++ = 0x00ffu & c; + *frame++ = 0x00ffu & (c >> 8); + } + } + return frame; +} + +static unsigned char * +writeLoBytes(unsigned char *frame, unsigned short const *str, size_t n) +{ + if (n > 0) { + unsigned short const bom = *str; + if (hasUcs2ByteOrderMarker(bom)) { + str++; n--; /* skip BOM */ + } + while (n--) { + unsigned short const c = toLittleEndian(bom, *str++); + if (c < 0x0020u || 0x00ffu < c) { + *frame++ = 0x0020; /* blank */ + } + else { + *frame++ = c; + } + } + } + return frame; +} + +static unsigned char * +set_frame_comment(unsigned char *frame, FrameDataNode const *node) +{ + size_t const n = sizeOfCommentNode(node); + if (n > 10) { + frame = set_4_byte_value(frame, node->fid); + frame = set_4_byte_value(frame, (uint32_t) (n - 10)); + /* clear 2-byte header flags */ + *frame++ = 0; + *frame++ = 0; + /* encoding descriptor byte */ + *frame++ = node->txt.enc == 1 ? 1 : 0; + /* 3 bytes language */ + *frame++ = node->lng[0]; + *frame++ = node->lng[1]; + *frame++ = node->lng[2]; + /* descriptor with zero byte(s) separator */ + if (node->dsc.enc != 1) { + frame = writeChars(frame, node->dsc.ptr.l, node->dsc.dim); + *frame++ = 0; + } + else { + frame = writeUcs2s(frame, node->dsc.ptr.u, node->dsc.dim); + *frame++ = 0; + *frame++ = 0; + } + /* comment full text */ + if (node->txt.enc != 1) { + frame = writeChars(frame, node->txt.ptr.l, node->txt.dim); + } + else { + frame = writeUcs2s(frame, node->txt.ptr.u, node->txt.dim); + } + } + return frame; +} + +static unsigned char * +set_frame_custom2(unsigned char *frame, FrameDataNode const *node) +{ + size_t const n = sizeOfNode(node); + if (n > 10) { + frame = set_4_byte_value(frame, node->fid); + frame = set_4_byte_value(frame, (unsigned long) (n - 10)); + /* clear 2-byte header flags */ + *frame++ = 0; + *frame++ = 0; + /* clear 1 encoding descriptor byte to indicate ISO-8859-1 format */ + *frame++ = node->txt.enc == 1 ? 1 : 0; + if (node->dsc.dim > 0) { + if (node->dsc.enc != 1) { + frame = writeChars(frame, node->dsc.ptr.l, node->dsc.dim); + *frame++ = 0; + } + else { + frame = writeUcs2s(frame, node->dsc.ptr.u, node->dsc.dim); + *frame++ = 0; + *frame++ = 0; + } + } + if (node->txt.enc != 1) { + frame = writeChars(frame, node->txt.ptr.l, node->txt.dim); + } + else { + frame = writeUcs2s(frame, node->txt.ptr.u, node->txt.dim); + } + } + return frame; +} + +static unsigned char * +set_frame_wxxx(unsigned char *frame, FrameDataNode const *node) +{ + size_t const n = sizeOfWxxxNode(node); + if (n > 10) { + frame = set_4_byte_value(frame, node->fid); + frame = set_4_byte_value(frame, (unsigned long) (n - 10)); + /* clear 2-byte header flags */ + *frame++ = 0; + *frame++ = 0; + if (node->dsc.dim > 0) { + /* clear 1 encoding descriptor byte to indicate ISO-8859-1 format */ + *frame++ = node->dsc.enc == 1 ? 1 : 0; + if (node->dsc.enc != 1) { + frame = writeChars(frame, node->dsc.ptr.l, node->dsc.dim); + *frame++ = 0; + } + else { + frame = writeUcs2s(frame, node->dsc.ptr.u, node->dsc.dim); + *frame++ = 0; + *frame++ = 0; + } + } + if (node->txt.enc != 1) { + frame = writeChars(frame, node->txt.ptr.l, node->txt.dim); + } + else { + frame = writeLoBytes(frame, node->txt.ptr.u, node->txt.dim); + } + } + return frame; +} + +static unsigned char * +set_frame_apic(unsigned char *frame, const char *mimetype, const unsigned char *data, size_t size) +{ + /* ID3v2.3 standard APIC frame: + *
+ * Text encoding $xx + * MIME type $00 + * Picture type $xx + * Description $00 (00) + * Picture data + */ + if (mimetype && data && size) { + frame = set_4_byte_value(frame, FRAME_ID('A', 'P', 'I', 'C')); + frame = set_4_byte_value(frame, (unsigned long) (4 + strlen(mimetype) + size)); + /* clear 2-byte header flags */ + *frame++ = 0; + *frame++ = 0; + /* clear 1 encoding descriptor byte to indicate ISO-8859-1 format */ + *frame++ = 0; + /* copy mime_type */ + while (*mimetype) { + *frame++ = *mimetype++; + } + *frame++ = 0; + /* set picture type to 0 */ + *frame++ = 0; + /* empty description field */ + *frame++ = 0; + /* copy the image data */ + while (size--) { + *frame++ = *data++; + } + } + return frame; +} + +int +id3tag_set_fieldvalue(lame_t gfp, const char *fieldvalue) +{ + if (fieldvalue && *fieldvalue) { + if (strlen(fieldvalue) < 5 || fieldvalue[4] != '=') { + return -1; + } + return id3tag_set_textinfo_latin1(gfp, fieldvalue, &fieldvalue[5]); + } + return 0; +} + +int +id3tag_set_fieldvalue_utf16(lame_t gfp, const unsigned short *fieldvalue) +{ + if (fieldvalue && *fieldvalue) { + size_t dx = hasUcs2ByteOrderMarker(fieldvalue[0]); + unsigned short const separator = fromLatin1Char(fieldvalue, '='); + char fid[5] = {0,0,0,0,0}; + uint32_t const frame_id = toID3v2TagId_ucs2(fieldvalue); + if (local_ucs2_strlen(fieldvalue) < (5+dx) || fieldvalue[4+dx] != separator) { + return -1; + } + fid[0] = (frame_id >> 24) & 0x0ff; + fid[1] = (frame_id >> 16) & 0x0ff; + fid[2] = (frame_id >> 8) & 0x0ff; + fid[3] = frame_id & 0x0ff; + if (frame_id != 0) { + unsigned short* txt = 0; + int rc; + local_ucs2_substr(&txt, fieldvalue, dx+5, local_ucs2_strlen(fieldvalue)); + rc = id3tag_set_textinfo_utf16(gfp, fid, txt); + free(txt); + return rc; + } + } + return -1; +} + +extern int +id3tag_set_fieldvalue_ucs2(lame_t gfp, const unsigned short *fieldvalue); + +int +id3tag_set_fieldvalue_ucs2(lame_t gfp, const unsigned short *fieldvalue) +{ + return id3tag_set_fieldvalue_utf16(gfp, fieldvalue); +} + +size_t +lame_get_id3v2_tag(lame_t gfp, unsigned char *buffer, size_t size) +{ + lame_internal_flags *gfc; + if (gfp == 0) { + return 0; + } + gfc = gfp->internal_flags; + if (gfc == 0) { + return 0; + } + if (test_tag_spec_flags(gfc, V1_ONLY_FLAG)) { + return 0; + } +#if 0 + debug_tag_spec_flags(gfc, "lame_get_id3v2_tag"); +#endif + { + int usev2 = test_tag_spec_flags(gfc, ADD_V2_FLAG | V2_ONLY_FLAG); + /* calculate length of four fields which may not fit in verion 1 tag */ + size_t title_length = gfc->tag_spec.title ? strlen(gfc->tag_spec.title) : 0; + size_t artist_length = gfc->tag_spec.artist ? strlen(gfc->tag_spec.artist) : 0; + size_t album_length = gfc->tag_spec.album ? strlen(gfc->tag_spec.album) : 0; + size_t comment_length = gfc->tag_spec.comment ? strlen(gfc->tag_spec.comment) : 0; + /* write tag if explicitly requested or if fields overflow */ + if ((title_length > 30) + || (artist_length > 30) + || (album_length > 30) + || (comment_length > 30) + || (gfc->tag_spec.track_id3v1 && (comment_length > 28))) { + usev2 = 1; + } + if (usev2) { + size_t tag_size; + unsigned char *p; + size_t adjusted_tag_size; + const char *albumart_mime = NULL; + static const char *mime_jpeg = "image/jpeg"; + static const char *mime_png = "image/png"; + static const char *mime_gif = "image/gif"; + + if (gfp->num_samples != MAX_U_32_NUM) { + id3v2AddAudioDuration(gfp, gfp->num_samples); + } + + /* calulate size of tag starting with 10-byte tag header */ + tag_size = 10; + if (gfc->tag_spec.albumart && gfc->tag_spec.albumart_size) { + switch (gfc->tag_spec.albumart_mimetype) { + case MIMETYPE_JPEG: + albumart_mime = mime_jpeg; + break; + case MIMETYPE_PNG: + albumart_mime = mime_png; + break; + case MIMETYPE_GIF: + albumart_mime = mime_gif; + break; + } + if (albumart_mime) { + tag_size += 10 + 4 + strlen(albumart_mime) + gfc->tag_spec.albumart_size; + } + } + { + id3tag_spec *tag = &gfc->tag_spec; + if (tag->v2_head != 0) { + FrameDataNode *node; + for (node = tag->v2_head; node != 0; node = node->nxt) { + if (node->fid == ID_COMMENT || node->fid == ID_USER) { + tag_size += sizeOfCommentNode(node); + } + else if (isFrameIdMatching(node->fid, FRAME_ID('W',0,0,0))) { + tag_size += sizeOfWxxxNode(node); + } + else { + tag_size += sizeOfNode(node); + } + } + } + } + if (test_tag_spec_flags(gfc, PAD_V2_FLAG)) { + /* add some bytes of padding */ + tag_size += gfc->tag_spec.padding_size; + } + if (size < tag_size) { + return tag_size; + } + if (buffer == 0) { + return 0; + } + p = buffer; + /* set tag header starting with file identifier */ + *p++ = 'I'; + *p++ = 'D'; + *p++ = '3'; + /* set version number word */ + *p++ = 3; + *p++ = 0; + /* clear flags byte */ + *p++ = 0; + /* calculate and set tag size = total size - header size */ + adjusted_tag_size = tag_size - 10; + /* encode adjusted size into four bytes where most significant + * bit is clear in each byte, for 28-bit total */ + *p++ = (unsigned char) ((adjusted_tag_size >> 21) & 0x7fu); + *p++ = (unsigned char) ((adjusted_tag_size >> 14) & 0x7fu); + *p++ = (unsigned char) ((adjusted_tag_size >> 7) & 0x7fu); + *p++ = (unsigned char) (adjusted_tag_size & 0x7fu); + + /* + * NOTE: The remainder of the tag (frames and padding, if any) + * are not "unsynchronized" to prevent false MPEG audio headers + * from appearing in the bitstream. Why? Well, most players + * and utilities know how to skip the ID3 version 2 tag by now + * even if they don't read its contents, and it's actually + * very unlikely that such a false "sync" pattern would occur + * in just the simple text frames added here. + */ + + /* set each frame in tag */ + { + id3tag_spec *tag = &gfc->tag_spec; + if (tag->v2_head != 0) { + FrameDataNode *node; + for (node = tag->v2_head; node != 0; node = node->nxt) { + if (node->fid == ID_COMMENT || node->fid == ID_USER) { + p = set_frame_comment(p, node); + } + else if (isFrameIdMatching(node->fid,FRAME_ID('W',0,0,0))) { + p = set_frame_wxxx(p, node); + } + else { + p = set_frame_custom2(p, node); + } + } + } + } + if (albumart_mime) { + p = set_frame_apic(p, albumart_mime, gfc->tag_spec.albumart, + gfc->tag_spec.albumart_size); + } + /* clear any padding bytes */ + memset(p, 0, tag_size - (p - buffer)); + return tag_size; + } + } + return 0; +} + +int +id3tag_write_v2(lame_t gfp) +{ + lame_internal_flags *gfc = gfp->internal_flags; +#if 0 + debug_tag_spec_flags(gfc, "write v2"); +#endif + if (test_tag_spec_flags(gfc, V1_ONLY_FLAG)) { + return 0; + } + if (test_tag_spec_flags(gfc, CHANGED_FLAG)) { + unsigned char *tag = 0; + size_t tag_size, n; + + n = lame_get_id3v2_tag(gfp, 0, 0); + tag = lame_calloc(unsigned char, n); + if (tag == 0) { + return -1; + } + tag_size = lame_get_id3v2_tag(gfp, tag, n); + if (tag_size > n) { + free(tag); + return -1; + } + else { + size_t i; + /* write tag directly into bitstream at current position */ + for (i = 0; i < tag_size; ++i) { + add_dummy_byte(gfc, tag[i], 1); + } + } + free(tag); + return (int) tag_size; /* ok, tag should not exceed 2GB */ + } + return 0; +} + +static unsigned char * +set_text_field(unsigned char *field, const char *text, size_t size, int pad) +{ + while (size--) { + if (text && *text) { + *field++ = *text++; + } + else { + *field++ = pad; + } + } + return field; +} + +size_t +lame_get_id3v1_tag(lame_t gfp, unsigned char *buffer, size_t size) +{ + size_t const tag_size = 128; + lame_internal_flags *gfc; + + if (gfp == 0) { + return 0; + } + if (size < tag_size) { + return tag_size; + } + gfc = gfp->internal_flags; + if (gfc == 0) { + return 0; + } + if (buffer == 0) { + return 0; + } + if (test_tag_spec_flags(gfc, V2_ONLY_FLAG)) { + return 0; + } + if (test_tag_spec_flags(gfc, CHANGED_FLAG)) { + unsigned char *p = buffer; + int pad = test_tag_spec_flags(gfc, SPACE_V1_FLAG) ? ' ' : 0; + char year[5]; + + /* set tag identifier */ + *p++ = 'T'; + *p++ = 'A'; + *p++ = 'G'; + /* set each field in tag */ + p = set_text_field(p, gfc->tag_spec.title, 30, pad); + p = set_text_field(p, gfc->tag_spec.artist, 30, pad); + p = set_text_field(p, gfc->tag_spec.album, 30, pad); + sprintf(year, "%d", gfc->tag_spec.year); + p = set_text_field(p, gfc->tag_spec.year ? year : NULL, 4, pad); + /* limit comment field to 28 bytes if a track is specified */ + p = set_text_field(p, gfc->tag_spec.comment, gfc->tag_spec.track_id3v1 ? 28 : 30, pad); + if (gfc->tag_spec.track_id3v1) { + /* clear the next byte to indicate a version 1.1 tag */ + *p++ = 0; + *p++ = gfc->tag_spec.track_id3v1; + } + *p++ = gfc->tag_spec.genre_id3v1; + return tag_size; + } + return 0; +} + +int +id3tag_write_v1(lame_t gfp) +{ + lame_internal_flags *const gfc = gfp->internal_flags; + size_t i, n, m; + unsigned char tag[128]; + + m = sizeof(tag); + n = lame_get_id3v1_tag(gfp, tag, m); + if (n > m) { + return 0; + } + /* write tag directly into bitstream at current position */ + for (i = 0; i < n; ++i) { + add_dummy_byte(gfc, tag[i], 1); + } + return (int) n; /* ok, tag has fixed size of 128 bytes, well below 2GB */ +} diff --git a/node_modules/lame/deps/lame/libmp3lame/id3tag.h b/node_modules/lame/deps/lame/libmp3lame/id3tag.h new file mode 100644 index 0000000..ac9c56e --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/id3tag.h @@ -0,0 +1,63 @@ + +#ifndef LAME_ID3_H +#define LAME_ID3_H + + +#define CHANGED_FLAG (1U << 0) +#define ADD_V2_FLAG (1U << 1) +#define V1_ONLY_FLAG (1U << 2) +#define V2_ONLY_FLAG (1U << 3) +#define SPACE_V1_FLAG (1U << 4) +#define PAD_V2_FLAG (1U << 5) + +enum { + MIMETYPE_NONE = 0, + MIMETYPE_JPEG, + MIMETYPE_PNG, + MIMETYPE_GIF, +}; + +typedef struct FrameDataNode { + struct FrameDataNode *nxt; + uint32_t fid; /* Frame Identifier */ + char lng[4]; /* 3-character language descriptor */ + struct { + union { + char *l; /* ptr to Latin-1 chars */ + unsigned short *u; /* ptr to UCS-2 text */ + unsigned char *b; /* ptr to raw bytes */ + } ptr; + size_t dim; + int enc; /* 0:Latin-1, 1:UCS-2, 2:RAW */ + } dsc , txt; +} FrameDataNode; + + +typedef struct id3tag_spec { + /* private data members */ + unsigned int flags; + int year; + char *title; + char *artist; + char *album; + char *comment; + int track_id3v1; + int genre_id3v1; + unsigned char *albumart; + unsigned int albumart_size; + unsigned int padding_size; + int albumart_mimetype; + FrameDataNode *v2_head, *v2_tail; +} id3tag_spec; + + +/* write tag into stream at current position */ +extern int id3tag_write_v2(lame_global_flags * gfp); +extern int id3tag_write_v1(lame_global_flags * gfp); +/* + * NOTE: A version 2 tag will NOT be added unless one of the text fields won't + * fit in a version 1 tag (e.g. the title string is longer than 30 characters), + * or the "id3tag_add_v2" or "id3tag_v2_only" functions are used. + */ + +#endif diff --git a/node_modules/lame/deps/lame/libmp3lame/l3side.h b/node_modules/lame/deps/lame/libmp3lame/l3side.h new file mode 100644 index 0000000..f65bbed --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/l3side.h @@ -0,0 +1,95 @@ +/* + * Layer 3 side include file + * + * Copyright (c) 1999 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_L3SIDE_H +#define LAME_L3SIDE_H + +/* max scalefactor band, max(SBMAX_l, SBMAX_s*3, (SBMAX_s-3)*3+8) */ +#define SFBMAX (SBMAX_s*3) + +/* Layer III side information. */ +typedef struct { + int l[1 + SBMAX_l]; + int s[1 + SBMAX_s]; + int psfb21[1 + PSFB21]; + int psfb12[1 + PSFB12]; +} scalefac_struct; + + +typedef struct { + FLOAT l[SBMAX_l]; + FLOAT s[SBMAX_s][3]; +} III_psy_xmin; + +typedef struct { + III_psy_xmin thm; + III_psy_xmin en; +} III_psy_ratio; + +typedef struct { + FLOAT xr[576]; + int l3_enc[576]; + int scalefac[SFBMAX]; + FLOAT xrpow_max; + + int part2_3_length; + int big_values; + int count1; + int global_gain; + int scalefac_compress; + int block_type; + int mixed_block_flag; + int table_select[3]; + int subblock_gain[3 + 1]; + int region0_count; + int region1_count; + int preflag; + int scalefac_scale; + int count1table_select; + + int part2_length; + int sfb_lmax; + int sfb_smin; + int psy_lmax; + int sfbmax; + int psymax; + int sfbdivide; + int width[SFBMAX]; + int window[SFBMAX]; + int count1bits; + /* added for LSF */ + const int *sfb_partition_table; + int slen[4]; + + int max_nonzero_coeff; + char energy_above_cutoff[SFBMAX]; +} gr_info; + +typedef struct { + gr_info tt[2][2]; + int main_data_begin; + int private_bits; + int resvDrain_pre; + int resvDrain_post; + int scfsi[2][4]; +} III_side_info_t; + +#endif diff --git a/node_modules/lame/deps/lame/libmp3lame/lame-analysis.h b/node_modules/lame/deps/lame/libmp3lame/lame-analysis.h new file mode 100644 index 0000000..5055a60 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/lame-analysis.h @@ -0,0 +1,96 @@ +/* + * GTK plotting routines source file + * + * Copyright (c) 1999 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_GTKANAL_H +#define LAME_GTKANAL_H + + +#define READ_AHEAD 40 /* number of frames to read ahead */ +#define MAXMPGLAG READ_AHEAD /* if the mpg123 lag becomes bigger than this + we have to stop */ +#define NUMBACK 6 /* number of frames we can back up */ +#define NUMPINFO (NUMBACK+READ_AHEAD+1) + + + +struct plotting_data { + int frameNum; /* current frame number */ + int frameNum123; + int num_samples; /* number of pcm samples read for this frame */ + double frametime; /* starting time of frame, in seconds */ + double pcmdata[2][1600]; + double pcmdata2[2][1152 + 1152 - DECDELAY]; + double xr[2][2][576]; + double mpg123xr[2][2][576]; + double ms_ratio[2]; + double ms_ener_ratio[2]; + + /* L,R, M and S values */ + double energy_save[4][BLKSIZE]; /* psymodel is one ahead */ + double energy[2][4][BLKSIZE]; + double pe[2][4]; + double thr[2][4][SBMAX_l]; + double en[2][4][SBMAX_l]; + double thr_s[2][4][3 * SBMAX_s]; + double en_s[2][4][3 * SBMAX_s]; + double ers_save[4]; /* psymodel is one ahead */ + double ers[2][4]; + + double sfb[2][2][SBMAX_l]; + double sfb_s[2][2][3 * SBMAX_s]; + double LAMEsfb[2][2][SBMAX_l]; + double LAMEsfb_s[2][2][3 * SBMAX_s]; + + int LAMEqss[2][2]; + int qss[2][2]; + int big_values[2][2]; + int sub_gain[2][2][3]; + + double xfsf[2][2][SBMAX_l]; + double xfsf_s[2][2][3 * SBMAX_s]; + + int over[2][2]; + double tot_noise[2][2]; + double max_noise[2][2]; + double over_noise[2][2]; + int over_SSD[2][2]; + int blocktype[2][2]; + int scalefac_scale[2][2]; + int preflag[2][2]; + int mpg123blocktype[2][2]; + int mixed[2][2]; + int mainbits[2][2]; + int sfbits[2][2]; + int LAMEmainbits[2][2]; + int LAMEsfbits[2][2]; + int framesize, stereo, js, ms_stereo, i_stereo, emph, bitrate, sampfreq, maindata; + int crc, padding; + int scfsi[2], mean_bits, resvsize; + int totbits; +}; +#ifndef plotting_data_defined +#define plotting_data_defined +typedef struct plotting_data plotting_data; +#endif +#if 0 +extern plotting_data *pinfo; +#endif +#endif diff --git a/node_modules/lame/deps/lame/libmp3lame/lame.c b/node_modules/lame/deps/lame/libmp3lame/lame.c new file mode 100644 index 0000000..5989160 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/lame.c @@ -0,0 +1,2614 @@ +/* -*- mode: C; mode: fold -*- */ +/* + * LAME MP3 encoding engine + * + * Copyright (c) 1999-2000 Mark Taylor + * Copyright (c) 2000-2005 Takehiro Tominaga + * Copyright (c) 2000-2011 Robert Hegemann + * Copyright (c) 2000-2005 Gabriel Bouvigne + * Copyright (c) 2000-2004 Alexander Leidinger + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: lame.c,v 1.365 2011/10/18 21:51:20 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + + +#include "lame.h" +#include "machine.h" + +#include "encoder.h" +#include "util.h" +#include "lame_global_flags.h" +#include "gain_analysis.h" +#include "bitstream.h" +#include "quantize_pvt.h" +#include "set_get.h" +#include "quantize.h" +#include "psymodel.h" +#include "version.h" +#include "VbrTag.h" +#include "tables.h" + + +#if defined(__FreeBSD__) && !defined(__alpha__) +#include +#endif +#ifdef __riscos__ +#include "asmstuff.h" +#endif + +#ifdef __sun__ +/* woraround for SunOS 4.x, it has SEEK_* defined here */ +#include +#endif + + +#define LAME_DEFAULT_QUALITY 3 + + + +int +is_lame_global_flags_valid(const lame_global_flags * gfp) +{ + if (gfp == NULL) + return 0; + if (gfp->class_id != LAME_ID) + return 0; + return 1; +} + + +int +is_lame_internal_flags_valid(const lame_internal_flags * gfc) +{ + if (gfc == NULL) + return 0; + if (gfc->class_id != LAME_ID) + return 0; + return 1; +} + + + +static FLOAT +filter_coef(FLOAT x) +{ + if (x > 1.0) + return 0.0; + if (x <= 0.0) + return 1.0; + + return cos(PI / 2 * x); +} + +static void +lame_init_params_ppflt(lame_internal_flags * gfc) +{ + SessionConfig_t *const cfg = &gfc->cfg; + + /***************************************************************/ + /* compute info needed for polyphase filter (filter type==0, default) */ + /***************************************************************/ + + int band, maxband, minband; + FLOAT freq; + int lowpass_band = 32; + int highpass_band = -1; + + if (cfg->lowpass1 > 0) { + minband = 999; + for (band = 0; band <= 31; band++) { + freq = band / 31.0; + /* this band and above will be zeroed: */ + if (freq >= cfg->lowpass2) { + lowpass_band = Min(lowpass_band, band); + } + if (cfg->lowpass1 < freq && freq < cfg->lowpass2) { + minband = Min(minband, band); + } + } + + /* compute the *actual* transition band implemented by + * the polyphase filter */ + if (minband == 999) { + cfg->lowpass1 = (lowpass_band - .75) / 31.0; + } + else { + cfg->lowpass1 = (minband - .75) / 31.0; + } + cfg->lowpass2 = lowpass_band / 31.0; + } + + /* make sure highpass filter is within 90% of what the effective + * highpass frequency will be */ + if (cfg->highpass2 > 0) { + if (cfg->highpass2 < .9 * (.75 / 31.0)) { + cfg->highpass1 = 0; + cfg->highpass2 = 0; + MSGF(gfc, "Warning: highpass filter disabled. " "highpass frequency too small\n"); + } + } + + if (cfg->highpass2 > 0) { + maxband = -1; + for (band = 0; band <= 31; band++) { + freq = band / 31.0; + /* this band and below will be zereod */ + if (freq <= cfg->highpass1) { + highpass_band = Max(highpass_band, band); + } + if (cfg->highpass1 < freq && freq < cfg->highpass2) { + maxband = Max(maxband, band); + } + } + /* compute the *actual* transition band implemented by + * the polyphase filter */ + cfg->highpass1 = highpass_band / 31.0; + if (maxband == -1) { + cfg->highpass2 = (highpass_band + .75) / 31.0; + } + else { + cfg->highpass2 = (maxband + .75) / 31.0; + } + } + + for (band = 0; band < 32; band++) { + FLOAT fc1, fc2; + freq = band / 31.0f; + if (cfg->highpass2 > cfg->highpass1) { + fc1 = filter_coef((cfg->highpass2 - freq) / (cfg->highpass2 - cfg->highpass1 + 1e-20)); + } + else { + fc1 = 1.0f; + } + if (cfg->lowpass2 > cfg->lowpass1) { + fc2 = filter_coef((freq - cfg->lowpass1) / (cfg->lowpass2 - cfg->lowpass1 + 1e-20)); + } + else { + fc2 = 1.0f; + } + gfc->sv_enc.amp_filter[band] = fc1 * fc2; + } +} + + +static void +optimum_bandwidth(double *const lowerlimit, double *const upperlimit, const unsigned bitrate) +{ +/* + * Input: + * bitrate total bitrate in kbps + * + * Output: + * lowerlimit: best lowpass frequency limit for input filter in Hz + * upperlimit: best highpass frequency limit for input filter in Hz + */ + int table_index; + + typedef struct { + int bitrate; /* only indicative value */ + int lowpass; + } band_pass_t; + + const band_pass_t freq_map[] = { + {8, 2000}, + {16, 3700}, + {24, 3900}, + {32, 5500}, + {40, 7000}, + {48, 7500}, + {56, 10000}, + {64, 11000}, + {80, 13500}, + {96, 15100}, + {112, 15600}, + {128, 17000}, + {160, 17500}, + {192, 18600}, + {224, 19400}, + {256, 19700}, + {320, 20500} + }; + + + table_index = nearestBitrateFullIndex(bitrate); + + (void) freq_map[table_index].bitrate; + *lowerlimit = freq_map[table_index].lowpass; + + +/* + * Now we try to choose a good high pass filtering frequency. + * This value is currently not used. + * For fu < 16 kHz: sqrt(fu*fl) = 560 Hz + * For fu = 18 kHz: no high pass filtering + * This gives: + * + * 2 kHz => 160 Hz + * 3 kHz => 107 Hz + * 4 kHz => 80 Hz + * 8 kHz => 40 Hz + * 16 kHz => 20 Hz + * 17 kHz => 10 Hz + * 18 kHz => 0 Hz + * + * These are ad hoc values and these can be optimized if a high pass is available. + */ +/* if (f_low <= 16000) + f_high = 16000. * 20. / f_low; + else if (f_low <= 18000) + f_high = 180. - 0.01 * f_low; + else + f_high = 0.;*/ + + /* + * When we sometimes have a good highpass filter, we can add the highpass + * frequency to the lowpass frequency + */ + + /*if (upperlimit != NULL) + *upperlimit = f_high;*/ + (void) upperlimit; +} + + +static int +optimum_samplefreq(int lowpassfreq, int input_samplefreq) +{ +/* + * Rules: + * - if possible, sfb21 should NOT be used + * + */ + int suggested_samplefreq = 44100; + + if (input_samplefreq >= 48000) + suggested_samplefreq = 48000; + else if (input_samplefreq >= 44100) + suggested_samplefreq = 44100; + else if (input_samplefreq >= 32000) + suggested_samplefreq = 32000; + else if (input_samplefreq >= 24000) + suggested_samplefreq = 24000; + else if (input_samplefreq >= 22050) + suggested_samplefreq = 22050; + else if (input_samplefreq >= 16000) + suggested_samplefreq = 16000; + else if (input_samplefreq >= 12000) + suggested_samplefreq = 12000; + else if (input_samplefreq >= 11025) + suggested_samplefreq = 11025; + else if (input_samplefreq >= 8000) + suggested_samplefreq = 8000; + + if (lowpassfreq == -1) + return suggested_samplefreq; + + if (lowpassfreq <= 15960) + suggested_samplefreq = 44100; + if (lowpassfreq <= 15250) + suggested_samplefreq = 32000; + if (lowpassfreq <= 11220) + suggested_samplefreq = 24000; + if (lowpassfreq <= 9970) + suggested_samplefreq = 22050; + if (lowpassfreq <= 7230) + suggested_samplefreq = 16000; + if (lowpassfreq <= 5420) + suggested_samplefreq = 12000; + if (lowpassfreq <= 4510) + suggested_samplefreq = 11025; + if (lowpassfreq <= 3970) + suggested_samplefreq = 8000; + + if (input_samplefreq < suggested_samplefreq) { + /* choose a valid MPEG sample frequency above the input sample frequency + to avoid SFB21/12 bitrate bloat + rh 061115 + */ + if (input_samplefreq > 44100) { + return 48000; + } + if (input_samplefreq > 32000) { + return 44100; + } + if (input_samplefreq > 24000) { + return 32000; + } + if (input_samplefreq > 22050) { + return 24000; + } + if (input_samplefreq > 16000) { + return 22050; + } + if (input_samplefreq > 12000) { + return 16000; + } + if (input_samplefreq > 11025) { + return 12000; + } + if (input_samplefreq > 8000) { + return 11025; + } + return 8000; + } + return suggested_samplefreq; +} + + + + + +/* set internal feature flags. USER should not access these since + * some combinations will produce strange results */ +static void +lame_init_qval(lame_global_flags * gfp) +{ + lame_internal_flags *const gfc = gfp->internal_flags; + SessionConfig_t *const cfg = &gfc->cfg; + + switch (gfp->quality) { + default: + case 9: /* no psymodel, no noise shaping */ + cfg->noise_shaping = 0; + cfg->noise_shaping_amp = 0; + cfg->noise_shaping_stop = 0; + cfg->use_best_huffman = 0; + cfg->full_outer_loop = 0; + break; + + case 8: + gfp->quality = 7; + /*lint --fallthrough */ + case 7: /* use psymodel (for short block and m/s switching), but no noise shapping */ + cfg->noise_shaping = 0; + cfg->noise_shaping_amp = 0; + cfg->noise_shaping_stop = 0; + cfg->use_best_huffman = 0; + cfg->full_outer_loop = 0; + if (gfp->VBR == vbr_mt || gfp->VBR == vbr_mtrh) { + cfg->full_outer_loop = -1; + } + break; + + case 6: + if (cfg->noise_shaping == 0) + cfg->noise_shaping = 1; + cfg->noise_shaping_amp = 0; + cfg->noise_shaping_stop = 0; + if (cfg->subblock_gain == -1) + cfg->subblock_gain = 1; + cfg->use_best_huffman = 0; + cfg->full_outer_loop = 0; + break; + + case 5: + if (cfg->noise_shaping == 0) + cfg->noise_shaping = 1; + cfg->noise_shaping_amp = 0; + cfg->noise_shaping_stop = 0; + if (cfg->subblock_gain == -1) + cfg->subblock_gain = 1; + cfg->use_best_huffman = 0; + cfg->full_outer_loop = 0; + break; + + case 4: + if (cfg->noise_shaping == 0) + cfg->noise_shaping = 1; + cfg->noise_shaping_amp = 0; + cfg->noise_shaping_stop = 0; + if (cfg->subblock_gain == -1) + cfg->subblock_gain = 1; + cfg->use_best_huffman = 1; + cfg->full_outer_loop = 0; + break; + + case 3: + if (cfg->noise_shaping == 0) + cfg->noise_shaping = 1; + cfg->noise_shaping_amp = 1; + cfg->noise_shaping_stop = 1; + if (cfg->subblock_gain == -1) + cfg->subblock_gain = 1; + cfg->use_best_huffman = 1; + cfg->full_outer_loop = 0; + break; + + case 2: + if (cfg->noise_shaping == 0) + cfg->noise_shaping = 1; + if (gfc->sv_qnt.substep_shaping == 0) + gfc->sv_qnt.substep_shaping = 2; + cfg->noise_shaping_amp = 1; + cfg->noise_shaping_stop = 1; + if (cfg->subblock_gain == -1) + cfg->subblock_gain = 1; + cfg->use_best_huffman = 1; /* inner loop */ + cfg->full_outer_loop = 0; + break; + + case 1: + if (cfg->noise_shaping == 0) + cfg->noise_shaping = 1; + if (gfc->sv_qnt.substep_shaping == 0) + gfc->sv_qnt.substep_shaping = 2; + cfg->noise_shaping_amp = 2; + cfg->noise_shaping_stop = 1; + if (cfg->subblock_gain == -1) + cfg->subblock_gain = 1; + cfg->use_best_huffman = 1; + cfg->full_outer_loop = 0; + break; + + case 0: + if (cfg->noise_shaping == 0) + cfg->noise_shaping = 1; + if (gfc->sv_qnt.substep_shaping == 0) + gfc->sv_qnt.substep_shaping = 2; + cfg->noise_shaping_amp = 2; + cfg->noise_shaping_stop = 1; + if (cfg->subblock_gain == -1) + cfg->subblock_gain = 1; + cfg->use_best_huffman = 1; /*type 2 disabled because of it slowness, + in favor of full outer loop search */ + cfg->full_outer_loop = 1; + break; + } + +} + + + +static double +linear_int(double a, double b, double m) +{ + return a + m * (b - a); +} + + + +/******************************************************************** + * initialize internal params based on data in gf + * (globalflags struct filled in by calling program) + * + * OUTLINE: + * + * We first have some complex code to determine bitrate, + * output samplerate and mode. It is complicated by the fact + * that we allow the user to set some or all of these parameters, + * and need to determine best possible values for the rest of them: + * + * 1. set some CPU related flags + * 2. check if we are mono->mono, stereo->mono or stereo->stereo + * 3. compute bitrate and output samplerate: + * user may have set compression ratio + * user may have set a bitrate + * user may have set a output samplerate + * 4. set some options which depend on output samplerate + * 5. compute the actual compression ratio + * 6. set mode based on compression ratio + * + * The remaining code is much simpler - it just sets options + * based on the mode & compression ratio: + * + * set allow_diff_short based on mode + * select lowpass filter based on compression ratio & mode + * set the bitrate index, and min/max bitrates for VBR modes + * disable VBR tag if it is not appropriate + * initialize the bitstream + * initialize scalefac_band data + * set sideinfo_len (based on channels, CRC, out_samplerate) + * write an id3v2 tag into the bitstream + * write VBR tag into the bitstream + * set mpeg1/2 flag + * estimate the number of frames (based on a lot of data) + * + * now we set more flags: + * nspsytune: + * see code + * VBR modes + * see code + * CBR/ABR + * see code + * + * Finally, we set the algorithm flags based on the gfp->quality value + * lame_init_qval(gfp); + * + ********************************************************************/ +int +lame_init_params(lame_global_flags * gfp) +{ + + int i; + int j; + lame_internal_flags *const gfc = gfp->internal_flags; + SessionConfig_t *const cfg = &gfc->cfg; + + gfc->class_id = 0; + + cfg->enforce_min_bitrate = gfp->VBR_hard_min; + cfg->analysis = gfp->analysis; + if (cfg->analysis) + gfp->write_lame_tag = 0; + + /* some file options not allowed if output is: not specified or stdout */ + if (gfc->pinfo != NULL) + gfp->write_lame_tag = 0; /* disable Xing VBR tag */ + + /* report functions */ + gfc->report_msg = gfp->report.msgf; + gfc->report_dbg = gfp->report.debugf; + gfc->report_err = gfp->report.errorf; + + if (gfp->asm_optimizations.amd3dnow) + gfc->CPU_features.AMD_3DNow = has_3DNow(); + else + gfc->CPU_features.AMD_3DNow = 0; + + if (gfp->asm_optimizations.mmx) + gfc->CPU_features.MMX = has_MMX(); + else + gfc->CPU_features.MMX = 0; + + if (gfp->asm_optimizations.sse) { + gfc->CPU_features.SSE = has_SSE(); + gfc->CPU_features.SSE2 = has_SSE2(); + } + else { + gfc->CPU_features.SSE = 0; + gfc->CPU_features.SSE2 = 0; + } + + + if (NULL == gfc->ATH) + gfc->ATH = calloc(1, sizeof(ATH_t)); + + if (NULL == gfc->ATH) + return -2; /* maybe error codes should be enumerated in lame.h ?? */ + + if (NULL == gfc->sv_rpg.rgdata) + gfc->sv_rpg.rgdata = calloc(1, sizeof(replaygain_t)); + if (NULL == gfc->sv_rpg.rgdata) { + freegfc(gfc); + gfp->internal_flags = NULL; + return -2; + } + + cfg->error_protection = gfp->error_protection; + cfg->copyright = gfp->copyright; + cfg->original = gfp->original; + cfg->extension = gfp->extension; + cfg->emphasis = gfp->emphasis; + + cfg->channels_in = gfp->num_channels; + if (cfg->channels_in == 1) + gfp->mode = MONO; + cfg->channels_out = (gfp->mode == MONO) ? 1 : 2; + if (gfp->mode == MONO) + gfp->force_ms = 0; /* don't allow forced mid/side stereo for mono output */ + cfg->force_ms = gfp->force_ms; + + if (gfp->VBR == vbr_off && gfp->VBR_mean_bitrate_kbps != 128 && gfp->brate == 0) + gfp->brate = gfp->VBR_mean_bitrate_kbps; + + switch (gfp->VBR) { + case vbr_off: + case vbr_mtrh: + case vbr_mt: + /* these modes can handle free format condition */ + break; + default: + gfp->free_format = 0; /* mode can't be mixed with free format */ + break; + } + + cfg->free_format = gfp->free_format; + + if (gfp->VBR == vbr_off && gfp->brate == 0) { + /* no bitrate or compression ratio specified, use 11.025 */ + if (EQ(gfp->compression_ratio, 0)) + gfp->compression_ratio = 11.025; /* rate to compress a CD down to exactly 128000 bps */ + } + + /* find bitrate if user specify a compression ratio */ + if (gfp->VBR == vbr_off && gfp->compression_ratio > 0) { + + if (gfp->samplerate_out == 0) + gfp->samplerate_out = map2MP3Frequency((int) (0.97 * gfp->samplerate_in)); /* round up with a margin of 3% */ + + /* choose a bitrate for the output samplerate which achieves + * specified compression ratio + */ + gfp->brate = gfp->samplerate_out * 16 * cfg->channels_out / (1.e3 * gfp->compression_ratio); + + /* we need the version for the bitrate table look up */ + cfg->samplerate_index = SmpFrqIndex(gfp->samplerate_out, &cfg->version); + + if (!cfg->free_format) /* for non Free Format find the nearest allowed bitrate */ + gfp->brate = FindNearestBitrate(gfp->brate, cfg->version, gfp->samplerate_out); + } + if (gfp->samplerate_out) { + if (gfp->samplerate_out < 16000) { + gfp->VBR_mean_bitrate_kbps = Max(gfp->VBR_mean_bitrate_kbps, 8); + gfp->VBR_mean_bitrate_kbps = Min(gfp->VBR_mean_bitrate_kbps, 64); + } + else if (gfp->samplerate_out < 32000) { + gfp->VBR_mean_bitrate_kbps = Max(gfp->VBR_mean_bitrate_kbps, 8); + gfp->VBR_mean_bitrate_kbps = Min(gfp->VBR_mean_bitrate_kbps, 160); + } + else { + gfp->VBR_mean_bitrate_kbps = Max(gfp->VBR_mean_bitrate_kbps, 32); + gfp->VBR_mean_bitrate_kbps = Min(gfp->VBR_mean_bitrate_kbps, 320); + } + } + /* WORK IN PROGRESS */ + /* mapping VBR scale to internal VBR quality settings */ + if (gfp->samplerate_out == 0 && (gfp->VBR == vbr_mt || gfp->VBR == vbr_mtrh)) { + float const qval = gfp->VBR_q + gfp->VBR_q_frac; + struct q_map { int sr_a; float qa, qb, ta, tb; int lp; }; + struct q_map const m[9] + = { {48000, 0.0,6.5, 0.0,6.5, 23700} + , {44100, 0.0,6.5, 0.0,6.5, 21780} + , {32000, 6.5,8.0, 5.2,6.5, 15800} + , {24000, 8.0,8.5, 5.2,6.0, 11850} + , {22050, 8.5,9.01, 5.2,6.5, 10892} + , {16000, 9.01,9.4, 4.9,6.5, 7903} + , {12000, 9.4,9.6, 4.5,6.0, 5928} + , {11025, 9.6,9.9, 5.1,6.5, 5446} + , { 8000, 9.9,10., 4.9,6.5, 3952} + }; + for (i = 2; i < 9; ++i) { + if (gfp->samplerate_in == m[i].sr_a) { + if (qval < m[i].qa) { + double d = qval / m[i].qa; + d = d * m[i].ta; + gfp->VBR_q = (int)d; + gfp->VBR_q_frac = d - gfp->VBR_q; + } + } + if (gfp->samplerate_in >= m[i].sr_a) { + if (m[i].qa <= qval && qval < m[i].qb) { + float const q_ = m[i].qb-m[i].qa; + float const t_ = m[i].tb-m[i].ta; + double d = m[i].ta + t_ * (qval-m[i].qa) / q_; + gfp->VBR_q = (int)d; + gfp->VBR_q_frac = d - gfp->VBR_q; + gfp->samplerate_out = m[i].sr_a; + if (gfp->lowpassfreq == 0) { + gfp->lowpassfreq = -1; + } + break; + } + } + } + } + + /****************************************************************/ + /* if a filter has not been enabled, see if we should add one: */ + /****************************************************************/ + if (gfp->lowpassfreq == 0) { + double lowpass = 16000; + double highpass; + + switch (gfp->VBR) { + case vbr_off:{ + optimum_bandwidth(&lowpass, &highpass, gfp->brate); + break; + } + case vbr_abr:{ + optimum_bandwidth(&lowpass, &highpass, gfp->VBR_mean_bitrate_kbps); + break; + } + case vbr_rh:{ + int const x[11] = { + 19500, 19000, 18600, 18000, 17500, 16000, 15600, 14900, 12500, 10000, 3950 + }; + if (0 <= gfp->VBR_q && gfp->VBR_q <= 9) { + double a = x[gfp->VBR_q], b = x[gfp->VBR_q + 1], m = gfp->VBR_q_frac; + lowpass = linear_int(a, b, m); + } + else { + lowpass = 19500; + } + break; + } + case vbr_mtrh: + case vbr_mt:{ + int const x[11] = { + 24000, 19500, 18500, 18000, 17500, 17000, 16500, 15600, 15200, 7230, 3950 + }; + if (0 <= gfp->VBR_q && gfp->VBR_q <= 9) { + double a = x[gfp->VBR_q], b = x[gfp->VBR_q + 1], m = gfp->VBR_q_frac; + lowpass = linear_int(a, b, m); + } + else { + lowpass = 21500; + } + break; + } + default:{ + int const x[11] = { + 19500, 19000, 18500, 18000, 17500, 16500, 15500, 14500, 12500, 9500, 3950 + }; + if (0 <= gfp->VBR_q && gfp->VBR_q <= 9) { + double a = x[gfp->VBR_q], b = x[gfp->VBR_q + 1], m = gfp->VBR_q_frac; + lowpass = linear_int(a, b, m); + } + else { + lowpass = 19500; + } + } + } + + if (gfp->mode == MONO && (gfp->VBR == vbr_off || gfp->VBR == vbr_abr)) + lowpass *= 1.5; + + gfp->lowpassfreq = lowpass; + } + + if (gfp->samplerate_out == 0) { + if (2 * gfp->lowpassfreq > gfp->samplerate_in) { + gfp->lowpassfreq = gfp->samplerate_in / 2; + } + gfp->samplerate_out = optimum_samplefreq((int) gfp->lowpassfreq, gfp->samplerate_in); + } + if (gfp->VBR == vbr_mt || gfp->VBR == vbr_mtrh) { + gfp->lowpassfreq = Min(24000, gfp->lowpassfreq); + } + else { + gfp->lowpassfreq = Min(20500, gfp->lowpassfreq); + } + gfp->lowpassfreq = Min(gfp->samplerate_out / 2, gfp->lowpassfreq); + + if (gfp->VBR == vbr_off) { + gfp->compression_ratio = gfp->samplerate_out * 16 * cfg->channels_out / (1.e3 * gfp->brate); + } + if (gfp->VBR == vbr_abr) { + gfp->compression_ratio = + gfp->samplerate_out * 16 * cfg->channels_out / (1.e3 * gfp->VBR_mean_bitrate_kbps); + } + + /* do not compute ReplayGain values and do not find the peak sample + if we can't store them */ + if (!gfp->write_lame_tag) { + gfp->findReplayGain = 0; + gfp->decode_on_the_fly = 0; + cfg->findPeakSample = 0; + } + + cfg->findReplayGain = gfp->findReplayGain; + cfg->decode_on_the_fly = gfp->decode_on_the_fly; + + if (cfg->decode_on_the_fly) + cfg->findPeakSample = 1; + + if (cfg->findReplayGain) { + if (InitGainAnalysis(gfc->sv_rpg.rgdata, gfp->samplerate_out) == INIT_GAIN_ANALYSIS_ERROR) { + freegfc(gfc); + gfp->internal_flags = NULL; + return -6; + } + } + +#ifdef DECODE_ON_THE_FLY + if (cfg->decode_on_the_fly && !gfp->decode_only) { + if (gfc->hip) { + hip_decode_exit(gfc->hip); + } + gfc->hip = hip_decode_init(); + /* report functions */ + hip_set_errorf(gfc->hip, gfp->report.errorf); + hip_set_debugf(gfc->hip, gfp->report.debugf); + hip_set_msgf(gfc->hip, gfp->report.msgf); + } +#endif + + cfg->disable_reservoir = gfp->disable_reservoir; + cfg->lowpassfreq = gfp->lowpassfreq; + cfg->highpassfreq = gfp->highpassfreq; + cfg->samplerate_in = gfp->samplerate_in; + cfg->samplerate_out = gfp->samplerate_out; + cfg->mode_gr = cfg->samplerate_out <= 24000 ? 1 : 2; /* Number of granules per frame */ + gfc->ov_enc.encoder_delay = ENCDELAY; + + + /* + * sample freq bitrate compression ratio + * [kHz] [kbps/channel] for 16 bit input + * 44.1 56 12.6 + * 44.1 64 11.025 + * 44.1 80 8.82 + * 22.05 24 14.7 + * 22.05 32 11.025 + * 22.05 40 8.82 + * 16 16 16.0 + * 16 24 10.667 + * + */ + /* + * For VBR, take a guess at the compression_ratio. + * For example: + * + * VBR_q compression like + * - 4.4 320 kbps/44 kHz + * 0...1 5.5 256 kbps/44 kHz + * 2 7.3 192 kbps/44 kHz + * 4 8.8 160 kbps/44 kHz + * 6 11 128 kbps/44 kHz + * 9 14.7 96 kbps + * + * for lower bitrates, downsample with --resample + */ + + switch (gfp->VBR) { + case vbr_mt: + case vbr_rh: + case vbr_mtrh: + { + /*numbers are a bit strange, but they determine the lowpass value */ + FLOAT const cmp[] = { 5.7, 6.5, 7.3, 8.2, 10, 11.9, 13, 14, 15, 16.5 }; + gfp->compression_ratio = cmp[gfp->VBR_q]; + } + break; + case vbr_abr: + gfp->compression_ratio = + cfg->samplerate_out * 16 * cfg->channels_out / (1.e3 * gfp->VBR_mean_bitrate_kbps); + break; + default: + gfp->compression_ratio = cfg->samplerate_out * 16 * cfg->channels_out / (1.e3 * gfp->brate); + break; + } + + + /* mode = -1 (not set by user) or + * mode = MONO (because of only 1 input channel). + * If mode has not been set, then select J-STEREO + */ + if (gfp->mode == NOT_SET) { + gfp->mode = JOINT_STEREO; + } + + cfg->mode = gfp->mode; + + + /* apply user driven high pass filter */ + if (cfg->highpassfreq > 0) { + cfg->highpass1 = 2. * cfg->highpassfreq; + + if (gfp->highpasswidth >= 0) + cfg->highpass2 = 2. * (cfg->highpassfreq + gfp->highpasswidth); + else /* 0% above on default */ + cfg->highpass2 = (1 + 0.00) * 2. * cfg->highpassfreq; + + cfg->highpass1 /= cfg->samplerate_out; + cfg->highpass2 /= cfg->samplerate_out; + } + else { + cfg->highpass1 = 0; + cfg->highpass2 = 0; + } + /* apply user driven low pass filter */ + cfg->lowpass1 = 0; + cfg->lowpass2 = 0; + if (cfg->lowpassfreq > 0 && cfg->lowpassfreq < (cfg->samplerate_out / 2) ) { + cfg->lowpass2 = 2. * cfg->lowpassfreq; + if (gfp->lowpasswidth >= 0) { + cfg->lowpass1 = 2. * (cfg->lowpassfreq - gfp->lowpasswidth); + if (cfg->lowpass1 < 0) /* has to be >= 0 */ + cfg->lowpass1 = 0; + } + else { /* 0% below on default */ + cfg->lowpass1 = (1 - 0.00) * 2. * cfg->lowpassfreq; + } + cfg->lowpass1 /= cfg->samplerate_out; + cfg->lowpass2 /= cfg->samplerate_out; + } + + + + + /**********************************************************************/ + /* compute info needed for polyphase filter (filter type==0, default) */ + /**********************************************************************/ + lame_init_params_ppflt(gfc); + + + /******************************************************* + * samplerate and bitrate index + *******************************************************/ + cfg->samplerate_index = SmpFrqIndex(cfg->samplerate_out, &cfg->version); + if (cfg->samplerate_index < 0) { + freegfc(gfc); + gfp->internal_flags = NULL; + return -1; + } + + if (gfp->VBR == vbr_off) { + if (cfg->free_format) { + gfc->ov_enc.bitrate_index = 0; + } + else { + gfp->brate = FindNearestBitrate(gfp->brate, cfg->version, cfg->samplerate_out); + gfc->ov_enc.bitrate_index = BitrateIndex(gfp->brate, cfg->version, cfg->samplerate_out); + if (gfc->ov_enc.bitrate_index <= 0) { + freegfc(gfc); + gfp->internal_flags = NULL; + return -1; + } + } + } + else { + gfc->ov_enc.bitrate_index = 1; + } + + init_bit_stream_w(gfc); + + j = cfg->samplerate_index + (3 * cfg->version) + 6 * (cfg->samplerate_out < 16000); + for (i = 0; i < SBMAX_l + 1; i++) + gfc->scalefac_band.l[i] = sfBandIndex[j].l[i]; + + for (i = 0; i < PSFB21 + 1; i++) { + int const size = (gfc->scalefac_band.l[22] - gfc->scalefac_band.l[21]) / PSFB21; + int const start = gfc->scalefac_band.l[21] + i * size; + gfc->scalefac_band.psfb21[i] = start; + } + gfc->scalefac_band.psfb21[PSFB21] = 576; + + for (i = 0; i < SBMAX_s + 1; i++) + gfc->scalefac_band.s[i] = sfBandIndex[j].s[i]; + + for (i = 0; i < PSFB12 + 1; i++) { + int const size = (gfc->scalefac_band.s[13] - gfc->scalefac_band.s[12]) / PSFB12; + int const start = gfc->scalefac_band.s[12] + i * size; + gfc->scalefac_band.psfb12[i] = start; + } + gfc->scalefac_band.psfb12[PSFB12] = 192; + + /* determine the mean bitrate for main data */ + if (cfg->mode_gr == 2) /* MPEG 1 */ + cfg->sideinfo_len = (cfg->channels_out == 1) ? 4 + 17 : 4 + 32; + else /* MPEG 2 */ + cfg->sideinfo_len = (cfg->channels_out == 1) ? 4 + 9 : 4 + 17; + + if (cfg->error_protection) + cfg->sideinfo_len += 2; + + gfc->class_id = LAME_ID; + + { + int k; + + for (k = 0; k < 19; k++) + gfc->sv_enc.pefirbuf[k] = 700 * cfg->mode_gr * cfg->channels_out; + + if (gfp->ATHtype == -1) + gfp->ATHtype = 4; + } + + assert(gfp->VBR_q <= 9); + assert(gfp->VBR_q >= 0); + + switch (gfp->VBR) { + + case vbr_mt: + case vbr_mtrh:{ + if (gfp->strict_ISO < 0) { + gfp->strict_ISO = MDB_MAXIMUM; + } + if (gfp->useTemporal < 0) { + gfp->useTemporal = 0; /* off by default for this VBR mode */ + } + + (void) apply_preset(gfp, 500 - (gfp->VBR_q * 10), 0); + /* The newer VBR code supports only a limited + subset of quality levels: + 9-5=5 are the same, uses x^3/4 quantization + 4-0=0 are the same 5 plus best huffman divide code + */ + if (gfp->quality < 0) + gfp->quality = LAME_DEFAULT_QUALITY; + if (gfp->quality < 5) + gfp->quality = 0; + if (gfp->quality > 7) + gfp->quality = 7; + + /* sfb21 extra only with MPEG-1 at higher sampling rates + */ + if (gfp->experimentalY) + gfc->sv_qnt.sfb21_extra = 0; + else + gfc->sv_qnt.sfb21_extra = (cfg->samplerate_out > 44000); + + gfc->iteration_loop = VBR_new_iteration_loop; + break; + + } + case vbr_rh:{ + + (void) apply_preset(gfp, 500 - (gfp->VBR_q * 10), 0); + + /* sfb21 extra only with MPEG-1 at higher sampling rates + */ + if (gfp->experimentalY) + gfc->sv_qnt.sfb21_extra = 0; + else + gfc->sv_qnt.sfb21_extra = (cfg->samplerate_out > 44000); + + /* VBR needs at least the output of GPSYCHO, + * so we have to garantee that by setting a minimum + * quality level, actually level 6 does it. + * down to level 6 + */ + if (gfp->quality > 6) + gfp->quality = 6; + + + if (gfp->quality < 0) + gfp->quality = LAME_DEFAULT_QUALITY; + + gfc->iteration_loop = VBR_old_iteration_loop; + break; + } + + default: /* cbr/abr */ { + vbr_mode vbrmode; + + /* no sfb21 extra with CBR code + */ + gfc->sv_qnt.sfb21_extra = 0; + + if (gfp->quality < 0) + gfp->quality = LAME_DEFAULT_QUALITY; + + + vbrmode = gfp->VBR; + if (vbrmode == vbr_off) + (void) lame_set_VBR_mean_bitrate_kbps(gfp, gfp->brate); + /* second, set parameters depending on bitrate */ + (void) apply_preset(gfp, gfp->VBR_mean_bitrate_kbps, 0); + gfp->VBR = vbrmode; + + if (vbrmode == vbr_off) { + gfc->iteration_loop = CBR_iteration_loop; + } + else { + gfc->iteration_loop = ABR_iteration_loop; + } + break; + } + } + + /*initialize default values common for all modes */ + + gfc->sv_qnt.mask_adjust = gfp->maskingadjust; + gfc->sv_qnt.mask_adjust_short = gfp->maskingadjust_short; + + /* just another daily changing developer switch */ + if (gfp->tune) { + gfc->sv_qnt.mask_adjust += gfp->tune_value_a; + gfc->sv_qnt.mask_adjust_short += gfp->tune_value_a; + } + + + if (gfp->VBR != vbr_off) { /* choose a min/max bitrate for VBR */ + /* if the user didn't specify VBR_max_bitrate: */ + cfg->vbr_min_bitrate_index = 1; /* default: allow 8 kbps (MPEG-2) or 32 kbps (MPEG-1) */ + cfg->vbr_max_bitrate_index = 14; /* default: allow 160 kbps (MPEG-2) or 320 kbps (MPEG-1) */ + if (cfg->samplerate_out < 16000) + cfg->vbr_max_bitrate_index = 8; /* default: allow 64 kbps (MPEG-2.5) */ + if (gfp->VBR_min_bitrate_kbps) { + gfp->VBR_min_bitrate_kbps = + FindNearestBitrate(gfp->VBR_min_bitrate_kbps, cfg->version, cfg->samplerate_out); + cfg->vbr_min_bitrate_index = + BitrateIndex(gfp->VBR_min_bitrate_kbps, cfg->version, cfg->samplerate_out); + if (cfg->vbr_min_bitrate_index < 0) + return -1; + } + if (gfp->VBR_max_bitrate_kbps) { + gfp->VBR_max_bitrate_kbps = + FindNearestBitrate(gfp->VBR_max_bitrate_kbps, cfg->version, cfg->samplerate_out); + cfg->vbr_max_bitrate_index = + BitrateIndex(gfp->VBR_max_bitrate_kbps, cfg->version, cfg->samplerate_out); + if (cfg->vbr_max_bitrate_index < 0) + return -1; + } + gfp->VBR_min_bitrate_kbps = bitrate_table[cfg->version][cfg->vbr_min_bitrate_index]; + gfp->VBR_max_bitrate_kbps = bitrate_table[cfg->version][cfg->vbr_max_bitrate_index]; + gfp->VBR_mean_bitrate_kbps = + Min(bitrate_table[cfg->version][cfg->vbr_max_bitrate_index], + gfp->VBR_mean_bitrate_kbps); + gfp->VBR_mean_bitrate_kbps = + Max(bitrate_table[cfg->version][cfg->vbr_min_bitrate_index], + gfp->VBR_mean_bitrate_kbps); + } + + cfg->preset = gfp->preset; + cfg->write_lame_tag = gfp->write_lame_tag; + cfg->vbr = gfp->VBR; + gfc->sv_qnt.substep_shaping = gfp->substep_shaping; + cfg->noise_shaping = gfp->noise_shaping; + cfg->subblock_gain = gfp->subblock_gain; + cfg->use_best_huffman = gfp->use_best_huffman; + cfg->avg_bitrate = gfp->brate; + cfg->vbr_avg_bitrate_kbps = gfp->VBR_mean_bitrate_kbps; + cfg->compression_ratio = gfp->compression_ratio; + + /* initialize internal qval settings */ + lame_init_qval(gfp); + + + /* automatic ATH adjustment on + */ + if (gfp->athaa_type < 0) + gfc->ATH->use_adjust = 3; + else + gfc->ATH->use_adjust = gfp->athaa_type; + + + /* initialize internal adaptive ATH settings -jd */ + gfc->ATH->aa_sensitivity_p = pow(10.0, gfp->athaa_sensitivity / -10.0); + + + if (gfp->short_blocks == short_block_not_set) { + gfp->short_blocks = short_block_allowed; + } + + /*Note Jan/2003: Many hardware decoders cannot handle short blocks in regular + stereo mode unless they are coupled (same type in both channels) + it is a rare event (1 frame per min. or so) that LAME would use + uncoupled short blocks, so lets turn them off until we decide + how to handle this. No other encoders allow uncoupled short blocks, + even though it is in the standard. */ + /* rh 20040217: coupling makes no sense for mono and dual-mono streams + */ + if (gfp->short_blocks == short_block_allowed + && (cfg->mode == JOINT_STEREO || cfg->mode == STEREO)) { + gfp->short_blocks = short_block_coupled; + } + + cfg->short_blocks = gfp->short_blocks; + + + if (lame_get_quant_comp(gfp) < 0) + (void) lame_set_quant_comp(gfp, 1); + if (lame_get_quant_comp_short(gfp) < 0) + (void) lame_set_quant_comp_short(gfp, 0); + + if (lame_get_msfix(gfp) < 0) + lame_set_msfix(gfp, 0); + + /* select psychoacoustic model */ + (void) lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | 1); + + if (gfp->ATHtype < 0) + gfp->ATHtype = 4; + + if (gfp->ATHcurve < 0) + gfp->ATHcurve = 4; + + if (gfp->interChRatio < 0) + gfp->interChRatio = 0; + + if (gfp->useTemporal < 0) + gfp->useTemporal = 1; /* on by default */ + + + cfg->interChRatio = gfp->interChRatio; + cfg->msfix = gfp->msfix; + cfg->ATH_offset_db = 0-gfp->ATH_lower_db; + cfg->ATH_offset_factor = powf(10.f, cfg->ATH_offset_db * 0.1f); + cfg->ATHcurve = gfp->ATHcurve; + cfg->ATHtype = gfp->ATHtype; + cfg->ATHonly = gfp->ATHonly; + cfg->ATHshort = gfp->ATHshort; + cfg->noATH = gfp->noATH; + + cfg->quant_comp = gfp->quant_comp; + cfg->quant_comp_short = gfp->quant_comp_short; + + cfg->use_temporal_masking_effect = gfp->useTemporal; + cfg->use_safe_joint_stereo = gfp->exp_nspsytune & 2; + { + cfg->adjust_bass_db = (gfp->exp_nspsytune >> 2) & 63; + if (cfg->adjust_bass_db >= 32.f) + cfg->adjust_bass_db -= 64.f; + cfg->adjust_bass_db *= 0.25f; + + cfg->adjust_alto_db = (gfp->exp_nspsytune >> 8) & 63; + if (cfg->adjust_alto_db >= 32.f) + cfg->adjust_alto_db -= 64.f; + cfg->adjust_alto_db *= 0.25f; + + cfg->adjust_treble_db = (gfp->exp_nspsytune >> 14) & 63; + if (cfg->adjust_treble_db >= 32.f) + cfg->adjust_treble_db -= 64.f; + cfg->adjust_treble_db *= 0.25f; + + /* to be compatible with Naoki's original code, the next 6 bits + * define only the amount of changing treble for sfb21 */ + cfg->adjust_sfb21_db = (gfp->exp_nspsytune >> 20) & 63; + if (cfg->adjust_sfb21_db >= 32.f) + cfg->adjust_sfb21_db -= 64.f; + cfg->adjust_sfb21_db *= 0.25f; + cfg->adjust_sfb21_db += cfg->adjust_treble_db; + } + + /* Setting up the PCM input data transform matrix, to apply + * user defined re-scaling, and or two-to-one channel downmix. + */ + { + FLOAT m[2][2] = { {1.0f, 0.0f}, {0.0f, 1.0f} }; + + /* user selected scaling of the samples */ + m[0][0] *= gfp->scale; + m[0][1] *= gfp->scale; + m[1][0] *= gfp->scale; + m[1][1] *= gfp->scale; + /* user selected scaling of the channel 0 (left) samples */ + m[0][0] *= gfp->scale_left; + m[0][1] *= gfp->scale_left; + /* user selected scaling of the channel 1 (right) samples */ + m[1][0] *= gfp->scale_right; + m[1][1] *= gfp->scale_right; + /* Downsample to Mono if 2 channels in and 1 channel out */ + if (cfg->channels_in == 2 && cfg->channels_out == 1) { + m[0][0] = 0.5f * (m[0][0] + m[1][0]); + m[0][1] = 0.5f * (m[0][1] + m[1][1]); + m[1][0] = 0; + m[1][1] = 0; + } + cfg->pcm_transform[0][0] = m[0][0]; + cfg->pcm_transform[0][1] = m[0][1]; + cfg->pcm_transform[1][0] = m[1][0]; + cfg->pcm_transform[1][1] = m[1][1]; + } + + /* padding method as described in + * "MPEG-Layer3 / Bitstream Syntax and Decoding" + * by Martin Sieler, Ralph Sperschneider + * + * note: there is no padding for the very first frame + * + * Robert Hegemann 2000-06-22 + */ + gfc->sv_enc.slot_lag = gfc->sv_enc.frac_SpF = 0; + if (cfg->vbr == vbr_off) + gfc->sv_enc.slot_lag = gfc->sv_enc.frac_SpF + = ((cfg->version + 1) * 72000L * cfg->avg_bitrate) % cfg->samplerate_out; + + (void) lame_init_bitstream(gfp); + + iteration_init(gfc); + (void) psymodel_init(gfp); + + cfg->buffer_constraint = get_max_frame_buffer_size_by_constraint(cfg, gfp->strict_ISO); + return 0; +} + +static void +concatSep(char* dest, char const* sep, char const* str) +{ + if (*dest != 0) strcat(dest, sep); + strcat(dest, str); +} + +/* + * print_config + * + * Prints some selected information about the coding parameters via + * the macro command MSGF(), which is currently mapped to lame_errorf + * (reports via a error function?), which is a printf-like function + * for . + */ + +void +lame_print_config(const lame_global_flags * gfp) +{ + lame_internal_flags const *const gfc = gfp->internal_flags; + SessionConfig_t const *const cfg = &gfc->cfg; + double const out_samplerate = cfg->samplerate_out; + double const in_samplerate = cfg->samplerate_in; + + MSGF(gfc, "LAME %s %s (%s)\n", get_lame_version(), get_lame_os_bitness(), get_lame_url()); + +#if (LAME_ALPHA_VERSION) + MSGF(gfc, "warning: alpha versions should be used for testing only\n"); +#endif + if (gfc->CPU_features.MMX + || gfc->CPU_features.AMD_3DNow || gfc->CPU_features.SSE || gfc->CPU_features.SSE2) { + char text[256] = { 0 }; + int fft_asm_used = 0; +#ifdef HAVE_NASM + if (gfc->CPU_features.AMD_3DNow) { + fft_asm_used = 1; + } + else if (gfc->CPU_features.SSE) { + fft_asm_used = 2; + } +#else +# if defined( HAVE_XMMINTRIN_H ) && defined( MIN_ARCH_SSE ) + { + fft_asm_used = 3; + } +# endif +#endif + if (gfc->CPU_features.MMX) { +#ifdef MMX_choose_table + concatSep(text, ", ", "MMX (ASM used)"); +#else + concatSep(text, ", ", "MMX"); +#endif + } + if (gfc->CPU_features.AMD_3DNow) { + concatSep(text, ", ", (fft_asm_used == 1) ? "3DNow! (ASM used)" : "3DNow!"); + } + if (gfc->CPU_features.SSE) { +#if defined(HAVE_XMMINTRIN_H) + concatSep(text, ", ", "SSE (ASM used)"); +#else + concatSep(text, ", ", (fft_asm_used == 2) ? "SSE (ASM used)" : "SSE"); +#endif + } + if (gfc->CPU_features.SSE2) { + concatSep(text, ", ", (fft_asm_used == 3) ? "SSE2 (ASM used)" : "SSE2"); + } + MSGF(gfc, "CPU features: %s\n", text); + } + + if (cfg->channels_in == 2 && cfg->channels_out == 1 /* mono */ ) { + MSGF(gfc, "Autoconverting from stereo to mono. Setting encoding to mono mode.\n"); + } + + if (isResamplingNecessary(cfg)) { + MSGF(gfc, "Resampling: input %g kHz output %g kHz\n", + 1.e-3 * in_samplerate, 1.e-3 * out_samplerate); + } + + if (cfg->highpass2 > 0.) + MSGF(gfc, + "Using polyphase highpass filter, transition band: %5.0f Hz - %5.0f Hz\n", + 0.5 * cfg->highpass1 * out_samplerate, 0.5 * cfg->highpass2 * out_samplerate); + if (0. < cfg->lowpass1 || 0. < cfg->lowpass2) { + MSGF(gfc, + "Using polyphase lowpass filter, transition band: %5.0f Hz - %5.0f Hz\n", + 0.5 * cfg->lowpass1 * out_samplerate, 0.5 * cfg->lowpass2 * out_samplerate); + } + else { + MSGF(gfc, "polyphase lowpass filter disabled\n"); + } + + if (cfg->free_format) { + MSGF(gfc, "Warning: many decoders cannot handle free format bitstreams\n"); + if (cfg->avg_bitrate > 320) { + MSGF(gfc, + "Warning: many decoders cannot handle free format bitrates >320 kbps (see documentation)\n"); + } + } +} + + +/** rh: + * some pretty printing is very welcome at this point! + * so, if someone is willing to do so, please do it! + * add more, if you see more... + */ +void +lame_print_internals(const lame_global_flags * gfp) +{ + lame_internal_flags const *const gfc = gfp->internal_flags; + SessionConfig_t const *const cfg = &gfc->cfg; + const char *pc = ""; + + /* compiler/processor optimizations, operational, etc. + */ + MSGF(gfc, "\nmisc:\n\n"); + + MSGF(gfc, "\tscaling: %g\n", gfp->scale); + MSGF(gfc, "\tch0 (left) scaling: %g\n", gfp->scale_left); + MSGF(gfc, "\tch1 (right) scaling: %g\n", gfp->scale_right); + switch (cfg->use_best_huffman) { + default: + pc = "normal"; + break; + case 1: + pc = "best (outside loop)"; + break; + case 2: + pc = "best (inside loop, slow)"; + break; + } + MSGF(gfc, "\thuffman search: %s\n", pc); + MSGF(gfc, "\texperimental Y=%d\n", gfp->experimentalY); + MSGF(gfc, "\t...\n"); + + /* everything controlling the stream format + */ + MSGF(gfc, "\nstream format:\n\n"); + switch (cfg->version) { + case 0: + pc = "2.5"; + break; + case 1: + pc = "1"; + break; + case 2: + pc = "2"; + break; + default: + pc = "?"; + break; + } + MSGF(gfc, "\tMPEG-%s Layer 3\n", pc); + switch (cfg->mode) { + case JOINT_STEREO: + pc = "joint stereo"; + break; + case STEREO: + pc = "stereo"; + break; + case DUAL_CHANNEL: + pc = "dual channel"; + break; + case MONO: + pc = "mono"; + break; + case NOT_SET: + pc = "not set (error)"; + break; + default: + pc = "unknown (error)"; + break; + } + MSGF(gfc, "\t%d channel - %s\n", cfg->channels_out, pc); + + switch (cfg->vbr) { + case vbr_off: + pc = "off"; + break; + default: + pc = "all"; + break; + } + MSGF(gfc, "\tpadding: %s\n", pc); + + if (vbr_default == cfg->vbr) + pc = "(default)"; + else if (cfg->free_format) + pc = "(free format)"; + else + pc = ""; + switch (cfg->vbr) { + case vbr_off: + MSGF(gfc, "\tconstant bitrate - CBR %s\n", pc); + break; + case vbr_abr: + MSGF(gfc, "\tvariable bitrate - ABR %s\n", pc); + break; + case vbr_rh: + MSGF(gfc, "\tvariable bitrate - VBR rh %s\n", pc); + break; + case vbr_mt: + MSGF(gfc, "\tvariable bitrate - VBR mt %s\n", pc); + break; + case vbr_mtrh: + MSGF(gfc, "\tvariable bitrate - VBR mtrh %s\n", pc); + break; + default: + MSGF(gfc, "\t ?? oops, some new one ?? \n"); + break; + } + if (cfg->write_lame_tag) + MSGF(gfc, "\tusing LAME Tag\n"); + MSGF(gfc, "\t...\n"); + + /* everything controlling psychoacoustic settings, like ATH, etc. + */ + MSGF(gfc, "\npsychoacoustic:\n\n"); + + switch (cfg->short_blocks) { + default: + case short_block_not_set: + pc = "?"; + break; + case short_block_allowed: + pc = "allowed"; + break; + case short_block_coupled: + pc = "channel coupled"; + break; + case short_block_dispensed: + pc = "dispensed"; + break; + case short_block_forced: + pc = "forced"; + break; + } + MSGF(gfc, "\tusing short blocks: %s\n", pc); + MSGF(gfc, "\tsubblock gain: %d\n", cfg->subblock_gain); + MSGF(gfc, "\tadjust masking: %g dB\n", gfc->sv_qnt.mask_adjust); + MSGF(gfc, "\tadjust masking short: %g dB\n", gfc->sv_qnt.mask_adjust_short); + MSGF(gfc, "\tquantization comparison: %d\n", cfg->quant_comp); + MSGF(gfc, "\t ^ comparison short blocks: %d\n", cfg->quant_comp_short); + MSGF(gfc, "\tnoise shaping: %d\n", cfg->noise_shaping); + MSGF(gfc, "\t ^ amplification: %d\n", cfg->noise_shaping_amp); + MSGF(gfc, "\t ^ stopping: %d\n", cfg->noise_shaping_stop); + + pc = "using"; + if (cfg->ATHshort) + pc = "the only masking for short blocks"; + if (cfg->ATHonly) + pc = "the only masking"; + if (cfg->noATH) + pc = "not used"; + MSGF(gfc, "\tATH: %s\n", pc); + MSGF(gfc, "\t ^ type: %d\n", cfg->ATHtype); + MSGF(gfc, "\t ^ shape: %g%s\n", cfg->ATHcurve, " (only for type 4)"); + MSGF(gfc, "\t ^ level adjustement: %g dB\n", cfg->ATH_offset_db); + MSGF(gfc, "\t ^ adjust type: %d\n", gfc->ATH->use_adjust); + MSGF(gfc, "\t ^ adjust sensitivity power: %f\n", gfc->ATH->aa_sensitivity_p); + + MSGF(gfc, "\texperimental psy tunings by Naoki Shibata\n"); + MSGF(gfc, "\t adjust masking bass=%g dB, alto=%g dB, treble=%g dB, sfb21=%g dB\n", + 10 * log10(gfc->sv_qnt.longfact[0]), + 10 * log10(gfc->sv_qnt.longfact[7]), + 10 * log10(gfc->sv_qnt.longfact[14]), 10 * log10(gfc->sv_qnt.longfact[21])); + + pc = cfg->use_temporal_masking_effect ? "yes" : "no"; + MSGF(gfc, "\tusing temporal masking effect: %s\n", pc); + MSGF(gfc, "\tinterchannel masking ratio: %g\n", cfg->interChRatio); + MSGF(gfc, "\t...\n"); + + /* that's all ? + */ + MSGF(gfc, "\n"); + return; +} + + +static void +save_gain_values(lame_internal_flags * gfc) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + RpgStateVar_t const *const rsv = &gfc->sv_rpg; + RpgResult_t *const rov = &gfc->ov_rpg; + /* save the ReplayGain value */ + if (cfg->findReplayGain) { + FLOAT const RadioGain = (FLOAT) GetTitleGain(rsv->rgdata); + if (NEQ(RadioGain, GAIN_NOT_ENOUGH_SAMPLES)) { + rov->RadioGain = (int) floor(RadioGain * 10.0 + 0.5); /* round to nearest */ + } + else { + rov->RadioGain = 0; + } + } + + /* find the gain and scale change required for no clipping */ + if (cfg->findPeakSample) { + rov->noclipGainChange = (int) ceil(log10(rov->PeakSample / 32767.0) * 20.0 * 10.0); /* round up */ + + if (rov->noclipGainChange > 0) { /* clipping occurs */ + rov->noclipScale = floor((32767.0f / rov->PeakSample) * 100.0f) / 100.0f; /* round down */ + } + else /* no clipping */ + rov->noclipScale = -1.0f; + } +} + + + +static int +update_inbuffer_size(lame_internal_flags * gfc, const int nsamples) +{ + EncStateVar_t *const esv = &gfc->sv_enc; + if (esv->in_buffer_0 == 0 || esv->in_buffer_nsamples < nsamples) { + if (esv->in_buffer_0) { + free(esv->in_buffer_0); + } + if (esv->in_buffer_1) { + free(esv->in_buffer_1); + } + esv->in_buffer_0 = calloc(nsamples, sizeof(sample_t)); + esv->in_buffer_1 = calloc(nsamples, sizeof(sample_t)); + esv->in_buffer_nsamples = nsamples; + } + if (esv->in_buffer_0 == NULL || esv->in_buffer_1 == NULL) { + if (esv->in_buffer_0) { + free(esv->in_buffer_0); + } + if (esv->in_buffer_1) { + free(esv->in_buffer_1); + } + esv->in_buffer_0 = 0; + esv->in_buffer_1 = 0; + esv->in_buffer_nsamples = 0; + ERRORF(gfc, "Error: can't allocate in_buffer buffer\n"); + return -2; + } + return 0; +} + + +static int +calcNeeded(SessionConfig_t const * cfg) +{ + int mf_needed; + int pcm_samples_per_frame = 576 * cfg->mode_gr; + + /* some sanity checks */ +#if ENCDELAY < MDCTDELAY +# error ENCDELAY is less than MDCTDELAY, see encoder.h +#endif +#if FFTOFFSET > BLKSIZE +# error FFTOFFSET is greater than BLKSIZE, see encoder.h +#endif + + mf_needed = BLKSIZE + pcm_samples_per_frame - FFTOFFSET; /* amount needed for FFT */ + /*mf_needed = Max(mf_needed, 286 + 576 * (1 + gfc->mode_gr)); */ + mf_needed = Max(mf_needed, 512 + pcm_samples_per_frame - 32); + + assert(MFSIZE >= mf_needed); + + return mf_needed; +} + + +/* + * THE MAIN LAME ENCODING INTERFACE + * mt 3/00 + * + * input pcm data, output (maybe) mp3 frames. + * This routine handles all buffering, resampling and filtering for you. + * The required mp3buffer_size can be computed from num_samples, + * samplerate and encoding rate, but here is a worst case estimate: + * + * mp3buffer_size in bytes = 1.25*num_samples + 7200 + * + * return code = number of bytes output in mp3buffer. can be 0 + * + * NOTE: this routine uses LAME's internal PCM data representation, + * 'sample_t'. It should not be used by any application. + * applications should use lame_encode_buffer(), + * lame_encode_buffer_float() + * lame_encode_buffer_int() + * etc... depending on what type of data they are working with. +*/ +static int +lame_encode_buffer_sample_t(lame_internal_flags * gfc, + int nsamples, unsigned char *mp3buf, const int mp3buf_size) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t *const esv = &gfc->sv_enc; + int pcm_samples_per_frame = 576 * cfg->mode_gr; + int mp3size = 0, ret, i, ch, mf_needed; + int mp3out; + sample_t *mfbuf[2]; + sample_t *in_buffer[2]; + + if (gfc->class_id != LAME_ID) + return -3; + + if (nsamples == 0) + return 0; + + /* copy out any tags that may have been written into bitstream */ + mp3out = copy_buffer(gfc, mp3buf, mp3buf_size, 0); + if (mp3out < 0) + return mp3out; /* not enough buffer space */ + mp3buf += mp3out; + mp3size += mp3out; + + in_buffer[0] = esv->in_buffer_0; + in_buffer[1] = esv->in_buffer_1; + + mf_needed = calcNeeded(cfg); + + mfbuf[0] = esv->mfbuf[0]; + mfbuf[1] = esv->mfbuf[1]; + + while (nsamples > 0) { + sample_t const *in_buffer_ptr[2]; + int n_in = 0; /* number of input samples processed with fill_buffer */ + int n_out = 0; /* number of samples output with fill_buffer */ + /* n_in <> n_out if we are resampling */ + + in_buffer_ptr[0] = in_buffer[0]; + in_buffer_ptr[1] = in_buffer[1]; + /* copy in new samples into mfbuf, with resampling */ + fill_buffer(gfc, mfbuf, &in_buffer_ptr[0], nsamples, &n_in, &n_out); + + /* compute ReplayGain of resampled input if requested */ + if (cfg->findReplayGain && !cfg->decode_on_the_fly) + if (AnalyzeSamples + (gfc->sv_rpg.rgdata, &mfbuf[0][esv->mf_size], &mfbuf[1][esv->mf_size], n_out, + cfg->channels_out) == GAIN_ANALYSIS_ERROR) + return -6; + + + + /* update in_buffer counters */ + nsamples -= n_in; + in_buffer[0] += n_in; + if (cfg->channels_out == 2) + in_buffer[1] += n_in; + + /* update mfbuf[] counters */ + esv->mf_size += n_out; + assert(esv->mf_size <= MFSIZE); + + /* lame_encode_flush may have set gfc->mf_sample_to_encode to 0 + * so we have to reinitialize it here when that happened. + */ + if (esv->mf_samples_to_encode < 1) { + esv->mf_samples_to_encode = ENCDELAY + POSTDELAY; + } + esv->mf_samples_to_encode += n_out; + + + if (esv->mf_size >= mf_needed) { + /* encode the frame. */ + /* mp3buf = pointer to current location in buffer */ + /* mp3buf_size = size of original mp3 output buffer */ + /* = 0 if we should not worry about the */ + /* buffer size because calling program is */ + /* to lazy to compute it */ + /* mp3size = size of data written to buffer so far */ + /* mp3buf_size-mp3size = amount of space avalable */ + + int buf_size = mp3buf_size - mp3size; + if (mp3buf_size == 0) + buf_size = 0; + + ret = lame_encode_mp3_frame(gfc, mfbuf[0], mfbuf[1], mp3buf, buf_size); + + if (ret < 0) + return ret; + mp3buf += ret; + mp3size += ret; + + /* shift out old samples */ + esv->mf_size -= pcm_samples_per_frame; + esv->mf_samples_to_encode -= pcm_samples_per_frame; + for (ch = 0; ch < cfg->channels_out; ch++) + for (i = 0; i < esv->mf_size; i++) + mfbuf[ch][i] = mfbuf[ch][i + pcm_samples_per_frame]; + } + } + assert(nsamples == 0); + + return mp3size; +} + +enum PCMSampleType +{ pcm_short_type +, pcm_int_type +, pcm_long_type +, pcm_float_type +, pcm_double_type +}; + +static void +lame_copy_inbuffer(lame_internal_flags* gfc, + void const* l, void const* r, int nsamples, + enum PCMSampleType pcm_type, int jump, FLOAT s) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t *const esv = &gfc->sv_enc; + sample_t* ib0 = esv->in_buffer_0; + sample_t* ib1 = esv->in_buffer_1; + FLOAT m[2][2]; + + /* Apply user defined re-scaling */ + m[0][0] = s * cfg->pcm_transform[0][0]; + m[0][1] = s * cfg->pcm_transform[0][1]; + m[1][0] = s * cfg->pcm_transform[1][0]; + m[1][1] = s * cfg->pcm_transform[1][1]; + + /* make a copy of input buffer, changing type to sample_t */ +#define COPY_AND_TRANSFORM(T) \ +{ \ + T const *bl = l, *br = r; \ + int i; \ + for (i = 0; i < nsamples; i++) { \ + sample_t const xl = *bl; \ + sample_t const xr = *br; \ + sample_t const u = xl * m[0][0] + xr * m[0][1]; \ + sample_t const v = xl * m[1][0] + xr * m[1][1]; \ + ib0[i] = u; \ + ib1[i] = v; \ + bl += jump; \ + br += jump; \ + } \ +} + switch ( pcm_type ) { + case pcm_short_type: + COPY_AND_TRANSFORM(short int); + break; + case pcm_int_type: + COPY_AND_TRANSFORM(int); + break; + case pcm_long_type: + COPY_AND_TRANSFORM(long int); + break; + case pcm_float_type: + COPY_AND_TRANSFORM(float); + break; + case pcm_double_type: + COPY_AND_TRANSFORM(double); + break; + } +} + + +static int +lame_encode_buffer_template(lame_global_flags * gfp, + void const* buffer_l, void const* buffer_r, const int nsamples, + unsigned char *mp3buf, const int mp3buf_size, enum PCMSampleType pcm_type, int aa, FLOAT norm) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + SessionConfig_t const *const cfg = &gfc->cfg; + + if (nsamples == 0) + return 0; + + if (update_inbuffer_size(gfc, nsamples) != 0) { + return -2; + } + /* make a copy of input buffer, changing type to sample_t */ + if (cfg->channels_in > 1) { + if (buffer_l == 0 || buffer_r == 0) { + return 0; + } + lame_copy_inbuffer(gfc, buffer_l, buffer_r, nsamples, pcm_type, aa, norm); + } + else { + if (buffer_l == 0) { + return 0; + } + lame_copy_inbuffer(gfc, buffer_l, buffer_l, nsamples, pcm_type, aa, norm); + } + + return lame_encode_buffer_sample_t(gfc, nsamples, mp3buf, mp3buf_size); + } + } + return -3; +} + +int +lame_encode_buffer(lame_global_flags * gfp, + const short int pcm_l[], const short int pcm_r[], const int nsamples, + unsigned char *mp3buf, const int mp3buf_size) +{ + return lame_encode_buffer_template(gfp, pcm_l, pcm_r, nsamples, mp3buf, mp3buf_size, pcm_short_type, 1, 1.0); +} + + +int +lame_encode_buffer_float(lame_global_flags * gfp, + const float pcm_l[], const float pcm_r[], const int nsamples, + unsigned char *mp3buf, const int mp3buf_size) +{ + /* input is assumed to be normalized to +/- 32768 for full scale */ + return lame_encode_buffer_template(gfp, pcm_l, pcm_r, nsamples, mp3buf, mp3buf_size, pcm_float_type, 1, 1.0); +} + + +int +lame_encode_buffer_ieee_float(lame_t gfp, + const float pcm_l[], const float pcm_r[], const int nsamples, + unsigned char *mp3buf, const int mp3buf_size) +{ + /* input is assumed to be normalized to +/- 1.0 for full scale */ + return lame_encode_buffer_template(gfp, pcm_l, pcm_r, nsamples, mp3buf, mp3buf_size, pcm_float_type, 1, 32767.0); +} + + +int +lame_encode_buffer_interleaved_ieee_float(lame_t gfp, + const float pcm[], const int nsamples, + unsigned char *mp3buf, const int mp3buf_size) +{ + /* input is assumed to be normalized to +/- 1.0 for full scale */ + return lame_encode_buffer_template(gfp, pcm, pcm+1, nsamples, mp3buf, mp3buf_size, pcm_float_type, 2, 32767.0); +} + + +int +lame_encode_buffer_ieee_double(lame_t gfp, + const double pcm_l[], const double pcm_r[], const int nsamples, + unsigned char *mp3buf, const int mp3buf_size) +{ + /* input is assumed to be normalized to +/- 1.0 for full scale */ + return lame_encode_buffer_template(gfp, pcm_l, pcm_r, nsamples, mp3buf, mp3buf_size, pcm_double_type, 1, 32767.0); +} + + +int +lame_encode_buffer_interleaved_ieee_double(lame_t gfp, + const double pcm[], const int nsamples, + unsigned char *mp3buf, const int mp3buf_size) +{ + /* input is assumed to be normalized to +/- 1.0 for full scale */ + return lame_encode_buffer_template(gfp, pcm, pcm+1, nsamples, mp3buf, mp3buf_size, pcm_double_type, 2, 32767.0); +} + + +int +lame_encode_buffer_int(lame_global_flags * gfp, + const int pcm_l[], const int pcm_r[], const int nsamples, + unsigned char *mp3buf, const int mp3buf_size) +{ + /* input is assumed to be normalized to +/- MAX_INT for full scale */ + FLOAT const norm = (1.0 / (1L << (8 * sizeof(int) - 16))); + return lame_encode_buffer_template(gfp, pcm_l, pcm_r, nsamples, mp3buf, mp3buf_size, pcm_int_type, 1, norm); +} + + +int +lame_encode_buffer_long2(lame_global_flags * gfp, + const long pcm_l[], const long pcm_r[], const int nsamples, + unsigned char *mp3buf, const int mp3buf_size) +{ + /* input is assumed to be normalized to +/- MAX_LONG for full scale */ + FLOAT const norm = (1.0 / (1L << (8 * sizeof(long) - 16))); + return lame_encode_buffer_template(gfp, pcm_l, pcm_r, nsamples, mp3buf, mp3buf_size, pcm_long_type, 1, norm); +} + + +int +lame_encode_buffer_long(lame_global_flags * gfp, + const long pcm_l[], const long pcm_r[], const int nsamples, + unsigned char *mp3buf, const int mp3buf_size) +{ + /* input is assumed to be normalized to +/- 32768 for full scale */ + return lame_encode_buffer_template(gfp, pcm_l, pcm_r, nsamples, mp3buf, mp3buf_size, pcm_long_type, 1, 1.0); +} + + + +int +lame_encode_buffer_interleaved(lame_global_flags * gfp, + short int pcm[], int nsamples, + unsigned char *mp3buf, int mp3buf_size) +{ + /* input is assumed to be normalized to +/- MAX_SHORT for full scale */ + return lame_encode_buffer_template(gfp, pcm, pcm+1, nsamples, mp3buf, mp3buf_size, pcm_short_type, 2, 1.0); +} + + + + +/***************************************************************** + Flush mp3 buffer, pad with ancillary data so last frame is complete. + Reset reservoir size to 0 + but keep all PCM samples and MDCT data in memory + This option is used to break a large file into several mp3 files + that when concatenated together will decode with no gaps + Because we set the reservoir=0, they will also decode seperately + with no errors. +*********************************************************************/ +int +lame_encode_flush_nogap(lame_global_flags * gfp, unsigned char *mp3buffer, int mp3buffer_size) +{ + int rc = -3; + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + flush_bitstream(gfc); + rc = copy_buffer(gfc, mp3buffer, mp3buffer_size, 1); + save_gain_values(gfc); + } + } + return rc; +} + + +/* called by lame_init_params. You can also call this after flush_nogap + if you want to write new id3v2 and Xing VBR tags into the bitstream */ +int +lame_init_bitstream(lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags *const gfc = gfp->internal_flags; + if (gfc != 0) { + gfc->ov_enc.frame_number = 0; + + if (gfp->write_id3tag_automatic) { + (void) id3tag_write_v2(gfp); + } + /* initialize histogram data optionally used by frontend */ + memset(gfc->ov_enc.bitrate_channelmode_hist, 0, + sizeof(gfc->ov_enc.bitrate_channelmode_hist)); + memset(gfc->ov_enc.bitrate_blocktype_hist, 0, + sizeof(gfc->ov_enc.bitrate_blocktype_hist)); + + gfc->ov_rpg.PeakSample = 0.0; + + /* Write initial VBR Header to bitstream and init VBR data */ + if (gfc->cfg.write_lame_tag) + (void) InitVbrTag(gfp); + + + return 0; + } + } + return -3; +} + + +/*****************************************************************/ +/* flush internal PCM sample buffers, then mp3 buffers */ +/* then write id3 v1 tags into bitstream. */ +/*****************************************************************/ + +int +lame_encode_flush(lame_global_flags * gfp, unsigned char *mp3buffer, int mp3buffer_size) +{ + lame_internal_flags *gfc; + SessionConfig_t const *cfg; + EncStateVar_t *esv; + short int buffer[2][1152]; + int imp3 = 0, mp3count, mp3buffer_size_remaining; + + /* we always add POSTDELAY=288 padding to make sure granule with real + * data can be complety decoded (because of 50% overlap with next granule */ + int end_padding; + int frames_left; + int samples_to_encode; + int pcm_samples_per_frame; + int mf_needed; + int is_resampling_necessary; + double resample_ratio = 1; + + if (!is_lame_global_flags_valid(gfp)) { + return -3; + } + gfc = gfp->internal_flags; + if (!is_lame_internal_flags_valid(gfc)) { + return -3; + } + cfg = &gfc->cfg; + esv = &gfc->sv_enc; + + /* Was flush already called? */ + if (esv->mf_samples_to_encode < 1) { + return 0; + } + pcm_samples_per_frame = 576 * cfg->mode_gr; + mf_needed = calcNeeded(cfg); + + samples_to_encode = esv->mf_samples_to_encode - POSTDELAY; + + memset(buffer, 0, sizeof(buffer)); + mp3count = 0; + + is_resampling_necessary = isResamplingNecessary(cfg); + if (is_resampling_necessary) { + resample_ratio = (double)cfg->samplerate_in / (double)cfg->samplerate_out; + /* delay due to resampling; needs to be fixed, if resampling code gets changed */ + samples_to_encode += 16. / resample_ratio; + } + end_padding = pcm_samples_per_frame - (samples_to_encode % pcm_samples_per_frame); + if (end_padding < 576) + end_padding += pcm_samples_per_frame; + gfc->ov_enc.encoder_padding = end_padding; + + frames_left = (samples_to_encode + end_padding) / pcm_samples_per_frame; + while (frames_left > 0 && imp3 >= 0) { + int const frame_num = gfc->ov_enc.frame_number; + int bunch = mf_needed - esv->mf_size; + + bunch *= resample_ratio; + if (bunch > 1152) bunch = 1152; + if (bunch < 1) bunch = 1; + + mp3buffer_size_remaining = mp3buffer_size - mp3count; + + /* if user specifed buffer size = 0, dont check size */ + if (mp3buffer_size == 0) + mp3buffer_size_remaining = 0; + + /* send in a frame of 0 padding until all internal sample buffers + * are flushed + */ + imp3 = lame_encode_buffer(gfp, buffer[0], buffer[1], bunch, + mp3buffer, mp3buffer_size_remaining); + + mp3buffer += imp3; + mp3count += imp3; + frames_left -= ((frame_num != gfc->ov_enc.frame_number) ? 1 : 0); + } + /* Set esv->mf_samples_to_encode to 0, so we may detect + * and break loops calling it more than once in a row. + */ + esv->mf_samples_to_encode = 0; + + if (imp3 < 0) { + /* some type of fatal error */ + return imp3; + } + + mp3buffer_size_remaining = mp3buffer_size - mp3count; + /* if user specifed buffer size = 0, dont check size */ + if (mp3buffer_size == 0) + mp3buffer_size_remaining = 0; + + /* mp3 related stuff. bit buffer might still contain some mp3 data */ + flush_bitstream(gfc); + imp3 = copy_buffer(gfc, mp3buffer, mp3buffer_size_remaining, 1); + save_gain_values(gfc); + if (imp3 < 0) { + /* some type of fatal error */ + return imp3; + } + mp3buffer += imp3; + mp3count += imp3; + mp3buffer_size_remaining = mp3buffer_size - mp3count; + /* if user specifed buffer size = 0, dont check size */ + if (mp3buffer_size == 0) + mp3buffer_size_remaining = 0; + + if (gfp->write_id3tag_automatic) { + /* write a id3 tag to the bitstream */ + (void) id3tag_write_v1(gfp); + + imp3 = copy_buffer(gfc, mp3buffer, mp3buffer_size_remaining, 0); + + if (imp3 < 0) { + return imp3; + } + mp3count += imp3; + } +#if 0 + { + int const ed = gfc->ov_enc.encoder_delay; + int const ep = gfc->ov_enc.encoder_padding; + int const ns = (gfc->ov_enc.frame_number * pcm_samples_per_frame) - (ed + ep); + double duration = ns; + duration /= cfg->samplerate_out; + MSGF(gfc, "frames=%d\n", gfc->ov_enc.frame_number); + MSGF(gfc, "pcm_samples_per_frame=%d\n", pcm_samples_per_frame); + MSGF(gfc, "encoder delay=%d\n", ed); + MSGF(gfc, "encoder padding=%d\n", ep); + MSGF(gfc, "sample count=%d (%g)\n", ns, cfg->samplerate_in * duration); + MSGF(gfc, "duration=%g sec\n", duration); + } +#endif + return mp3count; +} + +/*********************************************************************** + * + * lame_close () + * + * frees internal buffers + * + ***********************************************************************/ + +int +lame_close(lame_global_flags * gfp) +{ + int ret = 0; + if (gfp && gfp->class_id == LAME_ID) { + lame_internal_flags *const gfc = gfp->internal_flags; + gfp->class_id = 0; + if (NULL == gfc || gfc->class_id != LAME_ID) { + ret = -3; + } + if (NULL != gfc) { + gfc->class_id = 0; + /* this routine will free all malloc'd data in gfc, and then free gfc: */ + freegfc(gfc); + gfp->internal_flags = NULL; + } + if (gfp->lame_allocated_gfp) { + gfp->lame_allocated_gfp = 0; + free(gfp); + } + } + return ret; +} + +/*****************************************************************/ +/* flush internal mp3 buffers, and free internal buffers */ +/*****************************************************************/ +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +int CDECL +lame_encode_finish(lame_global_flags * gfp, unsigned char *mp3buffer, int mp3buffer_size); +#else +#endif + +int +lame_encode_finish(lame_global_flags * gfp, unsigned char *mp3buffer, int mp3buffer_size) +{ + int const ret = lame_encode_flush(gfp, mp3buffer, mp3buffer_size); + + (void) lame_close(gfp); + + return ret; +} + +/*****************************************************************/ +/* write VBR Xing header, and ID3 version 1 tag, if asked for */ +/*****************************************************************/ +void lame_mp3_tags_fid(lame_global_flags * gfp, FILE * fpStream); + +void +lame_mp3_tags_fid(lame_global_flags * gfp, FILE * fpStream) +{ + lame_internal_flags *gfc; + SessionConfig_t const *cfg; + if (!is_lame_global_flags_valid(gfp)) { + return; + } + gfc = gfp->internal_flags; + if (!is_lame_internal_flags_valid(gfc)) { + return; + } + cfg = &gfc->cfg; + if (!cfg->write_lame_tag) { + return; + } + /* Write Xing header again */ + if (fpStream && !fseek(fpStream, 0, SEEK_SET)) { + int rc = PutVbrTag(gfp, fpStream); + switch (rc) { + default: + /* OK */ + break; + + case -1: + ERRORF(gfc, "Error: could not update LAME tag.\n"); + break; + + case -2: + ERRORF(gfc, "Error: could not update LAME tag, file not seekable.\n"); + break; + + case -3: + ERRORF(gfc, "Error: could not update LAME tag, file not readable.\n"); + break; + } + } +} + + + +/* initialize mp3 encoder */ +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +static +#else +#endif +int +lame_init_old(lame_global_flags * gfp) +{ + lame_internal_flags *gfc; + SessionConfig_t *cfg; + + disable_FPE(); /* disable floating point exceptions */ + + memset(gfp, 0, sizeof(lame_global_flags)); + + gfp->class_id = LAME_ID; + + if (NULL == (gfc = gfp->internal_flags = calloc(1, sizeof(lame_internal_flags)))) + return -1; + + cfg = &gfc->cfg; + + /* Global flags. set defaults here for non-zero values */ + /* see lame.h for description */ + /* set integer values to -1 to mean that LAME will compute the + * best value, UNLESS the calling program as set it + * (and the value is no longer -1) + */ + gfp->strict_ISO = MDB_MAXIMUM; + + gfp->mode = NOT_SET; + gfp->original = 1; + gfp->samplerate_in = 44100; + gfp->num_channels = 2; + gfp->num_samples = MAX_U_32_NUM; + + gfp->write_lame_tag = 1; + gfp->quality = -1; + gfp->short_blocks = short_block_not_set; + gfp->subblock_gain = -1; + + gfp->lowpassfreq = 0; + gfp->highpassfreq = 0; + gfp->lowpasswidth = -1; + gfp->highpasswidth = -1; + + gfp->VBR = vbr_off; + gfp->VBR_q = 4; + gfp->ATHcurve = -1; + gfp->VBR_mean_bitrate_kbps = 128; + gfp->VBR_min_bitrate_kbps = 0; + gfp->VBR_max_bitrate_kbps = 0; + gfp->VBR_hard_min = 0; + cfg->vbr_min_bitrate_index = 1; /* not 0 ????? */ + cfg->vbr_max_bitrate_index = 13; /* not 14 ????? */ + + gfp->quant_comp = -1; + gfp->quant_comp_short = -1; + + gfp->msfix = -1; + + gfc->sv_qnt.OldValue[0] = 180; + gfc->sv_qnt.OldValue[1] = 180; + gfc->sv_qnt.CurrentStep[0] = 4; + gfc->sv_qnt.CurrentStep[1] = 4; + gfc->sv_qnt.masking_lower = 1; + + gfp->attackthre = -1; + gfp->attackthre_s = -1; + + gfp->scale = 1; + gfp->scale_left = 1; + gfp->scale_right = 1; + + gfp->athaa_type = -1; + gfp->ATHtype = -1; /* default = -1 = set in lame_init_params */ + /* 2 = equal loudness curve */ + gfp->athaa_sensitivity = 0.0; /* no offset */ + gfp->useTemporal = -1; + gfp->interChRatio = -1; + + /* The reason for + * int mf_samples_to_encode = ENCDELAY + POSTDELAY; + * ENCDELAY = internal encoder delay. And then we have to add POSTDELAY=288 + * because of the 50% MDCT overlap. A 576 MDCT granule decodes to + * 1152 samples. To synthesize the 576 samples centered under this granule + * we need the previous granule for the first 288 samples (no problem), and + * the next granule for the next 288 samples (not possible if this is last + * granule). So we need to pad with 288 samples to make sure we can + * encode the 576 samples we are interested in. + */ + gfc->sv_enc.mf_samples_to_encode = ENCDELAY + POSTDELAY; + gfc->ov_enc.encoder_padding = 0; + gfc->sv_enc.mf_size = ENCDELAY - MDCTDELAY; /* we pad input with this many 0's */ + + gfp->findReplayGain = 0; + gfp->decode_on_the_fly = 0; + + gfc->cfg.decode_on_the_fly = 0; + gfc->cfg.findReplayGain = 0; + gfc->cfg.findPeakSample = 0; + + gfc->ov_rpg.RadioGain = 0; + gfc->ov_rpg.noclipGainChange = 0; + gfc->ov_rpg.noclipScale = -1.0; + + gfp->asm_optimizations.mmx = 1; + gfp->asm_optimizations.amd3dnow = 1; + gfp->asm_optimizations.sse = 1; + + gfp->preset = 0; + + gfp->write_id3tag_automatic = 1; + + gfp->report.debugf = &lame_report_def; + gfp->report.errorf = &lame_report_def; + gfp->report.msgf = &lame_report_def; + return 0; +} + + +lame_global_flags * +lame_init(void) +{ + lame_global_flags *gfp; + int ret; + + init_log_table(); + + gfp = calloc(1, sizeof(lame_global_flags)); + if (gfp == NULL) + return NULL; + + ret = lame_init_old(gfp); + if (ret != 0) { + free(gfp); + return NULL; + } + + gfp->lame_allocated_gfp = 1; + return gfp; +} + + +/*********************************************************************** + * + * some simple statistics + * + * Robert Hegemann 2000-10-11 + * + ***********************************************************************/ + +/* histogram of used bitrate indexes: + * One has to weight them to calculate the average bitrate in kbps + * + * bitrate indices: + * there are 14 possible bitrate indices, 0 has the special meaning + * "free format" which is not possible to mix with VBR and 15 is forbidden + * anyway. + * + * stereo modes: + * 0: LR number of left-right encoded frames + * 1: LR-I number of left-right and intensity encoded frames + * 2: MS number of mid-side encoded frames + * 3: MS-I number of mid-side and intensity encoded frames + * + * 4: number of encoded frames + * + */ + +void +lame_bitrate_kbps(const lame_global_flags * gfp, int bitrate_kbps[14]) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + SessionConfig_t const *const cfg = &gfc->cfg; + int i; + if (cfg->free_format) { + for (i = 0; i < 14; i++) + bitrate_kbps[i] = -1; + bitrate_kbps[0] = cfg->avg_bitrate; + } + else { + for (i = 0; i < 14; i++) + bitrate_kbps[i] = bitrate_table[cfg->version][i + 1]; + } + } + } +} + + +void +lame_bitrate_hist(const lame_global_flags * gfp, int bitrate_count[14]) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t const *const eov = &gfc->ov_enc; + int i; + + if (cfg->free_format) { + for (i = 0; i < 14; i++) { + bitrate_count[i] = 0; + } + bitrate_count[0] = eov->bitrate_channelmode_hist[0][4]; + } + else { + for (i = 0; i < 14; i++) { + bitrate_count[i] = eov->bitrate_channelmode_hist[i + 1][4]; + } + } + } + } +} + + +void +lame_stereo_mode_hist(const lame_global_flags * gfp, int stmode_count[4]) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + EncResult_t const *const eov = &gfc->ov_enc; + int i; + + for (i = 0; i < 4; i++) { + stmode_count[i] = eov->bitrate_channelmode_hist[15][i]; + } + } + } +} + + + +void +lame_bitrate_stereo_mode_hist(const lame_global_flags * gfp, int bitrate_stmode_count[14][4]) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t const *const eov = &gfc->ov_enc; + int i; + int j; + + if (cfg->free_format) { + for (j = 0; j < 14; j++) + for (i = 0; i < 4; i++) { + bitrate_stmode_count[j][i] = 0; + } + for (i = 0; i < 4; i++) { + bitrate_stmode_count[0][i] = eov->bitrate_channelmode_hist[0][i]; + } + } + else { + for (j = 0; j < 14; j++) { + for (i = 0; i < 4; i++) { + bitrate_stmode_count[j][i] = eov->bitrate_channelmode_hist[j + 1][i]; + } + } + } + } + } +} + + +void +lame_block_type_hist(const lame_global_flags * gfp, int btype_count[6]) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + EncResult_t const *const eov = &gfc->ov_enc; + int i; + + for (i = 0; i < 6; ++i) { + btype_count[i] = eov->bitrate_blocktype_hist[15][i]; + } + } + } +} + + + +void +lame_bitrate_block_type_hist(const lame_global_flags * gfp, int bitrate_btype_count[14][6]) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t const *const eov = &gfc->ov_enc; + int i, j; + + if (cfg->free_format) { + for (j = 0; j < 14; ++j) { + for (i = 0; i < 6; ++i) { + bitrate_btype_count[j][i] = 0; + } + } + for (i = 0; i < 6; ++i) { + bitrate_btype_count[0][i] = eov->bitrate_blocktype_hist[0][i]; + } + } + else { + for (j = 0; j < 14; ++j) { + for (i = 0; i < 6; ++i) { + bitrate_btype_count[j][i] = eov->bitrate_blocktype_hist[j + 1][i]; + } + } + } + } + } +} + +/* end of lame.c */ diff --git a/node_modules/lame/deps/lame/libmp3lame/lame.rc b/node_modules/lame/deps/lame/libmp3lame/lame.rc new file mode 100644 index 0000000..12d0193 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/lame.rc @@ -0,0 +1,50 @@ +#include +#include "version.h" + +#ifdef _DLL +IDI_ICON1 ICON DISCARDABLE "logoe.ico" +#else +IDI_ICON1 ICON DISCARDABLE "logoe.ico" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION LAME_MAJOR_VERSION,LAME_MINOR_VERSION,LAME_TYPE_VERSION,LAME_PATCH_VERSION + PRODUCTVERSION LAME_MAJOR_VERSION,LAME_MINOR_VERSION,LAME_TYPE_VERSION,LAME_PATCH_VERSION + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 +#ifdef _DLL + FILETYPE VFT_DLL +#else + FILETYPE VFT_APP +#endif + FILESUBTYPE 0x0L + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" // Lang=US English, CharSet=Windows Multilingual + BEGIN + VALUE "CompanyName", LAME_URL "\0" + VALUE "FileDescription", "MP3 Encoder.\0" + VALUE "FileVersion", LAME_VERSION_STRING "\0" + VALUE "LegalCopyright", "Copyright (C) 1999-2011 The L.A.M.E. Team\0" +#ifdef _DLL + VALUE "OriginalFilename", STR(_DLL) "\0" +#else + VALUE "OriginalFilename", STR(_APP) "\0" +#endif + VALUE "ProductName", "L.A.M.E.\0" + VALUE "ProductVersion", LAME_VERSION_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 // mandatory by convention + END + END +/* End of Version info */ + diff --git a/node_modules/lame/deps/lame/libmp3lame/lame_global_flags.h b/node_modules/lame/deps/lame/libmp3lame/lame_global_flags.h new file mode 100644 index 0000000..ad9e677 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/lame_global_flags.h @@ -0,0 +1,184 @@ +#ifndef LAME_GLOBAL_FLAGS_H +#define LAME_GLOBAL_FLAGS_H + +#ifndef lame_internal_flags_defined +#define lame_internal_flags_defined +struct lame_internal_flags; +typedef struct lame_internal_flags lame_internal_flags; +#endif + + +typedef enum short_block_e { + short_block_not_set = -1, /* allow LAME to decide */ + short_block_allowed = 0, /* LAME may use them, even different block types for L/R */ + short_block_coupled, /* LAME may use them, but always same block types in L/R */ + short_block_dispensed, /* LAME will not use short blocks, long blocks only */ + short_block_forced /* LAME will not use long blocks, short blocks only */ +} short_block_t; + +/*********************************************************************** +* +* Control Parameters set by User. These parameters are here for +* backwards compatibility with the old, non-shared lib API. +* Please use the lame_set_variablename() functions below +* +* +***********************************************************************/ +struct lame_global_struct { + unsigned int class_id; + + /* input description */ + unsigned long num_samples; /* number of samples. default=2^32-1 */ + int num_channels; /* input number of channels. default=2 */ + int samplerate_in; /* input_samp_rate in Hz. default=44.1 kHz */ + int samplerate_out; /* output_samp_rate. + default: LAME picks best value + at least not used for MP3 decoding: + Remember 44.1 kHz MP3s and AC97 */ + float scale; /* scale input by this amount before encoding + at least not used for MP3 decoding */ + float scale_left; /* scale input of channel 0 (left) by this + amount before encoding */ + float scale_right; /* scale input of channel 1 (right) by this + amount before encoding */ + + /* general control params */ + int analysis; /* collect data for a MP3 frame analyzer? */ + int write_lame_tag; /* add Xing VBR tag? */ + int decode_only; /* use lame/mpglib to convert mp3 to wav */ + int quality; /* quality setting 0=best, 9=worst default=5 */ + MPEG_mode mode; /* see enum in lame.h + default = LAME picks best value */ + int force_ms; /* force M/S mode. requires mode=1 */ + int free_format; /* use free format? default=0 */ + int findReplayGain; /* find the RG value? default=0 */ + int decode_on_the_fly; /* decode on the fly? default=0 */ + int write_id3tag_automatic; /* 1 (default) writes ID3 tags, 0 not */ + + int nogap_total; + int nogap_current; + + int substep_shaping; + int noise_shaping; + int subblock_gain; /* 0 = no, 1 = yes */ + int use_best_huffman; /* 0 = no. 1=outside loop 2=inside loop(slow) */ + + /* + * set either brate>0 or compression_ratio>0, LAME will compute + * the value of the variable not set. + * Default is compression_ratio = 11.025 + */ + int brate; /* bitrate */ + float compression_ratio; /* sizeof(wav file)/sizeof(mp3 file) */ + + + /* frame params */ + int copyright; /* mark as copyright. default=0 */ + int original; /* mark as original. default=1 */ + int extension; /* the MP3 'private extension' bit. + Meaningless */ + int emphasis; /* Input PCM is emphased PCM (for + instance from one of the rarely + emphased CDs), it is STRONGLY not + recommended to use this, because + psycho does not take it into account, + and last but not least many decoders + don't care about these bits */ + int error_protection; /* use 2 bytes per frame for a CRC + checksum. default=0 */ + int strict_ISO; /* enforce ISO spec as much as possible */ + + int disable_reservoir; /* use bit reservoir? */ + + /* quantization/noise shaping */ + int quant_comp; + int quant_comp_short; + int experimentalY; + int experimentalZ; + int exp_nspsytune; + + int preset; + + /* VBR control */ + vbr_mode VBR; + float VBR_q_frac; /* Range [0,...,1[ */ + int VBR_q; /* Range [0,...,9] */ + int VBR_mean_bitrate_kbps; + int VBR_min_bitrate_kbps; + int VBR_max_bitrate_kbps; + int VBR_hard_min; /* strictly enforce VBR_min_bitrate + normaly, it will be violated for analog + silence */ + + + /* resampling and filtering */ + int lowpassfreq; /* freq in Hz. 0=lame choses. + -1=no filter */ + int highpassfreq; /* freq in Hz. 0=lame choses. + -1=no filter */ + int lowpasswidth; /* freq width of filter, in Hz + (default=15%) */ + int highpasswidth; /* freq width of filter, in Hz + (default=15%) */ + + + + /* + * psycho acoustics and other arguments which you should not change + * unless you know what you are doing + */ + float maskingadjust; + float maskingadjust_short; + int ATHonly; /* only use ATH */ + int ATHshort; /* only use ATH for short blocks */ + int noATH; /* disable ATH */ + int ATHtype; /* select ATH formula */ + float ATHcurve; /* change ATH formula 4 shape */ + float ATH_lower_db; /* lower ATH by this many db */ + int athaa_type; /* select ATH auto-adjust scheme */ + float athaa_sensitivity; /* dB, tune active region of auto-level */ + short_block_t short_blocks; + int useTemporal; /* use temporal masking effect */ + float interChRatio; + float msfix; /* Naoki's adjustment of Mid/Side maskings */ + + int tune; /* 0 off, 1 on */ + float tune_value_a; /* used to pass values for debugging and stuff */ + + float attackthre; /* attack threshold for L/R/M channel */ + float attackthre_s; /* attack threshold for S channel */ + + + struct { + void (*msgf) (const char *format, va_list ap); + void (*debugf) (const char *format, va_list ap); + void (*errorf) (const char *format, va_list ap); + } report; + + /************************************************************************/ + /* internal variables, do not set... */ + /* provided because they may be of use to calling application */ + /************************************************************************/ + + int lame_allocated_gfp; /* is this struct owned by calling + program or lame? */ + + + + /**************************************************************************/ + /* more internal variables are stored in this structure: */ + /**************************************************************************/ + lame_internal_flags *internal_flags; + + + struct { + int mmx; + int amd3dnow; + int sse; + + } asm_optimizations; +}; + +int is_lame_global_flags_valid(const lame_global_flags * gfp); + +#endif /* LAME_GLOBAL_FLAGS_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/lameerror.h b/node_modules/lame/deps/lame/libmp3lame/lameerror.h new file mode 100644 index 0000000..7d9216b --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/lameerror.h @@ -0,0 +1,26 @@ +/* + * A collection of LAME Error Codes + * + * Please use the constants defined here instead of some arbitrary + * values. Currently the values starting at -10 to avoid intersection + * with the -1, -2, -3 and -4 used in the current code. + * + * May be this should be a part of the include/lame.h. + */ + +typedef enum { + LAME_OKAY = 0, + LAME_NOERROR = 0, + LAME_GENERICERROR = -1, + LAME_NOMEM = -10, + LAME_BADBITRATE = -11, + LAME_BADSAMPFREQ = -12, + LAME_INTERNALERROR = -13, + + FRONTEND_READERROR = -80, + FRONTEND_WRITEERROR = -81, + FRONTEND_FILETOOLARGE = -82, + +} lame_errorcodes_t; + +/* end of lameerror.h */ diff --git a/node_modules/lame/deps/lame/libmp3lame/logoe.ico b/node_modules/lame/deps/lame/libmp3lame/logoe.ico new file mode 100644 index 0000000..70994ae Binary files /dev/null and b/node_modules/lame/deps/lame/libmp3lame/logoe.ico differ diff --git a/node_modules/lame/deps/lame/libmp3lame/machine.h b/node_modules/lame/deps/lame/libmp3lame/machine.h new file mode 100644 index 0000000..3d9d336 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/machine.h @@ -0,0 +1,188 @@ +/* + * Machine dependent defines/includes for LAME. + * + * Copyright (c) 1999 A.L. Faber + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_MACHINE_H +#define LAME_MACHINE_H + +#include "version.h" + +#if (LAME_RELEASE_VERSION == 0) +#undef NDEBUG +#endif + +#include +#include + +#ifdef STDC_HEADERS +# include +# include +#else +# ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex +# endif +char *strchr(), *strrchr(); +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# define memmove(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#if defined(__riscos__) && defined(FPA10) +# include "ymath.h" +#else +# include +#endif +#include + +#include + +#ifdef HAVE_ERRNO_H +# include +#endif +#ifdef HAVE_FCNTL_H +# include +#endif + +#if defined(macintosh) +# include +# include +#else +# include +# include +#endif + +#ifdef HAVE_INTTYPES_H +# include +#else +# ifdef HAVE_STDINT_H +# include +# endif +#endif + +#ifdef WITH_DMALLOC +#include +#endif + +/* + * 3 different types of pow() functions: + * - table lookup + * - pow() + * - exp() on some machines this is claimed to be faster than pow() + */ + +#define POW20(x) (assert(0 <= (x+Q_MAX2) && x < Q_MAX), pow20[x+Q_MAX2]) +/*#define POW20(x) pow(2.0,((double)(x)-210)*.25) */ +/*#define POW20(x) exp( ((double)(x)-210)*(.25*LOG2) ) */ + +#define IPOW20(x) (assert(0 <= x && x < Q_MAX), ipow20[x]) +/*#define IPOW20(x) exp( -((double)(x)-210)*.1875*LOG2 ) */ +/*#define IPOW20(x) pow(2.0,-((double)(x)-210)*.1875) */ + +/* in case this is used without configure */ +#ifndef inline +# define inline +#endif + +#if defined(_MSC_VER) +# undef inline +# define inline _inline +#elif defined(__SASC) || defined(__GNUC__) || defined(__ICC) || defined(__ECC) +/* if __GNUC__ we always want to inline, not only if the user requests it */ +# undef inline +# define inline __inline +#endif + +#if defined(_MSC_VER) +# pragma warning( disable : 4244 ) +/*# pragma warning( disable : 4305 ) */ +#endif + +/* + * FLOAT for variables which require at least 32 bits + * FLOAT8 for variables which require at least 64 bits + * + * On some machines, 64 bit will be faster than 32 bit. Also, some math + * routines require 64 bit float, so setting FLOAT=float will result in a + * lot of conversions. + */ + +#if ( defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) ) +# define WIN32_LEAN_AND_MEAN +# include +# include +# define FLOAT_MAX FLT_MAX +#else +# ifndef FLOAT +typedef float FLOAT; +# ifdef FLT_MAX +# define FLOAT_MAX FLT_MAX +# else +# define FLOAT_MAX 1e37 /* approx */ +# endif +# endif +#endif + +#ifndef FLOAT8 +typedef double FLOAT8; +# ifdef DBL_MAX +# define FLOAT8_MAX DBL_MAX +# else +# define FLOAT8_MAX 1e99 /* approx */ +# endif +#else +# ifdef FLT_MAX +# define FLOAT8_MAX FLT_MAX +# else +# define FLOAT8_MAX 1e37 /* approx */ +# endif +#endif + +/* sample_t must be floating point, at least 32 bits */ +typedef FLOAT sample_t; + +#define dimension_of(array) (sizeof(array)/sizeof(array[0])) +#define beyond(array) (array+dimension_of(array)) +#define compiletime_assert(expression) extern char static_assert_##FILE##_##LINE[expression?1:0] + +#if 1 +#define EQ(a,b) (\ +(fabs(a) > fabs(b)) \ + ? (fabs((a)-(b)) <= (fabs(a) * 1e-6f)) \ + : (fabs((a)-(b)) <= (fabs(b) * 1e-6f))) +#else +#define EQ(a,b) (fabs((a)-(b))<1E-37) +#endif + +#define NEQ(a,b) (!EQ(a,b)) + +#endif + +#ifdef _MSC_VER +# if _MSC_VER < 1400 +# define fabsf fabs +# define powf pow +# define log10f log10 +# endif +#endif + + +/* end of machine.h */ diff --git a/node_modules/lame/deps/lame/libmp3lame/mpglib_interface.c b/node_modules/lame/deps/lame/libmp3lame/mpglib_interface.c new file mode 100644 index 0000000..5b90211 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/mpglib_interface.c @@ -0,0 +1,476 @@ +/* -*- mode: C; mode: fold -*- */ +/* + * LAME MP3 encoding engine + * + * Copyright (c) 1999-2000 Mark Taylor + * Copyright (c) 2003 Olcios + * Copyright (c) 2008 Robert Hegemann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: mpglib_interface.c,v 1.42 2011/05/07 16:05:17 rbrito Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef HAVE_MPGLIB +#define hip_global_struct mpstr_tag +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "interface.h" + +#include "util.h" + + + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +/* + * OBSOLETE: + * - kept to let it link + * - forward declaration to silence compiler + */ +int CDECL lame_decode_init(void); +int CDECL lame_decode( + unsigned char * mp3buf, + int len, + short pcm_l[], + short pcm_r[] ); +int CDECL lame_decode_headers( + unsigned char* mp3buf, + int len, + short pcm_l[], + short pcm_r[], + mp3data_struct* mp3data ); +int CDECL lame_decode1( + unsigned char* mp3buf, + int len, + short pcm_l[], + short pcm_r[] ); +int CDECL lame_decode1_headers( + unsigned char* mp3buf, + int len, + short pcm_l[], + short pcm_r[], + mp3data_struct* mp3data ); +int CDECL lame_decode1_headersB( + unsigned char* mp3buf, + int len, + short pcm_l[], + short pcm_r[], + mp3data_struct* mp3data, + int *enc_delay, + int *enc_padding ); +int CDECL lame_decode_exit(void); +#endif + + +static MPSTR mp; + +int +lame_decode_exit(void) +{ + ExitMP3(&mp); + return 0; +} + + +int +lame_decode_init(void) +{ + (void) InitMP3(&mp); + return 0; +} + + + + +/* copy mono samples */ +#define COPY_MONO(DST_TYPE, SRC_TYPE) \ + DST_TYPE *pcm_l = (DST_TYPE *)pcm_l_raw; \ + SRC_TYPE const *p_samples = (SRC_TYPE const *)p; \ + for (i = 0; i < processed_samples; i++) \ + *pcm_l++ = (DST_TYPE)(*p_samples++); + +/* copy stereo samples */ +#define COPY_STEREO(DST_TYPE, SRC_TYPE) \ + DST_TYPE *pcm_l = (DST_TYPE *)pcm_l_raw, *pcm_r = (DST_TYPE *)pcm_r_raw; \ + SRC_TYPE const *p_samples = (SRC_TYPE const *)p; \ + for (i = 0; i < processed_samples; i++) { \ + *pcm_l++ = (DST_TYPE)(*p_samples++); \ + *pcm_r++ = (DST_TYPE)(*p_samples++); \ + } + + + +/* + * For lame_decode: return code + * -1 error + * 0 ok, but need more data before outputing any samples + * n number of samples output. either 576 or 1152 depending on MP3 file. + */ + +static int +decode1_headersB_clipchoice(PMPSTR pmp, unsigned char *buffer, int len, + char pcm_l_raw[], char pcm_r_raw[], mp3data_struct * mp3data, + int *enc_delay, int *enc_padding, + char *p, size_t psize, int decoded_sample_size, + int (*decodeMP3_ptr) (PMPSTR, unsigned char *, int, char *, int, + int *)) +{ + static const int smpls[2][4] = { + /* Layer I II III */ + {0, 384, 1152, 1152}, /* MPEG-1 */ + {0, 384, 1152, 576} /* MPEG-2(.5) */ + }; + + int processed_bytes; + int processed_samples; /* processed samples per channel */ + int ret; + int i; + + mp3data->header_parsed = 0; + + ret = (*decodeMP3_ptr) (pmp, buffer, len, p, (int) psize, &processed_bytes); + /* three cases: + * 1. headers parsed, but data not complete + * pmp->header_parsed==1 + * pmp->framesize=0 + * pmp->fsizeold=size of last frame, or 0 if this is first frame + * + * 2. headers, data parsed, but ancillary data not complete + * pmp->header_parsed==1 + * pmp->framesize=size of frame + * pmp->fsizeold=size of last frame, or 0 if this is first frame + * + * 3. frame fully decoded: + * pmp->header_parsed==0 + * pmp->framesize=0 + * pmp->fsizeold=size of frame (which is now the last frame) + * + */ + if (pmp->header_parsed || pmp->fsizeold > 0 || pmp->framesize > 0) { + mp3data->header_parsed = 1; + mp3data->stereo = pmp->fr.stereo; + mp3data->samplerate = freqs[pmp->fr.sampling_frequency]; + mp3data->mode = pmp->fr.mode; + mp3data->mode_ext = pmp->fr.mode_ext; + mp3data->framesize = smpls[pmp->fr.lsf][pmp->fr.lay]; + + /* free format, we need the entire frame before we can determine + * the bitrate. If we haven't gotten the entire frame, bitrate=0 */ + if (pmp->fsizeold > 0) /* works for free format and fixed, no overrun, temporal results are < 400.e6 */ + mp3data->bitrate = 8 * (4 + pmp->fsizeold) * mp3data->samplerate / + (1.e3 * mp3data->framesize) + 0.5; + else if (pmp->framesize > 0) + mp3data->bitrate = 8 * (4 + pmp->framesize) * mp3data->samplerate / + (1.e3 * mp3data->framesize) + 0.5; + else + mp3data->bitrate = tabsel_123[pmp->fr.lsf][pmp->fr.lay - 1][pmp->fr.bitrate_index]; + + + + if (pmp->num_frames > 0) { + /* Xing VBR header found and num_frames was set */ + mp3data->totalframes = pmp->num_frames; + mp3data->nsamp = mp3data->framesize * pmp->num_frames; + *enc_delay = pmp->enc_delay; + *enc_padding = pmp->enc_padding; + } + } + + switch (ret) { + case MP3_OK: + switch (pmp->fr.stereo) { + case 1: + processed_samples = processed_bytes / decoded_sample_size; + if (decoded_sample_size == sizeof(short)) { + COPY_MONO(short, short) + } + else { + COPY_MONO(sample_t, FLOAT) + } + break; + case 2: + processed_samples = (processed_bytes / decoded_sample_size) >> 1; + if (decoded_sample_size == sizeof(short)) { + COPY_STEREO(short, short) + } + else { + COPY_STEREO(sample_t, FLOAT) + } + break; + default: + processed_samples = -1; + assert(0); + break; + } + break; + + case MP3_NEED_MORE: + processed_samples = 0; + break; + + case MP3_ERR: + processed_samples = -1; + break; + + default: + processed_samples = -1; + assert(0); + break; + } + + /*fprintf(stderr,"ok, more, err: %i %i %i\n", MP3_OK, MP3_NEED_MORE, MP3_ERR ); */ + /*fprintf(stderr,"ret = %i out=%i\n", ret, processed_samples ); */ + return processed_samples; +} + + +#define OUTSIZE_CLIPPED (4096*sizeof(short)) + +int +lame_decode1_headersB(unsigned char *buffer, + int len, + short pcm_l[], short pcm_r[], mp3data_struct * mp3data, + int *enc_delay, int *enc_padding) +{ + static char out[OUTSIZE_CLIPPED]; + + return decode1_headersB_clipchoice(&mp, buffer, len, (char *) pcm_l, (char *) pcm_r, mp3data, + enc_delay, enc_padding, out, OUTSIZE_CLIPPED, + sizeof(short), decodeMP3); +} + + + + + +/* + * For lame_decode: return code + * -1 error + * 0 ok, but need more data before outputing any samples + * n number of samples output. Will be at most one frame of + * MPEG data. + */ + +int +lame_decode1_headers(unsigned char *buffer, + int len, short pcm_l[], short pcm_r[], mp3data_struct * mp3data) +{ + int enc_delay, enc_padding; + return lame_decode1_headersB(buffer, len, pcm_l, pcm_r, mp3data, &enc_delay, &enc_padding); +} + + +int +lame_decode1(unsigned char *buffer, int len, short pcm_l[], short pcm_r[]) +{ + mp3data_struct mp3data; + + return lame_decode1_headers(buffer, len, pcm_l, pcm_r, &mp3data); +} + + +/* + * For lame_decode: return code + * -1 error + * 0 ok, but need more data before outputing any samples + * n number of samples output. a multiple of 576 or 1152 depending on MP3 file. + */ + +int +lame_decode_headers(unsigned char *buffer, + int len, short pcm_l[], short pcm_r[], mp3data_struct * mp3data) +{ + int ret; + int totsize = 0; /* number of decoded samples per channel */ + + for (;;) { + switch (ret = lame_decode1_headers(buffer, len, pcm_l + totsize, pcm_r + totsize, mp3data)) { + case -1: + return ret; + case 0: + return totsize; + default: + totsize += ret; + len = 0; /* future calls to decodeMP3 are just to flush buffers */ + break; + } + } +} + + +int +lame_decode(unsigned char *buffer, int len, short pcm_l[], short pcm_r[]) +{ + mp3data_struct mp3data; + + return lame_decode_headers(buffer, len, pcm_l, pcm_r, &mp3data); +} + + + + +hip_t hip_decode_init(void) +{ + hip_t hip = calloc(1, sizeof(hip_global_flags)); + InitMP3(hip); + return hip; +} + + +int hip_decode_exit(hip_t hip) +{ + if (hip) { + ExitMP3(hip); + free(hip); + } + return 0; +} + + +/* we forbid input with more than 1152 samples per channel for output in the unclipped mode */ +#define OUTSIZE_UNCLIPPED (1152*2*sizeof(FLOAT)) + +int +hip_decode1_unclipped(hip_t hip, unsigned char *buffer, size_t len, sample_t pcm_l[], sample_t pcm_r[]) +{ + static char out[OUTSIZE_UNCLIPPED]; + mp3data_struct mp3data; + int enc_delay, enc_padding; + + if (hip) { + return decode1_headersB_clipchoice(hip, buffer, len, (char *) pcm_l, (char *) pcm_r, &mp3data, + &enc_delay, &enc_padding, out, OUTSIZE_UNCLIPPED, + sizeof(FLOAT), decodeMP3_unclipped); + } + return 0; +} + +/* + * For hip_decode: return code + * -1 error + * 0 ok, but need more data before outputing any samples + * n number of samples output. Will be at most one frame of + * MPEG data. + */ + +int +hip_decode1_headers(hip_t hip, unsigned char *buffer, + size_t len, short pcm_l[], short pcm_r[], mp3data_struct * mp3data) +{ + int enc_delay, enc_padding; + return hip_decode1_headersB(hip, buffer, len, pcm_l, pcm_r, mp3data, &enc_delay, &enc_padding); +} + + +int +hip_decode1(hip_t hip, unsigned char *buffer, size_t len, short pcm_l[], short pcm_r[]) +{ + mp3data_struct mp3data; + return hip_decode1_headers(hip, buffer, len, pcm_l, pcm_r, &mp3data); +} + + +/* + * For hip_decode: return code + * -1 error + * 0 ok, but need more data before outputing any samples + * n number of samples output. a multiple of 576 or 1152 depending on MP3 file. + */ + +int +hip_decode_headers(hip_t hip, unsigned char *buffer, + size_t len, short pcm_l[], short pcm_r[], mp3data_struct * mp3data) +{ + int ret; + int totsize = 0; /* number of decoded samples per channel */ + + for (;;) { + switch (ret = hip_decode1_headers(hip, buffer, len, pcm_l + totsize, pcm_r + totsize, mp3data)) { + case -1: + return ret; + case 0: + return totsize; + default: + totsize += ret; + len = 0; /* future calls to decodeMP3 are just to flush buffers */ + break; + } + } +} + + +int +hip_decode(hip_t hip, unsigned char *buffer, size_t len, short pcm_l[], short pcm_r[]) +{ + mp3data_struct mp3data; + return hip_decode_headers(hip, buffer, len, pcm_l, pcm_r, &mp3data); +} + + +int +hip_decode1_headersB(hip_t hip, unsigned char *buffer, + size_t len, + short pcm_l[], short pcm_r[], mp3data_struct * mp3data, + int *enc_delay, int *enc_padding) +{ + static char out[OUTSIZE_CLIPPED]; + if (hip) { + return decode1_headersB_clipchoice(hip, buffer, len, (char *) pcm_l, (char *) pcm_r, mp3data, + enc_delay, enc_padding, out, OUTSIZE_CLIPPED, + sizeof(short), decodeMP3); + } + return -1; +} + + +void hip_set_pinfo(hip_t hip, plotting_data* pinfo) +{ + if (hip) { + hip->pinfo = pinfo; + } +} + + + +void hip_set_errorf(hip_t hip, lame_report_function func) +{ + if (hip) { + hip->report_err = func; + } +} + +void hip_set_debugf(hip_t hip, lame_report_function func) +{ + if (hip) { + hip->report_dbg = func; + } +} + +void hip_set_msgf (hip_t hip, lame_report_function func) +{ + if (hip) { + hip->report_msg = func; + } +} + +#endif + +/* end of mpglib_interface.c */ diff --git a/node_modules/lame/deps/lame/libmp3lame/newmdct.c b/node_modules/lame/deps/lame/libmp3lame/newmdct.c new file mode 100644 index 0000000..596cac9 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/newmdct.c @@ -0,0 +1,1039 @@ +/* + * MP3 window subband -> subband filtering -> mdct routine + * + * Copyright (c) 1999-2000 Takehiro Tominaga + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Special Thanks to Patrick De Smet for your advices. + */ + +/* $Id: newmdct.c,v 1.39 2011/05/07 16:05:17 rbrito Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "newmdct.h" + + + +#ifndef USE_GOGO_SUBBAND +static const FLOAT enwindow[] = { + -4.77e-07 * 0.740951125354959 / 2.384e-06, 1.03951e-04 * 0.740951125354959 / 2.384e-06, + 9.53674e-04 * 0.740951125354959 / 2.384e-06, 2.841473e-03 * 0.740951125354959 / 2.384e-06, + 3.5758972e-02 * 0.740951125354959 / 2.384e-06, 3.401756e-03 * 0.740951125354959 / 2.384e-06, 9.83715e-04 * 0.740951125354959 / 2.384e-06, 9.9182e-05 * 0.740951125354959 / 2.384e-06, /* 15 */ + 1.2398e-05 * 0.740951125354959 / 2.384e-06, 1.91212e-04 * 0.740951125354959 / 2.384e-06, + 2.283096e-03 * 0.740951125354959 / 2.384e-06, 1.6994476e-02 * 0.740951125354959 / 2.384e-06, + -1.8756866e-02 * 0.740951125354959 / 2.384e-06, -2.630711e-03 * 0.740951125354959 / 2.384e-06, + -2.47478e-04 * 0.740951125354959 / 2.384e-06, -1.4782e-05 * 0.740951125354959 / 2.384e-06, + 9.063471690191471e-01, + 1.960342806591213e-01, + + + -4.77e-07 * 0.773010453362737 / 2.384e-06, 1.05858e-04 * 0.773010453362737 / 2.384e-06, + 9.30786e-04 * 0.773010453362737 / 2.384e-06, 2.521515e-03 * 0.773010453362737 / 2.384e-06, + 3.5694122e-02 * 0.773010453362737 / 2.384e-06, 3.643036e-03 * 0.773010453362737 / 2.384e-06, 9.91821e-04 * 0.773010453362737 / 2.384e-06, 9.6321e-05 * 0.773010453362737 / 2.384e-06, /* 14 */ + 1.1444e-05 * 0.773010453362737 / 2.384e-06, 1.65462e-04 * 0.773010453362737 / 2.384e-06, + 2.110004e-03 * 0.773010453362737 / 2.384e-06, 1.6112804e-02 * 0.773010453362737 / 2.384e-06, + -1.9634247e-02 * 0.773010453362737 / 2.384e-06, -2.803326e-03 * 0.773010453362737 / 2.384e-06, + -2.77042e-04 * 0.773010453362737 / 2.384e-06, -1.6689e-05 * 0.773010453362737 / 2.384e-06, + 8.206787908286602e-01, + 3.901806440322567e-01, + + + -4.77e-07 * 0.803207531480645 / 2.384e-06, 1.07288e-04 * 0.803207531480645 / 2.384e-06, + 9.02653e-04 * 0.803207531480645 / 2.384e-06, 2.174854e-03 * 0.803207531480645 / 2.384e-06, + 3.5586357e-02 * 0.803207531480645 / 2.384e-06, 3.858566e-03 * 0.803207531480645 / 2.384e-06, 9.95159e-04 * 0.803207531480645 / 2.384e-06, 9.3460e-05 * 0.803207531480645 / 2.384e-06, /* 13 */ + 1.0014e-05 * 0.803207531480645 / 2.384e-06, 1.40190e-04 * 0.803207531480645 / 2.384e-06, + 1.937389e-03 * 0.803207531480645 / 2.384e-06, 1.5233517e-02 * 0.803207531480645 / 2.384e-06, + -2.0506859e-02 * 0.803207531480645 / 2.384e-06, -2.974033e-03 * 0.803207531480645 / 2.384e-06, + -3.07560e-04 * 0.803207531480645 / 2.384e-06, -1.8120e-05 * 0.803207531480645 / 2.384e-06, + 7.416505462720353e-01, + 5.805693545089249e-01, + + + -4.77e-07 * 0.831469612302545 / 2.384e-06, 1.08242e-04 * 0.831469612302545 / 2.384e-06, + 8.68797e-04 * 0.831469612302545 / 2.384e-06, 1.800537e-03 * 0.831469612302545 / 2.384e-06, + 3.5435200e-02 * 0.831469612302545 / 2.384e-06, 4.049301e-03 * 0.831469612302545 / 2.384e-06, 9.94205e-04 * 0.831469612302545 / 2.384e-06, 9.0599e-05 * 0.831469612302545 / 2.384e-06, /* 12 */ + 9.060e-06 * 0.831469612302545 / 2.384e-06, 1.16348e-04 * 0.831469612302545 / 2.384e-06, + 1.766682e-03 * 0.831469612302545 / 2.384e-06, 1.4358521e-02 * 0.831469612302545 / 2.384e-06, + -2.1372318e-02 * 0.831469612302545 / 2.384e-06, -3.14188e-03 * 0.831469612302545 / 2.384e-06, + -3.39031e-04 * 0.831469612302545 / 2.384e-06, -1.9550e-05 * 0.831469612302545 / 2.384e-06, + 6.681786379192989e-01, + 7.653668647301797e-01, + + + -4.77e-07 * 0.857728610000272 / 2.384e-06, 1.08719e-04 * 0.857728610000272 / 2.384e-06, + 8.29220e-04 * 0.857728610000272 / 2.384e-06, 1.399517e-03 * 0.857728610000272 / 2.384e-06, + 3.5242081e-02 * 0.857728610000272 / 2.384e-06, 4.215240e-03 * 0.857728610000272 / 2.384e-06, 9.89437e-04 * 0.857728610000272 / 2.384e-06, 8.7261e-05 * 0.857728610000272 / 2.384e-06, /* 11 */ + 8.106e-06 * 0.857728610000272 / 2.384e-06, 9.3937e-05 * 0.857728610000272 / 2.384e-06, + 1.597881e-03 * 0.857728610000272 / 2.384e-06, 1.3489246e-02 * 0.857728610000272 / 2.384e-06, + -2.2228718e-02 * 0.857728610000272 / 2.384e-06, -3.306866e-03 * 0.857728610000272 / 2.384e-06, + -3.71456e-04 * 0.857728610000272 / 2.384e-06, -2.1458e-05 * 0.857728610000272 / 2.384e-06, + 5.993769336819237e-01, + 9.427934736519954e-01, + + + -4.77e-07 * 0.881921264348355 / 2.384e-06, 1.08719e-04 * 0.881921264348355 / 2.384e-06, + 7.8392e-04 * 0.881921264348355 / 2.384e-06, 9.71317e-04 * 0.881921264348355 / 2.384e-06, + 3.5007000e-02 * 0.881921264348355 / 2.384e-06, 4.357815e-03 * 0.881921264348355 / 2.384e-06, 9.80854e-04 * 0.881921264348355 / 2.384e-06, 8.3923e-05 * 0.881921264348355 / 2.384e-06, /* 10 */ + 7.629e-06 * 0.881921264348355 / 2.384e-06, 7.2956e-05 * 0.881921264348355 / 2.384e-06, + 1.432419e-03 * 0.881921264348355 / 2.384e-06, 1.2627602e-02 * 0.881921264348355 / 2.384e-06, + -2.3074150e-02 * 0.881921264348355 / 2.384e-06, -3.467083e-03 * 0.881921264348355 / 2.384e-06, + -4.04358e-04 * 0.881921264348355 / 2.384e-06, -2.3365e-05 * 0.881921264348355 / 2.384e-06, + 5.345111359507916e-01, + 1.111140466039205e+00, + + + -9.54e-07 * 0.903989293123443 / 2.384e-06, 1.08242e-04 * 0.903989293123443 / 2.384e-06, + 7.31945e-04 * 0.903989293123443 / 2.384e-06, 5.15938e-04 * 0.903989293123443 / 2.384e-06, + 3.4730434e-02 * 0.903989293123443 / 2.384e-06, 4.477024e-03 * 0.903989293123443 / 2.384e-06, 9.68933e-04 * 0.903989293123443 / 2.384e-06, 8.0585e-05 * 0.903989293123443 / 2.384e-06, /* 9 */ + 6.676e-06 * 0.903989293123443 / 2.384e-06, 5.2929e-05 * 0.903989293123443 / 2.384e-06, + 1.269817e-03 * 0.903989293123443 / 2.384e-06, 1.1775017e-02 * 0.903989293123443 / 2.384e-06, + -2.3907185e-02 * 0.903989293123443 / 2.384e-06, -3.622532e-03 * 0.903989293123443 / 2.384e-06, + -4.38213e-04 * 0.903989293123443 / 2.384e-06, -2.5272e-05 * 0.903989293123443 / 2.384e-06, + 4.729647758913199e-01, + 1.268786568327291e+00, + + + -9.54e-07 * 0.92387953251128675613 / 2.384e-06, + 1.06812e-04 * 0.92387953251128675613 / 2.384e-06, + 6.74248e-04 * 0.92387953251128675613 / 2.384e-06, + 3.3379e-05 * 0.92387953251128675613 / 2.384e-06, + 3.4412861e-02 * 0.92387953251128675613 / 2.384e-06, + 4.573822e-03 * 0.92387953251128675613 / 2.384e-06, + 9.54151e-04 * 0.92387953251128675613 / 2.384e-06, + 7.6771e-05 * 0.92387953251128675613 / 2.384e-06, + 6.199e-06 * 0.92387953251128675613 / 2.384e-06, 3.4332e-05 * 0.92387953251128675613 / 2.384e-06, + 1.111031e-03 * 0.92387953251128675613 / 2.384e-06, + 1.0933399e-02 * 0.92387953251128675613 / 2.384e-06, + -2.4725437e-02 * 0.92387953251128675613 / 2.384e-06, + -3.771782e-03 * 0.92387953251128675613 / 2.384e-06, + -4.72546e-04 * 0.92387953251128675613 / 2.384e-06, + -2.7657e-05 * 0.92387953251128675613 / 2.384e-06, + 4.1421356237309504879e-01, /* tan(PI/8) */ + 1.414213562373095e+00, + + + -9.54e-07 * 0.941544065183021 / 2.384e-06, 1.05381e-04 * 0.941544065183021 / 2.384e-06, + 6.10352e-04 * 0.941544065183021 / 2.384e-06, -4.75883e-04 * 0.941544065183021 / 2.384e-06, + 3.4055710e-02 * 0.941544065183021 / 2.384e-06, 4.649162e-03 * 0.941544065183021 / 2.384e-06, 9.35555e-04 * 0.941544065183021 / 2.384e-06, 7.3433e-05 * 0.941544065183021 / 2.384e-06, /* 7 */ + 5.245e-06 * 0.941544065183021 / 2.384e-06, 1.7166e-05 * 0.941544065183021 / 2.384e-06, + 9.56535e-04 * 0.941544065183021 / 2.384e-06, 1.0103703e-02 * 0.941544065183021 / 2.384e-06, + -2.5527000e-02 * 0.941544065183021 / 2.384e-06, -3.914356e-03 * 0.941544065183021 / 2.384e-06, + -5.07355e-04 * 0.941544065183021 / 2.384e-06, -3.0041e-05 * 0.941544065183021 / 2.384e-06, + 3.578057213145241e-01, + 1.546020906725474e+00, + + + -9.54e-07 * 0.956940335732209 / 2.384e-06, 1.02520e-04 * 0.956940335732209 / 2.384e-06, + 5.39303e-04 * 0.956940335732209 / 2.384e-06, -1.011848e-03 * 0.956940335732209 / 2.384e-06, + 3.3659935e-02 * 0.956940335732209 / 2.384e-06, 4.703045e-03 * 0.956940335732209 / 2.384e-06, 9.15051e-04 * 0.956940335732209 / 2.384e-06, 7.0095e-05 * 0.956940335732209 / 2.384e-06, /* 6 */ + 4.768e-06 * 0.956940335732209 / 2.384e-06, 9.54e-07 * 0.956940335732209 / 2.384e-06, + 8.06808e-04 * 0.956940335732209 / 2.384e-06, 9.287834e-03 * 0.956940335732209 / 2.384e-06, + -2.6310921e-02 * 0.956940335732209 / 2.384e-06, -4.048824e-03 * 0.956940335732209 / 2.384e-06, + -5.42164e-04 * 0.956940335732209 / 2.384e-06, -3.2425e-05 * 0.956940335732209 / 2.384e-06, + 3.033466836073424e-01, + 1.662939224605090e+00, + + + -1.431e-06 * 0.970031253194544 / 2.384e-06, 9.9182e-05 * 0.970031253194544 / 2.384e-06, + 4.62532e-04 * 0.970031253194544 / 2.384e-06, -1.573563e-03 * 0.970031253194544 / 2.384e-06, + 3.3225536e-02 * 0.970031253194544 / 2.384e-06, 4.737377e-03 * 0.970031253194544 / 2.384e-06, 8.91685e-04 * 0.970031253194544 / 2.384e-06, 6.6280e-05 * 0.970031253194544 / 2.384e-06, /* 5 */ + 4.292e-06 * 0.970031253194544 / 2.384e-06, -1.3828e-05 * 0.970031253194544 / 2.384e-06, + 6.61850e-04 * 0.970031253194544 / 2.384e-06, 8.487225e-03 * 0.970031253194544 / 2.384e-06, + -2.7073860e-02 * 0.970031253194544 / 2.384e-06, -4.174709e-03 * 0.970031253194544 / 2.384e-06, + -5.76973e-04 * 0.970031253194544 / 2.384e-06, -3.4809e-05 * 0.970031253194544 / 2.384e-06, + 2.504869601913055e-01, + 1.763842528696710e+00, + + + -1.431e-06 * 0.98078528040323 / 2.384e-06, 9.5367e-05 * 0.98078528040323 / 2.384e-06, + 3.78609e-04 * 0.98078528040323 / 2.384e-06, -2.161503e-03 * 0.98078528040323 / 2.384e-06, + 3.2754898e-02 * 0.98078528040323 / 2.384e-06, 4.752159e-03 * 0.98078528040323 / 2.384e-06, 8.66413e-04 * 0.98078528040323 / 2.384e-06, 6.2943e-05 * 0.98078528040323 / 2.384e-06, /* 4 */ + 3.815e-06 * 0.98078528040323 / 2.384e-06, -2.718e-05 * 0.98078528040323 / 2.384e-06, + 5.22137e-04 * 0.98078528040323 / 2.384e-06, 7.703304e-03 * 0.98078528040323 / 2.384e-06, + -2.7815342e-02 * 0.98078528040323 / 2.384e-06, -4.290581e-03 * 0.98078528040323 / 2.384e-06, + -6.11782e-04 * 0.98078528040323 / 2.384e-06, -3.7670e-05 * 0.98078528040323 / 2.384e-06, + 1.989123673796580e-01, + 1.847759065022573e+00, + + + -1.907e-06 * 0.989176509964781 / 2.384e-06, 9.0122e-05 * 0.989176509964781 / 2.384e-06, + 2.88486e-04 * 0.989176509964781 / 2.384e-06, -2.774239e-03 * 0.989176509964781 / 2.384e-06, + 3.2248020e-02 * 0.989176509964781 / 2.384e-06, 4.748821e-03 * 0.989176509964781 / 2.384e-06, 8.38757e-04 * 0.989176509964781 / 2.384e-06, 5.9605e-05 * 0.989176509964781 / 2.384e-06, /* 3 */ + 3.338e-06 * 0.989176509964781 / 2.384e-06, -3.9577e-05 * 0.989176509964781 / 2.384e-06, + 3.88145e-04 * 0.989176509964781 / 2.384e-06, 6.937027e-03 * 0.989176509964781 / 2.384e-06, + -2.8532982e-02 * 0.989176509964781 / 2.384e-06, -4.395962e-03 * 0.989176509964781 / 2.384e-06, + -6.46591e-04 * 0.989176509964781 / 2.384e-06, -4.0531e-05 * 0.989176509964781 / 2.384e-06, + 1.483359875383474e-01, + 1.913880671464418e+00, + + + -1.907e-06 * 0.995184726672197 / 2.384e-06, 8.4400e-05 * 0.995184726672197 / 2.384e-06, + 1.91689e-04 * 0.995184726672197 / 2.384e-06, -3.411293e-03 * 0.995184726672197 / 2.384e-06, + 3.1706810e-02 * 0.995184726672197 / 2.384e-06, 4.728317e-03 * 0.995184726672197 / 2.384e-06, + 8.09669e-04 * 0.995184726672197 / 2.384e-06, 5.579e-05 * 0.995184726672197 / 2.384e-06, + 3.338e-06 * 0.995184726672197 / 2.384e-06, -5.0545e-05 * 0.995184726672197 / 2.384e-06, + 2.59876e-04 * 0.995184726672197 / 2.384e-06, 6.189346e-03 * 0.995184726672197 / 2.384e-06, + -2.9224873e-02 * 0.995184726672197 / 2.384e-06, -4.489899e-03 * 0.995184726672197 / 2.384e-06, + -6.80923e-04 * 0.995184726672197 / 2.384e-06, -4.3392e-05 * 0.995184726672197 / 2.384e-06, + 9.849140335716425e-02, + 1.961570560806461e+00, + + + -2.384e-06 * 0.998795456205172 / 2.384e-06, 7.7724e-05 * 0.998795456205172 / 2.384e-06, + 8.8215e-05 * 0.998795456205172 / 2.384e-06, -4.072189e-03 * 0.998795456205172 / 2.384e-06, + 3.1132698e-02 * 0.998795456205172 / 2.384e-06, 4.691124e-03 * 0.998795456205172 / 2.384e-06, + 7.79152e-04 * 0.998795456205172 / 2.384e-06, 5.2929e-05 * 0.998795456205172 / 2.384e-06, + 2.861e-06 * 0.998795456205172 / 2.384e-06, -6.0558e-05 * 0.998795456205172 / 2.384e-06, + 1.37329e-04 * 0.998795456205172 / 2.384e-06, 5.462170e-03 * 0.998795456205172 / 2.384e-06, + -2.9890060e-02 * 0.998795456205172 / 2.384e-06, -4.570484e-03 * 0.998795456205172 / 2.384e-06, + -7.14302e-04 * 0.998795456205172 / 2.384e-06, -4.6253e-05 * 0.998795456205172 / 2.384e-06, + 4.912684976946725e-02, + 1.990369453344394e+00, + + + 3.5780907e-02 * SQRT2 * 0.5 / 2.384e-06, 1.7876148e-02 * SQRT2 * 0.5 / 2.384e-06, + 3.134727e-03 * SQRT2 * 0.5 / 2.384e-06, 2.457142e-03 * SQRT2 * 0.5 / 2.384e-06, + 9.71317e-04 * SQRT2 * 0.5 / 2.384e-06, 2.18868e-04 * SQRT2 * 0.5 / 2.384e-06, + 1.01566e-04 * SQRT2 * 0.5 / 2.384e-06, 1.3828e-05 * SQRT2 * 0.5 / 2.384e-06, + + 3.0526638e-02 / 2.384e-06, 4.638195e-03 / 2.384e-06, 7.47204e-04 / 2.384e-06, + 4.9591e-05 / 2.384e-06, + 4.756451e-03 / 2.384e-06, 2.1458e-05 / 2.384e-06, -6.9618e-05 / 2.384e-06, /* 2.384e-06/2.384e-06 */ +}; +#endif + + +#define NS 12 +#define NL 36 + +static const FLOAT win[4][NL] = { + { + 2.382191739347913e-13, + 6.423305872147834e-13, + 9.400849094049688e-13, + 1.122435026096556e-12, + 1.183840321267481e-12, + 1.122435026096556e-12, + 9.400849094049690e-13, + 6.423305872147839e-13, + 2.382191739347918e-13, + + 5.456116108943412e-12, + 4.878985199565852e-12, + 4.240448995017367e-12, + 3.559909094758252e-12, + 2.858043359288075e-12, + 2.156177623817898e-12, + 1.475637723558783e-12, + 8.371015190102974e-13, + 2.599706096327376e-13, + + -5.456116108943412e-12, + -4.878985199565852e-12, + -4.240448995017367e-12, + -3.559909094758252e-12, + -2.858043359288076e-12, + -2.156177623817898e-12, + -1.475637723558783e-12, + -8.371015190102975e-13, + -2.599706096327376e-13, + + -2.382191739347923e-13, + -6.423305872147843e-13, + -9.400849094049696e-13, + -1.122435026096556e-12, + -1.183840321267481e-12, + -1.122435026096556e-12, + -9.400849094049694e-13, + -6.423305872147840e-13, + -2.382191739347918e-13, + }, + { + 2.382191739347913e-13, + 6.423305872147834e-13, + 9.400849094049688e-13, + 1.122435026096556e-12, + 1.183840321267481e-12, + 1.122435026096556e-12, + 9.400849094049688e-13, + 6.423305872147841e-13, + 2.382191739347918e-13, + + 5.456116108943413e-12, + 4.878985199565852e-12, + 4.240448995017367e-12, + 3.559909094758253e-12, + 2.858043359288075e-12, + 2.156177623817898e-12, + 1.475637723558782e-12, + 8.371015190102975e-13, + 2.599706096327376e-13, + + -5.461314069809755e-12, + -4.921085770524055e-12, + -4.343405037091838e-12, + -3.732668368707687e-12, + -3.093523840190885e-12, + -2.430835727329465e-12, + -1.734679010007751e-12, + -9.748253656609281e-13, + -2.797435120168326e-13, + + 0.000000000000000e+00, + 0.000000000000000e+00, + 0.000000000000000e+00, + 0.000000000000000e+00, + 0.000000000000000e+00, + 0.000000000000000e+00, + -2.283748241799531e-13, + -4.037858874020686e-13, + -2.146547464825323e-13, + }, + { + 1.316524975873958e-01, /* win[SHORT_TYPE] */ + 4.142135623730950e-01, + 7.673269879789602e-01, + + 1.091308501069271e+00, /* tantab_l */ + 1.303225372841206e+00, + 1.569685577117490e+00, + 1.920982126971166e+00, + 2.414213562373094e+00, + 3.171594802363212e+00, + 4.510708503662055e+00, + 7.595754112725146e+00, + 2.290376554843115e+01, + + 0.98480775301220802032, /* cx */ + 0.64278760968653936292, + 0.34202014332566882393, + 0.93969262078590842791, + -0.17364817766693030343, + -0.76604444311897790243, + 0.86602540378443870761, + 0.500000000000000e+00, + + -5.144957554275265e-01, /* ca */ + -4.717319685649723e-01, + -3.133774542039019e-01, + -1.819131996109812e-01, + -9.457419252642064e-02, + -4.096558288530405e-02, + -1.419856857247115e-02, + -3.699974673760037e-03, + + 8.574929257125442e-01, /* cs */ + 8.817419973177052e-01, + 9.496286491027329e-01, + 9.833145924917901e-01, + 9.955178160675857e-01, + 9.991605581781475e-01, + 9.998991952444470e-01, + 9.999931550702802e-01, + }, + { + 0.000000000000000e+00, + 0.000000000000000e+00, + 0.000000000000000e+00, + 0.000000000000000e+00, + 0.000000000000000e+00, + 0.000000000000000e+00, + 2.283748241799531e-13, + 4.037858874020686e-13, + 2.146547464825323e-13, + + 5.461314069809755e-12, + 4.921085770524055e-12, + 4.343405037091838e-12, + 3.732668368707687e-12, + 3.093523840190885e-12, + 2.430835727329466e-12, + 1.734679010007751e-12, + 9.748253656609281e-13, + 2.797435120168326e-13, + + -5.456116108943413e-12, + -4.878985199565852e-12, + -4.240448995017367e-12, + -3.559909094758253e-12, + -2.858043359288075e-12, + -2.156177623817898e-12, + -1.475637723558782e-12, + -8.371015190102975e-13, + -2.599706096327376e-13, + + -2.382191739347913e-13, + -6.423305872147834e-13, + -9.400849094049688e-13, + -1.122435026096556e-12, + -1.183840321267481e-12, + -1.122435026096556e-12, + -9.400849094049688e-13, + -6.423305872147841e-13, + -2.382191739347918e-13, + } +}; + +#define tantab_l (win[SHORT_TYPE]+3) +#define cx (win[SHORT_TYPE]+12) +#define ca (win[SHORT_TYPE]+20) +#define cs (win[SHORT_TYPE]+28) + +/************************************************************************ +* +* window_subband() +* +* PURPOSE: Overlapping window on PCM samples +* +* SEMANTICS: +* 32 16-bit pcm samples are scaled to fractional 2's complement and +* concatenated to the end of the window buffer #x#. The updated window +* buffer #x# is then windowed by the analysis window #c# to produce the +* windowed sample #z# +* +************************************************************************/ + +/* + * new IDCT routine written by Takehiro TOMINAGA + */ +static const int order[] = { + 0, 1, 16, 17, 8, 9, 24, 25, 4, 5, 20, 21, 12, 13, 28, 29, + 2, 3, 18, 19, 10, 11, 26, 27, 6, 7, 22, 23, 14, 15, 30, 31 +}; + + +/* returns sum_j=0^31 a[j]*cos(PI*j*(k+1/2)/32), 0<=k<32 */ +inline static void +window_subband(const sample_t * x1, FLOAT a[SBLIMIT]) +{ + int i; + FLOAT const *wp = enwindow + 10; + + const sample_t *x2 = &x1[238 - 14 - 286]; + + for (i = -15; i < 0; i++) { + FLOAT w, s, t; + + w = wp[-10]; + s = x2[-224] * w; + t = x1[224] * w; + w = wp[-9]; + s += x2[-160] * w; + t += x1[160] * w; + w = wp[-8]; + s += x2[-96] * w; + t += x1[96] * w; + w = wp[-7]; + s += x2[-32] * w; + t += x1[32] * w; + w = wp[-6]; + s += x2[32] * w; + t += x1[-32] * w; + w = wp[-5]; + s += x2[96] * w; + t += x1[-96] * w; + w = wp[-4]; + s += x2[160] * w; + t += x1[-160] * w; + w = wp[-3]; + s += x2[224] * w; + t += x1[-224] * w; + + w = wp[-2]; + s += x1[-256] * w; + t -= x2[256] * w; + w = wp[-1]; + s += x1[-192] * w; + t -= x2[192] * w; + w = wp[0]; + s += x1[-128] * w; + t -= x2[128] * w; + w = wp[1]; + s += x1[-64] * w; + t -= x2[64] * w; + w = wp[2]; + s += x1[0] * w; + t -= x2[0] * w; + w = wp[3]; + s += x1[64] * w; + t -= x2[-64] * w; + w = wp[4]; + s += x1[128] * w; + t -= x2[-128] * w; + w = wp[5]; + s += x1[192] * w; + t -= x2[-192] * w; + + /* + * this multiplyer could be removed, but it needs more 256 FLOAT data. + * thinking about the data cache performance, I think we should not + * use such a huge table. tt 2000/Oct/25 + */ + s *= wp[6]; + w = t - s; + a[30 + i * 2] = t + s; + a[31 + i * 2] = wp[7] * w; + wp += 18; + x1--; + x2++; + } + { + FLOAT s, t, u, v; + t = x1[-16] * wp[-10]; + s = x1[-32] * wp[-2]; + t += (x1[-48] - x1[16]) * wp[-9]; + s += x1[-96] * wp[-1]; + t += (x1[-80] + x1[48]) * wp[-8]; + s += x1[-160] * wp[0]; + t += (x1[-112] - x1[80]) * wp[-7]; + s += x1[-224] * wp[1]; + t += (x1[-144] + x1[112]) * wp[-6]; + s -= x1[32] * wp[2]; + t += (x1[-176] - x1[144]) * wp[-5]; + s -= x1[96] * wp[3]; + t += (x1[-208] + x1[176]) * wp[-4]; + s -= x1[160] * wp[4]; + t += (x1[-240] - x1[208]) * wp[-3]; + s -= x1[224]; + + u = s - t; + v = s + t; + + t = a[14]; + s = a[15] - t; + + a[31] = v + t; /* A0 */ + a[30] = u + s; /* A1 */ + a[15] = u - s; /* A2 */ + a[14] = v - t; /* A3 */ + } + { + FLOAT xr; + xr = a[28] - a[0]; + a[0] += a[28]; + a[28] = xr * wp[-2 * 18 + 7]; + xr = a[29] - a[1]; + a[1] += a[29]; + a[29] = xr * wp[-2 * 18 + 7]; + + xr = a[26] - a[2]; + a[2] += a[26]; + a[26] = xr * wp[-4 * 18 + 7]; + xr = a[27] - a[3]; + a[3] += a[27]; + a[27] = xr * wp[-4 * 18 + 7]; + + xr = a[24] - a[4]; + a[4] += a[24]; + a[24] = xr * wp[-6 * 18 + 7]; + xr = a[25] - a[5]; + a[5] += a[25]; + a[25] = xr * wp[-6 * 18 + 7]; + + xr = a[22] - a[6]; + a[6] += a[22]; + a[22] = xr * SQRT2; + xr = a[23] - a[7]; + a[7] += a[23]; + a[23] = xr * SQRT2 - a[7]; + a[7] -= a[6]; + a[22] -= a[7]; + a[23] -= a[22]; + + xr = a[6]; + a[6] = a[31] - xr; + a[31] = a[31] + xr; + xr = a[7]; + a[7] = a[30] - xr; + a[30] = a[30] + xr; + xr = a[22]; + a[22] = a[15] - xr; + a[15] = a[15] + xr; + xr = a[23]; + a[23] = a[14] - xr; + a[14] = a[14] + xr; + + xr = a[20] - a[8]; + a[8] += a[20]; + a[20] = xr * wp[-10 * 18 + 7]; + xr = a[21] - a[9]; + a[9] += a[21]; + a[21] = xr * wp[-10 * 18 + 7]; + + xr = a[18] - a[10]; + a[10] += a[18]; + a[18] = xr * wp[-12 * 18 + 7]; + xr = a[19] - a[11]; + a[11] += a[19]; + a[19] = xr * wp[-12 * 18 + 7]; + + xr = a[16] - a[12]; + a[12] += a[16]; + a[16] = xr * wp[-14 * 18 + 7]; + xr = a[17] - a[13]; + a[13] += a[17]; + a[17] = xr * wp[-14 * 18 + 7]; + + xr = -a[20] + a[24]; + a[20] += a[24]; + a[24] = xr * wp[-12 * 18 + 7]; + xr = -a[21] + a[25]; + a[21] += a[25]; + a[25] = xr * wp[-12 * 18 + 7]; + + xr = a[4] - a[8]; + a[4] += a[8]; + a[8] = xr * wp[-12 * 18 + 7]; + xr = a[5] - a[9]; + a[5] += a[9]; + a[9] = xr * wp[-12 * 18 + 7]; + + xr = a[0] - a[12]; + a[0] += a[12]; + a[12] = xr * wp[-4 * 18 + 7]; + xr = a[1] - a[13]; + a[1] += a[13]; + a[13] = xr * wp[-4 * 18 + 7]; + xr = a[16] - a[28]; + a[16] += a[28]; + a[28] = xr * wp[-4 * 18 + 7]; + xr = -a[17] + a[29]; + a[17] += a[29]; + a[29] = xr * wp[-4 * 18 + 7]; + + xr = SQRT2 * (a[2] - a[10]); + a[2] += a[10]; + a[10] = xr; + xr = SQRT2 * (a[3] - a[11]); + a[3] += a[11]; + a[11] = xr; + xr = SQRT2 * (-a[18] + a[26]); + a[18] += a[26]; + a[26] = xr - a[18]; + xr = SQRT2 * (-a[19] + a[27]); + a[19] += a[27]; + a[27] = xr - a[19]; + + xr = a[2]; + a[19] -= a[3]; + a[3] -= xr; + a[2] = a[31] - xr; + a[31] += xr; + xr = a[3]; + a[11] -= a[19]; + a[18] -= xr; + a[3] = a[30] - xr; + a[30] += xr; + xr = a[18]; + a[27] -= a[11]; + a[19] -= xr; + a[18] = a[15] - xr; + a[15] += xr; + + xr = a[19]; + a[10] -= xr; + a[19] = a[14] - xr; + a[14] += xr; + xr = a[10]; + a[11] -= xr; + a[10] = a[23] - xr; + a[23] += xr; + xr = a[11]; + a[26] -= xr; + a[11] = a[22] - xr; + a[22] += xr; + xr = a[26]; + a[27] -= xr; + a[26] = a[7] - xr; + a[7] += xr; + + xr = a[27]; + a[27] = a[6] - xr; + a[6] += xr; + + xr = SQRT2 * (a[0] - a[4]); + a[0] += a[4]; + a[4] = xr; + xr = SQRT2 * (a[1] - a[5]); + a[1] += a[5]; + a[5] = xr; + xr = SQRT2 * (a[16] - a[20]); + a[16] += a[20]; + a[20] = xr; + xr = SQRT2 * (a[17] - a[21]); + a[17] += a[21]; + a[21] = xr; + + xr = -SQRT2 * (a[8] - a[12]); + a[8] += a[12]; + a[12] = xr - a[8]; + xr = -SQRT2 * (a[9] - a[13]); + a[9] += a[13]; + a[13] = xr - a[9]; + xr = -SQRT2 * (a[25] - a[29]); + a[25] += a[29]; + a[29] = xr - a[25]; + xr = -SQRT2 * (a[24] + a[28]); + a[24] -= a[28]; + a[28] = xr - a[24]; + + xr = a[24] - a[16]; + a[24] = xr; + xr = a[20] - xr; + a[20] = xr; + xr = a[28] - xr; + a[28] = xr; + + xr = a[25] - a[17]; + a[25] = xr; + xr = a[21] - xr; + a[21] = xr; + xr = a[29] - xr; + a[29] = xr; + + xr = a[17] - a[1]; + a[17] = xr; + xr = a[9] - xr; + a[9] = xr; + xr = a[25] - xr; + a[25] = xr; + xr = a[5] - xr; + a[5] = xr; + xr = a[21] - xr; + a[21] = xr; + xr = a[13] - xr; + a[13] = xr; + xr = a[29] - xr; + a[29] = xr; + + xr = a[1] - a[0]; + a[1] = xr; + xr = a[16] - xr; + a[16] = xr; + xr = a[17] - xr; + a[17] = xr; + xr = a[8] - xr; + a[8] = xr; + xr = a[9] - xr; + a[9] = xr; + xr = a[24] - xr; + a[24] = xr; + xr = a[25] - xr; + a[25] = xr; + xr = a[4] - xr; + a[4] = xr; + xr = a[5] - xr; + a[5] = xr; + xr = a[20] - xr; + a[20] = xr; + xr = a[21] - xr; + a[21] = xr; + xr = a[12] - xr; + a[12] = xr; + xr = a[13] - xr; + a[13] = xr; + xr = a[28] - xr; + a[28] = xr; + xr = a[29] - xr; + a[29] = xr; + + xr = a[0]; + a[0] += a[31]; + a[31] -= xr; + xr = a[1]; + a[1] += a[30]; + a[30] -= xr; + xr = a[16]; + a[16] += a[15]; + a[15] -= xr; + xr = a[17]; + a[17] += a[14]; + a[14] -= xr; + xr = a[8]; + a[8] += a[23]; + a[23] -= xr; + xr = a[9]; + a[9] += a[22]; + a[22] -= xr; + xr = a[24]; + a[24] += a[7]; + a[7] -= xr; + xr = a[25]; + a[25] += a[6]; + a[6] -= xr; + xr = a[4]; + a[4] += a[27]; + a[27] -= xr; + xr = a[5]; + a[5] += a[26]; + a[26] -= xr; + xr = a[20]; + a[20] += a[11]; + a[11] -= xr; + xr = a[21]; + a[21] += a[10]; + a[10] -= xr; + xr = a[12]; + a[12] += a[19]; + a[19] -= xr; + xr = a[13]; + a[13] += a[18]; + a[18] -= xr; + xr = a[28]; + a[28] += a[3]; + a[3] -= xr; + xr = a[29]; + a[29] += a[2]; + a[2] -= xr; + } + +} + + +/*-------------------------------------------------------------------*/ +/* */ +/* Function: Calculation of the MDCT */ +/* In the case of long blocks (type 0,1,3) there are */ +/* 36 coefficents in the time domain and 18 in the frequency */ +/* domain. */ +/* In the case of short blocks (type 2) there are 3 */ +/* transformations with short length. This leads to 12 coefficents */ +/* in the time and 6 in the frequency domain. In this case the */ +/* results are stored side by side in the vector out[]. */ +/* */ +/* New layer3 */ +/* */ +/*-------------------------------------------------------------------*/ + +inline static void +mdct_short(FLOAT * inout) +{ + int l; + for (l = 0; l < 3; l++) { + FLOAT tc0, tc1, tc2, ts0, ts1, ts2; + + ts0 = inout[2 * 3] * win[SHORT_TYPE][0] - inout[5 * 3]; + tc0 = inout[0 * 3] * win[SHORT_TYPE][2] - inout[3 * 3]; + tc1 = ts0 + tc0; + tc2 = ts0 - tc0; + + ts0 = inout[5 * 3] * win[SHORT_TYPE][0] + inout[2 * 3]; + tc0 = inout[3 * 3] * win[SHORT_TYPE][2] + inout[0 * 3]; + ts1 = ts0 + tc0; + ts2 = -ts0 + tc0; + + tc0 = (inout[1 * 3] * win[SHORT_TYPE][1] - inout[4 * 3]) * 2.069978111953089e-11; /* tritab_s[1] */ + ts0 = (inout[4 * 3] * win[SHORT_TYPE][1] + inout[1 * 3]) * 2.069978111953089e-11; /* tritab_s[1] */ + + inout[3 * 0] = tc1 * 1.907525191737280e-11 /* tritab_s[2] */ + tc0; + inout[3 * 5] = -ts1 * 1.907525191737280e-11 /* tritab_s[0] */ + ts0; + + tc2 = tc2 * 0.86602540378443870761 * 1.907525191737281e-11 /* tritab_s[2] */ ; + ts1 = ts1 * 0.5 * 1.907525191737281e-11 + ts0; + inout[3 * 1] = tc2 - ts1; + inout[3 * 2] = tc2 + ts1; + + tc1 = tc1 * 0.5 * 1.907525191737281e-11 - tc0; + ts2 = ts2 * 0.86602540378443870761 * 1.907525191737281e-11 /* tritab_s[0] */ ; + inout[3 * 3] = tc1 + ts2; + inout[3 * 4] = tc1 - ts2; + + inout++; + } +} + +inline static void +mdct_long(FLOAT * out, FLOAT const *in) +{ + FLOAT ct, st; + { + FLOAT tc1, tc2, tc3, tc4, ts5, ts6, ts7, ts8; + /* 1,2, 5,6, 9,10, 13,14, 17 */ + tc1 = in[17] - in[9]; + tc3 = in[15] - in[11]; + tc4 = in[14] - in[12]; + ts5 = in[0] + in[8]; + ts6 = in[1] + in[7]; + ts7 = in[2] + in[6]; + ts8 = in[3] + in[5]; + + out[17] = (ts5 + ts7 - ts8) - (ts6 - in[4]); + st = (ts5 + ts7 - ts8) * cx[7] + (ts6 - in[4]); + ct = (tc1 - tc3 - tc4) * cx[6]; + out[5] = ct + st; + out[6] = ct - st; + + tc2 = (in[16] - in[10]) * cx[6]; + ts6 = ts6 * cx[7] + in[4]; + ct = tc1 * cx[0] + tc2 + tc3 * cx[1] + tc4 * cx[2]; + st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3]; + out[1] = ct + st; + out[2] = ct - st; + + ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0]; + st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4]; + out[9] = ct + st; + out[10] = ct - st; + + ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1]; + st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5]; + out[13] = ct + st; + out[14] = ct - st; + } + { + FLOAT ts1, ts2, ts3, ts4, tc5, tc6, tc7, tc8; + + ts1 = in[8] - in[0]; + ts3 = in[6] - in[2]; + ts4 = in[5] - in[3]; + tc5 = in[17] + in[9]; + tc6 = in[16] + in[10]; + tc7 = in[15] + in[11]; + tc8 = in[14] + in[12]; + + out[0] = (tc5 + tc7 + tc8) + (tc6 + in[13]); + ct = (tc5 + tc7 + tc8) * cx[7] - (tc6 + in[13]); + st = (ts1 - ts3 + ts4) * cx[6]; + out[11] = ct + st; + out[12] = ct - st; + + ts2 = (in[7] - in[1]) * cx[6]; + tc6 = in[13] - tc6 * cx[7]; + ct = tc5 * cx[3] - tc6 + tc7 * cx[4] + tc8 * cx[5]; + st = ts1 * cx[2] + ts2 + ts3 * cx[0] + ts4 * cx[1]; + out[3] = ct + st; + out[4] = ct - st; + + ct = -tc5 * cx[5] + tc6 - tc7 * cx[3] - tc8 * cx[4]; + st = ts1 * cx[1] + ts2 - ts3 * cx[2] - ts4 * cx[0]; + out[7] = ct + st; + out[8] = ct - st; + + ct = -tc5 * cx[4] + tc6 - tc7 * cx[5] - tc8 * cx[3]; + st = ts1 * cx[0] - ts2 + ts3 * cx[1] - ts4 * cx[2]; + out[15] = ct + st; + out[16] = ct - st; + } +} + + +void +mdct_sub48(lame_internal_flags * gfc, const sample_t * w0, const sample_t * w1) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t *const esv = &gfc->sv_enc; + int gr, k, ch; + const sample_t *wk; + + wk = w0 + 286; + /* thinking cache performance, ch->gr loop is better than gr->ch loop */ + for (ch = 0; ch < cfg->channels_out; ch++) { + for (gr = 0; gr < cfg->mode_gr; gr++) { + int band; + gr_info *const gi = &(gfc->l3_side.tt[gr][ch]); + FLOAT *mdct_enc = gi->xr; + FLOAT *samp = esv->sb_sample[ch][1 - gr][0]; + + for (k = 0; k < 18 / 2; k++) { + window_subband(wk, samp); + window_subband(wk + 32, samp + 32); + samp += 64; + wk += 64; + /* + * Compensate for inversion in the analysis filter + */ + for (band = 1; band < 32; band += 2) { + samp[band - 32] *= -1; + } + } + + /* + * Perform imdct of 18 previous subband samples + * + 18 current subband samples + */ + for (band = 0; band < 32; band++, mdct_enc += 18) { + int type = gi->block_type; + FLOAT const *const band0 = esv->sb_sample[ch][gr][0] + order[band]; + FLOAT *const band1 = esv->sb_sample[ch][1 - gr][0] + order[band]; + if (gi->mixed_block_flag && band < 2) + type = 0; + if (esv->amp_filter[band] < 1e-12) { + memset(mdct_enc, 0, 18 * sizeof(FLOAT)); + } + else { + if (esv->amp_filter[band] < 1.0) { + for (k = 0; k < 18; k++) + band1[k * 32] *= esv->amp_filter[band]; + } + if (type == SHORT_TYPE) { + for (k = -NS / 4; k < 0; k++) { + FLOAT const w = win[SHORT_TYPE][k + 3]; + mdct_enc[k * 3 + 9] = band0[(9 + k) * 32] * w - band0[(8 - k) * 32]; + mdct_enc[k * 3 + 18] = band0[(14 - k) * 32] * w + band0[(15 + k) * 32]; + mdct_enc[k * 3 + 10] = band0[(15 + k) * 32] * w - band0[(14 - k) * 32]; + mdct_enc[k * 3 + 19] = band1[(2 - k) * 32] * w + band1[(3 + k) * 32]; + mdct_enc[k * 3 + 11] = band1[(3 + k) * 32] * w - band1[(2 - k) * 32]; + mdct_enc[k * 3 + 20] = band1[(8 - k) * 32] * w + band1[(9 + k) * 32]; + } + mdct_short(mdct_enc); + } + else { + FLOAT work[18]; + for (k = -NL / 4; k < 0; k++) { + FLOAT a, b; + a = win[type][k + 27] * band1[(k + 9) * 32] + + win[type][k + 36] * band1[(8 - k) * 32]; + b = win[type][k + 9] * band0[(k + 9) * 32] + - win[type][k + 18] * band0[(8 - k) * 32]; + work[k + 9] = a - b * tantab_l[k + 9]; + work[k + 18] = a * tantab_l[k + 9] + b; + } + + mdct_long(mdct_enc, work); + } + } + /* + * Perform aliasing reduction butterfly + */ + if (type != SHORT_TYPE && band != 0) { + for (k = 7; k >= 0; --k) { + FLOAT bu, bd; + bu = mdct_enc[k] * ca[k] + mdct_enc[-1 - k] * cs[k]; + bd = mdct_enc[k] * cs[k] - mdct_enc[-1 - k] * ca[k]; + + mdct_enc[-1 - k] = bu; + mdct_enc[k] = bd; + } + } + } + } + wk = w1 + 286; + if (cfg->mode_gr == 1) { + memcpy(esv->sb_sample[ch][0], esv->sb_sample[ch][1], 576 * sizeof(FLOAT)); + } + } +} diff --git a/node_modules/lame/deps/lame/libmp3lame/newmdct.h b/node_modules/lame/deps/lame/libmp3lame/newmdct.h new file mode 100644 index 0000000..0b58a95 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/newmdct.h @@ -0,0 +1,27 @@ +/* + * New Modified DCT include file + * + * Copyright (c) 1999 Takehiro TOMINAGA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_NEWMDCT_H +#define LAME_NEWMDCT_H + +void mdct_sub48(lame_internal_flags * gfc, const sample_t * w0, const sample_t * w1); + +#endif /* LAME_NEWMDCT_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/presets.c b/node_modules/lame/deps/lame/libmp3lame/presets.c new file mode 100644 index 0000000..16f3a94 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/presets.c @@ -0,0 +1,400 @@ +/* + * presets.c -- Apply presets + * + * Copyright (c) 2002-2008 Gabriel Bouvigne + * Copyright (c) 2007-2011 Robert Hegemann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lame.h" +#include "machine.h" +#include "set_get.h" +#include "encoder.h" +#include "util.h" +#include "lame_global_flags.h" + +#define SET_OPTION(opt, val, def) if (enforce) \ + (void) lame_set_##opt(gfp, val); \ + else if (!(fabs(lame_get_##opt(gfp) - def) > 0)) \ + (void) lame_set_##opt(gfp, val); + +#define SET__OPTION(opt, val, def) if (enforce) \ + lame_set_##opt(gfp, val); \ + else if (!(fabs(lame_get_##opt(gfp) - def) > 0)) \ + lame_set_##opt(gfp, val); + +#undef Min +#undef Max + +static inline int +min_int(int a, int b) +{ + if (a < b) { + return a; + } + return b; +} + +static inline int +max_int(int a, int b) +{ + if (a > b) { + return a; + } + return b; +} + + + +typedef struct { + int vbr_q; + int quant_comp; + int quant_comp_s; + int expY; + FLOAT st_lrm; /*short threshold */ + FLOAT st_s; + FLOAT masking_adj; + FLOAT masking_adj_short; + FLOAT ath_lower; + FLOAT ath_curve; + FLOAT ath_sensitivity; + FLOAT interch; + int safejoint; + int sfb21mod; + FLOAT msfix; + FLOAT minval; + FLOAT ath_fixpoint; +} vbr_presets_t; + + /* *INDENT-OFF* */ + + /* Switch mappings for VBR mode VBR_RH */ + static const vbr_presets_t vbr_old_switch_map[] = { + /*vbr_q qcomp_l qcomp_s expY st_lrm st_s mask adj_l adj_s ath_lower ath_curve ath_sens interChR safejoint sfb21mod msfix */ + {0, 9, 9, 0, 5.20, 125.0, -4.2, -6.3, 4.8, 1, 0, 0, 2, 21, 0.97, 5, 100}, + {1, 9, 9, 0, 5.30, 125.0, -3.6, -5.6, 4.5, 1.5, 0, 0, 2, 21, 1.35, 5, 100}, + {2, 9, 9, 0, 5.60, 125.0, -2.2, -3.5, 2.8, 2, 0, 0, 2, 21, 1.49, 5, 100}, + {3, 9, 9, 1, 5.80, 130.0, -1.8, -2.8, 2.6, 3, -4, 0, 2, 20, 1.64, 5, 100}, + {4, 9, 9, 1, 6.00, 135.0, -0.7, -1.1, 1.1, 3.5, -8, 0, 2, 0, 1.79, 5, 100}, + {5, 9, 9, 1, 6.40, 140.0, 0.5, 0.4, -7.5, 4, -12, 0.0002, 0, 0, 1.95, 5, 100}, + {6, 9, 9, 1, 6.60, 145.0, 0.67, 0.65, -14.7, 6.5, -19, 0.0004, 0, 0, 2.30, 5, 100}, + {7, 9, 9, 1, 6.60, 145.0, 0.8, 0.75, -19.7, 8, -22, 0.0006, 0, 0, 2.70, 5, 100}, + {8, 9, 9, 1, 6.60, 145.0, 1.2, 1.15, -27.5, 10, -23, 0.0007, 0, 0, 0, 5, 100}, + {9, 9, 9, 1, 6.60, 145.0, 1.6, 1.6, -36, 11, -25, 0.0008, 0, 0, 0, 5, 100}, + {10, 9, 9, 1, 6.60, 145.0, 2.0, 2.0, -36, 12, -25, 0.0008, 0, 0, 0, 5, 100} + }; + + static const vbr_presets_t vbr_mt_psy_switch_map[] = { + /*vbr_q qcomp_l qcomp_s expY st_lrm st_s mask adj_l adj_s ath_lower ath_curve ath_sens --- safejoint sfb21mod msfix */ + {0, 9, 9, 0, 4.20, 25.0, -6.8, -6.8, 7.1, 1, 0, 0, 2, 31, 1.000, 5, 100}, + {1, 9, 9, 0, 4.20, 25.0, -4.8, -4.8, 5.4, 1.4, -1, 0, 2, 27, 1.122, 5, 98}, + {2, 9, 9, 0, 4.20, 25.0, -2.6, -2.6, 3.7, 2.0, -3, 0, 2, 23, 1.288, 5, 97}, + {3, 9, 9, 1, 4.20, 25.0, -1.6, -1.6, 2.0, 2.0, -5, 0, 2, 18, 1.479, 5, 96}, + {4, 9, 9, 1, 4.20, 25.0, -0.0, -0.0, 0.0, 2.0, -8, 0, 2, 12, 1.698, 5, 95}, + {5, 9, 9, 1, 4.20, 25.0, 1.3, 1.3, -6, 3.5, -11, 0, 2, 8, 1.950, 5, 94.2}, +#if 0 + {6, 9, 9, 1, 4.50, 100.0, 1.5, 1.5, -24.0, 6.0, -14, 0, 2, 4, 2.239, 3, 93.9}, + {7, 9, 9, 1, 4.80, 200.0, 1.7, 1.7, -28.0, 9.0, -20, 0, 2, 0, 2.570, 1, 93.6}, +#else + {6, 9, 9, 1, 4.50, 100.0, 2.2, 2.3, -12.0, 6.0, -14, 0, 2, 4, 2.239, 3, 93.9}, + {7, 9, 9, 1, 4.80, 200.0, 2.7, 2.7, -18.0, 9.0, -17, 0, 2, 0, 2.570, 1, 93.6}, +#endif + {8, 9, 9, 1, 5.30, 300.0, 2.8, 2.8, -21.0, 10.0, -23, 0.0002, 0, 0, 2.951, 0, 93.3}, + {9, 9, 9, 1, 6.60, 300.0, 2.8, 2.8, -23.0, 11.0, -25, 0.0006, 0, 0, 3.388, 0, 93.3}, + {10, 9, 9, 1, 25.00, 300.0, 2.8, 2.8, -25.0, 12.0, -27, 0.0025, 0, 0, 3.500, 0, 93.3} + }; + + /* *INDENT-ON* */ + +static vbr_presets_t const* +get_vbr_preset(int v) +{ + switch (v) { + case vbr_mtrh: + case vbr_mt: + return &vbr_mt_psy_switch_map[0]; + default: + return &vbr_old_switch_map[0]; + } +} + +#define NOOP(m) (void)p.m +#define LERP(m) (p.m = p.m + x * (q.m - p.m)) + +static void +apply_vbr_preset(lame_global_flags * gfp, int a, int enforce) +{ + vbr_presets_t const *vbr_preset = get_vbr_preset(lame_get_VBR(gfp)); + float x = gfp->VBR_q_frac; + vbr_presets_t p = vbr_preset[a]; + vbr_presets_t q = vbr_preset[a + 1]; + vbr_presets_t const *set = &p; + + NOOP(vbr_q); + NOOP(quant_comp); + NOOP(quant_comp_s); + NOOP(expY); + LERP(st_lrm); + LERP(st_s); + LERP(masking_adj); + LERP(masking_adj_short); + LERP(ath_lower); + LERP(ath_curve); + LERP(ath_sensitivity); + LERP(interch); + NOOP(safejoint); + LERP(sfb21mod); + LERP(msfix); + LERP(minval); + LERP(ath_fixpoint); + + (void) lame_set_VBR_q(gfp, set->vbr_q); + SET_OPTION(quant_comp, set->quant_comp, -1); + SET_OPTION(quant_comp_short, set->quant_comp_s, -1); + if (set->expY) { + (void) lame_set_experimentalY(gfp, set->expY); + } + SET_OPTION(short_threshold_lrm, set->st_lrm, -1); + SET_OPTION(short_threshold_s, set->st_s, -1); + SET_OPTION(maskingadjust, set->masking_adj, 0); + SET_OPTION(maskingadjust_short, set->masking_adj_short, 0); + if (lame_get_VBR(gfp) == vbr_mt || lame_get_VBR(gfp) == vbr_mtrh) { + lame_set_ATHtype(gfp, 5); + } + SET_OPTION(ATHlower, set->ath_lower, 0); + SET_OPTION(ATHcurve, set->ath_curve, -1); + SET_OPTION(athaa_sensitivity, set->ath_sensitivity, 0); + if (set->interch > 0) { + SET_OPTION(interChRatio, set->interch, -1); + } + + /* parameters for which there is no proper set/get interface */ + if (set->safejoint > 0) { + (void) lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | 2); + } + if (set->sfb21mod > 0) { + int const nsp = lame_get_exp_nspsytune(gfp); + int const val = (nsp >> 20) & 63; + if (val == 0) { + int const sf21mod = (set->sfb21mod << 20) | nsp; + (void) lame_set_exp_nspsytune(gfp, sf21mod); + } + } + SET__OPTION(msfix, set->msfix, -1); + + if (enforce == 0) { + gfp->VBR_q = a; + gfp->VBR_q_frac = x; + } + gfp->internal_flags->cfg.minval = set->minval; + gfp->internal_flags->cfg.ATHfixpoint = set->ath_fixpoint; +} + +static int +apply_abr_preset(lame_global_flags * gfp, int preset, int enforce) +{ + typedef struct { + int abr_kbps; + int quant_comp; + int quant_comp_s; + int safejoint; + FLOAT nsmsfix; + FLOAT st_lrm; /*short threshold */ + FLOAT st_s; + FLOAT scale; + FLOAT masking_adj; + FLOAT ath_lower; + FLOAT ath_curve; + FLOAT interch; + int sfscale; + } abr_presets_t; + + + /* *INDENT-OFF* */ + + /* + * Switch mappings for ABR mode + */ + const abr_presets_t abr_switch_map[] = { + /* kbps quant q_s safejoint nsmsfix st_lrm st_s scale msk ath_lwr ath_curve interch , sfscale */ + { 8, 9, 9, 0, 0, 6.60, 145, 0.95, 0, -30.0, 11, 0.0012, 1}, /* 8, impossible to use in stereo */ + { 16, 9, 9, 0, 0, 6.60, 145, 0.95, 0, -25.0, 11, 0.0010, 1}, /* 16 */ + { 24, 9, 9, 0, 0, 6.60, 145, 0.95, 0, -20.0, 11, 0.0010, 1}, /* 24 */ + { 32, 9, 9, 0, 0, 6.60, 145, 0.95, 0, -15.0, 11, 0.0010, 1}, /* 32 */ + { 40, 9, 9, 0, 0, 6.60, 145, 0.95, 0, -10.0, 11, 0.0009, 1}, /* 40 */ + { 48, 9, 9, 0, 0, 6.60, 145, 0.95, 0, -10.0, 11, 0.0009, 1}, /* 48 */ + { 56, 9, 9, 0, 0, 6.60, 145, 0.95, 0, -6.0, 11, 0.0008, 1}, /* 56 */ + { 64, 9, 9, 0, 0, 6.60, 145, 0.95, 0, -2.0, 11, 0.0008, 1}, /* 64 */ + { 80, 9, 9, 0, 0, 6.60, 145, 0.95, 0, .0, 8, 0.0007, 1}, /* 80 */ + { 96, 9, 9, 0, 2.50, 6.60, 145, 0.95, 0, 1.0, 5.5, 0.0006, 1}, /* 96 */ + {112, 9, 9, 0, 2.25, 6.60, 145, 0.95, 0, 2.0, 4.5, 0.0005, 1}, /* 112 */ + {128, 9, 9, 0, 1.95, 6.40, 140, 0.95, 0, 3.0, 4, 0.0002, 1}, /* 128 */ + {160, 9, 9, 1, 1.79, 6.00, 135, 0.95, -2, 5.0, 3.5, 0, 1}, /* 160 */ + {192, 9, 9, 1, 1.49, 5.60, 125, 0.97, -4, 7.0, 3, 0, 0}, /* 192 */ + {224, 9, 9, 1, 1.25, 5.20, 125, 0.98, -6, 9.0, 2, 0, 0}, /* 224 */ + {256, 9, 9, 1, 0.97, 5.20, 125, 1.00, -8, 10.0, 1, 0, 0}, /* 256 */ + {320, 9, 9, 1, 0.90, 5.20, 125, 1.00, -10, 12.0, 0, 0, 0} /* 320 */ + }; + + /* *INDENT-ON* */ + + /* Variables for the ABR stuff */ + int r; + int actual_bitrate = preset; + + r = nearestBitrateFullIndex(preset); + + (void) lame_set_VBR(gfp, vbr_abr); + (void) lame_set_VBR_mean_bitrate_kbps(gfp, (actual_bitrate)); + (void) lame_set_VBR_mean_bitrate_kbps(gfp, min_int(lame_get_VBR_mean_bitrate_kbps(gfp), 320)); + (void) lame_set_VBR_mean_bitrate_kbps(gfp, max_int(lame_get_VBR_mean_bitrate_kbps(gfp), 8)); + (void) lame_set_brate(gfp, lame_get_VBR_mean_bitrate_kbps(gfp)); + + + /* parameters for which there is no proper set/get interface */ + if (abr_switch_map[r].safejoint > 0) + (void) lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | 2); /* safejoint */ + + if (abr_switch_map[r].sfscale > 0) + (void) lame_set_sfscale(gfp, 1); + + + SET_OPTION(quant_comp, abr_switch_map[r].quant_comp, -1); + SET_OPTION(quant_comp_short, abr_switch_map[r].quant_comp_s, -1); + + SET__OPTION(msfix, abr_switch_map[r].nsmsfix, -1); + + SET_OPTION(short_threshold_lrm, abr_switch_map[r].st_lrm, -1); + SET_OPTION(short_threshold_s, abr_switch_map[r].st_s, -1); + + /* ABR seems to have big problems with clipping, especially at low bitrates */ + /* so we compensate for that here by using a scale value depending on bitrate */ + lame_set_scale(gfp, lame_get_scale(gfp) * abr_switch_map[r].scale); + + SET_OPTION(maskingadjust, abr_switch_map[r].masking_adj, 0); + if (abr_switch_map[r].masking_adj > 0) { + SET_OPTION(maskingadjust_short, abr_switch_map[r].masking_adj * .9, 0); + } + else { + SET_OPTION(maskingadjust_short, abr_switch_map[r].masking_adj * 1.1, 0); + } + + + SET_OPTION(ATHlower, abr_switch_map[r].ath_lower, 0); + SET_OPTION(ATHcurve, abr_switch_map[r].ath_curve, -1); + + SET_OPTION(interChRatio, abr_switch_map[r].interch, -1); + + (void) abr_switch_map[r].abr_kbps; + + gfp->internal_flags->cfg.minval = 5. * (abr_switch_map[r].abr_kbps / 320.); + + return preset; +} + + + +int +apply_preset(lame_global_flags * gfp, int preset, int enforce) +{ + /*translate legacy presets */ + switch (preset) { + case R3MIX: + { + preset = V3; + (void) lame_set_VBR(gfp, vbr_mtrh); + break; + } + case MEDIUM: + case MEDIUM_FAST: + { + preset = V4; + (void) lame_set_VBR(gfp, vbr_mtrh); + break; + } + case STANDARD: + case STANDARD_FAST: + { + preset = V2; + (void) lame_set_VBR(gfp, vbr_mtrh); + break; + } + case EXTREME: + case EXTREME_FAST: + { + preset = V0; + (void) lame_set_VBR(gfp, vbr_mtrh); + break; + } + case INSANE: + { + preset = 320; + gfp->preset = preset; + (void) apply_abr_preset(gfp, preset, enforce); + lame_set_VBR(gfp, vbr_off); + return preset; + } + } + + gfp->preset = preset; + { + switch (preset) { + case V9: + apply_vbr_preset(gfp, 9, enforce); + return preset; + case V8: + apply_vbr_preset(gfp, 8, enforce); + return preset; + case V7: + apply_vbr_preset(gfp, 7, enforce); + return preset; + case V6: + apply_vbr_preset(gfp, 6, enforce); + return preset; + case V5: + apply_vbr_preset(gfp, 5, enforce); + return preset; + case V4: + apply_vbr_preset(gfp, 4, enforce); + return preset; + case V3: + apply_vbr_preset(gfp, 3, enforce); + return preset; + case V2: + apply_vbr_preset(gfp, 2, enforce); + return preset; + case V1: + apply_vbr_preset(gfp, 1, enforce); + return preset; + case V0: + apply_vbr_preset(gfp, 0, enforce); + return preset; + default: + break; + } + } + if (8 <= preset && preset <= 320) { + return apply_abr_preset(gfp, preset, enforce); + } + + gfp->preset = 0; /*no corresponding preset found */ + return preset; +} diff --git a/node_modules/lame/deps/lame/libmp3lame/psymodel.c b/node_modules/lame/deps/lame/libmp3lame/psymodel.c new file mode 100644 index 0000000..cc1458e --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/psymodel.c @@ -0,0 +1,2157 @@ +/* + * psymodel.c + * + * Copyright (c) 1999-2000 Mark Taylor + * Copyright (c) 2001-2002 Naoki Shibata + * Copyright (c) 2000-2003 Takehiro Tominaga + * Copyright (c) 2000-2011 Robert Hegemann + * Copyright (c) 2000-2005 Gabriel Bouvigne + * Copyright (c) 2000-2005 Alexander Leidinger + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: psymodel.c,v 1.209 2011/05/24 20:45:55 robert Exp $ */ + + +/* +PSYCHO ACOUSTICS + + +This routine computes the psycho acoustics, delayed by one granule. + +Input: buffer of PCM data (1024 samples). + +This window should be centered over the 576 sample granule window. +The routine will compute the psycho acoustics for +this granule, but return the psycho acoustics computed +for the *previous* granule. This is because the block +type of the previous granule can only be determined +after we have computed the psycho acoustics for the following +granule. + +Output: maskings and energies for each scalefactor band. +block type, PE, and some correlation measures. +The PE is used by CBR modes to determine if extra bits +from the bit reservoir should be used. The correlation +measures are used to determine mid/side or regular stereo. +*/ +/* +Notation: + +barks: a non-linear frequency scale. Mapping from frequency to + barks is given by freq2bark() + +scalefactor bands: The spectrum (frequencies) are broken into + SBMAX "scalefactor bands". Thes bands + are determined by the MPEG ISO spec. In + the noise shaping/quantization code, we allocate + bits among the partition bands to achieve the + best possible quality + +partition bands: The spectrum is also broken into about + 64 "partition bands". Each partition + band is about .34 barks wide. There are about 2-5 + partition bands for each scalefactor band. + +LAME computes all psycho acoustic information for each partition +band. Then at the end of the computations, this information +is mapped to scalefactor bands. The energy in each scalefactor +band is taken as the sum of the energy in all partition bands +which overlap the scalefactor band. The maskings can be computed +in the same way (and thus represent the average masking in that band) +or by taking the minmum value multiplied by the number of +partition bands used (which represents a minimum masking in that band). +*/ +/* +The general outline is as follows: + +1. compute the energy in each partition band +2. compute the tonality in each partition band +3. compute the strength of each partion band "masker" +4. compute the masking (via the spreading function applied to each masker) +5. Modifications for mid/side masking. + +Each partition band is considiered a "masker". The strength +of the i'th masker in band j is given by: + + s3(bark(i)-bark(j))*strength(i) + +The strength of the masker is a function of the energy and tonality. +The more tonal, the less masking. LAME uses a simple linear formula +(controlled by NMT and TMN) which says the strength is given by the +energy divided by a linear function of the tonality. +*/ +/* +s3() is the "spreading function". It is given by a formula +determined via listening tests. + +The total masking in the j'th partition band is the sum over +all maskings i. It is thus given by the convolution of +the strength with s3(), the "spreading function." + +masking(j) = sum_over_i s3(i-j)*strength(i) = s3 o strength + +where "o" = convolution operator. s3 is given by a formula determined +via listening tests. It is normalized so that s3 o 1 = 1. + +Note: instead of a simple convolution, LAME also has the +option of using "additive masking" + +The most critical part is step 2, computing the tonality of each +partition band. LAME has two tonality estimators. The first +is based on the ISO spec, and measures how predictiable the +signal is over time. The more predictable, the more tonal. +The second measure is based on looking at the spectrum of +a single granule. The more peaky the spectrum, the more +tonal. By most indications, the latter approach is better. + +Finally, in step 5, the maskings for the mid and side +channel are possibly increased. Under certain circumstances, +noise in the mid & side channels is assumed to also +be masked by strong maskers in the L or R channels. + + +Other data computed by the psy-model: + +ms_ratio side-channel / mid-channel masking ratio (for previous granule) +ms_ratio_next side-channel / mid-channel masking ratio for this granule + +percep_entropy[2] L and R values (prev granule) of PE - A measure of how + much pre-echo is in the previous granule +percep_entropy_MS[2] mid and side channel values (prev granule) of percep_entropy +energy[4] L,R,M,S energy in each channel, prev granule +blocktype_d[2] block type to use for previous granule +*/ + + + + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "psymodel.h" +#include "lame_global_flags.h" +#include "fft.h" +#include "lame-analysis.h" + + +#define NSFIRLEN 21 + +#ifdef M_LN10 +#define LN_TO_LOG10 (M_LN10/10) +#else +#define LN_TO_LOG10 0.2302585093 +#endif + + +/* + L3psycho_anal. Compute psycho acoustics. + + Data returned to the calling program must be delayed by one + granule. + + This is done in two places. + If we do not need to know the blocktype, the copying + can be done here at the top of the program: we copy the data for + the last granule (computed during the last call) before it is + overwritten with the new data. It looks like this: + + 0. static psymodel_data + 1. calling_program_data = psymodel_data + 2. compute psymodel_data + + For data which needs to know the blocktype, the copying must be + done at the end of this loop, and the old values must be saved: + + 0. static psymodel_data_old + 1. compute psymodel_data + 2. compute possible block type of this granule + 3. compute final block type of previous granule based on #2. + 4. calling_program_data = psymodel_data_old + 5. psymodel_data_old = psymodel_data +*/ + + + + + +/* psycho_loudness_approx + jd - 2001 mar 12 +in: energy - BLKSIZE/2 elements of frequency magnitudes ^ 2 + gfp - uses out_samplerate, ATHtype (also needed for ATHformula) +returns: loudness^2 approximation, a positive value roughly tuned for a value + of 1.0 for signals near clipping. +notes: When calibrated, feeding this function binary white noise at sample + values +32767 or -32768 should return values that approach 3. + ATHformula is used to approximate an equal loudness curve. +future: Data indicates that the shape of the equal loudness curve varies + with intensity. This function might be improved by using an equal + loudness curve shaped for typical playback levels (instead of the + ATH, that is shaped for the threshold). A flexible realization might + simply bend the existing ATH curve to achieve the desired shape. + However, the potential gain may not be enough to justify an effort. +*/ +static FLOAT +psycho_loudness_approx(FLOAT const *energy, FLOAT const *eql_w) +{ + int i; + FLOAT loudness_power; + + loudness_power = 0.0; + /* apply weights to power in freq. bands */ + for (i = 0; i < BLKSIZE / 2; ++i) + loudness_power += energy[i] * eql_w[i]; + loudness_power *= VO_SCALE; + + return loudness_power; +} + +/* mask_add optimization */ +/* init the limit values used to avoid computing log in mask_add when it is not necessary */ + +/* For example, with i = 10*log10(m2/m1)/10*16 (= log10(m2/m1)*16) + * + * abs(i)>8 is equivalent (as i is an integer) to + * abs(i)>=9 + * i>=9 || i<=-9 + * equivalent to (as i is the biggest integer smaller than log10(m2/m1)*16 + * or the smallest integer bigger than log10(m2/m1)*16 depending on the sign of log10(m2/m1)*16) + * log10(m2/m1)>=9/16 || log10(m2/m1)<=-9/16 + * exp10 is strictly increasing thus this is equivalent to + * m2/m1 >= 10^(9/16) || m2/m1<=10^(-9/16) which are comparisons to constants + */ + + +#define I1LIMIT 8 /* as in if(i>8) */ +#define I2LIMIT 23 /* as in if(i>24) -> changed 23 */ +#define MLIMIT 15 /* as in if(m<15) */ + +static FLOAT ma_max_i1; +static FLOAT ma_max_i2; +static FLOAT ma_max_m; + + /*This is the masking table: + According to tonality, values are going from 0dB (TMN) + to 9.3dB (NMT). + After additive masking computation, 8dB are added, so + final values are going from 8dB to 17.3dB + */ +static const FLOAT tab[] = { + 1.0 /*pow(10, -0) */ , + 0.79433 /*pow(10, -0.1) */ , + 0.63096 /*pow(10, -0.2) */ , + 0.63096 /*pow(10, -0.2) */ , + 0.63096 /*pow(10, -0.2) */ , + 0.63096 /*pow(10, -0.2) */ , + 0.63096 /*pow(10, -0.2) */ , + 0.25119 /*pow(10, -0.6) */ , + 0.11749 /*pow(10, -0.93) */ +}; + +static const int tab_mask_add_delta[] = { 2, 2, 2, 1, 1, 1, 0, 0, -1 }; +#define STATIC_ASSERT_EQUAL_DIMENSION(A,B) {static char static_assert_##A[dimension_of(A) == dimension_of(B) ? 1 : -1];(void) static_assert_##A;} + +inline static int +mask_add_delta(int i) +{ + STATIC_ASSERT_EQUAL_DIMENSION(tab_mask_add_delta,tab); + assert(i < (int)dimension_of(tab)); + return tab_mask_add_delta[i]; +} + + +static void +init_mask_add_max_values(void) +{ + ma_max_i1 = pow(10, (I1LIMIT + 1) / 16.0); + ma_max_i2 = pow(10, (I2LIMIT + 1) / 16.0); + ma_max_m = pow(10, (MLIMIT) / 10.0); +} + + + + +/* addition of simultaneous masking Naoki Shibata 2000/7 */ +inline static FLOAT +vbrpsy_mask_add(FLOAT m1, FLOAT m2, int b, int delta) +{ + static const FLOAT table2[] = { + 1.33352 * 1.33352, 1.35879 * 1.35879, 1.38454 * 1.38454, 1.39497 * 1.39497, + 1.40548 * 1.40548, 1.3537 * 1.3537, 1.30382 * 1.30382, 1.22321 * 1.22321, + 1.14758 * 1.14758, + 1 + }; + + FLOAT ratio; + + if (m1 < 0) { + m1 = 0; + } + if (m2 < 0) { + m2 = 0; + } + if (m1 <= 0) { + return m2; + } + if (m2 <= 0) { + return m1; + } + if (m2 > m1) { + ratio = m2 / m1; + } + else { + ratio = m1 / m2; + } + if (abs(b) <= delta) { /* approximately, 1 bark = 3 partitions */ + /* originally 'if(i > 8)' */ + if (ratio >= ma_max_i1) { + return m1 + m2; + } + else { + int i = (int) (FAST_LOG10_X(ratio, 16.0f)); + return (m1 + m2) * table2[i]; + } + } + if (ratio < ma_max_i2) { + return m1 + m2; + } + if (m1 < m2) { + m1 = m2; + } + return m1; +} + + +/* short block threshold calculation (part 2) + + partition band bo_s[sfb] is at the transition from scalefactor + band sfb to the next one sfb+1; enn and thmm have to be split + between them +*/ +static void +convert_partition2scalefac(PsyConst_CB2SB_t const *const gd, FLOAT const *eb, FLOAT const *thr, + FLOAT enn_out[], FLOAT thm_out[]) +{ + FLOAT enn, thmm; + int sb, b, n = gd->n_sb; + enn = thmm = 0.0f; + for (sb = b = 0; sb < n; ++b, ++sb) { + int const bo_sb = gd->bo[sb]; + int const npart = gd->npart; + int const b_lim = bo_sb < npart ? bo_sb : npart; + while (b < b_lim) { + assert(eb[b] >= 0); /* iff failed, it may indicate some index error elsewhere */ + assert(thr[b] >= 0); + enn += eb[b]; + thmm += thr[b]; + b++; + } + if (b >= npart) { + enn_out[sb] = enn; + thm_out[sb] = thmm; + ++sb; + break; + } + assert(eb[b] >= 0); /* iff failed, it may indicate some index error elsewhere */ + assert(thr[b] >= 0); + { + /* at transition sfb -> sfb+1 */ + FLOAT const w_curr = gd->bo_weight[sb]; + FLOAT const w_next = 1.0f - w_curr; + enn += w_curr * eb[b]; + thmm += w_curr * thr[b]; + enn_out[sb] = enn; + thm_out[sb] = thmm; + enn = w_next * eb[b]; + thmm = w_next * thr[b]; + } + } + /* zero initialize the rest */ + for (; sb < n; ++sb) { + enn_out[sb] = 0; + thm_out[sb] = 0; + } +} + +static void +convert_partition2scalefac_s(lame_internal_flags * gfc, FLOAT const *eb, FLOAT const *thr, int chn, + int sblock) +{ + PsyStateVar_t *const psv = &gfc->sv_psy; + PsyConst_CB2SB_t const *const gds = &gfc->cd_psy->s; + FLOAT enn[SBMAX_s], thm[SBMAX_s]; + int sb; + convert_partition2scalefac(gds, eb, thr, enn, thm); + for (sb = 0; sb < SBMAX_s; ++sb) { + psv->en[chn].s[sb][sblock] = enn[sb]; + psv->thm[chn].s[sb][sblock] = thm[sb]; + } +} + +/* longblock threshold calculation (part 2) */ +static void +convert_partition2scalefac_l(lame_internal_flags * gfc, FLOAT const *eb, FLOAT const *thr, int chn) +{ + PsyStateVar_t *const psv = &gfc->sv_psy; + PsyConst_CB2SB_t const *const gdl = &gfc->cd_psy->l; + FLOAT *enn = &psv->en[chn].l[0]; + FLOAT *thm = &psv->thm[chn].l[0]; + convert_partition2scalefac(gdl, eb, thr, enn, thm); +} + +static void +convert_partition2scalefac_l_to_s(lame_internal_flags * gfc, FLOAT const *eb, FLOAT const *thr, + int chn) +{ + PsyStateVar_t *const psv = &gfc->sv_psy; + PsyConst_CB2SB_t const *const gds = &gfc->cd_psy->l_to_s; + FLOAT enn[SBMAX_s], thm[SBMAX_s]; + int sb, sblock; + convert_partition2scalefac(gds, eb, thr, enn, thm); + for (sb = 0; sb < SBMAX_s; ++sb) { + FLOAT const scale = 1. / 64.f; + FLOAT const tmp_enn = enn[sb]; + FLOAT const tmp_thm = thm[sb] * scale; + for (sblock = 0; sblock < 3; ++sblock) { + psv->en[chn].s[sb][sblock] = tmp_enn; + psv->thm[chn].s[sb][sblock] = tmp_thm; + } + } +} + + + +static inline FLOAT +NS_INTERP(FLOAT x, FLOAT y, FLOAT r) +{ + /* was pow((x),(r))*pow((y),1-(r)) */ + if (r >= 1.0f) + return x; /* 99.7% of the time */ + if (r <= 0.0f) + return y; + if (y > 0.0f) + return powf(x / y, r) * y; /* rest of the time */ + return 0.0f; /* never happens */ +} + + + +static FLOAT +pecalc_s(III_psy_ratio const *mr, FLOAT masking_lower) +{ + FLOAT pe_s; + static const FLOAT regcoef_s[] = { + 11.8, /* these values are tuned only for 44.1kHz... */ + 13.6, + 17.2, + 32, + 46.5, + 51.3, + 57.5, + 67.1, + 71.5, + 84.6, + 97.6, + 130, +/* 255.8 */ + }; + unsigned int sb, sblock; + + pe_s = 1236.28f / 4; + for (sb = 0; sb < SBMAX_s - 1; sb++) { + for (sblock = 0; sblock < 3; sblock++) { + FLOAT const thm = mr->thm.s[sb][sblock]; + assert(sb < dimension_of(regcoef_s)); + if (thm > 0.0f) { + FLOAT const x = thm * masking_lower; + FLOAT const en = mr->en.s[sb][sblock]; + if (en > x) { + if (en > x * 1e10f) { + pe_s += regcoef_s[sb] * (10.0f * LOG10); + } + else { + assert(x > 0); + pe_s += regcoef_s[sb] * FAST_LOG10(en / x); + } + } + } + } + } + + return pe_s; +} + +static FLOAT +pecalc_l(III_psy_ratio const *mr, FLOAT masking_lower) +{ + FLOAT pe_l; + static const FLOAT regcoef_l[] = { + 6.8, /* these values are tuned only for 44.1kHz... */ + 5.8, + 5.8, + 6.4, + 6.5, + 9.9, + 12.1, + 14.4, + 15, + 18.9, + 21.6, + 26.9, + 34.2, + 40.2, + 46.8, + 56.5, + 60.7, + 73.9, + 85.7, + 93.4, + 126.1, +/* 241.3 */ + }; + unsigned int sb; + + pe_l = 1124.23f / 4; + for (sb = 0; sb < SBMAX_l - 1; sb++) { + FLOAT const thm = mr->thm.l[sb]; + assert(sb < dimension_of(regcoef_l)); + if (thm > 0.0f) { + FLOAT const x = thm * masking_lower; + FLOAT const en = mr->en.l[sb]; + if (en > x) { + if (en > x * 1e10f) { + pe_l += regcoef_l[sb] * (10.0f * LOG10); + } + else { + assert(x > 0); + pe_l += regcoef_l[sb] * FAST_LOG10(en / x); + } + } + } + } + + return pe_l; +} + + +static void +calc_energy(PsyConst_CB2SB_t const *l, FLOAT const *fftenergy, FLOAT * eb, FLOAT * max, FLOAT * avg) +{ + int b, j; + + for (b = j = 0; b < l->npart; ++b) { + FLOAT ebb = 0, m = 0; + int i; + for (i = 0; i < l->numlines[b]; ++i, ++j) { + FLOAT const el = fftenergy[j]; + assert(el >= 0); + ebb += el; + if (m < el) + m = el; + } + eb[b] = ebb; + max[b] = m; + avg[b] = ebb * l->rnumlines[b]; + assert(l->rnumlines[b] >= 0); + assert(ebb >= 0); + assert(eb[b] >= 0); + assert(max[b] >= 0); + assert(avg[b] >= 0); + } +} + + +static void +calc_mask_index_l(lame_internal_flags const *gfc, FLOAT const *max, + FLOAT const *avg, unsigned char *mask_idx) +{ + PsyConst_CB2SB_t const *const gdl = &gfc->cd_psy->l; + FLOAT m, a; + int b, k; + int const last_tab_entry = sizeof(tab) / sizeof(tab[0]) - 1; + b = 0; + a = avg[b] + avg[b + 1]; + assert(a >= 0); + if (a > 0.0f) { + m = max[b]; + if (m < max[b + 1]) + m = max[b + 1]; + assert((gdl->numlines[b] + gdl->numlines[b + 1] - 1) > 0); + a = 20.0f * (m * 2.0f - a) + / (a * (gdl->numlines[b] + gdl->numlines[b + 1] - 1)); + k = (int) a; + if (k > last_tab_entry) + k = last_tab_entry; + mask_idx[b] = k; + } + else { + mask_idx[b] = 0; + } + + for (b = 1; b < gdl->npart - 1; b++) { + a = avg[b - 1] + avg[b] + avg[b + 1]; + assert(a >= 0); + if (a > 0.0f) { + m = max[b - 1]; + if (m < max[b]) + m = max[b]; + if (m < max[b + 1]) + m = max[b + 1]; + assert((gdl->numlines[b - 1] + gdl->numlines[b] + gdl->numlines[b + 1] - 1) > 0); + a = 20.0f * (m * 3.0f - a) + / (a * (gdl->numlines[b - 1] + gdl->numlines[b] + gdl->numlines[b + 1] - 1)); + k = (int) a; + if (k > last_tab_entry) + k = last_tab_entry; + mask_idx[b] = k; + } + else { + mask_idx[b] = 0; + } + } + assert(b > 0); + assert(b == gdl->npart - 1); + + a = avg[b - 1] + avg[b]; + assert(a >= 0); + if (a > 0.0f) { + m = max[b - 1]; + if (m < max[b]) + m = max[b]; + assert((gdl->numlines[b - 1] + gdl->numlines[b] - 1) > 0); + a = 20.0f * (m * 2.0f - a) + / (a * (gdl->numlines[b - 1] + gdl->numlines[b] - 1)); + k = (int) a; + if (k > last_tab_entry) + k = last_tab_entry; + mask_idx[b] = k; + } + else { + mask_idx[b] = 0; + } + assert(b == (gdl->npart - 1)); +} + + +static void +vbrpsy_compute_fft_l(lame_internal_flags * gfc, const sample_t * const buffer[2], int chn, + int gr_out, FLOAT fftenergy[HBLKSIZE], FLOAT(*wsamp_l)[BLKSIZE]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + PsyStateVar_t *psv = &gfc->sv_psy; + plotting_data *plt = cfg->analysis ? gfc->pinfo : 0; + int j; + + if (chn < 2) { + fft_long(gfc, *wsamp_l, chn, buffer); + } + else if (chn == 2) { + FLOAT const sqrt2_half = SQRT2 * 0.5f; + /* FFT data for mid and side channel is derived from L & R */ + for (j = BLKSIZE - 1; j >= 0; --j) { + FLOAT const l = wsamp_l[0][j]; + FLOAT const r = wsamp_l[1][j]; + wsamp_l[0][j] = (l + r) * sqrt2_half; + wsamp_l[1][j] = (l - r) * sqrt2_half; + } + } + + /********************************************************************* + * compute energies + *********************************************************************/ + fftenergy[0] = wsamp_l[0][0]; + fftenergy[0] *= fftenergy[0]; + + for (j = BLKSIZE / 2 - 1; j >= 0; --j) { + FLOAT const re = (*wsamp_l)[BLKSIZE / 2 - j]; + FLOAT const im = (*wsamp_l)[BLKSIZE / 2 + j]; + fftenergy[BLKSIZE / 2 - j] = (re * re + im * im) * 0.5f; + } + /* total energy */ + { + FLOAT totalenergy = 0.0f; + for (j = 11; j < HBLKSIZE; j++) + totalenergy += fftenergy[j]; + + psv->tot_ener[chn] = totalenergy; + } + + if (plt) { + for (j = 0; j < HBLKSIZE; j++) { + plt->energy[gr_out][chn][j] = plt->energy_save[chn][j]; + plt->energy_save[chn][j] = fftenergy[j]; + } + } +} + + +static void +vbrpsy_compute_fft_s(lame_internal_flags const *gfc, const sample_t * const buffer[2], int chn, + int sblock, FLOAT(*fftenergy_s)[HBLKSIZE_s], FLOAT(*wsamp_s)[3][BLKSIZE_s]) +{ + int j; + + if (sblock == 0 && chn < 2) { + fft_short(gfc, *wsamp_s, chn, buffer); + } + if (chn == 2) { + FLOAT const sqrt2_half = SQRT2 * 0.5f; + /* FFT data for mid and side channel is derived from L & R */ + for (j = BLKSIZE_s - 1; j >= 0; --j) { + FLOAT const l = wsamp_s[0][sblock][j]; + FLOAT const r = wsamp_s[1][sblock][j]; + wsamp_s[0][sblock][j] = (l + r) * sqrt2_half; + wsamp_s[1][sblock][j] = (l - r) * sqrt2_half; + } + } + + /********************************************************************* + * compute energies + *********************************************************************/ + fftenergy_s[sblock][0] = (*wsamp_s)[sblock][0]; + fftenergy_s[sblock][0] *= fftenergy_s[sblock][0]; + for (j = BLKSIZE_s / 2 - 1; j >= 0; --j) { + FLOAT const re = (*wsamp_s)[sblock][BLKSIZE_s / 2 - j]; + FLOAT const im = (*wsamp_s)[sblock][BLKSIZE_s / 2 + j]; + fftenergy_s[sblock][BLKSIZE_s / 2 - j] = (re * re + im * im) * 0.5f; + } +} + + + /********************************************************************* + * compute loudness approximation (used for ATH auto-level adjustment) + *********************************************************************/ +static void +vbrpsy_compute_loudness_approximation_l(lame_internal_flags * gfc, int gr_out, int chn, + const FLOAT fftenergy[HBLKSIZE]) +{ + PsyStateVar_t *psv = &gfc->sv_psy; + if (chn < 2) { /*no loudness for mid/side ch */ + gfc->ov_psy.loudness_sq[gr_out][chn] = psv->loudness_sq_save[chn]; + psv->loudness_sq_save[chn] = psycho_loudness_approx(fftenergy, gfc->ATH->eql_w); + } +} + + + /********************************************************************** + * Apply HPF of fs/4 to the input signal. + * This is used for attack detection / handling. + **********************************************************************/ +static void +vbrpsy_attack_detection(lame_internal_flags * gfc, const sample_t * const buffer[2], int gr_out, + III_psy_ratio masking_ratio[2][2], III_psy_ratio masking_MS_ratio[2][2], + FLOAT energy[4], FLOAT sub_short_factor[4][3], int ns_attacks[4][4], + int uselongblock[2]) +{ + FLOAT ns_hpfsmpl[2][576]; + SessionConfig_t const *const cfg = &gfc->cfg; + PsyStateVar_t *const psv = &gfc->sv_psy; + plotting_data *plt = cfg->analysis ? gfc->pinfo : 0; + int const n_chn_out = cfg->channels_out; + /* chn=2 and 3 = Mid and Side channels */ + int const n_chn_psy = (cfg->mode == JOINT_STEREO) ? 4 : n_chn_out; + int chn, i, j; + + memset(&ns_hpfsmpl[0][0], 0, sizeof(ns_hpfsmpl)); + /* Don't copy the input buffer into a temporary buffer */ + /* unroll the loop 2 times */ + for (chn = 0; chn < n_chn_out; chn++) { + static const FLOAT fircoef[] = { + -8.65163e-18 * 2, -0.00851586 * 2, -6.74764e-18 * 2, 0.0209036 * 2, + -3.36639e-17 * 2, -0.0438162 * 2, -1.54175e-17 * 2, 0.0931738 * 2, + -5.52212e-17 * 2, -0.313819 * 2 + }; + /* apply high pass filter of fs/4 */ + const sample_t *const firbuf = &buffer[chn][576 - 350 - NSFIRLEN + 192]; + assert(dimension_of(fircoef) == ((NSFIRLEN - 1) / 2)); + for (i = 0; i < 576; i++) { + FLOAT sum1, sum2; + sum1 = firbuf[i + 10]; + sum2 = 0.0; + for (j = 0; j < ((NSFIRLEN - 1) / 2) - 1; j += 2) { + sum1 += fircoef[j] * (firbuf[i + j] + firbuf[i + NSFIRLEN - j]); + sum2 += fircoef[j + 1] * (firbuf[i + j + 1] + firbuf[i + NSFIRLEN - j - 1]); + } + ns_hpfsmpl[chn][i] = sum1 + sum2; + } + masking_ratio[gr_out][chn].en = psv->en[chn]; + masking_ratio[gr_out][chn].thm = psv->thm[chn]; + if (n_chn_psy > 2) { + /* MS maskings */ + /*percep_MS_entropy [chn-2] = gfc -> pe [chn]; */ + masking_MS_ratio[gr_out][chn].en = psv->en[chn + 2]; + masking_MS_ratio[gr_out][chn].thm = psv->thm[chn + 2]; + } + } + for (chn = 0; chn < n_chn_psy; chn++) { + FLOAT attack_intensity[12]; + FLOAT en_subshort[12]; + FLOAT en_short[4] = { 0, 0, 0, 0 }; + FLOAT const *pf = ns_hpfsmpl[chn & 1]; + int ns_uselongblock = 1; + + if (chn == 2) { + for (i = 0, j = 576; j > 0; ++i, --j) { + FLOAT const l = ns_hpfsmpl[0][i]; + FLOAT const r = ns_hpfsmpl[1][i]; + ns_hpfsmpl[0][i] = l + r; + ns_hpfsmpl[1][i] = l - r; + } + } + /*************************************************************** + * determine the block type (window type) + ***************************************************************/ + /* calculate energies of each sub-shortblocks */ + for (i = 0; i < 3; i++) { + en_subshort[i] = psv->last_en_subshort[chn][i + 6]; + assert(psv->last_en_subshort[chn][i + 4] > 0); + attack_intensity[i] = en_subshort[i] / psv->last_en_subshort[chn][i + 4]; + en_short[0] += en_subshort[i]; + } + + for (i = 0; i < 9; i++) { + FLOAT const *const pfe = pf + 576 / 9; + FLOAT p = 1.; + for (; pf < pfe; pf++) + if (p < fabs(*pf)) + p = fabs(*pf); + psv->last_en_subshort[chn][i] = en_subshort[i + 3] = p; + en_short[1 + i / 3] += p; + if (p > en_subshort[i + 3 - 2]) { + assert(en_subshort[i + 3 - 2] > 0); + p = p / en_subshort[i + 3 - 2]; + } + else if (en_subshort[i + 3 - 2] > p * 10.0f) { + assert(p > 0); + p = en_subshort[i + 3 - 2] / (p * 10.0f); + } + else { + p = 0.0; + } + attack_intensity[i + 3] = p; + } + + /* pulse like signal detection for fatboy.wav and so on */ + for (i = 0; i < 3; ++i) { + FLOAT const enn = + en_subshort[i * 3 + 3] + en_subshort[i * 3 + 4] + en_subshort[i * 3 + 5]; + FLOAT factor = 1.f; + if (en_subshort[i * 3 + 5] * 6 < enn) { + factor *= 0.5f; + if (en_subshort[i * 3 + 4] * 6 < enn) { + factor *= 0.5f; + } + } + sub_short_factor[chn][i] = factor; + } + + if (plt) { + FLOAT x = attack_intensity[0]; + for (i = 1; i < 12; i++) { + if (x < attack_intensity[i]) { + x = attack_intensity[i]; + } + } + plt->ers[gr_out][chn] = plt->ers_save[chn]; + plt->ers_save[chn] = x; + } + + /* compare energies between sub-shortblocks */ + { + FLOAT x = gfc->cd_psy->attack_threshold[chn]; + for (i = 0; i < 12; i++) { + if (ns_attacks[chn][i / 3] == 0) { + if (attack_intensity[i] > x) { + ns_attacks[chn][i / 3] = (i % 3) + 1; + } + } + } + } + /* should have energy change between short blocks, in order to avoid periodic signals */ + /* Good samples to show the effect are Trumpet test songs */ + /* GB: tuned (1) to avoid too many short blocks for test sample TRUMPET */ + /* RH: tuned (2) to let enough short blocks through for test sample FSOL and SNAPS */ + for (i = 1; i < 4; i++) { + FLOAT const u = en_short[i - 1]; + FLOAT const v = en_short[i]; + FLOAT const m = Max(u, v); + if (m < 40000) { /* (2) */ + if (u < 1.7f * v && v < 1.7f * u) { /* (1) */ + if (i == 1 && ns_attacks[chn][0] <= ns_attacks[chn][i]) { + ns_attacks[chn][0] = 0; + } + ns_attacks[chn][i] = 0; + } + } + } + + if (ns_attacks[chn][0] <= psv->last_attacks[chn]) { + ns_attacks[chn][0] = 0; + } + + if (psv->last_attacks[chn] == 3 || + ns_attacks[chn][0] + ns_attacks[chn][1] + ns_attacks[chn][2] + ns_attacks[chn][3]) { + ns_uselongblock = 0; + + if (ns_attacks[chn][1] && ns_attacks[chn][0]) { + ns_attacks[chn][1] = 0; + } + if (ns_attacks[chn][2] && ns_attacks[chn][1]) { + ns_attacks[chn][2] = 0; + } + if (ns_attacks[chn][3] && ns_attacks[chn][2]) { + ns_attacks[chn][3] = 0; + } + } + + if (chn < 2) { + uselongblock[chn] = ns_uselongblock; + } + else { + if (ns_uselongblock == 0) { + uselongblock[0] = uselongblock[1] = 0; + } + } + + /* there is a one granule delay. Copy maskings computed last call + * into masking_ratio to return to calling program. + */ + energy[chn] = psv->tot_ener[chn]; + } +} + + +static void +vbrpsy_skip_masking_s(lame_internal_flags * gfc, int chn, int sblock) +{ + if (sblock == 0) { + FLOAT *nbs2 = &gfc->sv_psy.nb_s2[chn][0]; + FLOAT *nbs1 = &gfc->sv_psy.nb_s1[chn][0]; + int const n = gfc->cd_psy->s.npart; + int b; + for (b = 0; b < n; b++) { + nbs2[b] = nbs1[b]; + } + } +} + + +static void +vbrpsy_calc_mask_index_s(lame_internal_flags const *gfc, FLOAT const *max, + FLOAT const *avg, unsigned char *mask_idx) +{ + PsyConst_CB2SB_t const *const gds = &gfc->cd_psy->s; + FLOAT m, a; + int b, k; + int const last_tab_entry = dimension_of(tab) - 1; + b = 0; + a = avg[b] + avg[b + 1]; + assert(a >= 0); + if (a > 0.0f) { + m = max[b]; + if (m < max[b + 1]) + m = max[b + 1]; + assert((gds->numlines[b] + gds->numlines[b + 1] - 1) > 0); + a = 20.0f * (m * 2.0f - a) + / (a * (gds->numlines[b] + gds->numlines[b + 1] - 1)); + k = (int) a; + if (k > last_tab_entry) + k = last_tab_entry; + mask_idx[b] = k; + } + else { + mask_idx[b] = 0; + } + + for (b = 1; b < gds->npart - 1; b++) { + a = avg[b - 1] + avg[b] + avg[b + 1]; + assert(b + 1 < gds->npart); + assert(a >= 0); + if (a > 0.0) { + m = max[b - 1]; + if (m < max[b]) + m = max[b]; + if (m < max[b + 1]) + m = max[b + 1]; + assert((gds->numlines[b - 1] + gds->numlines[b] + gds->numlines[b + 1] - 1) > 0); + a = 20.0f * (m * 3.0f - a) + / (a * (gds->numlines[b - 1] + gds->numlines[b] + gds->numlines[b + 1] - 1)); + k = (int) a; + if (k > last_tab_entry) + k = last_tab_entry; + mask_idx[b] = k; + } + else { + mask_idx[b] = 0; + } + } + assert(b > 0); + assert(b == gds->npart - 1); + + a = avg[b - 1] + avg[b]; + assert(a >= 0); + if (a > 0.0f) { + m = max[b - 1]; + if (m < max[b]) + m = max[b]; + assert((gds->numlines[b - 1] + gds->numlines[b] - 1) > 0); + a = 20.0f * (m * 2.0f - a) + / (a * (gds->numlines[b - 1] + gds->numlines[b] - 1)); + k = (int) a; + if (k > last_tab_entry) + k = last_tab_entry; + mask_idx[b] = k; + } + else { + mask_idx[b] = 0; + } + assert(b == (gds->npart - 1)); +} + + +static void +vbrpsy_compute_masking_s(lame_internal_flags * gfc, const FLOAT(*fftenergy_s)[HBLKSIZE_s], + FLOAT * eb, FLOAT * thr, int chn, int sblock) +{ + PsyStateVar_t *const psv = &gfc->sv_psy; + PsyConst_CB2SB_t const *const gds = &gfc->cd_psy->s; + FLOAT max[CBANDS], avg[CBANDS]; + int i, j, b; + unsigned char mask_idx_s[CBANDS]; + + memset(max, 0, sizeof(max)); + memset(avg, 0, sizeof(avg)); + + for (b = j = 0; b < gds->npart; ++b) { + FLOAT ebb = 0, m = 0; + int const n = gds->numlines[b]; + for (i = 0; i < n; ++i, ++j) { + FLOAT const el = fftenergy_s[sblock][j]; + ebb += el; + if (m < el) + m = el; + } + eb[b] = ebb; + assert(ebb >= 0); + max[b] = m; + assert(n > 0); + avg[b] = ebb * gds->rnumlines[b]; + assert(avg[b] >= 0); + } + assert(b == gds->npart); + assert(j == 129); + vbrpsy_calc_mask_index_s(gfc, max, avg, mask_idx_s); + for (j = b = 0; b < gds->npart; b++) { + int kk = gds->s3ind[b][0]; + int const last = gds->s3ind[b][1]; + int const delta = mask_add_delta(mask_idx_s[b]); + int dd, dd_n; + FLOAT x, ecb, avg_mask; + FLOAT const masking_lower = gds->masking_lower[b] * gfc->sv_qnt.masking_lower; + + dd = mask_idx_s[kk]; + dd_n = 1; + ecb = gds->s3[j] * eb[kk] * tab[mask_idx_s[kk]]; + ++j, ++kk; + while (kk <= last) { + dd += mask_idx_s[kk]; + dd_n += 1; + x = gds->s3[j] * eb[kk] * tab[mask_idx_s[kk]]; + ecb = vbrpsy_mask_add(ecb, x, kk - b, delta); + ++j, ++kk; + } + dd = (1 + 2 * dd) / (2 * dd_n); + avg_mask = tab[dd] * 0.5f; + ecb *= avg_mask; +#if 0 /* we can do PRE ECHO control now here, or do it later */ + if (psv->blocktype_old[chn & 0x01] == SHORT_TYPE) { + /* limit calculated threshold by even older granule */ + FLOAT const t1 = rpelev_s * psv->nb_s1[chn][b]; + FLOAT const t2 = rpelev2_s * psv->nb_s2[chn][b]; + FLOAT const tm = (t2 > 0) ? Min(ecb, t2) : ecb; + thr[b] = (t1 > 0) ? NS_INTERP(Min(tm, t1), ecb, 0.6) : ecb; + } + else { + /* limit calculated threshold by older granule */ + FLOAT const t1 = rpelev_s * psv->nb_s1[chn][b]; + thr[b] = (t1 > 0) ? NS_INTERP(Min(ecb, t1), ecb, 0.6) : ecb; + } +#else /* we do it later */ + thr[b] = ecb; +#endif + psv->nb_s2[chn][b] = psv->nb_s1[chn][b]; + psv->nb_s1[chn][b] = ecb; + { + /* if THR exceeds EB, the quantization routines will take the difference + * from other bands. in case of strong tonal samples (tonaltest.wav) + * this leads to heavy distortions. that's why we limit THR here. + */ + x = max[b]; + x *= gds->minval[b]; + x *= avg_mask; + if (thr[b] > x) { + thr[b] = x; + } + } + if (masking_lower > 1) { + thr[b] *= masking_lower; + } + if (thr[b] > eb[b]) { + thr[b] = eb[b]; + } + if (masking_lower < 1) { + thr[b] *= masking_lower; + } + + assert(thr[b] >= 0); + } + for (; b < CBANDS; ++b) { + eb[b] = 0; + thr[b] = 0; + } +} + + +static void +vbrpsy_compute_masking_l(lame_internal_flags * gfc, const FLOAT fftenergy[HBLKSIZE], + FLOAT eb_l[CBANDS], FLOAT thr[CBANDS], int chn) +{ + PsyStateVar_t *const psv = &gfc->sv_psy; + PsyConst_CB2SB_t const *const gdl = &gfc->cd_psy->l; + FLOAT max[CBANDS], avg[CBANDS]; + unsigned char mask_idx_l[CBANDS + 2]; + int k, b; + + /********************************************************************* + * Calculate the energy and the tonality of each partition. + *********************************************************************/ + calc_energy(gdl, fftenergy, eb_l, max, avg); + calc_mask_index_l(gfc, max, avg, mask_idx_l); + + /********************************************************************* + * convolve the partitioned energy and unpredictability + * with the spreading function, s3_l[b][k] + ********************************************************************/ + k = 0; + for (b = 0; b < gdl->npart; b++) { + FLOAT x, ecb, avg_mask, t; + FLOAT const masking_lower = gdl->masking_lower[b] * gfc->sv_qnt.masking_lower; + /* convolve the partitioned energy with the spreading function */ + int kk = gdl->s3ind[b][0]; + int const last = gdl->s3ind[b][1]; + int const delta = mask_add_delta(mask_idx_l[b]); + int dd = 0, dd_n = 0; + + dd = mask_idx_l[kk]; + dd_n += 1; + ecb = gdl->s3[k] * eb_l[kk] * tab[mask_idx_l[kk]]; + ++k, ++kk; + while (kk <= last) { + dd += mask_idx_l[kk]; + dd_n += 1; + x = gdl->s3[k] * eb_l[kk] * tab[mask_idx_l[kk]]; + t = vbrpsy_mask_add(ecb, x, kk - b, delta); +#if 0 + ecb += eb_l[kk]; + if (ecb > t) { + ecb = t; + } +#else + ecb = t; +#endif + ++k, ++kk; + } + dd = (1 + 2 * dd) / (2 * dd_n); + avg_mask = tab[dd] * 0.5f; + ecb *= avg_mask; + + /**** long block pre-echo control ****/ + /* dont use long block pre-echo control if previous granule was + * a short block. This is to avoid the situation: + * frame0: quiet (very low masking) + * frame1: surge (triggers short blocks) + * frame2: regular frame. looks like pre-echo when compared to + * frame0, but all pre-echo was in frame1. + */ + /* chn=0,1 L and R channels + chn=2,3 S and M channels. + */ + if (psv->blocktype_old[chn & 0x01] == SHORT_TYPE) { + FLOAT const ecb_limit = rpelev * psv->nb_l1[chn][b]; + if (ecb_limit > 0) { + thr[b] = Min(ecb, ecb_limit); + } + else { + /* Robert 071209: + Because we don't calculate long block psy when we know a granule + should be of short blocks, we don't have any clue how the granule + before would have looked like as a long block. So we have to guess + a little bit for this END_TYPE block. + Most of the time we get away with this sloppyness. (fingers crossed :) + The speed increase is worth it. + */ + thr[b] = Min(ecb, eb_l[b] * NS_PREECHO_ATT2); + } + } + else { + FLOAT ecb_limit_2 = rpelev2 * psv->nb_l2[chn][b]; + FLOAT ecb_limit_1 = rpelev * psv->nb_l1[chn][b]; + FLOAT ecb_limit; + if (ecb_limit_2 <= 0) { + ecb_limit_2 = ecb; + } + if (ecb_limit_1 <= 0) { + ecb_limit_1 = ecb; + } + if (psv->blocktype_old[chn & 0x01] == NORM_TYPE) { + ecb_limit = Min(ecb_limit_1, ecb_limit_2); + } + else { + ecb_limit = ecb_limit_1; + } + thr[b] = Min(ecb, ecb_limit); + } + psv->nb_l2[chn][b] = psv->nb_l1[chn][b]; + psv->nb_l1[chn][b] = ecb; + { + /* if THR exceeds EB, the quantization routines will take the difference + * from other bands. in case of strong tonal samples (tonaltest.wav) + * this leads to heavy distortions. that's why we limit THR here. + */ + x = max[b]; + x *= gdl->minval[b]; + x *= avg_mask; + if (thr[b] > x) { + thr[b] = x; + } + } + if (masking_lower > 1) { + thr[b] *= masking_lower; + } + if (thr[b] > eb_l[b]) { + thr[b] = eb_l[b]; + } + if (masking_lower < 1) { + thr[b] *= masking_lower; + } + assert(thr[b] >= 0); + } + for (; b < CBANDS; ++b) { + eb_l[b] = 0; + thr[b] = 0; + } +} + + +static void +vbrpsy_compute_block_type(SessionConfig_t const *cfg, int *uselongblock) +{ + int chn; + + if (cfg->short_blocks == short_block_coupled + /* force both channels to use the same block type */ + /* this is necessary if the frame is to be encoded in ms_stereo. */ + /* But even without ms_stereo, FhG does this */ + && !(uselongblock[0] && uselongblock[1])) + uselongblock[0] = uselongblock[1] = 0; + + for (chn = 0; chn < cfg->channels_out; chn++) { + /* disable short blocks */ + if (cfg->short_blocks == short_block_dispensed) { + uselongblock[chn] = 1; + } + if (cfg->short_blocks == short_block_forced) { + uselongblock[chn] = 0; + } + } +} + + +static void +vbrpsy_apply_block_type(PsyStateVar_t * psv, int nch, int const *uselongblock, int *blocktype_d) +{ + int chn; + + /* update the blocktype of the previous granule, since it depends on what + * happend in this granule */ + for (chn = 0; chn < nch; chn++) { + int blocktype = NORM_TYPE; + /* disable short blocks */ + + if (uselongblock[chn]) { + /* no attack : use long blocks */ + assert(psv->blocktype_old[chn] != START_TYPE); + if (psv->blocktype_old[chn] == SHORT_TYPE) + blocktype = STOP_TYPE; + } + else { + /* attack : use short blocks */ + blocktype = SHORT_TYPE; + if (psv->blocktype_old[chn] == NORM_TYPE) { + psv->blocktype_old[chn] = START_TYPE; + } + if (psv->blocktype_old[chn] == STOP_TYPE) + psv->blocktype_old[chn] = SHORT_TYPE; + } + + blocktype_d[chn] = psv->blocktype_old[chn]; /* value returned to calling program */ + psv->blocktype_old[chn] = blocktype; /* save for next call to l3psy_anal */ + } +} + + +/*************************************************************** + * compute M/S thresholds from Johnston & Ferreira 1992 ICASSP paper + ***************************************************************/ + +static void +vbrpsy_compute_MS_thresholds(const FLOAT eb[4][CBANDS], FLOAT thr[4][CBANDS], + const FLOAT cb_mld[CBANDS], const FLOAT ath_cb[CBANDS], FLOAT athlower, + FLOAT msfix, int n) +{ + FLOAT const msfix2 = msfix * 2.f; + FLOAT rside, rmid; + int b; + for (b = 0; b < n; ++b) { + FLOAT const ebM = eb[2][b]; + FLOAT const ebS = eb[3][b]; + FLOAT const thmL = thr[0][b]; + FLOAT const thmR = thr[1][b]; + FLOAT thmM = thr[2][b]; + FLOAT thmS = thr[3][b]; + + /* use this fix if L & R masking differs by 2db or less */ + /* if db = 10*log10(x2/x1) < 2 */ + /* if (x2 < 1.58*x1) { */ + if (thmL <= 1.58f * thmR && thmR <= 1.58f * thmL) { + FLOAT const mld_m = cb_mld[b] * ebS; + FLOAT const mld_s = cb_mld[b] * ebM; + FLOAT const tmp_m = Min(thmS, mld_m); + FLOAT const tmp_s = Min(thmM, mld_s); + rmid = Max(thmM, tmp_m); + rside = Max(thmS, tmp_s); + } + else { + rmid = thmM; + rside = thmS; + } + if (msfix > 0.f) { + /***************************************************************/ + /* Adjust M/S maskings if user set "msfix" */ + /***************************************************************/ + /* Naoki Shibata 2000 */ + FLOAT thmLR, thmMS; + FLOAT const ath = ath_cb[b] * athlower; + FLOAT const tmp_l = Max(thmL, ath); + FLOAT const tmp_r = Max(thmR, ath); + thmLR = Min(tmp_l, tmp_r); + thmM = Max(rmid, ath); + thmS = Max(rside, ath); + thmMS = thmM + thmS; + if (thmMS > 0.f && (thmLR * msfix2) < thmMS) { + FLOAT const f = thmLR * msfix2 / thmMS; + thmM *= f; + thmS *= f; + assert(thmMS > 0.f); + } + rmid = Min(thmM, rmid); + rside = Min(thmS, rside); + } + if (rmid > ebM) { + rmid = ebM; + } + if (rside > ebS) { + rside = ebS; + } + thr[2][b] = rmid; + thr[3][b] = rside; + } +} + + +/* + * NOTE: the bitrate reduction from the inter-channel masking effect is low + * compared to the chance of getting annyoing artefacts. L3psycho_anal_vbr does + * not use this feature. (Robert 071216) +*/ + +int +L3psycho_anal_vbr(lame_internal_flags * gfc, + const sample_t * const buffer[2], int gr_out, + III_psy_ratio masking_ratio[2][2], + III_psy_ratio masking_MS_ratio[2][2], + FLOAT percep_entropy[2], FLOAT percep_MS_entropy[2], + FLOAT energy[4], int blocktype_d[2]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + PsyStateVar_t *const psv = &gfc->sv_psy; + PsyConst_CB2SB_t const *const gdl = &gfc->cd_psy->l; + PsyConst_CB2SB_t const *const gds = &gfc->cd_psy->s; + plotting_data *plt = cfg->analysis ? gfc->pinfo : 0; + + III_psy_xmin last_thm[4]; + + /* fft and energy calculation */ + FLOAT(*wsamp_l)[BLKSIZE]; + FLOAT(*wsamp_s)[3][BLKSIZE_s]; + FLOAT fftenergy[HBLKSIZE]; + FLOAT fftenergy_s[3][HBLKSIZE_s]; + FLOAT wsamp_L[2][BLKSIZE]; + FLOAT wsamp_S[2][3][BLKSIZE_s]; + FLOAT eb[4][CBANDS], thr[4][CBANDS]; + + FLOAT sub_short_factor[4][3]; + FLOAT thmm; + FLOAT const pcfact = 0.6f; + FLOAT const ath_factor = + (cfg->msfix > 0.f) ? (cfg->ATH_offset_factor * gfc->ATH->adjust_factor) : 1.f; + + const FLOAT(*const_eb)[CBANDS] = (const FLOAT(*)[CBANDS]) eb; + const FLOAT(*const_fftenergy_s)[HBLKSIZE_s] = (const FLOAT(*)[HBLKSIZE_s]) fftenergy_s; + + /* block type */ + int ns_attacks[4][4] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0} }; + int uselongblock[2]; + + /* usual variables like loop indices, etc.. */ + int chn, sb, sblock; + + /* chn=2 and 3 = Mid and Side channels */ + int const n_chn_psy = (cfg->mode == JOINT_STEREO) ? 4 : cfg->channels_out; + + memcpy(&last_thm[0], &psv->thm[0], sizeof(last_thm)); + + vbrpsy_attack_detection(gfc, buffer, gr_out, masking_ratio, masking_MS_ratio, energy, + sub_short_factor, ns_attacks, uselongblock); + + vbrpsy_compute_block_type(cfg, uselongblock); + + /* LONG BLOCK CASE */ + { + for (chn = 0; chn < n_chn_psy; chn++) { + int const ch01 = chn & 0x01; + + wsamp_l = wsamp_L + ch01; + vbrpsy_compute_fft_l(gfc, buffer, chn, gr_out, fftenergy, wsamp_l); + vbrpsy_compute_loudness_approximation_l(gfc, gr_out, chn, fftenergy); + vbrpsy_compute_masking_l(gfc, fftenergy, eb[chn], thr[chn], chn); + } + if (cfg->mode == JOINT_STEREO) { + if ((uselongblock[0] + uselongblock[1]) == 2) { + vbrpsy_compute_MS_thresholds(const_eb, thr, gdl->mld_cb, gfc->ATH->cb_l, + ath_factor, cfg->msfix, gdl->npart); + } + } + /* TODO: apply adaptive ATH masking here ?? */ + for (chn = 0; chn < n_chn_psy; chn++) { + convert_partition2scalefac_l(gfc, eb[chn], thr[chn], chn); + convert_partition2scalefac_l_to_s(gfc, eb[chn], thr[chn], chn); + } + } + /* SHORT BLOCKS CASE */ + { + int const force_short_block_calc = gfc->cd_psy->force_short_block_calc; + for (sblock = 0; sblock < 3; sblock++) { + for (chn = 0; chn < n_chn_psy; ++chn) { + int const ch01 = chn & 0x01; + if (uselongblock[ch01] && !force_short_block_calc) { + vbrpsy_skip_masking_s(gfc, chn, sblock); + } + else { + /* compute masking thresholds for short blocks */ + wsamp_s = wsamp_S + ch01; + vbrpsy_compute_fft_s(gfc, buffer, chn, sblock, fftenergy_s, wsamp_s); + vbrpsy_compute_masking_s(gfc, const_fftenergy_s, eb[chn], thr[chn], chn, + sblock); + } + } + if (cfg->mode == JOINT_STEREO) { + if ((uselongblock[0] + uselongblock[1]) == 0) { + vbrpsy_compute_MS_thresholds(const_eb, thr, gds->mld_cb, gfc->ATH->cb_s, + ath_factor, cfg->msfix, gds->npart); + } + } + /* TODO: apply adaptive ATH masking here ?? */ + for (chn = 0; chn < n_chn_psy; ++chn) { + int const ch01 = chn & 0x01; + if (!uselongblock[ch01] || force_short_block_calc) { + convert_partition2scalefac_s(gfc, eb[chn], thr[chn], chn, sblock); + } + } + } + + /**** short block pre-echo control ****/ + for (chn = 0; chn < n_chn_psy; chn++) { + for (sb = 0; sb < SBMAX_s; sb++) { + FLOAT new_thmm[3], prev_thm, t1, t2; + for (sblock = 0; sblock < 3; sblock++) { + thmm = psv->thm[chn].s[sb][sblock]; + thmm *= NS_PREECHO_ATT0; + + t1 = t2 = thmm; + + if (sblock > 0) { + prev_thm = new_thmm[sblock - 1]; + } + else { + prev_thm = last_thm[chn].s[sb][2]; + } + if (ns_attacks[chn][sblock] >= 2 || ns_attacks[chn][sblock + 1] == 1) { + t1 = NS_INTERP(prev_thm, thmm, NS_PREECHO_ATT1 * pcfact); + } + thmm = Min(t1, thmm); + if (ns_attacks[chn][sblock] == 1) { + t2 = NS_INTERP(prev_thm, thmm, NS_PREECHO_ATT2 * pcfact); + } + else if ((sblock == 0 && psv->last_attacks[chn] == 3) + || (sblock > 0 && ns_attacks[chn][sblock - 1] == 3)) { /* 2nd preceeding block */ + switch (sblock) { + case 0: + prev_thm = last_thm[chn].s[sb][1]; + break; + case 1: + prev_thm = last_thm[chn].s[sb][2]; + break; + case 2: + prev_thm = new_thmm[0]; + break; + } + t2 = NS_INTERP(prev_thm, thmm, NS_PREECHO_ATT2 * pcfact); + } + + thmm = Min(t1, thmm); + thmm = Min(t2, thmm); + + /* pulse like signal detection for fatboy.wav and so on */ + thmm *= sub_short_factor[chn][sblock]; + + new_thmm[sblock] = thmm; + } + for (sblock = 0; sblock < 3; sblock++) { + psv->thm[chn].s[sb][sblock] = new_thmm[sblock]; + } + } + } + } + for (chn = 0; chn < n_chn_psy; chn++) { + psv->last_attacks[chn] = ns_attacks[chn][2]; + } + + + /*************************************************************** + * determine final block type + ***************************************************************/ + vbrpsy_apply_block_type(psv, cfg->channels_out, uselongblock, blocktype_d); + + /********************************************************************* + * compute the value of PE to return ... no delay and advance + *********************************************************************/ + for (chn = 0; chn < n_chn_psy; chn++) { + FLOAT *ppe; + int type; + III_psy_ratio const *mr; + + if (chn > 1) { + ppe = percep_MS_entropy - 2; + type = NORM_TYPE; + if (blocktype_d[0] == SHORT_TYPE || blocktype_d[1] == SHORT_TYPE) + type = SHORT_TYPE; + mr = &masking_MS_ratio[gr_out][chn - 2]; + } + else { + ppe = percep_entropy; + type = blocktype_d[chn]; + mr = &masking_ratio[gr_out][chn]; + } + if (type == SHORT_TYPE) { + ppe[chn] = pecalc_s(mr, gfc->sv_qnt.masking_lower); + } + else { + ppe[chn] = pecalc_l(mr, gfc->sv_qnt.masking_lower); + } + + if (plt) { + plt->pe[gr_out][chn] = ppe[chn]; + } + } + return 0; +} + + + + +/* + * The spreading function. Values returned in units of energy + */ +static FLOAT +s3_func(FLOAT bark) +{ + FLOAT tempx, x, tempy, temp; + tempx = bark; + if (tempx >= 0) + tempx *= 3; + else + tempx *= 1.5; + + if (tempx >= 0.5 && tempx <= 2.5) { + temp = tempx - 0.5; + x = 8.0 * (temp * temp - 2.0 * temp); + } + else + x = 0.0; + tempx += 0.474; + tempy = 15.811389 + 7.5 * tempx - 17.5 * sqrt(1.0 + tempx * tempx); + + if (tempy <= -60.0) + return 0.0; + + tempx = exp((x + tempy) * LN_TO_LOG10); + + /* Normalization. The spreading function should be normalized so that: + +inf + / + | s3 [ bark ] d(bark) = 1 + / + -inf + */ + tempx /= .6609193; + return tempx; +} + +#if 0 +static FLOAT +norm_s3_func(void) +{ + double lim_a = 0, lim_b = 0; + double x = 0, l, h; + for (x = 0; s3_func(x) > 1e-20; x -= 1); + l = x; + h = 0; + while (fabs(h - l) > 1e-12) { + x = (h + l) / 2; + if (s3_func(x) > 0) { + h = x; + } + else { + l = x; + } + } + lim_a = l; + for (x = 0; s3_func(x) > 1e-20; x += 1); + l = 0; + h = x; + while (fabs(h - l) > 1e-12) { + x = (h + l) / 2; + if (s3_func(x) > 0) { + l = x; + } + else { + h = x; + } + } + lim_b = h; + { + double sum = 0; + int const m = 1000; + int i; + for (i = 0; i <= m; ++i) { + double x = lim_a + i * (lim_b - lim_a) / m; + double y = s3_func(x); + sum += y; + } + { + double norm = (m + 1) / (sum * (lim_b - lim_a)); + /*printf( "norm = %lf\n",norm); */ + return norm; + } + } +} +#endif + +static FLOAT +stereo_demask(double f) +{ + /* setup stereo demasking thresholds */ + /* formula reverse enginerred from plot in paper */ + double arg = freq2bark(f); + arg = (Min(arg, 15.5) / 15.5); + + return pow(10.0, 1.25 * (1 - cos(PI * arg)) - 2.5); +} + +static void +init_numline(PsyConst_CB2SB_t * gd, FLOAT sfreq, int fft_size, + int mdct_size, int sbmax, int const *scalepos) +{ + FLOAT b_frq[CBANDS + 1]; + FLOAT const mdct_freq_frac = sfreq / (2.0f * mdct_size); + FLOAT const deltafreq = fft_size / (2.0f * mdct_size); + int partition[HBLKSIZE] = { 0 }; + int i, j, ni; + int sfb; + sfreq /= fft_size; + j = 0; + ni = 0; + /* compute numlines, the number of spectral lines in each partition band */ + /* each partition band should be about DELBARK wide. */ + for (i = 0; i < CBANDS; i++) { + FLOAT bark1; + int j2, nl; + bark1 = freq2bark(sfreq * j); + + b_frq[i] = sfreq * j; + + for (j2 = j; freq2bark(sfreq * j2) - bark1 < DELBARK && j2 <= fft_size / 2; j2++); + + nl = j2 - j; + gd->numlines[i] = nl; + gd->rnumlines[i] = (nl > 0) ? (1.0f / nl) : 0; + + ni = i + 1; + + while (j < j2) { + assert(j < HBLKSIZE); + partition[j++] = i; + } + if (j > fft_size / 2) { + j = fft_size / 2; + ++i; + break; + } + } + assert(i < CBANDS); + b_frq[i] = sfreq * j; + + gd->n_sb = sbmax; + gd->npart = ni; + + { + j = 0; + for (i = 0; i < gd->npart; i++) { + int const nl = gd->numlines[i]; + FLOAT const freq = sfreq * (j + nl / 2); + gd->mld_cb[i] = stereo_demask(freq); + j += nl; + } + for (; i < CBANDS; ++i) { + gd->mld_cb[i] = 1; + } + } + for (sfb = 0; sfb < sbmax; sfb++) { + int i1, i2, bo; + int start = scalepos[sfb]; + int end = scalepos[sfb + 1]; + + i1 = floor(.5 + deltafreq * (start - .5)); + if (i1 < 0) + i1 = 0; + i2 = floor(.5 + deltafreq * (end - .5)); + + if (i2 > fft_size / 2) + i2 = fft_size / 2; + + bo = partition[i2]; + gd->bm[sfb] = (partition[i1] + partition[i2]) / 2; + gd->bo[sfb] = bo; + + /* calculate how much of this band belongs to current scalefactor band */ + { + FLOAT const f_tmp = mdct_freq_frac * end; + FLOAT bo_w = (f_tmp - b_frq[bo]) / (b_frq[bo + 1] - b_frq[bo]); + if (bo_w < 0) { + bo_w = 0; + } + else { + if (bo_w > 1) { + bo_w = 1; + } + } + gd->bo_weight[sfb] = bo_w; + } + gd->mld[sfb] = stereo_demask(mdct_freq_frac * start); + } +} + +static void +compute_bark_values(PsyConst_CB2SB_t const *gd, FLOAT sfreq, int fft_size, + FLOAT * bval, FLOAT * bval_width) +{ + /* compute bark values of each critical band */ + int k, j = 0, ni = gd->npart; + sfreq /= fft_size; + for (k = 0; k < ni; k++) { + int const w = gd->numlines[k]; + FLOAT bark1, bark2; + + bark1 = freq2bark(sfreq * (j)); + bark2 = freq2bark(sfreq * (j + w - 1)); + bval[k] = .5 * (bark1 + bark2); + + bark1 = freq2bark(sfreq * (j - .5)); + bark2 = freq2bark(sfreq * (j + w - .5)); + bval_width[k] = bark2 - bark1; + j += w; + } +} + +static int +init_s3_values(FLOAT ** p, int (*s3ind)[2], int npart, + FLOAT const *bval, FLOAT const *bval_width, FLOAT const *norm) +{ + FLOAT s3[CBANDS][CBANDS]; + /* The s3 array is not linear in the bark scale. + * bval[x] should be used to get the bark value. + */ + int i, j, k; + int numberOfNoneZero = 0; + + memset(&s3[0][0], 0, sizeof(s3)); + + /* s[i][j], the value of the spreading function, + * centered at band j (masker), for band i (maskee) + * + * i.e.: sum over j to spread into signal barkval=i + * NOTE: i and j are used opposite as in the ISO docs + */ + for (i = 0; i < npart; i++) { + for (j = 0; j < npart; j++) { + FLOAT v = s3_func(bval[i] - bval[j]) * bval_width[j]; + s3[i][j] = v * norm[i]; + } + } + for (i = 0; i < npart; i++) { + for (j = 0; j < npart; j++) { + if (s3[i][j] > 0.0f) + break; + } + s3ind[i][0] = j; + + for (j = npart - 1; j > 0; j--) { + if (s3[i][j] > 0.0f) + break; + } + s3ind[i][1] = j; + numberOfNoneZero += (s3ind[i][1] - s3ind[i][0] + 1); + } + *p = malloc(sizeof(FLOAT) * numberOfNoneZero); + if (!*p) + return -1; + + k = 0; + for (i = 0; i < npart; i++) + for (j = s3ind[i][0]; j <= s3ind[i][1]; j++) + (*p)[k++] = s3[i][j]; + + return 0; +} + +int +psymodel_init(lame_global_flags const *gfp) +{ + lame_internal_flags *const gfc = gfp->internal_flags; + SessionConfig_t *const cfg = &gfc->cfg; + PsyStateVar_t *const psv = &gfc->sv_psy; + PsyConst_t *gd; + int i, j, b, sb, k; + FLOAT bvl_a = 13, bvl_b = 24; + FLOAT snr_l_a = 0, snr_l_b = 0; + FLOAT snr_s_a = -8.25, snr_s_b = -4.5; + + FLOAT bval[CBANDS]; + FLOAT bval_width[CBANDS]; + FLOAT norm[CBANDS]; + FLOAT const sfreq = cfg->samplerate_out; + + FLOAT xav = 10, xbv = 12; + FLOAT const minval_low = (0.f - cfg->minval); + + if (gfc->cd_psy != 0) { + return 0; + } + memset(norm, 0, sizeof(norm)); + + gd = calloc(1, sizeof(PsyConst_t)); + gfc->cd_psy = gd; + + gd->force_short_block_calc = gfp->experimentalZ; + + psv->blocktype_old[0] = psv->blocktype_old[1] = NORM_TYPE; /* the vbr header is long blocks */ + + for (i = 0; i < 4; ++i) { + for (j = 0; j < CBANDS; ++j) { + psv->nb_l1[i][j] = 1e20; + psv->nb_l2[i][j] = 1e20; + psv->nb_s1[i][j] = psv->nb_s2[i][j] = 1.0; + } + for (sb = 0; sb < SBMAX_l; sb++) { + psv->en[i].l[sb] = 1e20; + psv->thm[i].l[sb] = 1e20; + } + for (j = 0; j < 3; ++j) { + for (sb = 0; sb < SBMAX_s; sb++) { + psv->en[i].s[sb][j] = 1e20; + psv->thm[i].s[sb][j] = 1e20; + } + psv->last_attacks[i] = 0; + } + for (j = 0; j < 9; j++) + psv->last_en_subshort[i][j] = 10.; + } + + + /* init. for loudness approx. -jd 2001 mar 27 */ + psv->loudness_sq_save[0] = psv->loudness_sq_save[1] = 0.0; + + + + /************************************************************************* + * now compute the psychoacoustic model specific constants + ************************************************************************/ + /* compute numlines, bo, bm, bval, bval_width, mld */ + init_numline(&gd->l, sfreq, BLKSIZE, 576, SBMAX_l, gfc->scalefac_band.l); + assert(gd->l.npart < CBANDS); + compute_bark_values(&gd->l, sfreq, BLKSIZE, bval, bval_width); + + /* compute the spreading function */ + for (i = 0; i < gd->l.npart; i++) { + double snr = snr_l_a; + if (bval[i] >= bvl_a) { + snr = snr_l_b * (bval[i] - bvl_a) / (bvl_b - bvl_a) + + snr_l_a * (bvl_b - bval[i]) / (bvl_b - bvl_a); + } + norm[i] = pow(10.0, snr / 10.0); + } + i = init_s3_values(&gd->l.s3, gd->l.s3ind, gd->l.npart, bval, bval_width, norm); + if (i) + return i; + + /* compute long block specific values, ATH and MINVAL */ + j = 0; + for (i = 0; i < gd->l.npart; i++) { + double x; + + /* ATH */ + x = FLOAT_MAX; + for (k = 0; k < gd->l.numlines[i]; k++, j++) { + FLOAT const freq = sfreq * j / (1000.0 * BLKSIZE); + FLOAT level; + /* freq = Min(.1,freq); *//* ATH below 100 Hz constant, not further climbing */ + level = ATHformula(cfg, freq * 1000) - 20; /* scale to FFT units; returned value is in dB */ + level = pow(10., 0.1 * level); /* convert from dB -> energy */ + level *= gd->l.numlines[i]; + if (x > level) + x = level; + } + gfc->ATH->cb_l[i] = x; + + /* MINVAL. + For low freq, the strength of the masking is limited by minval + this is an ISO MPEG1 thing, dont know if it is really needed */ + /* FIXME: it does work to reduce low-freq problems in S53-Wind-Sax + and lead-voice samples, but introduces some 3 kbps bit bloat too. + TODO: Further refinement of the shape of this hack. + */ + x = 20.0 * (bval[i] / xav - 1.0); + if (x > 6) { + x = 30; + } + if (x < minval_low) { + x = minval_low; + } + if (cfg->samplerate_out < 44000) { + x = 30; + } + x -= 8.; + gd->l.minval[i] = pow(10.0, x / 10.) * gd->l.numlines[i]; + } + + /************************************************************************ + * do the same things for short blocks + ************************************************************************/ + init_numline(&gd->s, sfreq, BLKSIZE_s, 192, SBMAX_s, gfc->scalefac_band.s); + assert(gd->s.npart < CBANDS); + compute_bark_values(&gd->s, sfreq, BLKSIZE_s, bval, bval_width); + + /* SNR formula. short block is normalized by SNR. is it still right ? */ + j = 0; + for (i = 0; i < gd->s.npart; i++) { + double x; + double snr = snr_s_a; + if (bval[i] >= bvl_a) { + snr = snr_s_b * (bval[i] - bvl_a) / (bvl_b - bvl_a) + + snr_s_a * (bvl_b - bval[i]) / (bvl_b - bvl_a); + } + norm[i] = pow(10.0, snr / 10.0); + + /* ATH */ + x = FLOAT_MAX; + for (k = 0; k < gd->s.numlines[i]; k++, j++) { + FLOAT const freq = sfreq * j / (1000.0 * BLKSIZE_s); + FLOAT level; + /* freq = Min(.1,freq); *//* ATH below 100 Hz constant, not further climbing */ + level = ATHformula(cfg, freq * 1000) - 20; /* scale to FFT units; returned value is in dB */ + level = pow(10., 0.1 * level); /* convert from dB -> energy */ + level *= gd->s.numlines[i]; + if (x > level) + x = level; + } + gfc->ATH->cb_s[i] = x; + + /* MINVAL. + For low freq, the strength of the masking is limited by minval + this is an ISO MPEG1 thing, dont know if it is really needed */ + x = 7.0 * (bval[i] / xbv - 1.0); + if (bval[i] > xbv) { + x *= 1 + log(1 + x) * 3.1; + } + if (bval[i] < xbv) { + x *= 1 + log(1 - x) * 2.3; + } + if (x > 6) { + x = 30; + } + if (x < minval_low) { + x = minval_low; + } + if (cfg->samplerate_out < 44000) { + x = 30; + } + x -= 8; + gd->s.minval[i] = pow(10.0, x / 10) * gd->s.numlines[i]; + } + + i = init_s3_values(&gd->s.s3, gd->s.s3ind, gd->s.npart, bval, bval_width, norm); + if (i) + return i; + + + init_mask_add_max_values(); + init_fft(gfc); + + /* setup temporal masking */ + gd->decay = exp(-1.0 * LOG10 / (temporalmask_sustain_sec * sfreq / 192.0)); + + { + FLOAT msfix; + msfix = NS_MSFIX; + if (cfg->use_safe_joint_stereo) + msfix = 1.0; + if (fabs(cfg->msfix) > 0.0) + msfix = cfg->msfix; + cfg->msfix = msfix; + + /* spread only from npart_l bands. Normally, we use the spreading + * function to convolve from npart_l down to npart_l bands + */ + for (b = 0; b < gd->l.npart; b++) + if (gd->l.s3ind[b][1] > gd->l.npart - 1) + gd->l.s3ind[b][1] = gd->l.npart - 1; + } + + /* prepare for ATH auto adjustment: + * we want to decrease the ATH by 12 dB per second + */ +#define frame_duration (576. * cfg->mode_gr / sfreq) + gfc->ATH->decay = pow(10., -12. / 10. * frame_duration); + gfc->ATH->adjust_factor = 0.01; /* minimum, for leading low loudness */ + gfc->ATH->adjust_limit = 1.0; /* on lead, allow adjust up to maximum */ +#undef frame_duration + + assert(gd->l.bo[SBMAX_l - 1] <= gd->l.npart); + assert(gd->s.bo[SBMAX_s - 1] <= gd->s.npart); + + if (cfg->ATHtype != -1) { + /* compute equal loudness weights (eql_w) */ + FLOAT freq; + FLOAT const freq_inc = (FLOAT) cfg->samplerate_out / (FLOAT) (BLKSIZE); + FLOAT eql_balance = 0.0; + freq = 0.0; + for (i = 0; i < BLKSIZE / 2; ++i) { + /* convert ATH dB to relative power (not dB) */ + /* to determine eql_w */ + freq += freq_inc; + gfc->ATH->eql_w[i] = 1. / pow(10, ATHformula(cfg, freq) / 10); + eql_balance += gfc->ATH->eql_w[i]; + } + eql_balance = 1.0 / eql_balance; + for (i = BLKSIZE / 2; --i >= 0;) { /* scale weights */ + gfc->ATH->eql_w[i] *= eql_balance; + } + } + { + for (b = j = 0; b < gd->s.npart; ++b) { + for (i = 0; i < gd->s.numlines[b]; ++i) { + ++j; + } + } + assert(j == 129); + for (b = j = 0; b < gd->l.npart; ++b) { + for (i = 0; i < gd->l.numlines[b]; ++i) { + ++j; + } + } + assert(j == 513); + } + /* short block attack threshold */ + { + float x = gfp->attackthre; + float y = gfp->attackthre_s; + if (x < 0) { + x = NSATTACKTHRE; + } + if (y < 0) { + y = NSATTACKTHRE_S; + } + gd->attack_threshold[0] = gd->attack_threshold[1] = gd->attack_threshold[2] = x; + gd->attack_threshold[3] = y; + } + { + float sk_s = -10.f, sk_l = -4.7f; + static float const sk[] = + { -7.4, -7.4, -7.4, -9.5, -7.4, -6.1, -5.5, -4.7, -4.7, -4.7, -4.7 }; + if (gfp->VBR_q < 4) { + sk_l = sk_s = sk[0]; + } + else { + sk_l = sk_s = sk[gfp->VBR_q] + gfp->VBR_q_frac * (sk[gfp->VBR_q] - sk[gfp->VBR_q + 1]); + } + b = 0; + for (; b < gd->s.npart; b++) { + float m = (float) (gd->s.npart - b) / gd->s.npart; + gd->s.masking_lower[b] = powf(10.f, sk_s * m * 0.1f); + } + for (; b < CBANDS; ++b) { + gd->s.masking_lower[b] = 1.f; + } + b = 0; + for (; b < gd->l.npart; b++) { + float m = (float) (gd->l.npart - b) / gd->l.npart; + gd->l.masking_lower[b] = powf(10.f, sk_l * m * 0.1f); + } + for (; b < CBANDS; ++b) { + gd->l.masking_lower[b] = 1.f; + } + } + memcpy(&gd->l_to_s, &gd->l, sizeof(gd->l_to_s)); + init_numline(&gd->l_to_s, sfreq, BLKSIZE, 192, SBMAX_s, gfc->scalefac_band.s); + return 0; +} diff --git a/node_modules/lame/deps/lame/libmp3lame/psymodel.h b/node_modules/lame/deps/lame/libmp3lame/psymodel.h new file mode 100644 index 0000000..f46083c --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/psymodel.h @@ -0,0 +1,64 @@ +/* + * psymodel.h + * + * Copyright (c) 1999 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_PSYMODEL_H +#define LAME_PSYMODEL_H + + +int L3psycho_anal_ns(lame_internal_flags * gfc, + const sample_t *const buffer[2], int gr, + III_psy_ratio ratio[2][2], + III_psy_ratio MS_ratio[2][2], + FLOAT pe[2], FLOAT pe_MS[2], FLOAT ener[2], int blocktype_d[2]); + +int L3psycho_anal_vbr(lame_internal_flags * gfc, + const sample_t *const buffer[2], int gr, + III_psy_ratio ratio[2][2], + III_psy_ratio MS_ratio[2][2], + FLOAT pe[2], FLOAT pe_MS[2], FLOAT ener[2], int blocktype_d[2]); + + +int psymodel_init(lame_global_flags const* gfp); + + +#define rpelev 2 +#define rpelev2 16 +#define rpelev_s 2 +#define rpelev2_s 16 + +/* size of each partition band, in barks: */ +#define DELBARK .34 + + +/* tuned for output level (sensitive to energy scale) */ +#define VO_SCALE (1./( 14752*14752 )/(BLKSIZE/2)) + +#define temporalmask_sustain_sec 0.01 + +#define NS_PREECHO_ATT0 0.8 +#define NS_PREECHO_ATT1 0.6 +#define NS_PREECHO_ATT2 0.3 + +#define NS_MSFIX 3.5 +#define NSATTACKTHRE 4.4 +#define NSATTACKTHRE_S 25 + +#endif /* LAME_PSYMODEL_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/quantize.c b/node_modules/lame/deps/lame/libmp3lame/quantize.c new file mode 100644 index 0000000..ffbc6bd --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/quantize.c @@ -0,0 +1,2050 @@ +/* + * MP3 quantization + * + * Copyright (c) 1999-2000 Mark Taylor + * Copyright (c) 1999-2003 Takehiro Tominaga + * Copyright (c) 2000-2011 Robert Hegemann + * Copyright (c) 2001-2005 Gabriel Bouvigne + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: quantize.c,v 1.216.2.1 2012/01/08 23:49:58 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "quantize_pvt.h" +#include "reservoir.h" +#include "bitstream.h" +#include "vbrquantize.h" +#include "quantize.h" +#ifdef HAVE_XMMINTRIN_H +#include "vector/lame_intrin.h" +#endif + + + + +/* convert from L/R <-> Mid/Side */ +static void +ms_convert(III_side_info_t * l3_side, int gr) +{ + int i; + for (i = 0; i < 576; ++i) { + FLOAT l, r; + l = l3_side->tt[gr][0].xr[i]; + r = l3_side->tt[gr][1].xr[i]; + l3_side->tt[gr][0].xr[i] = (l + r) * (FLOAT) (SQRT2 * 0.5); + l3_side->tt[gr][1].xr[i] = (l - r) * (FLOAT) (SQRT2 * 0.5); + } +} + +/************************************************************************ + * + * init_outer_loop() + * mt 6/99 + * + * initializes cod_info, scalefac and xrpow + * + * returns 0 if all energies in xr are zero, else 1 + * + ************************************************************************/ + +static void +init_xrpow_core_c(gr_info * const cod_info, FLOAT xrpow[576], int upper, FLOAT * sum) +{ + int i; + FLOAT tmp; + *sum = 0; + for (i = 0; i <= upper; ++i) { + tmp = fabs(cod_info->xr[i]); + *sum += tmp; + xrpow[i] = sqrt(tmp * sqrt(tmp)); + + if (xrpow[i] > cod_info->xrpow_max) + cod_info->xrpow_max = xrpow[i]; + } +} + + + + + +void +init_xrpow_core_init(lame_internal_flags * const gfc) +{ + gfc->init_xrpow_core = init_xrpow_core_c; + +#if defined(HAVE_XMMINTRIN_H) + if (gfc->CPU_features.SSE) + gfc->init_xrpow_core = init_xrpow_core_sse; +#endif +#ifndef HAVE_NASM +#ifdef MIN_ARCH_SSE + gfc->init_xrpow_core = init_xrpow_core_sse; +#endif +#endif +} + + + +static int +init_xrpow(lame_internal_flags * gfc, gr_info * const cod_info, FLOAT xrpow[576]) +{ + FLOAT sum = 0; + int i; + int const upper = cod_info->max_nonzero_coeff; + + assert(xrpow != NULL); + cod_info->xrpow_max = 0; + + /* check if there is some energy we have to quantize + * and calculate xrpow matching our fresh scalefactors + */ + assert(0 <= upper && upper <= 575); + memset(&(xrpow[upper]), 0, (576 - upper) * sizeof(xrpow[0])); + + + gfc->init_xrpow_core(cod_info, xrpow, upper, &sum); + + /* return 1 if we have something to quantize, else 0 + */ + if (sum > (FLOAT) 1E-20) { + int j = 0; + if (gfc->sv_qnt.substep_shaping & 2) + j = 1; + + for (i = 0; i < cod_info->psymax; i++) + gfc->sv_qnt.pseudohalf[i] = j; + + return 1; + } + + memset(&cod_info->l3_enc[0], 0, sizeof(int) * 576); + return 0; +} + + + + + +/* +Gabriel Bouvigne feb/apr 2003 +Analog silence detection in partitionned sfb21 +or sfb12 for short blocks + +From top to bottom of sfb, changes to 0 +coeffs which are below ath. It stops on the first +coeff higher than ath. +*/ +static void +psfb21_analogsilence(lame_internal_flags const *gfc, gr_info * const cod_info) +{ + ATH_t const *const ATH = gfc->ATH; + FLOAT *const xr = cod_info->xr; + + if (cod_info->block_type != SHORT_TYPE) { /* NORM, START or STOP type, but not SHORT blocks */ + int gsfb; + int stop = 0; + for (gsfb = PSFB21 - 1; gsfb >= 0 && !stop; gsfb--) { + int const start = gfc->scalefac_band.psfb21[gsfb]; + int const end = gfc->scalefac_band.psfb21[gsfb + 1]; + int j; + FLOAT ath21; + ath21 = athAdjust(ATH->adjust_factor, ATH->psfb21[gsfb], ATH->floor, 0); + + if (gfc->sv_qnt.longfact[21] > 1e-12f) + ath21 *= gfc->sv_qnt.longfact[21]; + + for (j = end - 1; j >= start; j--) { + if (fabs(xr[j]) < ath21) + xr[j] = 0; + else { + stop = 1; + break; + } + } + } + } + else { + /*note: short blocks coeffs are reordered */ + int block; + for (block = 0; block < 3; block++) { + + int gsfb; + int stop = 0; + for (gsfb = PSFB12 - 1; gsfb >= 0 && !stop; gsfb--) { + int const start = gfc->scalefac_band.s[12] * 3 + + (gfc->scalefac_band.s[13] - gfc->scalefac_band.s[12]) * block + + (gfc->scalefac_band.psfb12[gsfb] - gfc->scalefac_band.psfb12[0]); + int const end = + start + (gfc->scalefac_band.psfb12[gsfb + 1] - gfc->scalefac_band.psfb12[gsfb]); + int j; + FLOAT ath12; + ath12 = athAdjust(ATH->adjust_factor, ATH->psfb12[gsfb], ATH->floor, 0); + + if (gfc->sv_qnt.shortfact[12] > 1e-12f) + ath12 *= gfc->sv_qnt.shortfact[12]; + + for (j = end - 1; j >= start; j--) { + if (fabs(xr[j]) < ath12) + xr[j] = 0; + else { + stop = 1; + break; + } + } + } + } + } + +} + + + + + +static void +init_outer_loop(lame_internal_flags const *gfc, gr_info * const cod_info) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int sfb, j; + /* initialize fresh cod_info + */ + cod_info->part2_3_length = 0; + cod_info->big_values = 0; + cod_info->count1 = 0; + cod_info->global_gain = 210; + cod_info->scalefac_compress = 0; + /* mixed_block_flag, block_type was set in psymodel.c */ + cod_info->table_select[0] = 0; + cod_info->table_select[1] = 0; + cod_info->table_select[2] = 0; + cod_info->subblock_gain[0] = 0; + cod_info->subblock_gain[1] = 0; + cod_info->subblock_gain[2] = 0; + cod_info->subblock_gain[3] = 0; /* this one is always 0 */ + cod_info->region0_count = 0; + cod_info->region1_count = 0; + cod_info->preflag = 0; + cod_info->scalefac_scale = 0; + cod_info->count1table_select = 0; + cod_info->part2_length = 0; + if (cfg->samplerate_out <= 8000) { + cod_info->sfb_lmax = 17; + cod_info->sfb_smin = 9; + cod_info->psy_lmax = 17; + } + else { + cod_info->sfb_lmax = SBPSY_l; + cod_info->sfb_smin = SBPSY_s; + cod_info->psy_lmax = gfc->sv_qnt.sfb21_extra ? SBMAX_l : SBPSY_l; + } + cod_info->psymax = cod_info->psy_lmax; + cod_info->sfbmax = cod_info->sfb_lmax; + cod_info->sfbdivide = 11; + for (sfb = 0; sfb < SBMAX_l; sfb++) { + cod_info->width[sfb] + = gfc->scalefac_band.l[sfb + 1] - gfc->scalefac_band.l[sfb]; + cod_info->window[sfb] = 3; /* which is always 0. */ + } + if (cod_info->block_type == SHORT_TYPE) { + FLOAT ixwork[576]; + FLOAT *ix; + + cod_info->sfb_smin = 0; + cod_info->sfb_lmax = 0; + if (cod_info->mixed_block_flag) { + /* + * MPEG-1: sfbs 0-7 long block, 3-12 short blocks + * MPEG-2(.5): sfbs 0-5 long block, 3-12 short blocks + */ + cod_info->sfb_smin = 3; + cod_info->sfb_lmax = cfg->mode_gr * 2 + 4; + } + if (cfg->samplerate_out <= 8000) { + cod_info->psymax + = cod_info->sfb_lmax + + 3 * (9 - cod_info->sfb_smin); + cod_info->sfbmax = cod_info->sfb_lmax + 3 * (9 - cod_info->sfb_smin); + } + else { + cod_info->psymax + = cod_info->sfb_lmax + + 3 * ((gfc->sv_qnt.sfb21_extra ? SBMAX_s : SBPSY_s) - cod_info->sfb_smin); + cod_info->sfbmax = cod_info->sfb_lmax + 3 * (SBPSY_s - cod_info->sfb_smin); + } + cod_info->sfbdivide = cod_info->sfbmax - 18; + cod_info->psy_lmax = cod_info->sfb_lmax; + /* re-order the short blocks, for more efficient encoding below */ + /* By Takehiro TOMINAGA */ + /* + Within each scalefactor band, data is given for successive + time windows, beginning with window 0 and ending with window 2. + Within each window, the quantized values are then arranged in + order of increasing frequency... + */ + ix = &cod_info->xr[gfc->scalefac_band.l[cod_info->sfb_lmax]]; + memcpy(ixwork, cod_info->xr, 576 * sizeof(FLOAT)); + for (sfb = cod_info->sfb_smin; sfb < SBMAX_s; sfb++) { + int const start = gfc->scalefac_band.s[sfb]; + int const end = gfc->scalefac_band.s[sfb + 1]; + int window, l; + for (window = 0; window < 3; window++) { + for (l = start; l < end; l++) { + *ix++ = ixwork[3 * l + window]; + } + } + } + + j = cod_info->sfb_lmax; + for (sfb = cod_info->sfb_smin; sfb < SBMAX_s; sfb++) { + cod_info->width[j] = cod_info->width[j + 1] = cod_info->width[j + 2] + = gfc->scalefac_band.s[sfb + 1] - gfc->scalefac_band.s[sfb]; + cod_info->window[j] = 0; + cod_info->window[j + 1] = 1; + cod_info->window[j + 2] = 2; + j += 3; + } + } + + cod_info->count1bits = 0; + cod_info->sfb_partition_table = nr_of_sfb_block[0][0]; + cod_info->slen[0] = 0; + cod_info->slen[1] = 0; + cod_info->slen[2] = 0; + cod_info->slen[3] = 0; + + cod_info->max_nonzero_coeff = 575; + + /* fresh scalefactors are all zero + */ + memset(cod_info->scalefac, 0, sizeof(cod_info->scalefac)); + + if (cfg->vbr != vbr_mt && cfg->vbr != vbr_mtrh && cfg->vbr != vbr_abr && cfg->vbr != vbr_off) { + psfb21_analogsilence(gfc, cod_info); + } +} + + + +/************************************************************************ + * + * bin_search_StepSize() + * + * author/date?? + * + * binary step size search + * used by outer_loop to get a quantizer step size to start with + * + ************************************************************************/ + +typedef enum { + BINSEARCH_NONE, + BINSEARCH_UP, + BINSEARCH_DOWN +} binsearchDirection_t; + +static int +bin_search_StepSize(lame_internal_flags * const gfc, gr_info * const cod_info, + int desired_rate, const int ch, const FLOAT xrpow[576]) +{ + int nBits; + int CurrentStep = gfc->sv_qnt.CurrentStep[ch]; + int flag_GoneOver = 0; + int const start = gfc->sv_qnt.OldValue[ch]; + binsearchDirection_t Direction = BINSEARCH_NONE; + cod_info->global_gain = start; + desired_rate -= cod_info->part2_length; + + assert(CurrentStep); + for (;;) { + int step; + nBits = count_bits(gfc, xrpow, cod_info, 0); + + if (CurrentStep == 1 || nBits == desired_rate) + break; /* nothing to adjust anymore */ + + if (nBits > desired_rate) { + /* increase Quantize_StepSize */ + if (Direction == BINSEARCH_DOWN) + flag_GoneOver = 1; + + if (flag_GoneOver) + CurrentStep /= 2; + Direction = BINSEARCH_UP; + step = CurrentStep; + } + else { + /* decrease Quantize_StepSize */ + if (Direction == BINSEARCH_UP) + flag_GoneOver = 1; + + if (flag_GoneOver) + CurrentStep /= 2; + Direction = BINSEARCH_DOWN; + step = -CurrentStep; + } + cod_info->global_gain += step; + if (cod_info->global_gain < 0) { + cod_info->global_gain = 0; + flag_GoneOver = 1; + } + if (cod_info->global_gain > 255) { + cod_info->global_gain = 255; + flag_GoneOver = 1; + } + } + + assert(cod_info->global_gain >= 0); + assert(cod_info->global_gain < 256); + + while (nBits > desired_rate && cod_info->global_gain < 255) { + cod_info->global_gain++; + nBits = count_bits(gfc, xrpow, cod_info, 0); + } + gfc->sv_qnt.CurrentStep[ch] = (start - cod_info->global_gain >= 4) ? 4 : 2; + gfc->sv_qnt.OldValue[ch] = cod_info->global_gain; + cod_info->part2_3_length = nBits; + return nBits; +} + + + + +/************************************************************************ + * + * trancate_smallspectrums() + * + * Takehiro TOMINAGA 2002-07-21 + * + * trancate smaller nubmers into 0 as long as the noise threshold is allowed. + * + ************************************************************************/ +static int +floatcompare(const void *v1, const void *v2) +{ + const FLOAT *const a = v1, *const b = v2; + if (*a > *b) + return 1; + if (*a < *b) + return -1; + return 0; +} + +static void +trancate_smallspectrums(lame_internal_flags const *gfc, + gr_info * const gi, const FLOAT * const l3_xmin, FLOAT * const work) +{ + int sfb, j, width; + FLOAT distort[SFBMAX]; + calc_noise_result dummy; + + if ((!(gfc->sv_qnt.substep_shaping & 4) && gi->block_type == SHORT_TYPE) + || gfc->sv_qnt.substep_shaping & 0x80) + return; + (void) calc_noise(gi, l3_xmin, distort, &dummy, 0); + for (j = 0; j < 576; j++) { + FLOAT xr = 0.0; + if (gi->l3_enc[j] != 0) + xr = fabs(gi->xr[j]); + work[j] = xr; + } + + j = 0; + sfb = 8; + if (gi->block_type == SHORT_TYPE) + sfb = 6; + do { + FLOAT allowedNoise, trancateThreshold; + int nsame, start; + + width = gi->width[sfb]; + j += width; + if (distort[sfb] >= 1.0) + continue; + + qsort(&work[j - width], width, sizeof(FLOAT), floatcompare); + if (EQ(work[j - 1], 0.0)) + continue; /* all zero sfb */ + + allowedNoise = (1.0 - distort[sfb]) * l3_xmin[sfb]; + trancateThreshold = 0.0; + start = 0; + do { + FLOAT noise; + for (nsame = 1; start + nsame < width; nsame++) + if (NEQ(work[start + j - width], work[start + j + nsame - width])) + break; + + noise = work[start + j - width] * work[start + j - width] * nsame; + if (allowedNoise < noise) { + if (start != 0) + trancateThreshold = work[start + j - width - 1]; + break; + } + allowedNoise -= noise; + start += nsame; + } while (start < width); + if (EQ(trancateThreshold, 0.0)) + continue; + +/* printf("%e %e %e\n", */ +/* trancateThreshold/l3_xmin[sfb], */ +/* trancateThreshold/(l3_xmin[sfb]*start), */ +/* trancateThreshold/(l3_xmin[sfb]*(start+width)) */ +/* ); */ +/* if (trancateThreshold > 1000*l3_xmin[sfb]*start) */ +/* trancateThreshold = 1000*l3_xmin[sfb]*start; */ + + do { + if (fabs(gi->xr[j - width]) <= trancateThreshold) + gi->l3_enc[j - width] = 0; + } while (--width > 0); + } while (++sfb < gi->psymax); + + gi->part2_3_length = noquant_count_bits(gfc, gi, 0); +} + + +/************************************************************************* + * + * loop_break() + * + * author/date?? + * + * Function: Returns zero if there is a scalefac which has not been + * amplified. Otherwise it returns one. + * + *************************************************************************/ + +inline static int +loop_break(const gr_info * const cod_info) +{ + int sfb; + + for (sfb = 0; sfb < cod_info->sfbmax; sfb++) + if (cod_info->scalefac[sfb] + + cod_info->subblock_gain[cod_info->window[sfb]] == 0) + return 0; + + return 1; +} + + + + +/* mt 5/99: Function: Improved calc_noise for a single channel */ + +/************************************************************************* + * + * quant_compare() + * + * author/date?? + * + * several different codes to decide which quantization is better + * + *************************************************************************/ + +static double +penalties(double noise) +{ + return FAST_LOG10(0.368 + 0.632 * noise * noise * noise); +} + +static double +get_klemm_noise(const FLOAT * distort, const gr_info * const gi) +{ + int sfb; + double klemm_noise = 1E-37; + for (sfb = 0; sfb < gi->psymax; sfb++) + klemm_noise += penalties(distort[sfb]); + + return Max(1e-20, klemm_noise); +} + +inline static int +quant_compare(const int quant_comp, + const calc_noise_result * const best, + calc_noise_result * const calc, const gr_info * const gi, const FLOAT * distort) +{ + /* + noise is given in decibels (dB) relative to masking thesholds. + + over_noise: ??? (the previous comment is fully wrong) + tot_noise: ??? (the previous comment is fully wrong) + max_noise: max quantization noise + + */ + int better; + + switch (quant_comp) { + default: + case 9:{ + if (best->over_count > 0) { + /* there are distorted sfb */ + better = calc->over_SSD <= best->over_SSD; + if (calc->over_SSD == best->over_SSD) + better = calc->bits < best->bits; + } + else { + /* no distorted sfb */ + better = ((calc->max_noise < 0) && + ((calc->max_noise * 10 + calc->bits) <= + (best->max_noise * 10 + best->bits))); + } + break; + } + + case 0: + better = calc->over_count < best->over_count + || (calc->over_count == best->over_count && calc->over_noise < best->over_noise) + || (calc->over_count == best->over_count && + EQ(calc->over_noise, best->over_noise) && calc->tot_noise < best->tot_noise); + break; + + case 8: + calc->max_noise = get_klemm_noise(distort, gi); + /*lint --fallthrough */ + case 1: + better = calc->max_noise < best->max_noise; + break; + case 2: + better = calc->tot_noise < best->tot_noise; + break; + case 3: + better = (calc->tot_noise < best->tot_noise) + && (calc->max_noise < best->max_noise); + break; + case 4: + better = (calc->max_noise <= 0.0 && best->max_noise > 0.2) + || (calc->max_noise <= 0.0 && + best->max_noise < 0.0 && + best->max_noise > calc->max_noise - 0.2 && calc->tot_noise < best->tot_noise) + || (calc->max_noise <= 0.0 && + best->max_noise > 0.0 && + best->max_noise > calc->max_noise - 0.2 && + calc->tot_noise < best->tot_noise + best->over_noise) + || (calc->max_noise > 0.0 && + best->max_noise > -0.05 && + best->max_noise > calc->max_noise - 0.1 && + calc->tot_noise + calc->over_noise < best->tot_noise + best->over_noise) + || (calc->max_noise > 0.0 && + best->max_noise > -0.1 && + best->max_noise > calc->max_noise - 0.15 && + calc->tot_noise + calc->over_noise + calc->over_noise < + best->tot_noise + best->over_noise + best->over_noise); + break; + case 5: + better = calc->over_noise < best->over_noise + || (EQ(calc->over_noise, best->over_noise) && calc->tot_noise < best->tot_noise); + break; + case 6: + better = calc->over_noise < best->over_noise + || (EQ(calc->over_noise, best->over_noise) && + (calc->max_noise < best->max_noise + || (EQ(calc->max_noise, best->max_noise) && calc->tot_noise <= best->tot_noise) + )); + break; + case 7: + better = calc->over_count < best->over_count || calc->over_noise < best->over_noise; + break; + } + + + if (best->over_count == 0) { + /* + If no distorted bands, only use this quantization + if it is better, and if it uses less bits. + Unfortunately, part2_3_length is sometimes a poor + estimator of the final size at low bitrates. + */ + better = better && calc->bits < best->bits; + } + + + return better; +} + + + +/************************************************************************* + * + * amp_scalefac_bands() + * + * author/date?? + * + * Amplify the scalefactor bands that violate the masking threshold. + * See ISO 11172-3 Section C.1.5.4.3.5 + * + * distort[] = noise/masking + * distort[] > 1 ==> noise is not masked + * distort[] < 1 ==> noise is masked + * max_dist = maximum value of distort[] + * + * Three algorithms: + * noise_shaping_amp + * 0 Amplify all bands with distort[]>1. + * + * 1 Amplify all bands with distort[] >= max_dist^(.5); + * ( 50% in the db scale) + * + * 2 Amplify first band with distort[] >= max_dist; + * + * + * For algorithms 0 and 1, if max_dist < 1, then amplify all bands + * with distort[] >= .95*max_dist. This is to make sure we always + * amplify at least one band. + * + * + *************************************************************************/ +static void +amp_scalefac_bands(lame_internal_flags * gfc, + gr_info * const cod_info, FLOAT const *distort, FLOAT xrpow[576], int bRefine) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int j, sfb; + FLOAT ifqstep34, trigger; + int noise_shaping_amp; + + if (cod_info->scalefac_scale == 0) { + ifqstep34 = 1.29683955465100964055; /* 2**(.75*.5) */ + } + else { + ifqstep34 = 1.68179283050742922612; /* 2**(.75*1) */ + } + + /* compute maximum value of distort[] */ + trigger = 0; + for (sfb = 0; sfb < cod_info->sfbmax; sfb++) { + if (trigger < distort[sfb]) + trigger = distort[sfb]; + } + + noise_shaping_amp = cfg->noise_shaping_amp; + if (noise_shaping_amp == 3) { + if (bRefine == 1) + noise_shaping_amp = 2; + else + noise_shaping_amp = 1; + } + switch (noise_shaping_amp) { + case 2: + /* amplify exactly 1 band */ + break; + + case 1: + /* amplify bands within 50% of max (on db scale) */ + if (trigger > 1.0) + trigger = pow(trigger, .5); + else + trigger *= .95; + break; + + case 0: + default: + /* ISO algorithm. amplify all bands with distort>1 */ + if (trigger > 1.0) + trigger = 1.0; + else + trigger *= .95; + break; + } + + j = 0; + for (sfb = 0; sfb < cod_info->sfbmax; sfb++) { + int const width = cod_info->width[sfb]; + int l; + j += width; + if (distort[sfb] < trigger) + continue; + + if (gfc->sv_qnt.substep_shaping & 2) { + gfc->sv_qnt.pseudohalf[sfb] = !gfc->sv_qnt.pseudohalf[sfb]; + if (!gfc->sv_qnt.pseudohalf[sfb] && cfg->noise_shaping_amp == 2) + return; + } + cod_info->scalefac[sfb]++; + for (l = -width; l < 0; l++) { + xrpow[j + l] *= ifqstep34; + if (xrpow[j + l] > cod_info->xrpow_max) + cod_info->xrpow_max = xrpow[j + l]; + } + + if (cfg->noise_shaping_amp == 2) + return; + } +} + +/************************************************************************* + * + * inc_scalefac_scale() + * + * Takehiro Tominaga 2000-xx-xx + * + * turns on scalefac scale and adjusts scalefactors + * + *************************************************************************/ + +static void +inc_scalefac_scale(gr_info * const cod_info, FLOAT xrpow[576]) +{ + int l, j, sfb; + const FLOAT ifqstep34 = 1.29683955465100964055; + + j = 0; + for (sfb = 0; sfb < cod_info->sfbmax; sfb++) { + int const width = cod_info->width[sfb]; + int s = cod_info->scalefac[sfb]; + if (cod_info->preflag) + s += pretab[sfb]; + j += width; + if (s & 1) { + s++; + for (l = -width; l < 0; l++) { + xrpow[j + l] *= ifqstep34; + if (xrpow[j + l] > cod_info->xrpow_max) + cod_info->xrpow_max = xrpow[j + l]; + } + } + cod_info->scalefac[sfb] = s >> 1; + } + cod_info->preflag = 0; + cod_info->scalefac_scale = 1; +} + + + +/************************************************************************* + * + * inc_subblock_gain() + * + * Takehiro Tominaga 2000-xx-xx + * + * increases the subblock gain and adjusts scalefactors + * + *************************************************************************/ + +static int +inc_subblock_gain(const lame_internal_flags * const gfc, gr_info * const cod_info, FLOAT xrpow[576]) +{ + int sfb, window; + int *const scalefac = cod_info->scalefac; + + /* subbloc_gain can't do anything in the long block region */ + for (sfb = 0; sfb < cod_info->sfb_lmax; sfb++) { + if (scalefac[sfb] >= 16) + return 1; + } + + for (window = 0; window < 3; window++) { + int s1, s2, l, j; + s1 = s2 = 0; + + for (sfb = cod_info->sfb_lmax + window; sfb < cod_info->sfbdivide; sfb += 3) { + if (s1 < scalefac[sfb]) + s1 = scalefac[sfb]; + } + for (; sfb < cod_info->sfbmax; sfb += 3) { + if (s2 < scalefac[sfb]) + s2 = scalefac[sfb]; + } + + if (s1 < 16 && s2 < 8) + continue; + + if (cod_info->subblock_gain[window] >= 7) + return 1; + + /* even though there is no scalefactor for sfb12 + * subblock gain affects upper frequencies too, that's why + * we have to go up to SBMAX_s + */ + cod_info->subblock_gain[window]++; + j = gfc->scalefac_band.l[cod_info->sfb_lmax]; + for (sfb = cod_info->sfb_lmax + window; sfb < cod_info->sfbmax; sfb += 3) { + FLOAT amp; + int const width = cod_info->width[sfb]; + int s = scalefac[sfb]; + assert(s >= 0); + s = s - (4 >> cod_info->scalefac_scale); + if (s >= 0) { + scalefac[sfb] = s; + j += width * 3; + continue; + } + + scalefac[sfb] = 0; + { + int const gain = 210 + (s << (cod_info->scalefac_scale + 1)); + amp = IPOW20(gain); + } + j += width * (window + 1); + for (l = -width; l < 0; l++) { + xrpow[j + l] *= amp; + if (xrpow[j + l] > cod_info->xrpow_max) + cod_info->xrpow_max = xrpow[j + l]; + } + j += width * (3 - window - 1); + } + + { + FLOAT const amp = IPOW20(202); + j += cod_info->width[sfb] * (window + 1); + for (l = -cod_info->width[sfb]; l < 0; l++) { + xrpow[j + l] *= amp; + if (xrpow[j + l] > cod_info->xrpow_max) + cod_info->xrpow_max = xrpow[j + l]; + } + } + } + return 0; +} + + + +/******************************************************************** + * + * balance_noise() + * + * Takehiro Tominaga /date?? + * Robert Hegemann 2000-09-06: made a function of it + * + * amplifies scalefactor bands, + * - if all are already amplified returns 0 + * - if some bands are amplified too much: + * * try to increase scalefac_scale + * * if already scalefac_scale was set + * try on short blocks to increase subblock gain + * + ********************************************************************/ +inline static int +balance_noise(lame_internal_flags * gfc, + gr_info * const cod_info, FLOAT const *distort, FLOAT xrpow[576], int bRefine) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int status; + + amp_scalefac_bands(gfc, cod_info, distort, xrpow, bRefine); + + /* check to make sure we have not amplified too much + * loop_break returns 0 if there is an unamplified scalefac + * scale_bitcount returns 0 if no scalefactors are too large + */ + + status = loop_break(cod_info); + + if (status) + return 0; /* all bands amplified */ + + /* not all scalefactors have been amplified. so these + * scalefacs are possibly valid. encode them: + */ + status = scale_bitcount(gfc, cod_info); + + if (!status) + return 1; /* amplified some bands not exceeding limits */ + + /* some scalefactors are too large. + * lets try setting scalefac_scale=1 + */ + if (cfg->noise_shaping > 1) { + memset(&gfc->sv_qnt.pseudohalf[0], 0, sizeof(gfc->sv_qnt.pseudohalf)); + if (!cod_info->scalefac_scale) { + inc_scalefac_scale(cod_info, xrpow); + status = 0; + } + else { + if (cod_info->block_type == SHORT_TYPE && cfg->subblock_gain > 0) { + status = inc_subblock_gain(gfc, cod_info, xrpow) + || loop_break(cod_info); + } + } + } + + if (!status) { + status = scale_bitcount(gfc, cod_info); + } + return !status; +} + + + +/************************************************************************ + * + * outer_loop () + * + * Function: The outer iteration loop controls the masking conditions + * of all scalefactorbands. It computes the best scalefac and + * global gain. This module calls the inner iteration loop + * + * mt 5/99 completely rewritten to allow for bit reservoir control, + * mid/side channels with L/R or mid/side masking thresholds, + * and chooses best quantization instead of last quantization when + * no distortion free quantization can be found. + * + * added VBR support mt 5/99 + * + * some code shuffle rh 9/00 + ************************************************************************/ + +static int +outer_loop(lame_internal_flags * gfc, gr_info * const cod_info, const FLOAT * const l3_xmin, /* allowed distortion */ + FLOAT xrpow[576], /* coloured magnitudes of spectral */ + const int ch, const int targ_bits) +{ /* maximum allowed bits */ + SessionConfig_t const *const cfg = &gfc->cfg; + gr_info cod_info_w; + FLOAT save_xrpow[576]; + FLOAT distort[SFBMAX]; + calc_noise_result best_noise_info; + int huff_bits; + int better; + int age; + calc_noise_data prev_noise; + int best_part2_3_length = 9999999; + int bEndOfSearch = 0; + int bRefine = 0; + int best_ggain_pass1 = 0; + + (void) bin_search_StepSize(gfc, cod_info, targ_bits, ch, xrpow); + + if (!cfg->noise_shaping) + /* fast mode, no noise shaping, we are ready */ + return 100; /* default noise_info.over_count */ + + memset(&prev_noise, 0, sizeof(calc_noise_data)); + + + /* compute the distortion in this quantization */ + /* coefficients and thresholds both l/r (or both mid/side) */ + (void) calc_noise(cod_info, l3_xmin, distort, &best_noise_info, &prev_noise); + best_noise_info.bits = cod_info->part2_3_length; + + cod_info_w = *cod_info; + age = 0; + /* if (cfg->vbr == vbr_rh || cfg->vbr == vbr_mtrh) */ + memcpy(save_xrpow, xrpow, sizeof(FLOAT) * 576); + + while (!bEndOfSearch) { + /* BEGIN MAIN LOOP */ + do { + calc_noise_result noise_info; + int search_limit; + int maxggain = 255; + + /* When quantization with no distorted bands is found, + * allow up to X new unsuccesful tries in serial. This + * gives us more possibilities for different quant_compare modes. + * Much more than 3 makes not a big difference, it is only slower. + */ + + if (gfc->sv_qnt.substep_shaping & 2) { + search_limit = 20; + } + else { + search_limit = 3; + } + + + + /* Check if the last scalefactor band is distorted. + * in VBR mode we can't get rid of the distortion, so quit now + * and VBR mode will try again with more bits. + * (makes a 10% speed increase, the files I tested were + * binary identical, 2000/05/20 Robert Hegemann) + * distort[] > 1 means noise > allowed noise + */ + if (gfc->sv_qnt.sfb21_extra) { + if (distort[cod_info_w.sfbmax] > 1.0) + break; + if (cod_info_w.block_type == SHORT_TYPE + && (distort[cod_info_w.sfbmax + 1] > 1.0 + || distort[cod_info_w.sfbmax + 2] > 1.0)) + break; + } + + /* try a new scalefactor conbination on cod_info_w */ + if (balance_noise(gfc, &cod_info_w, distort, xrpow, bRefine) == 0) + break; + if (cod_info_w.scalefac_scale) + maxggain = 254; + + /* inner_loop starts with the initial quantization step computed above + * and slowly increases until the bits < huff_bits. + * Thus it is important not to start with too large of an inital + * quantization step. Too small is ok, but inner_loop will take longer + */ + huff_bits = targ_bits - cod_info_w.part2_length; + if (huff_bits <= 0) + break; + + /* increase quantizer stepsize until needed bits are below maximum + */ + while ((cod_info_w.part2_3_length + = count_bits(gfc, xrpow, &cod_info_w, &prev_noise)) > huff_bits + && cod_info_w.global_gain <= maxggain) + cod_info_w.global_gain++; + + if (cod_info_w.global_gain > maxggain) + break; + + if (best_noise_info.over_count == 0) { + + while ((cod_info_w.part2_3_length + = count_bits(gfc, xrpow, &cod_info_w, &prev_noise)) > best_part2_3_length + && cod_info_w.global_gain <= maxggain) + cod_info_w.global_gain++; + + if (cod_info_w.global_gain > maxggain) + break; + } + + /* compute the distortion in this quantization */ + (void) calc_noise(&cod_info_w, l3_xmin, distort, &noise_info, &prev_noise); + noise_info.bits = cod_info_w.part2_3_length; + + /* check if this quantization is better + * than our saved quantization */ + if (cod_info->block_type != SHORT_TYPE) /* NORM, START or STOP type */ + better = cfg->quant_comp; + else + better = cfg->quant_comp_short; + + + better = quant_compare(better, &best_noise_info, &noise_info, &cod_info_w, distort); + + + /* save data so we can restore this quantization later */ + if (better) { + best_part2_3_length = cod_info->part2_3_length; + best_noise_info = noise_info; + *cod_info = cod_info_w; + age = 0; + /* save data so we can restore this quantization later */ + /*if (cfg->vbr == vbr_rh || cfg->vbr == vbr_mtrh) */ { + /* store for later reuse */ + memcpy(save_xrpow, xrpow, sizeof(FLOAT) * 576); + } + } + else { + /* early stop? */ + if (cfg->full_outer_loop == 0) { + if (++age > search_limit && best_noise_info.over_count == 0) + break; + if ((cfg->noise_shaping_amp == 3) && bRefine && age > 30) + break; + if ((cfg->noise_shaping_amp == 3) && bRefine && + (cod_info_w.global_gain - best_ggain_pass1) > 15) + break; + } + } + } + while ((cod_info_w.global_gain + cod_info_w.scalefac_scale) < 255); + + if (cfg->noise_shaping_amp == 3) { + if (!bRefine) { + /* refine search */ + cod_info_w = *cod_info; + memcpy(xrpow, save_xrpow, sizeof(FLOAT) * 576); + age = 0; + best_ggain_pass1 = cod_info_w.global_gain; + + bRefine = 1; + } + else { + /* search already refined, stop */ + bEndOfSearch = 1; + } + + } + else { + bEndOfSearch = 1; + } + } + + assert((cod_info->global_gain + cod_info->scalefac_scale) <= 255); + /* finish up + */ + if (cfg->vbr == vbr_rh || cfg->vbr == vbr_mtrh || cfg->vbr == vbr_mt) + /* restore for reuse on next try */ + memcpy(xrpow, save_xrpow, sizeof(FLOAT) * 576); + /* do the 'substep shaping' + */ + else if (gfc->sv_qnt.substep_shaping & 1) + trancate_smallspectrums(gfc, cod_info, l3_xmin, xrpow); + + return best_noise_info.over_count; +} + + + + + +/************************************************************************ + * + * iteration_finish_one() + * + * Robert Hegemann 2000-09-06 + * + * update reservoir status after FINAL quantization/bitrate + * + ************************************************************************/ + +static void +iteration_finish_one(lame_internal_flags * gfc, int gr, int ch) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + III_side_info_t *const l3_side = &gfc->l3_side; + gr_info *const cod_info = &l3_side->tt[gr][ch]; + + /* try some better scalefac storage + */ + best_scalefac_store(gfc, gr, ch, l3_side); + + /* best huffman_divide may save some bits too + */ + if (cfg->use_best_huffman == 1) + best_huffman_divide(gfc, cod_info); + + /* update reservoir status after FINAL quantization/bitrate + */ + ResvAdjust(gfc, cod_info); +} + + + +/********************************************************************* + * + * VBR_encode_granule() + * + * 2000-09-04 Robert Hegemann + * + *********************************************************************/ + +static void +VBR_encode_granule(lame_internal_flags * gfc, gr_info * const cod_info, const FLOAT * const l3_xmin, /* allowed distortion of the scalefactor */ + FLOAT xrpow[576], /* coloured magnitudes of spectral values */ + const int ch, int min_bits, int max_bits) +{ + gr_info bst_cod_info; + FLOAT bst_xrpow[576]; + int const Max_bits = max_bits; + int real_bits = max_bits + 1; + int this_bits = (max_bits + min_bits) / 2; + int dbits, over, found = 0; + int const sfb21_extra = gfc->sv_qnt.sfb21_extra; + + assert(Max_bits <= MAX_BITS_PER_CHANNEL); + memset(bst_cod_info.l3_enc, 0, sizeof(bst_cod_info.l3_enc)); + + /* search within round about 40 bits of optimal + */ + do { + assert(this_bits >= min_bits); + assert(this_bits <= max_bits); + assert(min_bits <= max_bits); + + if (this_bits > Max_bits - 42) + gfc->sv_qnt.sfb21_extra = 0; + else + gfc->sv_qnt.sfb21_extra = sfb21_extra; + + over = outer_loop(gfc, cod_info, l3_xmin, xrpow, ch, this_bits); + + /* is quantization as good as we are looking for ? + * in this case: is no scalefactor band distorted? + */ + if (over <= 0) { + found = 1; + /* now we know it can be done with "real_bits" + * and maybe we can skip some iterations + */ + real_bits = cod_info->part2_3_length; + + /* store best quantization so far + */ + bst_cod_info = *cod_info; + memcpy(bst_xrpow, xrpow, sizeof(FLOAT) * 576); + + /* try with fewer bits + */ + max_bits = real_bits - 32; + dbits = max_bits - min_bits; + this_bits = (max_bits + min_bits) / 2; + } + else { + /* try with more bits + */ + min_bits = this_bits + 32; + dbits = max_bits - min_bits; + this_bits = (max_bits + min_bits) / 2; + + if (found) { + found = 2; + /* start again with best quantization so far + */ + *cod_info = bst_cod_info; + memcpy(xrpow, bst_xrpow, sizeof(FLOAT) * 576); + } + } + } while (dbits > 12); + + gfc->sv_qnt.sfb21_extra = sfb21_extra; + + /* found=0 => nothing found, use last one + * found=1 => we just found the best and left the loop + * found=2 => we restored a good one and have now l3_enc to restore too + */ + if (found == 2) { + memcpy(cod_info->l3_enc, bst_cod_info.l3_enc, sizeof(int) * 576); + } + assert(cod_info->part2_3_length <= Max_bits); + +} + + + +/************************************************************************ + * + * get_framebits() + * + * Robert Hegemann 2000-09-05 + * + * calculates + * * how many bits are available for analog silent granules + * * how many bits to use for the lowest allowed bitrate + * * how many bits each bitrate would provide + * + ************************************************************************/ + +static void +get_framebits(lame_internal_flags * gfc, int frameBits[15]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t *const eov = &gfc->ov_enc; + int bitsPerFrame, i; + + /* always use at least this many bits per granule per channel + * unless we detect analog silence, see below + */ + eov->bitrate_index = cfg->vbr_min_bitrate_index; + bitsPerFrame = getframebits(gfc); + + /* bits for analog silence + */ + eov->bitrate_index = 1; + bitsPerFrame = getframebits(gfc); + + for (i = 1; i <= cfg->vbr_max_bitrate_index; i++) { + eov->bitrate_index = i; + frameBits[i] = ResvFrameBegin(gfc, &bitsPerFrame); + } +} + + + +/********************************************************************* + * + * VBR_prepare() + * + * 2000-09-04 Robert Hegemann + * + * * converts LR to MS coding when necessary + * * calculates allowed/adjusted quantization noise amounts + * * detects analog silent frames + * + * some remarks: + * - lower masking depending on Quality setting + * - quality control together with adjusted ATH MDCT scaling + * on lower quality setting allocate more noise from + * ATH masking, and on higher quality setting allocate + * less noise from ATH masking. + * - experiments show that going more than 2dB over GPSYCHO's + * limits ends up in very annoying artefacts + * + *********************************************************************/ + +/* RH: this one needs to be overhauled sometime */ + +static int +VBR_old_prepare(lame_internal_flags * gfc, + const FLOAT pe[2][2], FLOAT const ms_ener_ratio[2], + const III_psy_ratio ratio[2][2], + FLOAT l3_xmin[2][2][SFBMAX], + int frameBits[16], int min_bits[2][2], int max_bits[2][2], int bands[2][2]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t *const eov = &gfc->ov_enc; + + FLOAT masking_lower_db, adjust = 0.0; + int gr, ch; + int analog_silence = 1; + int avg, mxb, bits = 0; + + eov->bitrate_index = cfg->vbr_max_bitrate_index; + avg = ResvFrameBegin(gfc, &avg) / cfg->mode_gr; + + get_framebits(gfc, frameBits); + + for (gr = 0; gr < cfg->mode_gr; gr++) { + mxb = on_pe(gfc, pe, max_bits[gr], avg, gr, 0); + if (gfc->ov_enc.mode_ext == MPG_MD_MS_LR) { + ms_convert(&gfc->l3_side, gr); + reduce_side(max_bits[gr], ms_ener_ratio[gr], avg, mxb); + } + for (ch = 0; ch < cfg->channels_out; ++ch) { + gr_info *const cod_info = &gfc->l3_side.tt[gr][ch]; + + if (cod_info->block_type != SHORT_TYPE) { /* NORM, START or STOP type */ + adjust = 1.28 / (1 + exp(3.5 - pe[gr][ch] / 300.)) - 0.05; + masking_lower_db = gfc->sv_qnt.mask_adjust - adjust; + } + else { + adjust = 2.56 / (1 + exp(3.5 - pe[gr][ch] / 300.)) - 0.14; + masking_lower_db = gfc->sv_qnt.mask_adjust_short - adjust; + } + gfc->sv_qnt.masking_lower = pow(10.0, masking_lower_db * 0.1); + + init_outer_loop(gfc, cod_info); + bands[gr][ch] = calc_xmin(gfc, &ratio[gr][ch], cod_info, l3_xmin[gr][ch]); + if (bands[gr][ch]) + analog_silence = 0; + + min_bits[gr][ch] = 126; + + bits += max_bits[gr][ch]; + } + } + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + if (bits > frameBits[cfg->vbr_max_bitrate_index] && bits > 0) { + max_bits[gr][ch] *= frameBits[cfg->vbr_max_bitrate_index]; + max_bits[gr][ch] /= bits; + } + if (min_bits[gr][ch] > max_bits[gr][ch]) + min_bits[gr][ch] = max_bits[gr][ch]; + + } /* for ch */ + } /* for gr */ + + return analog_silence; +} + +static void +bitpressure_strategy(lame_internal_flags const *gfc, + FLOAT l3_xmin[2][2][SFBMAX], const int min_bits[2][2], int max_bits[2][2]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int gr, ch, sfb; + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + gr_info const *const gi = &gfc->l3_side.tt[gr][ch]; + FLOAT *pxmin = l3_xmin[gr][ch]; + for (sfb = 0; sfb < gi->psy_lmax; sfb++) + *pxmin++ *= 1. + .029 * sfb * sfb / SBMAX_l / SBMAX_l; + + if (gi->block_type == SHORT_TYPE) { + for (sfb = gi->sfb_smin; sfb < SBMAX_s; sfb++) { + *pxmin++ *= 1. + .029 * sfb * sfb / SBMAX_s / SBMAX_s; + *pxmin++ *= 1. + .029 * sfb * sfb / SBMAX_s / SBMAX_s; + *pxmin++ *= 1. + .029 * sfb * sfb / SBMAX_s / SBMAX_s; + } + } + max_bits[gr][ch] = Max(min_bits[gr][ch], 0.9 * max_bits[gr][ch]); + } + } +} + +/************************************************************************ + * + * VBR_iteration_loop() + * + * tries to find out how many bits are needed for each granule and channel + * to get an acceptable quantization. An appropriate bitrate will then be + * choosed for quantization. rh 8/99 + * + * Robert Hegemann 2000-09-06 rewrite + * + ************************************************************************/ + +void +VBR_old_iteration_loop(lame_internal_flags * gfc, const FLOAT pe[2][2], + const FLOAT ms_ener_ratio[2], const III_psy_ratio ratio[2][2]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t *const eov = &gfc->ov_enc; + FLOAT l3_xmin[2][2][SFBMAX]; + + FLOAT xrpow[576]; + int bands[2][2]; + int frameBits[15]; + int used_bits; + int bits; + int min_bits[2][2], max_bits[2][2]; + int mean_bits; + int ch, gr, analog_silence; + III_side_info_t *const l3_side = &gfc->l3_side; + + analog_silence = VBR_old_prepare(gfc, pe, ms_ener_ratio, ratio, + l3_xmin, frameBits, min_bits, max_bits, bands); + + /*---------------------------------*/ + for (;;) { + + /* quantize granules with lowest possible number of bits + */ + + used_bits = 0; + + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + int ret; + gr_info *const cod_info = &l3_side->tt[gr][ch]; + + /* init_outer_loop sets up cod_info, scalefac and xrpow + */ + ret = init_xrpow(gfc, cod_info, xrpow); + if (ret == 0 || max_bits[gr][ch] == 0) { + /* xr contains no energy + * l3_enc, our encoding data, will be quantized to zero + */ + continue; /* with next channel */ + } + + VBR_encode_granule(gfc, cod_info, l3_xmin[gr][ch], xrpow, + ch, min_bits[gr][ch], max_bits[gr][ch]); + + /* do the 'substep shaping' + */ + if (gfc->sv_qnt.substep_shaping & 1) { + trancate_smallspectrums(gfc, &l3_side->tt[gr][ch], l3_xmin[gr][ch], xrpow); + } + + ret = cod_info->part2_3_length + cod_info->part2_length; + used_bits += ret; + } /* for ch */ + } /* for gr */ + + /* find lowest bitrate able to hold used bits + */ + if (analog_silence && !cfg->enforce_min_bitrate) + /* we detected analog silence and the user did not specify + * any hard framesize limit, so start with smallest possible frame + */ + eov->bitrate_index = 1; + else + eov->bitrate_index = cfg->vbr_min_bitrate_index; + + for (; eov->bitrate_index < cfg->vbr_max_bitrate_index; eov->bitrate_index++) { + if (used_bits <= frameBits[eov->bitrate_index]) + break; + } + bits = ResvFrameBegin(gfc, &mean_bits); + + if (used_bits <= bits) + break; + + bitpressure_strategy(gfc, l3_xmin, (const int (*)[2])min_bits, max_bits); + + } /* breaks adjusted */ + /*--------------------------------------*/ + + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + iteration_finish_one(gfc, gr, ch); + } /* for ch */ + } /* for gr */ + ResvFrameEnd(gfc, mean_bits); +} + + + +static int +VBR_new_prepare(lame_internal_flags * gfc, + const FLOAT pe[2][2], const III_psy_ratio ratio[2][2], + FLOAT l3_xmin[2][2][SFBMAX], int frameBits[16], int max_bits[2][2], + int* max_resv) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t *const eov = &gfc->ov_enc; + + int gr, ch; + int analog_silence = 1; + int avg, bits = 0; + int maximum_framebits; + + if (!cfg->free_format) { + eov->bitrate_index = cfg->vbr_max_bitrate_index; + (void) ResvFrameBegin(gfc, &avg); + *max_resv = gfc->sv_enc.ResvMax; + + get_framebits(gfc, frameBits); + maximum_framebits = frameBits[cfg->vbr_max_bitrate_index]; + } + else { + eov->bitrate_index = 0; + maximum_framebits = ResvFrameBegin(gfc, &avg); + frameBits[0] = maximum_framebits; + *max_resv = gfc->sv_enc.ResvMax; + } + + for (gr = 0; gr < cfg->mode_gr; gr++) { + (void) on_pe(gfc, pe, max_bits[gr], avg, gr, 0); + if (gfc->ov_enc.mode_ext == MPG_MD_MS_LR) { + ms_convert(&gfc->l3_side, gr); + } + for (ch = 0; ch < cfg->channels_out; ++ch) { + gr_info *const cod_info = &gfc->l3_side.tt[gr][ch]; + + gfc->sv_qnt.masking_lower = pow(10.0, gfc->sv_qnt.mask_adjust * 0.1); + + init_outer_loop(gfc, cod_info); + if (0 != calc_xmin(gfc, &ratio[gr][ch], cod_info, l3_xmin[gr][ch])) + analog_silence = 0; + + bits += max_bits[gr][ch]; + } + } + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + if (bits > maximum_framebits && bits > 0) { + max_bits[gr][ch] *= maximum_framebits; + max_bits[gr][ch] /= bits; + } + + } /* for ch */ + } /* for gr */ + if (analog_silence) { + *max_resv = 0; + } + return analog_silence; +} + + + +void +VBR_new_iteration_loop(lame_internal_flags * gfc, const FLOAT pe[2][2], + const FLOAT ms_ener_ratio[2], const III_psy_ratio ratio[2][2]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t *const eov = &gfc->ov_enc; + FLOAT l3_xmin[2][2][SFBMAX]; + + FLOAT xrpow[2][2][576]; + int frameBits[15]; + int used_bits; + int max_bits[2][2]; + int ch, gr, analog_silence, pad; + III_side_info_t *const l3_side = &gfc->l3_side; + + const FLOAT (*const_l3_xmin)[2][SFBMAX] = (const FLOAT (*)[2][SFBMAX])l3_xmin; + const FLOAT (*const_xrpow)[2][576] = (const FLOAT (*)[2][576])xrpow; + const int (*const_max_bits)[2] = (const int (*)[2])max_bits; + + (void) ms_ener_ratio; /* not used */ + + memset(xrpow, 0, sizeof(xrpow)); + + analog_silence = VBR_new_prepare(gfc, pe, ratio, l3_xmin, frameBits, max_bits, &pad); + + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + gr_info *const cod_info = &l3_side->tt[gr][ch]; + + /* init_outer_loop sets up cod_info, scalefac and xrpow + */ + if (0 == init_xrpow(gfc, cod_info, xrpow[gr][ch])) { + max_bits[gr][ch] = 0; /* silent granule needs no bits */ + } + } /* for ch */ + } /* for gr */ + + /* quantize granules with lowest possible number of bits + */ + + used_bits = VBR_encode_frame(gfc, const_xrpow, const_l3_xmin, const_max_bits); + + if (!cfg->free_format) { + int i, j; + + /* find lowest bitrate able to hold used bits + */ + if (analog_silence && !cfg->enforce_min_bitrate) { + /* we detected analog silence and the user did not specify + * any hard framesize limit, so start with smallest possible frame + */ + i = 1; + } + else { + i = cfg->vbr_min_bitrate_index; + } + + for (; i < cfg->vbr_max_bitrate_index; i++) { + if (used_bits <= frameBits[i]) + break; + } + if (i > cfg->vbr_max_bitrate_index) { + i = cfg->vbr_max_bitrate_index; + } + if (pad > 0) { + for (j = cfg->vbr_max_bitrate_index; j > i; --j) { + int const unused = frameBits[j] - used_bits; + if (unused <= pad) + break; + } + eov->bitrate_index = j; + } + else { + eov->bitrate_index = i; + } + } + else { +#if 0 + static int mmm = 0; + int fff = getFramesize_kbps(gfc, used_bits); + int hhh = getFramesize_kbps(gfc, MAX_BITS_PER_GRANULE * cfg->mode_gr); + if (mmm < fff) + mmm = fff; + printf("demand=%3d kbps max=%3d kbps limit=%3d kbps\n", fff, mmm, hhh); +#endif + eov->bitrate_index = 0; + } + if (used_bits <= frameBits[eov->bitrate_index]) { + /* update Reservoire status */ + int mean_bits, fullframebits; + fullframebits = ResvFrameBegin(gfc, &mean_bits); + assert(used_bits <= fullframebits); + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + gr_info const *const cod_info = &l3_side->tt[gr][ch]; + ResvAdjust(gfc, cod_info); + } + } + ResvFrameEnd(gfc, mean_bits); + } + else { + /* SHOULD NOT HAPPEN INTERNAL ERROR + */ + ERRORF(gfc, "INTERNAL ERROR IN VBR NEW CODE, please send bug report\n"); + exit(-1); + } +} + + + + + +/******************************************************************** + * + * calc_target_bits() + * + * calculates target bits for ABR encoding + * + * mt 2000/05/31 + * + ********************************************************************/ + +static void +calc_target_bits(lame_internal_flags * gfc, + const FLOAT pe[2][2], + FLOAT const ms_ener_ratio[2], + int targ_bits[2][2], int *analog_silence_bits, int *max_frame_bits) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t *const eov = &gfc->ov_enc; + III_side_info_t const *const l3_side = &gfc->l3_side; + FLOAT res_factor; + int gr, ch, totbits, mean_bits; + int framesize = 576 * cfg->mode_gr; + + eov->bitrate_index = cfg->vbr_max_bitrate_index; + *max_frame_bits = ResvFrameBegin(gfc, &mean_bits); + + eov->bitrate_index = 1; + mean_bits = getframebits(gfc) - cfg->sideinfo_len * 8; + *analog_silence_bits = mean_bits / (cfg->mode_gr * cfg->channels_out); + + mean_bits = cfg->vbr_avg_bitrate_kbps * framesize * 1000; + if (gfc->sv_qnt.substep_shaping & 1) + mean_bits *= 1.09; + mean_bits /= cfg->samplerate_out; + mean_bits -= cfg->sideinfo_len * 8; + mean_bits /= (cfg->mode_gr * cfg->channels_out); + + /* + res_factor is the percentage of the target bitrate that should + be used on average. the remaining bits are added to the + bitreservoir and used for difficult to encode frames. + + Since we are tracking the average bitrate, we should adjust + res_factor "on the fly", increasing it if the average bitrate + is greater than the requested bitrate, and decreasing it + otherwise. Reasonable ranges are from .9 to 1.0 + + Until we get the above suggestion working, we use the following + tuning: + compression ratio res_factor + 5.5 (256kbps) 1.0 no need for bitreservoir + 11 (128kbps) .93 7% held for reservoir + + with linear interpolation for other values. + + */ + res_factor = .93 + .07 * (11.0 - cfg->compression_ratio) / (11.0 - 5.5); + if (res_factor < .90) + res_factor = .90; + if (res_factor > 1.00) + res_factor = 1.00; + + for (gr = 0; gr < cfg->mode_gr; gr++) { + int sum = 0; + for (ch = 0; ch < cfg->channels_out; ch++) { + targ_bits[gr][ch] = res_factor * mean_bits; + + if (pe[gr][ch] > 700) { + int add_bits = (pe[gr][ch] - 700) / 1.4; + + gr_info const *const cod_info = &l3_side->tt[gr][ch]; + targ_bits[gr][ch] = res_factor * mean_bits; + + /* short blocks use a little extra, no matter what the pe */ + if (cod_info->block_type == SHORT_TYPE) { + if (add_bits < mean_bits / 2) + add_bits = mean_bits / 2; + } + /* at most increase bits by 1.5*average */ + if (add_bits > mean_bits * 3 / 2) + add_bits = mean_bits * 3 / 2; + else if (add_bits < 0) + add_bits = 0; + + targ_bits[gr][ch] += add_bits; + } + if (targ_bits[gr][ch] > MAX_BITS_PER_CHANNEL) { + targ_bits[gr][ch] = MAX_BITS_PER_CHANNEL; + } + sum += targ_bits[gr][ch]; + } /* for ch */ + if (sum > MAX_BITS_PER_GRANULE) { + for (ch = 0; ch < cfg->channels_out; ++ch) { + targ_bits[gr][ch] *= MAX_BITS_PER_GRANULE; + targ_bits[gr][ch] /= sum; + } + } + } /* for gr */ + + if (gfc->ov_enc.mode_ext == MPG_MD_MS_LR) + for (gr = 0; gr < cfg->mode_gr; gr++) { + reduce_side(targ_bits[gr], ms_ener_ratio[gr], mean_bits * cfg->channels_out, + MAX_BITS_PER_GRANULE); + } + + /* sum target bits + */ + totbits = 0; + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + if (targ_bits[gr][ch] > MAX_BITS_PER_CHANNEL) + targ_bits[gr][ch] = MAX_BITS_PER_CHANNEL; + totbits += targ_bits[gr][ch]; + } + } + + /* repartion target bits if needed + */ + if (totbits > *max_frame_bits && totbits > 0) { + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + targ_bits[gr][ch] *= *max_frame_bits; + targ_bits[gr][ch] /= totbits; + } + } + } +} + + + + + + +/******************************************************************** + * + * ABR_iteration_loop() + * + * encode a frame with a disired average bitrate + * + * mt 2000/05/31 + * + ********************************************************************/ + +void +ABR_iteration_loop(lame_internal_flags * gfc, const FLOAT pe[2][2], + const FLOAT ms_ener_ratio[2], const III_psy_ratio ratio[2][2]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncResult_t *const eov = &gfc->ov_enc; + FLOAT l3_xmin[SFBMAX]; + FLOAT xrpow[576]; + int targ_bits[2][2]; + int mean_bits, max_frame_bits; + int ch, gr, ath_over; + int analog_silence_bits; + gr_info *cod_info; + III_side_info_t *const l3_side = &gfc->l3_side; + + mean_bits = 0; + + calc_target_bits(gfc, pe, ms_ener_ratio, targ_bits, &analog_silence_bits, &max_frame_bits); + + /* encode granules + */ + for (gr = 0; gr < cfg->mode_gr; gr++) { + + if (gfc->ov_enc.mode_ext == MPG_MD_MS_LR) { + ms_convert(&gfc->l3_side, gr); + } + for (ch = 0; ch < cfg->channels_out; ch++) { + FLOAT adjust, masking_lower_db; + cod_info = &l3_side->tt[gr][ch]; + + if (cod_info->block_type != SHORT_TYPE) { /* NORM, START or STOP type */ + /* adjust = 1.28/(1+exp(3.5-pe[gr][ch]/300.))-0.05; */ + adjust = 0; + masking_lower_db = gfc->sv_qnt.mask_adjust - adjust; + } + else { + /* adjust = 2.56/(1+exp(3.5-pe[gr][ch]/300.))-0.14; */ + adjust = 0; + masking_lower_db = gfc->sv_qnt.mask_adjust_short - adjust; + } + gfc->sv_qnt.masking_lower = pow(10.0, masking_lower_db * 0.1); + + + /* cod_info, scalefac and xrpow get initialized in init_outer_loop + */ + init_outer_loop(gfc, cod_info); + if (init_xrpow(gfc, cod_info, xrpow)) { + /* xr contains energy we will have to encode + * calculate the masking abilities + * find some good quantization in outer_loop + */ + ath_over = calc_xmin(gfc, &ratio[gr][ch], cod_info, l3_xmin); + if (0 == ath_over) /* analog silence */ + targ_bits[gr][ch] = analog_silence_bits; + + (void) outer_loop(gfc, cod_info, l3_xmin, xrpow, ch, targ_bits[gr][ch]); + } + iteration_finish_one(gfc, gr, ch); + } /* ch */ + } /* gr */ + + /* find a bitrate which can refill the resevoir to positive size. + */ + for (eov->bitrate_index = cfg->vbr_min_bitrate_index; + eov->bitrate_index <= cfg->vbr_max_bitrate_index; eov->bitrate_index++) { + if (ResvFrameBegin(gfc, &mean_bits) >= 0) + break; + } + assert(eov->bitrate_index <= cfg->vbr_max_bitrate_index); + + ResvFrameEnd(gfc, mean_bits); +} + + + + + + +/************************************************************************ + * + * CBR_iteration_loop() + * + * author/date?? + * + * encodes one frame of MP3 data with constant bitrate + * + ************************************************************************/ + +void +CBR_iteration_loop(lame_internal_flags * gfc, const FLOAT pe[2][2], + const FLOAT ms_ener_ratio[2], const III_psy_ratio ratio[2][2]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + FLOAT l3_xmin[SFBMAX]; + FLOAT xrpow[576]; + int targ_bits[2]; + int mean_bits, max_bits; + int gr, ch; + III_side_info_t *const l3_side = &gfc->l3_side; + gr_info *cod_info; + + (void) ResvFrameBegin(gfc, &mean_bits); + + /* quantize! */ + for (gr = 0; gr < cfg->mode_gr; gr++) { + + /* calculate needed bits + */ + max_bits = on_pe(gfc, pe, targ_bits, mean_bits, gr, gr); + + if (gfc->ov_enc.mode_ext == MPG_MD_MS_LR) { + ms_convert(&gfc->l3_side, gr); + reduce_side(targ_bits, ms_ener_ratio[gr], mean_bits, max_bits); + } + + for (ch = 0; ch < cfg->channels_out; ch++) { + FLOAT adjust, masking_lower_db; + cod_info = &l3_side->tt[gr][ch]; + + if (cod_info->block_type != SHORT_TYPE) { /* NORM, START or STOP type */ + /* adjust = 1.28/(1+exp(3.5-pe[gr][ch]/300.))-0.05; */ + adjust = 0; + masking_lower_db = gfc->sv_qnt.mask_adjust - adjust; + } + else { + /* adjust = 2.56/(1+exp(3.5-pe[gr][ch]/300.))-0.14; */ + adjust = 0; + masking_lower_db = gfc->sv_qnt.mask_adjust_short - adjust; + } + gfc->sv_qnt.masking_lower = pow(10.0, masking_lower_db * 0.1); + + /* init_outer_loop sets up cod_info, scalefac and xrpow + */ + init_outer_loop(gfc, cod_info); + if (init_xrpow(gfc, cod_info, xrpow)) { + /* xr contains energy we will have to encode + * calculate the masking abilities + * find some good quantization in outer_loop + */ + (void) calc_xmin(gfc, &ratio[gr][ch], cod_info, l3_xmin); + (void) outer_loop(gfc, cod_info, l3_xmin, xrpow, ch, targ_bits[ch]); + } + + iteration_finish_one(gfc, gr, ch); + assert(cod_info->part2_3_length <= MAX_BITS_PER_CHANNEL); + assert(cod_info->part2_3_length <= targ_bits[ch]); + } /* for ch */ + } /* for gr */ + + ResvFrameEnd(gfc, mean_bits); +} diff --git a/node_modules/lame/deps/lame/libmp3lame/quantize.h b/node_modules/lame/deps/lame/libmp3lame/quantize.h new file mode 100644 index 0000000..56edcc7 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/quantize.h @@ -0,0 +1,38 @@ +/* + * MP3 quantization + * + * Copyright (c) 1999 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_QUANTIZE_H +#define LAME_QUANTIZE_H + +void CBR_iteration_loop(lame_internal_flags * gfc, const FLOAT pe[2][2], + const FLOAT ms_ratio[2], const III_psy_ratio ratio[2][2]); + +void VBR_old_iteration_loop(lame_internal_flags * gfc, const FLOAT pe[2][2], + const FLOAT ms_ratio[2], const III_psy_ratio ratio[2][2]); + +void VBR_new_iteration_loop(lame_internal_flags * gfc, const FLOAT pe[2][2], + const FLOAT ms_ratio[2], const III_psy_ratio ratio[2][2]); + +void ABR_iteration_loop(lame_internal_flags * gfc, const FLOAT pe[2][2], + const FLOAT ms_ratio[2], const III_psy_ratio ratio[2][2]); + + +#endif /* LAME_QUANTIZE_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/quantize_pvt.c b/node_modules/lame/deps/lame/libmp3lame/quantize_pvt.c new file mode 100644 index 0000000..26b4d26 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/quantize_pvt.c @@ -0,0 +1,1073 @@ +/* + * quantize_pvt source file + * + * Copyright (c) 1999-2002 Takehiro Tominaga + * Copyright (c) 2000-2012 Robert Hegemann + * Copyright (c) 2001 Naoki Shibata + * Copyright (c) 2002-2005 Gabriel Bouvigne + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: quantize_pvt.c,v 1.169.2.2 2012/02/07 13:40:37 robert Exp $ */ +#ifdef HAVE_CONFIG_H +# include +#endif + + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "quantize_pvt.h" +#include "reservoir.h" +#include "lame-analysis.h" +#include + + +#define NSATHSCALE 100 /* Assuming dynamic range=96dB, this value should be 92 */ + +/* + The following table is used to implement the scalefactor + partitioning for MPEG2 as described in section + 2.4.3.2 of the IS. The indexing corresponds to the + way the tables are presented in the IS: + + [table_number][row_in_table][column of nr_of_sfb] +*/ +const int nr_of_sfb_block[6][3][4] = { + { + {6, 5, 5, 5}, + {9, 9, 9, 9}, + {6, 9, 9, 9} + }, + { + {6, 5, 7, 3}, + {9, 9, 12, 6}, + {6, 9, 12, 6} + }, + { + {11, 10, 0, 0}, + {18, 18, 0, 0}, + {15, 18, 0, 0} + }, + { + {7, 7, 7, 0}, + {12, 12, 12, 0}, + {6, 15, 12, 0} + }, + { + {6, 6, 6, 3}, + {12, 9, 9, 6}, + {6, 12, 9, 6} + }, + { + {8, 8, 5, 0}, + {15, 12, 9, 0}, + {6, 18, 9, 0} + } +}; + + +/* Table B.6: layer3 preemphasis */ +const int pretab[SBMAX_l] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 0 +}; + +/* + Here are MPEG1 Table B.8 and MPEG2 Table B.1 + -- Layer III scalefactor bands. + Index into this using a method such as: + idx = fr_ps->header->sampling_frequency + + (fr_ps->header->version * 3) +*/ + + +const scalefac_struct sfBandIndex[9] = { + { /* Table B.2.b: 22.05 kHz */ + {0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, + 522, 576}, + {0, 4, 8, 12, 18, 24, 32, 42, 56, 74, 100, 132, 174, 192} + , {0, 0, 0, 0, 0, 0, 0} /* sfb21 pseudo sub bands */ + , {0, 0, 0, 0, 0, 0, 0} /* sfb12 pseudo sub bands */ + }, + { /* Table B.2.c: 24 kHz */ /* docs: 332. mpg123(broken): 330 */ + {0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 114, 136, 162, 194, 232, 278, 332, 394, 464, + 540, 576}, + {0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 136, 180, 192} + , {0, 0, 0, 0, 0, 0, 0} /* sfb21 pseudo sub bands */ + , {0, 0, 0, 0, 0, 0, 0} /* sfb12 pseudo sub bands */ + }, + { /* Table B.2.a: 16 kHz */ + {0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, + 522, 576}, + {0, 4, 8, 12, 18, 26, 36, 48, 62, 80, 104, 134, 174, 192} + , {0, 0, 0, 0, 0, 0, 0} /* sfb21 pseudo sub bands */ + , {0, 0, 0, 0, 0, 0, 0} /* sfb12 pseudo sub bands */ + }, + { /* Table B.8.b: 44.1 kHz */ + {0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 196, 238, 288, 342, 418, + 576}, + {0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136, 192} + , {0, 0, 0, 0, 0, 0, 0} /* sfb21 pseudo sub bands */ + , {0, 0, 0, 0, 0, 0, 0} /* sfb12 pseudo sub bands */ + }, + { /* Table B.8.c: 48 kHz */ + {0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 190, 230, 276, 330, 384, + 576}, + {0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126, 192} + , {0, 0, 0, 0, 0, 0, 0} /* sfb21 pseudo sub bands */ + , {0, 0, 0, 0, 0, 0, 0} /* sfb12 pseudo sub bands */ + }, + { /* Table B.8.a: 32 kHz */ + {0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 240, 296, 364, 448, 550, + 576}, + {0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138, 180, 192} + , {0, 0, 0, 0, 0, 0, 0} /* sfb21 pseudo sub bands */ + , {0, 0, 0, 0, 0, 0, 0} /* sfb12 pseudo sub bands */ + }, + { /* MPEG-2.5 11.025 kHz */ + {0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, + 522, 576}, + {0 / 3, 12 / 3, 24 / 3, 36 / 3, 54 / 3, 78 / 3, 108 / 3, 144 / 3, 186 / 3, 240 / 3, 312 / 3, + 402 / 3, 522 / 3, 576 / 3} + , {0, 0, 0, 0, 0, 0, 0} /* sfb21 pseudo sub bands */ + , {0, 0, 0, 0, 0, 0, 0} /* sfb12 pseudo sub bands */ + }, + { /* MPEG-2.5 12 kHz */ + {0, 6, 12, 18, 24, 30, 36, 44, 54, 66, 80, 96, 116, 140, 168, 200, 238, 284, 336, 396, 464, + 522, 576}, + {0 / 3, 12 / 3, 24 / 3, 36 / 3, 54 / 3, 78 / 3, 108 / 3, 144 / 3, 186 / 3, 240 / 3, 312 / 3, + 402 / 3, 522 / 3, 576 / 3} + , {0, 0, 0, 0, 0, 0, 0} /* sfb21 pseudo sub bands */ + , {0, 0, 0, 0, 0, 0, 0} /* sfb12 pseudo sub bands */ + }, + { /* MPEG-2.5 8 kHz */ + {0, 12, 24, 36, 48, 60, 72, 88, 108, 132, 160, 192, 232, 280, 336, 400, 476, 566, 568, 570, + 572, 574, 576}, + {0 / 3, 24 / 3, 48 / 3, 72 / 3, 108 / 3, 156 / 3, 216 / 3, 288 / 3, 372 / 3, 480 / 3, 486 / 3, + 492 / 3, 498 / 3, 576 / 3} + , {0, 0, 0, 0, 0, 0, 0} /* sfb21 pseudo sub bands */ + , {0, 0, 0, 0, 0, 0, 0} /* sfb12 pseudo sub bands */ + } +}; + + + +FLOAT pow20[Q_MAX + Q_MAX2 + 1]; +FLOAT ipow20[Q_MAX]; +FLOAT pow43[PRECALC_SIZE]; +/* initialized in first call to iteration_init */ +#ifdef TAKEHIRO_IEEE754_HACK +FLOAT adj43asm[PRECALC_SIZE]; +#else +FLOAT adj43[PRECALC_SIZE]; +#endif + +/* +compute the ATH for each scalefactor band +cd range: 0..96db + +Input: 3.3kHz signal 32767 amplitude (3.3kHz is where ATH is smallest = -5db) +longblocks: sfb=12 en0/bw=-11db max_en0 = 1.3db +shortblocks: sfb=5 -9db 0db + +Input: 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 (repeated) +longblocks: amp=1 sfb=12 en0/bw=-103 db max_en0 = -92db + amp=32767 sfb=12 -12 db -1.4db + +Input: 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 (repeated) +shortblocks: amp=1 sfb=5 en0/bw= -99 -86 + amp=32767 sfb=5 -9 db 4db + + +MAX energy of largest wave at 3.3kHz = 1db +AVE energy of largest wave at 3.3kHz = -11db +Let's take AVE: -11db = maximum signal in sfb=12. +Dynamic range of CD: 96db. Therefor energy of smallest audible wave +in sfb=12 = -11 - 96 = -107db = ATH at 3.3kHz. + +ATH formula for this wave: -5db. To adjust to LAME scaling, we need +ATH = ATH_formula - 103 (db) +ATH = ATH * 2.5e-10 (ener) + +*/ + +static FLOAT +ATHmdct(SessionConfig_t const *cfg, FLOAT f) +{ + FLOAT ath; + + ath = ATHformula(cfg, f); + + if (cfg->ATHfixpoint > 0) { + ath -= cfg->ATHfixpoint; + } + else { + ath -= NSATHSCALE; + } + ath += cfg->ATH_offset_db; + + /* modify the MDCT scaling for the ATH and convert to energy */ + ath = powf(10.0f, ath * 0.1f); + return ath; +} + +static void +compute_ath(lame_internal_flags const* gfc) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + FLOAT *const ATH_l = gfc->ATH->l; + FLOAT *const ATH_psfb21 = gfc->ATH->psfb21; + FLOAT *const ATH_s = gfc->ATH->s; + FLOAT *const ATH_psfb12 = gfc->ATH->psfb12; + int sfb, i, start, end; + FLOAT ATH_f; + FLOAT const samp_freq = cfg->samplerate_out; + + for (sfb = 0; sfb < SBMAX_l; sfb++) { + start = gfc->scalefac_band.l[sfb]; + end = gfc->scalefac_band.l[sfb + 1]; + ATH_l[sfb] = FLOAT_MAX; + for (i = start; i < end; i++) { + FLOAT const freq = i * samp_freq / (2 * 576); + ATH_f = ATHmdct(cfg, freq); /* freq in kHz */ + ATH_l[sfb] = Min(ATH_l[sfb], ATH_f); + } + } + + for (sfb = 0; sfb < PSFB21; sfb++) { + start = gfc->scalefac_band.psfb21[sfb]; + end = gfc->scalefac_band.psfb21[sfb + 1]; + ATH_psfb21[sfb] = FLOAT_MAX; + for (i = start; i < end; i++) { + FLOAT const freq = i * samp_freq / (2 * 576); + ATH_f = ATHmdct(cfg, freq); /* freq in kHz */ + ATH_psfb21[sfb] = Min(ATH_psfb21[sfb], ATH_f); + } + } + + for (sfb = 0; sfb < SBMAX_s; sfb++) { + start = gfc->scalefac_band.s[sfb]; + end = gfc->scalefac_band.s[sfb + 1]; + ATH_s[sfb] = FLOAT_MAX; + for (i = start; i < end; i++) { + FLOAT const freq = i * samp_freq / (2 * 192); + ATH_f = ATHmdct(cfg, freq); /* freq in kHz */ + ATH_s[sfb] = Min(ATH_s[sfb], ATH_f); + } + ATH_s[sfb] *= (gfc->scalefac_band.s[sfb + 1] - gfc->scalefac_band.s[sfb]); + } + + for (sfb = 0; sfb < PSFB12; sfb++) { + start = gfc->scalefac_band.psfb12[sfb]; + end = gfc->scalefac_band.psfb12[sfb + 1]; + ATH_psfb12[sfb] = FLOAT_MAX; + for (i = start; i < end; i++) { + FLOAT const freq = i * samp_freq / (2 * 192); + ATH_f = ATHmdct(cfg, freq); /* freq in kHz */ + ATH_psfb12[sfb] = Min(ATH_psfb12[sfb], ATH_f); + } + /*not sure about the following */ + ATH_psfb12[sfb] *= (gfc->scalefac_band.s[13] - gfc->scalefac_band.s[12]); + } + + + /* no-ATH mode: + * reduce ATH to -200 dB + */ + + if (cfg->noATH) { + for (sfb = 0; sfb < SBMAX_l; sfb++) { + ATH_l[sfb] = 1E-20; + } + for (sfb = 0; sfb < PSFB21; sfb++) { + ATH_psfb21[sfb] = 1E-20; + } + for (sfb = 0; sfb < SBMAX_s; sfb++) { + ATH_s[sfb] = 1E-20; + } + for (sfb = 0; sfb < PSFB12; sfb++) { + ATH_psfb12[sfb] = 1E-20; + } + } + + /* work in progress, don't rely on it too much + */ + gfc->ATH->floor = 10. * log10(ATHmdct(cfg, -1.)); + + /* + { FLOAT g=10000, t=1e30, x; + for ( f = 100; f < 10000; f++ ) { + x = ATHmdct( cfg, f ); + if ( t > x ) t = x, g = f; + } + printf("min=%g\n", g); + } */ +} + + +static float const payload_long[2][4] = +{ {-0.000f, -0.000f, -0.000f, +0.000f} +, {-0.500f, -0.250f, -0.025f, +0.500f} +}; +static float const payload_short[2][4] = +{ {-0.000f, -0.000f, -0.000f, +0.000f} +, {-2.000f, -1.000f, -0.050f, +0.500f} +}; + +/************************************************************************/ +/* initialization for iteration_loop */ +/************************************************************************/ +void +iteration_init(lame_internal_flags * gfc) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + III_side_info_t *const l3_side = &gfc->l3_side; + FLOAT adjust, db; + int i, sel; + + if (gfc->iteration_init_init == 0) { + gfc->iteration_init_init = 1; + + l3_side->main_data_begin = 0; + compute_ath(gfc); + + pow43[0] = 0.0; + for (i = 1; i < PRECALC_SIZE; i++) + pow43[i] = pow((FLOAT) i, 4.0 / 3.0); + +#ifdef TAKEHIRO_IEEE754_HACK + adj43asm[0] = 0.0; + for (i = 1; i < PRECALC_SIZE; i++) + adj43asm[i] = i - 0.5 - pow(0.5 * (pow43[i - 1] + pow43[i]), 0.75); +#else + for (i = 0; i < PRECALC_SIZE - 1; i++) + adj43[i] = (i + 1) - pow(0.5 * (pow43[i] + pow43[i + 1]), 0.75); + adj43[i] = 0.5; +#endif + for (i = 0; i < Q_MAX; i++) + ipow20[i] = pow(2.0, (double) (i - 210) * -0.1875); + for (i = 0; i <= Q_MAX + Q_MAX2; i++) + pow20[i] = pow(2.0, (double) (i - 210 - Q_MAX2) * 0.25); + + huffman_init(gfc); + init_xrpow_core_init(gfc); + + sel = 1;/* RH: all modes like vbr-new (cfg->vbr == vbr_mt || cfg->vbr == vbr_mtrh) ? 1 : 0;*/ + + /* long */ + db = cfg->adjust_bass_db + payload_long[sel][0]; + adjust = powf(10.f, db * 0.1f); + for (i = 0; i <= 6; ++i) { + gfc->sv_qnt.longfact[i] = adjust; + } + db = cfg->adjust_alto_db + payload_long[sel][1]; + adjust = powf(10.f, db * 0.1f); + for (; i <= 13; ++i) { + gfc->sv_qnt.longfact[i] = adjust; + } + db = cfg->adjust_treble_db + payload_long[sel][2]; + adjust = powf(10.f, db * 0.1f); + for (; i <= 20; ++i) { + gfc->sv_qnt.longfact[i] = adjust; + } + db = cfg->adjust_sfb21_db + payload_long[sel][3]; + adjust = powf(10.f, db * 0.1f); + for (; i < SBMAX_l; ++i) { + gfc->sv_qnt.longfact[i] = adjust; + } + + /* short */ + db = cfg->adjust_bass_db + payload_short[sel][0]; + adjust = powf(10.f, db * 0.1f); + for (i = 0; i <= 2; ++i) { + gfc->sv_qnt.shortfact[i] = adjust; + } + db = cfg->adjust_alto_db + payload_short[sel][1]; + adjust = powf(10.f, db * 0.1f); + for (; i <= 6; ++i) { + gfc->sv_qnt.shortfact[i] = adjust; + } + db = cfg->adjust_treble_db + payload_short[sel][2]; + adjust = powf(10.f, db * 0.1f); + for (; i <= 11; ++i) { + gfc->sv_qnt.shortfact[i] = adjust; + } + db = cfg->adjust_sfb21_db + payload_short[sel][3]; + adjust = powf(10.f, db * 0.1f); + for (; i < SBMAX_s; ++i) { + gfc->sv_qnt.shortfact[i] = adjust; + } + } +} + + + + + +/************************************************************************ + * allocate bits among 2 channels based on PE + * mt 6/99 + * bugfixes rh 8/01: often allocated more than the allowed 4095 bits + ************************************************************************/ +int +on_pe(lame_internal_flags * gfc, const FLOAT pe[][2], int targ_bits[2], int mean_bits, int gr, int cbr) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int extra_bits = 0, tbits, bits; + int add_bits[2] = {0, 0}; + int max_bits; /* maximum allowed bits for this granule */ + int ch; + + /* allocate targ_bits for granule */ + ResvMaxBits(gfc, mean_bits, &tbits, &extra_bits, cbr); + max_bits = tbits + extra_bits; + if (max_bits > MAX_BITS_PER_GRANULE) /* hard limit per granule */ + max_bits = MAX_BITS_PER_GRANULE; + + for (bits = 0, ch = 0; ch < cfg->channels_out; ++ch) { + /****************************************************************** + * allocate bits for each channel + ******************************************************************/ + targ_bits[ch] = Min(MAX_BITS_PER_CHANNEL, tbits / cfg->channels_out); + + add_bits[ch] = targ_bits[ch] * pe[gr][ch] / 700.0 - targ_bits[ch]; + + /* at most increase bits by 1.5*average */ + if (add_bits[ch] > mean_bits * 3 / 4) + add_bits[ch] = mean_bits * 3 / 4; + if (add_bits[ch] < 0) + add_bits[ch] = 0; + + if (add_bits[ch] + targ_bits[ch] > MAX_BITS_PER_CHANNEL) + add_bits[ch] = Max(0, MAX_BITS_PER_CHANNEL - targ_bits[ch]); + + bits += add_bits[ch]; + } + if (bits > extra_bits && bits > 0) { + for (ch = 0; ch < cfg->channels_out; ++ch) { + add_bits[ch] = extra_bits * add_bits[ch] / bits; + } + } + + for (ch = 0; ch < cfg->channels_out; ++ch) { + targ_bits[ch] += add_bits[ch]; + extra_bits -= add_bits[ch]; + } + + for (bits = 0, ch = 0; ch < cfg->channels_out; ++ch) { + bits += targ_bits[ch]; + } + if (bits > MAX_BITS_PER_GRANULE) { + int sum = 0; + for (ch = 0; ch < cfg->channels_out; ++ch) { + targ_bits[ch] *= MAX_BITS_PER_GRANULE; + targ_bits[ch] /= bits; + sum += targ_bits[ch]; + } + assert(sum <= MAX_BITS_PER_GRANULE); + } + + return max_bits; +} + + + + +void +reduce_side(int targ_bits[2], FLOAT ms_ener_ratio, int mean_bits, int max_bits) +{ + int move_bits; + FLOAT fac; + + assert(max_bits <= MAX_BITS_PER_GRANULE); + assert(targ_bits[0] + targ_bits[1] <= MAX_BITS_PER_GRANULE); + + /* ms_ener_ratio = 0: allocate 66/33 mid/side fac=.33 + * ms_ener_ratio =.5: allocate 50/50 mid/side fac= 0 */ + /* 75/25 split is fac=.5 */ + /* float fac = .50*(.5-ms_ener_ratio[gr])/.5; */ + fac = .33 * (.5 - ms_ener_ratio) / .5; + if (fac < 0) + fac = 0; + if (fac > .5) + fac = .5; + + /* number of bits to move from side channel to mid channel */ + /* move_bits = fac*targ_bits[1]; */ + move_bits = fac * .5 * (targ_bits[0] + targ_bits[1]); + + if (move_bits > MAX_BITS_PER_CHANNEL - targ_bits[0]) { + move_bits = MAX_BITS_PER_CHANNEL - targ_bits[0]; + } + if (move_bits < 0) + move_bits = 0; + + if (targ_bits[1] >= 125) { + /* dont reduce side channel below 125 bits */ + if (targ_bits[1] - move_bits > 125) { + + /* if mid channel already has 2x more than average, dont bother */ + /* mean_bits = bits per granule (for both channels) */ + if (targ_bits[0] < mean_bits) + targ_bits[0] += move_bits; + targ_bits[1] -= move_bits; + } + else { + targ_bits[0] += targ_bits[1] - 125; + targ_bits[1] = 125; + } + } + + move_bits = targ_bits[0] + targ_bits[1]; + if (move_bits > max_bits) { + targ_bits[0] = (max_bits * targ_bits[0]) / move_bits; + targ_bits[1] = (max_bits * targ_bits[1]) / move_bits; + } + assert(targ_bits[0] <= MAX_BITS_PER_CHANNEL); + assert(targ_bits[1] <= MAX_BITS_PER_CHANNEL); + assert(targ_bits[0] + targ_bits[1] <= MAX_BITS_PER_GRANULE); +} + + +/** + * Robert Hegemann 2001-04-27: + * this adjusts the ATH, keeping the original noise floor + * affects the higher frequencies more than the lower ones + */ + +FLOAT +athAdjust(FLOAT a, FLOAT x, FLOAT athFloor, float ATHfixpoint) +{ + /* work in progress + */ + FLOAT const o = 90.30873362f; + FLOAT const p = (ATHfixpoint < 1.f) ? 94.82444863f : ATHfixpoint; + FLOAT u = FAST_LOG10_X(x, 10.0f); + FLOAT const v = a * a; + FLOAT w = 0.0f; + u -= athFloor; /* undo scaling */ + if (v > 1E-20f) + w = 1.f + FAST_LOG10_X(v, 10.0f / o); + if (w < 0) + w = 0.f; + u *= w; + u += athFloor + o - p; /* redo scaling */ + + return powf(10.f, 0.1f * u); +} + + + +/*************************************************************************/ +/* calc_xmin */ +/*************************************************************************/ + +/* + Calculate the allowed distortion for each scalefactor band, + as determined by the psychoacoustic model. + xmin(sb) = ratio(sb) * en(sb) / bw(sb) + + returns number of sfb's with energy > ATH +*/ + +int +calc_xmin(lame_internal_flags const *gfc, + III_psy_ratio const *const ratio, gr_info * const cod_info, FLOAT * pxmin) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int sfb, gsfb, j = 0, ath_over = 0, k; + ATH_t const *const ATH = gfc->ATH; + const FLOAT *const xr = cod_info->xr; + int max_nonzero; + + for (gsfb = 0; gsfb < cod_info->psy_lmax; gsfb++) { + FLOAT en0, xmin; + FLOAT rh1, rh2, rh3; + int width, l; + + xmin = athAdjust(ATH->adjust_factor, ATH->l[gsfb], ATH->floor, cfg->ATHfixpoint); + xmin *= gfc->sv_qnt.longfact[gsfb]; + + width = cod_info->width[gsfb]; + rh1 = xmin / width; +#ifdef DBL_EPSILON + rh2 = DBL_EPSILON; +#else + rh2 = 2.2204460492503131e-016; +#endif + en0 = 0.0; + for (l = 0; l < width; ++l) { + FLOAT const xa = xr[j++]; + FLOAT const x2 = xa * xa; + en0 += x2; + rh2 += (x2 < rh1) ? x2 : rh1; + } + if (en0 > xmin) + ath_over++; + + if (en0 < xmin) { + rh3 = en0; + } + else if (rh2 < xmin) { + rh3 = xmin; + } + else { + rh3 = rh2; + } + xmin = rh3; + { + FLOAT const e = ratio->en.l[gsfb]; + if (e > 1e-12f) { + FLOAT x; + x = en0 * ratio->thm.l[gsfb] / e; + x *= gfc->sv_qnt.longfact[gsfb]; + if (xmin < x) + xmin = x; + } + } + xmin = Max(xmin, DBL_EPSILON); + cod_info->energy_above_cutoff[gsfb] = (en0 > xmin+1e-14f) ? 1 : 0; + *pxmin++ = xmin; + } /* end of long block loop */ + + + + + /*use this function to determine the highest non-zero coeff */ + max_nonzero = 0; + for (k = 575; k > 0; --k) { + if (fabs(xr[k]) > 1e-12f) { + max_nonzero = k; + break; + } + } + if (cod_info->block_type != SHORT_TYPE) { /* NORM, START or STOP type, but not SHORT */ + max_nonzero |= 1; /* only odd numbers */ + } + else { + max_nonzero /= 6; /* 3 short blocks */ + max_nonzero *= 6; + max_nonzero += 5; + } + + if (gfc->sv_qnt.sfb21_extra == 0 && cfg->samplerate_out < 44000) { + int const sfb_l = (cfg->samplerate_out <= 8000) ? 17 : 21; + int const sfb_s = (cfg->samplerate_out <= 8000) ? 9 : 12; + int limit = 575; + if (cod_info->block_type != SHORT_TYPE) { /* NORM, START or STOP type, but not SHORT */ + limit = gfc->scalefac_band.l[sfb_l]-1; + } + else { + limit = 3*gfc->scalefac_band.s[sfb_s]-1; + } + if (max_nonzero > limit) { + max_nonzero = limit; + } + } + cod_info->max_nonzero_coeff = max_nonzero; + + + + for (sfb = cod_info->sfb_smin; gsfb < cod_info->psymax; sfb++, gsfb += 3) { + int width, b, l; + FLOAT tmpATH; + + tmpATH = athAdjust(ATH->adjust_factor, ATH->s[sfb], ATH->floor, cfg->ATHfixpoint); + tmpATH *= gfc->sv_qnt.shortfact[sfb]; + + width = cod_info->width[gsfb]; + for (b = 0; b < 3; b++) { + FLOAT en0 = 0.0, xmin = tmpATH; + FLOAT rh1, rh2, rh3; + + rh1 = tmpATH / width; +#ifdef DBL_EPSILON + rh2 = DBL_EPSILON; +#else + rh2 = 2.2204460492503131e-016; +#endif + for (l = 0; l < width; ++l) { + FLOAT const xa = xr[j++]; + FLOAT const x2 = xa * xa; + en0 += x2; + rh2 += (x2 < rh1) ? x2 : rh1; + } + if (en0 > tmpATH) + ath_over++; + + if (en0 < tmpATH) { + rh3 = en0; + } + else if (rh2 < tmpATH) { + rh3 = tmpATH; + } + else { + rh3 = rh2; + } + xmin = rh3; + { + FLOAT const e = ratio->en.s[sfb][b]; + if (e > 1e-12f) { + FLOAT x; + x = en0 * ratio->thm.s[sfb][b] / e; + x *= gfc->sv_qnt.shortfact[sfb]; + if (xmin < x) + xmin = x; + } + } + xmin = Max(xmin, DBL_EPSILON); + cod_info->energy_above_cutoff[gsfb+b] = (en0 > xmin+1e-14f) ? 1 : 0; + *pxmin++ = xmin; + } /* b */ + if (cfg->use_temporal_masking_effect) { + if (pxmin[-3] > pxmin[-3 + 1]) + pxmin[-3 + 1] += (pxmin[-3] - pxmin[-3 + 1]) * gfc->cd_psy->decay; + if (pxmin[-3 + 1] > pxmin[-3 + 2]) + pxmin[-3 + 2] += (pxmin[-3 + 1] - pxmin[-3 + 2]) * gfc->cd_psy->decay; + } + } /* end of short block sfb loop */ + + return ath_over; +} + + +static FLOAT +calc_noise_core_c(const gr_info * const cod_info, int *startline, int l, FLOAT step) +{ + FLOAT noise = 0; + int j = *startline; + const int *const ix = cod_info->l3_enc; + + if (j > cod_info->count1) { + while (l--) { + FLOAT temp; + temp = cod_info->xr[j]; + j++; + noise += temp * temp; + temp = cod_info->xr[j]; + j++; + noise += temp * temp; + } + } + else if (j > cod_info->big_values) { + FLOAT ix01[2]; + ix01[0] = 0; + ix01[1] = step; + while (l--) { + FLOAT temp; + temp = fabs(cod_info->xr[j]) - ix01[ix[j]]; + j++; + noise += temp * temp; + temp = fabs(cod_info->xr[j]) - ix01[ix[j]]; + j++; + noise += temp * temp; + } + } + else { + while (l--) { + FLOAT temp; + temp = fabs(cod_info->xr[j]) - pow43[ix[j]] * step; + j++; + noise += temp * temp; + temp = fabs(cod_info->xr[j]) - pow43[ix[j]] * step; + j++; + noise += temp * temp; + } + } + + *startline = j; + return noise; +} + + +/*************************************************************************/ +/* calc_noise */ +/*************************************************************************/ + +/* -oo dB => -1.00 */ +/* - 6 dB => -0.97 */ +/* - 3 dB => -0.80 */ +/* - 2 dB => -0.64 */ +/* - 1 dB => -0.38 */ +/* 0 dB => 0.00 */ +/* + 1 dB => +0.49 */ +/* + 2 dB => +1.06 */ +/* + 3 dB => +1.68 */ +/* + 6 dB => +3.69 */ +/* +10 dB => +6.45 */ + +int +calc_noise(gr_info const *const cod_info, + FLOAT const *l3_xmin, + FLOAT * distort, calc_noise_result * const res, calc_noise_data * prev_noise) +{ + int sfb, l, over = 0; + FLOAT over_noise_db = 0; + FLOAT tot_noise_db = 0; /* 0 dB relative to masking */ + FLOAT max_noise = -20.0; /* -200 dB relative to masking */ + int j = 0; + const int *scalefac = cod_info->scalefac; + + res->over_SSD = 0; + + + for (sfb = 0; sfb < cod_info->psymax; sfb++) { + int const s = + cod_info->global_gain - (((*scalefac++) + (cod_info->preflag ? pretab[sfb] : 0)) + << (cod_info->scalefac_scale + 1)) + - cod_info->subblock_gain[cod_info->window[sfb]] * 8; + FLOAT const r_l3_xmin = 1.f / *l3_xmin++; + FLOAT distort_ = 0.0f; + FLOAT noise = 0.0f; + + if (prev_noise && (prev_noise->step[sfb] == s)) { + + /* use previously computed values */ + j += cod_info->width[sfb]; + distort_ = r_l3_xmin * prev_noise->noise[sfb]; + + noise = prev_noise->noise_log[sfb]; + + } + else { + FLOAT const step = POW20(s); + l = cod_info->width[sfb] >> 1; + + if ((j + cod_info->width[sfb]) > cod_info->max_nonzero_coeff) { + int usefullsize; + usefullsize = cod_info->max_nonzero_coeff - j + 1; + + if (usefullsize > 0) + l = usefullsize >> 1; + else + l = 0; + } + + noise = calc_noise_core_c(cod_info, &j, l, step); + + + if (prev_noise) { + /* save noise values */ + prev_noise->step[sfb] = s; + prev_noise->noise[sfb] = noise; + } + + distort_ = r_l3_xmin * noise; + + /* multiplying here is adding in dB, but can overflow */ + noise = FAST_LOG10(Max(distort_, 1E-20f)); + + if (prev_noise) { + /* save noise values */ + prev_noise->noise_log[sfb] = noise; + } + } + *distort++ = distort_; + + if (prev_noise) { + /* save noise values */ + prev_noise->global_gain = cod_info->global_gain;; + } + + + /*tot_noise *= Max(noise, 1E-20); */ + tot_noise_db += noise; + + if (noise > 0.0) { + int tmp; + + tmp = Max((int) (noise * 10 + .5), 1); + res->over_SSD += tmp * tmp; + + over++; + /* multiplying here is adding in dB -but can overflow */ + /*over_noise *= noise; */ + over_noise_db += noise; + } + max_noise = Max(max_noise, noise); + + } + + res->over_count = over; + res->tot_noise = tot_noise_db; + res->over_noise = over_noise_db; + res->max_noise = max_noise; + + return over; +} + + + + + + + + +/************************************************************************ + * + * set_pinfo() + * + * updates plotting data + * + * Mark Taylor 2000-??-?? + * + * Robert Hegemann: moved noise/distortion calc into it + * + ************************************************************************/ + +static void +set_pinfo(lame_internal_flags const *gfc, + gr_info * const cod_info, const III_psy_ratio * const ratio, const int gr, const int ch) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int sfb, sfb2; + int j, i, l, start, end, bw; + FLOAT en0, en1; + FLOAT const ifqstep = (cod_info->scalefac_scale == 0) ? .5 : 1.0; + int const *const scalefac = cod_info->scalefac; + + FLOAT l3_xmin[SFBMAX], xfsf[SFBMAX]; + calc_noise_result noise; + + (void) calc_xmin(gfc, ratio, cod_info, l3_xmin); + (void) calc_noise(cod_info, l3_xmin, xfsf, &noise, 0); + + j = 0; + sfb2 = cod_info->sfb_lmax; + if (cod_info->block_type != SHORT_TYPE && !cod_info->mixed_block_flag) + sfb2 = 22; + for (sfb = 0; sfb < sfb2; sfb++) { + start = gfc->scalefac_band.l[sfb]; + end = gfc->scalefac_band.l[sfb + 1]; + bw = end - start; + for (en0 = 0.0; j < end; j++) + en0 += cod_info->xr[j] * cod_info->xr[j]; + en0 /= bw; + /* convert to MDCT units */ + en1 = 1e15; /* scaling so it shows up on FFT plot */ + gfc->pinfo->en[gr][ch][sfb] = en1 * en0; + gfc->pinfo->xfsf[gr][ch][sfb] = en1 * l3_xmin[sfb] * xfsf[sfb] / bw; + + if (ratio->en.l[sfb] > 0 && !cfg->ATHonly) + en0 = en0 / ratio->en.l[sfb]; + else + en0 = 0.0; + + gfc->pinfo->thr[gr][ch][sfb] = en1 * Max(en0 * ratio->thm.l[sfb], gfc->ATH->l[sfb]); + + /* there is no scalefactor bands >= SBPSY_l */ + gfc->pinfo->LAMEsfb[gr][ch][sfb] = 0; + if (cod_info->preflag && sfb >= 11) + gfc->pinfo->LAMEsfb[gr][ch][sfb] = -ifqstep * pretab[sfb]; + + if (sfb < SBPSY_l) { + assert(scalefac[sfb] >= 0); /* scfsi should be decoded by caller side */ + gfc->pinfo->LAMEsfb[gr][ch][sfb] -= ifqstep * scalefac[sfb]; + } + } /* for sfb */ + + if (cod_info->block_type == SHORT_TYPE) { + sfb2 = sfb; + for (sfb = cod_info->sfb_smin; sfb < SBMAX_s; sfb++) { + start = gfc->scalefac_band.s[sfb]; + end = gfc->scalefac_band.s[sfb + 1]; + bw = end - start; + for (i = 0; i < 3; i++) { + for (en0 = 0.0, l = start; l < end; l++) { + en0 += cod_info->xr[j] * cod_info->xr[j]; + j++; + } + en0 = Max(en0 / bw, 1e-20); + /* convert to MDCT units */ + en1 = 1e15; /* scaling so it shows up on FFT plot */ + + gfc->pinfo->en_s[gr][ch][3 * sfb + i] = en1 * en0; + gfc->pinfo->xfsf_s[gr][ch][3 * sfb + i] = en1 * l3_xmin[sfb2] * xfsf[sfb2] / bw; + if (ratio->en.s[sfb][i] > 0) + en0 = en0 / ratio->en.s[sfb][i]; + else + en0 = 0.0; + if (cfg->ATHonly || cfg->ATHshort) + en0 = 0; + + gfc->pinfo->thr_s[gr][ch][3 * sfb + i] = + en1 * Max(en0 * ratio->thm.s[sfb][i], gfc->ATH->s[sfb]); + + /* there is no scalefactor bands >= SBPSY_s */ + gfc->pinfo->LAMEsfb_s[gr][ch][3 * sfb + i] + = -2.0 * cod_info->subblock_gain[i]; + if (sfb < SBPSY_s) { + gfc->pinfo->LAMEsfb_s[gr][ch][3 * sfb + i] -= ifqstep * scalefac[sfb2]; + } + sfb2++; + } + } + } /* block type short */ + gfc->pinfo->LAMEqss[gr][ch] = cod_info->global_gain; + gfc->pinfo->LAMEmainbits[gr][ch] = cod_info->part2_3_length + cod_info->part2_length; + gfc->pinfo->LAMEsfbits[gr][ch] = cod_info->part2_length; + + gfc->pinfo->over[gr][ch] = noise.over_count; + gfc->pinfo->max_noise[gr][ch] = noise.max_noise * 10.0; + gfc->pinfo->over_noise[gr][ch] = noise.over_noise * 10.0; + gfc->pinfo->tot_noise[gr][ch] = noise.tot_noise * 10.0; + gfc->pinfo->over_SSD[gr][ch] = noise.over_SSD; +} + + +/************************************************************************ + * + * set_frame_pinfo() + * + * updates plotting data for a whole frame + * + * Robert Hegemann 2000-10-21 + * + ************************************************************************/ + +void +set_frame_pinfo(lame_internal_flags * gfc, const III_psy_ratio ratio[2][2]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int ch; + int gr; + + /* for every granule and channel patch l3_enc and set info + */ + for (gr = 0; gr < cfg->mode_gr; gr++) { + for (ch = 0; ch < cfg->channels_out; ch++) { + gr_info *const cod_info = &gfc->l3_side.tt[gr][ch]; + int scalefac_sav[SFBMAX]; + memcpy(scalefac_sav, cod_info->scalefac, sizeof(scalefac_sav)); + + /* reconstruct the scalefactors in case SCFSI was used + */ + if (gr == 1) { + int sfb; + for (sfb = 0; sfb < cod_info->sfb_lmax; sfb++) { + if (cod_info->scalefac[sfb] < 0) /* scfsi */ + cod_info->scalefac[sfb] = gfc->l3_side.tt[0][ch].scalefac[sfb]; + } + } + + set_pinfo(gfc, cod_info, &ratio[gr][ch], gr, ch); + memcpy(cod_info->scalefac, scalefac_sav, sizeof(scalefac_sav)); + } /* for ch */ + } /* for gr */ +} diff --git a/node_modules/lame/deps/lame/libmp3lame/quantize_pvt.h b/node_modules/lame/deps/lame/libmp3lame/quantize_pvt.h new file mode 100644 index 0000000..b8333e7 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/quantize_pvt.h @@ -0,0 +1,128 @@ +/* + * quantize_pvt include file + * + * Copyright (c) 1999 Takehiro TOMINAGA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_QUANTIZE_PVT_H +#define LAME_QUANTIZE_PVT_H + +#define IXMAX_VAL 8206 /* ix always <= 8191+15. see count_bits() */ + +/* buggy Winamp decoder cannot handle values > 8191 */ +/* #define IXMAX_VAL 8191 */ + +#define PRECALC_SIZE (IXMAX_VAL+2) + + +extern const int nr_of_sfb_block[6][3][4]; +extern const int pretab[SBMAX_l]; +extern const int slen1_tab[16]; +extern const int slen2_tab[16]; + +extern const scalefac_struct sfBandIndex[9]; + +extern FLOAT pow43[PRECALC_SIZE]; +#ifdef TAKEHIRO_IEEE754_HACK +extern FLOAT adj43asm[PRECALC_SIZE]; +#else +extern FLOAT adj43[PRECALC_SIZE]; +#endif + +#define Q_MAX (256+1) +#define Q_MAX2 116 /* minimum possible number of + -cod_info->global_gain + + ((scalefac[] + (cod_info->preflag ? pretab[sfb] : 0)) + << (cod_info->scalefac_scale + 1)) + + cod_info->subblock_gain[cod_info->window[sfb]] * 8; + + for long block, 0+((15+3)<<2) = 18*4 = 72 + for short block, 0+(15<<2)+7*8 = 15*4+56 = 116 + */ + +extern FLOAT pow20[Q_MAX + Q_MAX2 + 1]; +extern FLOAT ipow20[Q_MAX]; + +typedef struct calc_noise_result_t { + FLOAT over_noise; /* sum of quantization noise > masking */ + FLOAT tot_noise; /* sum of all quantization noise */ + FLOAT max_noise; /* max quantization noise */ + int over_count; /* number of quantization noise > masking */ + int over_SSD; /* SSD-like cost of distorted bands */ + int bits; +} calc_noise_result; + + +/** +* allows re-use of previously +* computed noise values +*/ +typedef struct calc_noise_data_t { + int global_gain; + int sfb_count1; + int step[39]; + FLOAT noise[39]; + FLOAT noise_log[39]; +} calc_noise_data; + + +int on_pe(lame_internal_flags * gfc, const FLOAT pe[2][2], + int targ_bits[2], int mean_bits, int gr, int cbr); + +void reduce_side(int targ_bits[2], FLOAT ms_ener_ratio, int mean_bits, int max_bits); + + +void iteration_init(lame_internal_flags * gfc); + + +int calc_xmin(lame_internal_flags const *gfc, + III_psy_ratio const *const ratio, gr_info * const cod_info, FLOAT * l3_xmin); + +int calc_noise(const gr_info * const cod_info, + const FLOAT * l3_xmin, + FLOAT * distort, calc_noise_result * const res, calc_noise_data * prev_noise); + +void set_frame_pinfo(lame_internal_flags * gfc, const III_psy_ratio ratio[2][2]); + + + + +/* takehiro.c */ + +int count_bits(lame_internal_flags const *const gfc, const FLOAT * const xr, + gr_info * const cod_info, calc_noise_data * prev_noise); +int noquant_count_bits(lame_internal_flags const *const gfc, + gr_info * const cod_info, calc_noise_data * prev_noise); + + +void best_huffman_divide(const lame_internal_flags * const gfc, gr_info * const cod_info); + +void best_scalefac_store(const lame_internal_flags * gfc, const int gr, const int ch, + III_side_info_t * const l3_side); + +int scale_bitcount(const lame_internal_flags * gfc, gr_info * cod_info); + +void huffman_init(lame_internal_flags * const gfc); + +void init_xrpow_core_init(lame_internal_flags * const gfc); + +FLOAT athAdjust(FLOAT a, FLOAT x, FLOAT athFloor, float ATHfixpoint); + +#define LARGE_BITS 100000 + +#endif /* LAME_QUANTIZE_PVT_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/reservoir.c b/node_modules/lame/deps/lame/libmp3lame/reservoir.c new file mode 100644 index 0000000..4fdaa8d --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/reservoir.c @@ -0,0 +1,293 @@ +/* + * bit reservoir source file + * + * Copyright (c) 1999-2000 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: reservoir.c,v 1.45 2011/05/07 16:05:17 rbrito Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "reservoir.h" + +#include "bitstream.h" +#include "lame-analysis.h" +#include "lame_global_flags.h" + + +/* + ResvFrameBegin: + Called (repeatedly) at the beginning of a frame. Updates the maximum + size of the reservoir, and checks to make sure main_data_begin + was set properly by the formatter +*/ + +/* + * Background information: + * + * This is the original text from the ISO standard. Because of + * sooo many bugs and irritations correcting comments are added + * in brackets []. A '^W' means you should remove the last word. + * + * 1) The following rule can be used to calculate the maximum + * number of bits used for one granule [^W frame]: + * At the highest possible bitrate of Layer III (320 kbps + * per stereo signal [^W^W^W], 48 kHz) the frames must be of + * [^W^W^W are designed to have] constant length, i.e. + * one buffer [^W^W the frame] length is: + * + * 320 kbps * 1152/48 kHz = 7680 bit = 960 byte + * + * This value is used as the maximum buffer per channel [^W^W] at + * lower bitrates [than 320 kbps]. At 64 kbps mono or 128 kbps + * stereo the main granule length is 64 kbps * 576/48 kHz = 768 bit + * [per granule and channel] at 48 kHz sampling frequency. + * This means that there is a maximum deviation (short time buffer + * [= reservoir]) of 7680 - 2*2*768 = 4608 bits is allowed at 64 kbps. + * The actual deviation is equal to the number of bytes [with the + * meaning of octets] denoted by the main_data_end offset pointer. + * The actual maximum deviation is (2^9-1)*8 bit = 4088 bits + * [for MPEG-1 and (2^8-1)*8 bit for MPEG-2, both are hard limits]. + * ... The xchange of buffer bits between the left and right channel + * is allowed without restrictions [exception: dual channel]. + * Because of the [constructed] constraint on the buffer size + * main_data_end is always set to 0 in the case of bit_rate_index==14, + * i.e. data rate 320 kbps per stereo signal [^W^W^W]. In this case + * all data are allocated between adjacent header [^W sync] words + * [, i.e. there is no buffering at all]. + */ + +int +ResvFrameBegin(lame_internal_flags * gfc, int *mean_bits) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t *const esv = &gfc->sv_enc; + int fullFrameBits; + int resvLimit; + int maxmp3buf; + III_side_info_t *const l3_side = &gfc->l3_side; + int frameLength; + int meanBits; + + frameLength = getframebits(gfc); + meanBits = (frameLength - cfg->sideinfo_len * 8) / cfg->mode_gr; + +/* + * Meaning of the variables: + * resvLimit: (0, 8, ..., 8*255 (MPEG-2), 8*511 (MPEG-1)) + * Number of bits can be stored in previous frame(s) due to + * counter size constaints + * maxmp3buf: ( ??? ... 8*1951 (MPEG-1 and 2), 8*2047 (MPEG-2.5)) + * Number of bits allowed to encode one frame (you can take 8*511 bit + * from the bit reservoir and at most 8*1440 bit from the current + * frame (320 kbps, 32 kHz), so 8*1951 bit is the largest possible + * value for MPEG-1 and -2) + * + * maximum allowed granule/channel size times 4 = 8*2047 bits., + * so this is the absolute maximum supported by the format. + * + * + * fullFrameBits: maximum number of bits available for encoding + * the current frame. + * + * mean_bits: target number of bits per granule. + * + * frameLength: + * + * gfc->ResvMax: maximum allowed reservoir + * + * gfc->ResvSize: current reservoir size + * + * l3_side->resvDrain_pre: + * ancillary data to be added to previous frame: + * (only usefull in VBR modes if it is possible to have + * maxmp3buf < fullFrameBits)). Currently disabled, + * see #define NEW_DRAIN + * 2010-02-13: RH now enabled, it seems to be needed for CBR too, + * as there exists one example, where the FhG decoder + * can't decode a -b320 CBR file anymore. + * + * l3_side->resvDrain_post: + * ancillary data to be added to this frame: + * + */ + + /* main_data_begin has 9 bits in MPEG-1, 8 bits MPEG-2 */ + resvLimit = (8 * 256) * cfg->mode_gr - 8; + + /* maximum allowed frame size. dont use more than this number of + bits, even if the frame has the space for them: */ + maxmp3buf = cfg->buffer_constraint; + esv->ResvMax = maxmp3buf - frameLength; + if (esv->ResvMax > resvLimit) + esv->ResvMax = resvLimit; + if (esv->ResvMax < 0 || cfg->disable_reservoir) + esv->ResvMax = 0; + + fullFrameBits = meanBits * cfg->mode_gr + Min(esv->ResvSize, esv->ResvMax); + + if (fullFrameBits > maxmp3buf) + fullFrameBits = maxmp3buf; + + assert(0 == esv->ResvMax % 8); + assert(esv->ResvMax >= 0); + + l3_side->resvDrain_pre = 0; + + if (gfc->pinfo != NULL) { + gfc->pinfo->mean_bits = meanBits / 2; /* expected bits per channel per granule [is this also right for mono/stereo, MPEG-1/2 ?] */ + gfc->pinfo->resvsize = esv->ResvSize; + } + *mean_bits = meanBits; + return fullFrameBits; +} + + +/* + ResvMaxBits + returns targ_bits: target number of bits to use for 1 granule + extra_bits: amount extra available from reservoir + Mark Taylor 4/99 +*/ +void +ResvMaxBits(lame_internal_flags * gfc, int mean_bits, int *targ_bits, int *extra_bits, int cbr) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t *const esv = &gfc->sv_enc; + int add_bits, targBits, extraBits; + int ResvSize = esv->ResvSize, ResvMax = esv->ResvMax; + + /* conpensate the saved bits used in the 1st granule */ + if (cbr) + ResvSize += mean_bits; + + if (gfc->sv_qnt.substep_shaping & 1) + ResvMax *= 0.9; + + targBits = mean_bits; + + /* extra bits if the reservoir is almost full */ + if (ResvSize * 10 > ResvMax * 9) { + add_bits = ResvSize - (ResvMax * 9) / 10; + targBits += add_bits; + gfc->sv_qnt.substep_shaping |= 0x80; + } + else { + add_bits = 0; + gfc->sv_qnt.substep_shaping &= 0x7f; + /* build up reservoir. this builds the reservoir a little slower + * than FhG. It could simple be mean_bits/15, but this was rigged + * to always produce 100 (the old value) at 128kbs */ + /* *targ_bits -= (int) (mean_bits/15.2); */ + if (!cfg->disable_reservoir && !(gfc->sv_qnt.substep_shaping & 1)) + targBits -= .1 * mean_bits; + } + + + /* amount from the reservoir we are allowed to use. ISO says 6/10 */ + extraBits = (ResvSize < (esv->ResvMax * 6) / 10 ? ResvSize : (esv->ResvMax * 6) / 10); + extraBits -= add_bits; + + if (extraBits < 0) + extraBits = 0; + + *targ_bits = targBits; + *extra_bits = extraBits; +} + +/* + ResvAdjust: + Called after a granule's bit allocation. Readjusts the size of + the reservoir to reflect the granule's usage. +*/ +void +ResvAdjust(lame_internal_flags * gfc, gr_info const *gi) +{ + gfc->sv_enc.ResvSize -= gi->part2_3_length + gi->part2_length; +} + + +/* + ResvFrameEnd: + Called after all granules in a frame have been allocated. Makes sure + that the reservoir size is within limits, possibly by adding stuffing + bits. +*/ +void +ResvFrameEnd(lame_internal_flags * gfc, int mean_bits) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t *const esv = &gfc->sv_enc; + III_side_info_t *const l3_side = &gfc->l3_side; + int stuffingBits; + int over_bits; + + esv->ResvSize += mean_bits * cfg->mode_gr; + stuffingBits = 0; + l3_side->resvDrain_post = 0; + l3_side->resvDrain_pre = 0; + + /* we must be byte aligned */ + if ((over_bits = esv->ResvSize % 8) != 0) + stuffingBits += over_bits; + + + over_bits = (esv->ResvSize - stuffingBits) - esv->ResvMax; + if (over_bits > 0) { + assert(0 == over_bits % 8); + assert(over_bits >= 0); + stuffingBits += over_bits; + } + + + /* NOTE: enabling the NEW_DRAIN code fixes some problems with FhG decoder + shipped with MS Windows operating systems. Using this, it is even + possible to use Gabriel's lax buffer consideration again, which + assumes, any decoder should have a buffer large enough + for a 320 kbps frame at 32 kHz sample rate. + + old drain code: + lame -b320 BlackBird.wav ---> does not play with GraphEdit.exe using FhG decoder V1.5 Build 50 + + new drain code: + lame -b320 BlackBird.wav ---> plays fine with GraphEdit.exe using FhG decoder V1.5 Build 50 + + Robert Hegemann, 2010-02-13. + */ + /* drain as many bits as possible into previous frame ancillary data + * In particular, in VBR mode ResvMax may have changed, and we have + * to make sure main_data_begin does not create a reservoir bigger + * than ResvMax mt 4/00*/ + { + int mdb_bytes = Min(l3_side->main_data_begin * 8, stuffingBits) / 8; + l3_side->resvDrain_pre += 8 * mdb_bytes; + stuffingBits -= 8 * mdb_bytes; + esv->ResvSize -= 8 * mdb_bytes; + l3_side->main_data_begin -= mdb_bytes; + } + /* drain the rest into this frames ancillary data */ + l3_side->resvDrain_post += stuffingBits; + esv->ResvSize -= stuffingBits; +} diff --git a/node_modules/lame/deps/lame/libmp3lame/reservoir.h b/node_modules/lame/deps/lame/libmp3lame/reservoir.h new file mode 100644 index 0000000..7c58593 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/reservoir.h @@ -0,0 +1,31 @@ +/* + * bit reservoir include file + * + * Copyright (c) 1999 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_RESERVOIR_H +#define LAME_RESERVOIR_H + +int ResvFrameBegin(lame_internal_flags * gfc, int *mean_bits); +void ResvMaxBits(lame_internal_flags * gfc, int mean_bits, int *targ_bits, int *max_bits, + int cbr); +void ResvAdjust(lame_internal_flags * gfc, gr_info const *gi); +void ResvFrameEnd(lame_internal_flags * gfc, int mean_bits); + +#endif /* LAME_RESERVOIR_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/set_get.c b/node_modules/lame/deps/lame/libmp3lame/set_get.c new file mode 100644 index 0000000..2c61f48 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/set_get.c @@ -0,0 +1,2277 @@ +/* -*- mode: C; mode: fold -*- */ +/* + * set/get functions for lame_global_flags + * + * Copyright (c) 2001-2005 Alexander Leidinger + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: set_get.c,v 1.98 2011/05/07 16:05:17 rbrito Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "bitstream.h" /* because of compute_flushbits */ + +#include "set_get.h" +#include "lame_global_flags.h" + +/* + * input stream description + */ + + +/* number of samples */ +/* it's unlikely for this function to return an error */ +int +lame_set_num_samples(lame_global_flags * gfp, unsigned long num_samples) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 2^32-1 */ + gfp->num_samples = num_samples; + return 0; + } + return -1; +} + +unsigned long +lame_get_num_samples(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->num_samples; + } + return 0; +} + + +/* input samplerate */ +int +lame_set_in_samplerate(lame_global_flags * gfp, int in_samplerate) +{ + if (is_lame_global_flags_valid(gfp)) { + /* input sample rate in Hz, default = 44100 Hz */ + gfp->samplerate_in = in_samplerate; + return 0; + } + return -1; +} + +int +lame_get_in_samplerate(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->samplerate_in; + } + return 0; +} + + +/* number of channels in input stream */ +int +lame_set_num_channels(lame_global_flags * gfp, int num_channels) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 2 */ + if (2 < num_channels || 0 == num_channels) { + return -1; /* we don't support more than 2 channels */ + } + gfp->num_channels = num_channels; + return 0; + } + return -1; +} + +int +lame_get_num_channels(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->num_channels; + } + return 0; +} + + +/* scale the input by this amount before encoding (not used for decoding) */ +int +lame_set_scale(lame_global_flags * gfp, float scale) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 1 */ + gfp->scale = scale; + return 0; + } + return -1; +} + +float +lame_get_scale(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->scale; + } + return 0; +} + + +/* scale the channel 0 (left) input by this amount before + encoding (not used for decoding) */ +int +lame_set_scale_left(lame_global_flags * gfp, float scale) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 1 */ + gfp->scale_left = scale; + return 0; + } + return -1; +} + +float +lame_get_scale_left(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->scale_left; + } + return 0; +} + + +/* scale the channel 1 (right) input by this amount before + encoding (not used for decoding) */ +int +lame_set_scale_right(lame_global_flags * gfp, float scale) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 1 */ + gfp->scale_right = scale; + return 0; + } + return -1; +} + +float +lame_get_scale_right(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->scale_right; + } + return 0; +} + + +/* output sample rate in Hz */ +int +lame_set_out_samplerate(lame_global_flags * gfp, int out_samplerate) +{ + if (is_lame_global_flags_valid(gfp)) { + /* + * default = 0: LAME picks best value based on the amount + * of compression + * MPEG only allows: + * MPEG1 32, 44.1, 48khz + * MPEG2 16, 22.05, 24 + * MPEG2.5 8, 11.025, 12 + * + * (not used by decoding routines) + */ + gfp->samplerate_out = out_samplerate; + return 0; + } + return -1; +} + +int +lame_get_out_samplerate(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->samplerate_out; + } + return 0; +} + + + + +/* + * general control parameters + */ + +/* collect data for an MP3 frame analzyer */ +int +lame_set_analysis(lame_global_flags * gfp, int analysis) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > analysis || 1 < analysis) + return -1; + gfp->analysis = analysis; + return 0; + } + return -1; +} + +int +lame_get_analysis(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->analysis && 1 >= gfp->analysis); + return gfp->analysis; + } + return 0; +} + + +/* write a Xing VBR header frame */ +int +lame_set_bWriteVbrTag(lame_global_flags * gfp, int bWriteVbrTag) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 1 (on) for VBR/ABR modes, 0 (off) for CBR mode */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > bWriteVbrTag || 1 < bWriteVbrTag) + return -1; + gfp->write_lame_tag = bWriteVbrTag; + return 0; + } + return -1; +} + +int +lame_get_bWriteVbrTag(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->write_lame_tag && 1 >= gfp->write_lame_tag); + return gfp->write_lame_tag; + } + return 0; +} + + + +/* decode only, use lame/mpglib to convert mp3 to wav */ +int +lame_set_decode_only(lame_global_flags * gfp, int decode_only) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > decode_only || 1 < decode_only) + return -1; + gfp->decode_only = decode_only; + return 0; + } + return -1; +} + +int +lame_get_decode_only(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->decode_only && 1 >= gfp->decode_only); + return gfp->decode_only; + } + return 0; +} + + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +/* 1=encode a Vorbis .ogg file. default=0 */ +/* DEPRECATED */ +int CDECL lame_set_ogg(lame_global_flags *, int); +int CDECL lame_get_ogg(const lame_global_flags *); +#else +#endif + +/* encode a Vorbis .ogg file */ +/* DEPRECATED */ +int +lame_set_ogg(lame_global_flags * gfp, int ogg) +{ + (void) gfp; + (void) ogg; + return -1; +} + +int +lame_get_ogg(const lame_global_flags * gfp) +{ + (void) gfp; + return 0; +} + + +/* + * Internal algorithm selection. + * True quality is determined by the bitrate but this variable will effect + * quality by selecting expensive or cheap algorithms. + * quality=0..9. 0=best (very slow). 9=worst. + * recommended: 3 near-best quality, not too slow + * 5 good quality, fast + * 7 ok quality, really fast + */ +int +lame_set_quality(lame_global_flags * gfp, int quality) +{ + if (is_lame_global_flags_valid(gfp)) { + if (quality < 0) { + gfp->quality = 0; + } + else if (quality > 9) { + gfp->quality = 9; + } + else { + gfp->quality = quality; + } + return 0; + } + return -1; +} + +int +lame_get_quality(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->quality; + } + return 0; +} + + +/* mode = STEREO, JOINT_STEREO, DUAL_CHANNEL (not supported), MONO */ +int +lame_set_mode(lame_global_flags * gfp, MPEG_mode mode) +{ + if (is_lame_global_flags_valid(gfp)) { + int mpg_mode = mode; + /* default: lame chooses based on compression ratio and input channels */ + if (mpg_mode < 0 || MAX_INDICATOR <= mpg_mode) + return -1; /* Unknown MPEG mode! */ + gfp->mode = mode; + return 0; + } + return -1; +} + +MPEG_mode +lame_get_mode(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(gfp->mode < MAX_INDICATOR); + return gfp->mode; + } + return NOT_SET; +} + + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +/* + mode_automs. Use a M/S mode with a switching threshold based on + compression ratio + DEPRECATED +*/ +int CDECL lame_set_mode_automs(lame_global_flags *, int); +int CDECL lame_get_mode_automs(const lame_global_flags *); +#else +#endif + +/* Us a M/S mode with a switching threshold based on compression ratio */ +/* DEPRECATED */ +int +lame_set_mode_automs(lame_global_flags * gfp, int mode_automs) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > mode_automs || 1 < mode_automs) + return -1; + lame_set_mode(gfp, JOINT_STEREO); + return 0; + } + return -1; +} + +int +lame_get_mode_automs(const lame_global_flags * gfp) +{ + (void) gfp; + return 1; +} + + +/* + * Force M/S for all frames. For testing only. + * Requires mode = 1. + */ +int +lame_set_force_ms(lame_global_flags * gfp, int force_ms) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > force_ms || 1 < force_ms) + return -1; + gfp->force_ms = force_ms; + return 0; + } + return -1; +} + +int +lame_get_force_ms(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->force_ms && 1 >= gfp->force_ms); + return gfp->force_ms; + } + return 0; +} + + +/* Use free_format. */ +int +lame_set_free_format(lame_global_flags * gfp, int free_format) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > free_format || 1 < free_format) + return -1; + gfp->free_format = free_format; + return 0; + } + return -1; +} + +int +lame_get_free_format(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->free_format && 1 >= gfp->free_format); + return gfp->free_format; + } + return 0; +} + + + +/* Perform ReplayGain analysis */ +int +lame_set_findReplayGain(lame_global_flags * gfp, int findReplayGain) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > findReplayGain || 1 < findReplayGain) + return -1; + gfp->findReplayGain = findReplayGain; + return 0; + } + return -1; +} + +int +lame_get_findReplayGain(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->findReplayGain && 1 >= gfp->findReplayGain); + return gfp->findReplayGain; + } + return 0; +} + + +/* Decode on the fly. Find the peak sample. If ReplayGain analysis is + enabled then perform it on the decoded data. */ +int +lame_set_decode_on_the_fly(lame_global_flags * gfp, int decode_on_the_fly) +{ + if (is_lame_global_flags_valid(gfp)) { +#ifndef DECODE_ON_THE_FLY + return -1; +#else + /* default = 0 (disabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > decode_on_the_fly || 1 < decode_on_the_fly) + return -1; + + gfp->decode_on_the_fly = decode_on_the_fly; + + return 0; +#endif + } + return -1; +} + +int +lame_get_decode_on_the_fly(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->decode_on_the_fly && 1 >= gfp->decode_on_the_fly); + return gfp->decode_on_the_fly; + } + return 0; +} + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +/* DEPRECATED: now does the same as lame_set_findReplayGain() + default = 0 (disabled) */ +int CDECL lame_set_ReplayGain_input(lame_global_flags *, int); +int CDECL lame_get_ReplayGain_input(const lame_global_flags *); + +/* DEPRECATED: now does the same as + lame_set_decode_on_the_fly() && lame_set_findReplayGain() + default = 0 (disabled) */ +int CDECL lame_set_ReplayGain_decode(lame_global_flags *, int); +int CDECL lame_get_ReplayGain_decode(const lame_global_flags *); + +/* DEPRECATED: now does the same as lame_set_decode_on_the_fly() + default = 0 (disabled) */ +int CDECL lame_set_findPeakSample(lame_global_flags *, int); +int CDECL lame_get_findPeakSample(const lame_global_flags *); +#else +#endif + +/* DEPRECATED. same as lame_set_decode_on_the_fly() */ +int +lame_set_findPeakSample(lame_global_flags * gfp, int arg) +{ + return lame_set_decode_on_the_fly(gfp, arg); +} + +int +lame_get_findPeakSample(const lame_global_flags * gfp) +{ + return lame_get_decode_on_the_fly(gfp); +} + +/* DEPRECATED. same as lame_set_findReplayGain() */ +int +lame_set_ReplayGain_input(lame_global_flags * gfp, int arg) +{ + return lame_set_findReplayGain(gfp, arg); +} + +int +lame_get_ReplayGain_input(const lame_global_flags * gfp) +{ + return lame_get_findReplayGain(gfp); +} + +/* DEPRECATED. same as lame_set_decode_on_the_fly() && + lame_set_findReplayGain() */ +int +lame_set_ReplayGain_decode(lame_global_flags * gfp, int arg) +{ + if (lame_set_decode_on_the_fly(gfp, arg) < 0 || lame_set_findReplayGain(gfp, arg) < 0) + return -1; + else + return 0; +} + +int +lame_get_ReplayGain_decode(const lame_global_flags * gfp) +{ + if (lame_get_decode_on_the_fly(gfp) > 0 && lame_get_findReplayGain(gfp) > 0) + return 1; + else + return 0; +} + + +/* set and get some gapless encoding flags */ + +int +lame_set_nogap_total(lame_global_flags * gfp, int the_nogap_total) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->nogap_total = the_nogap_total; + return 0; + } + return -1; +} + +int +lame_get_nogap_total(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->nogap_total; + } + return 0; +} + +int +lame_set_nogap_currentindex(lame_global_flags * gfp, int the_nogap_index) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->nogap_current = the_nogap_index; + return 0; + } + return -1; +} + +int +lame_get_nogap_currentindex(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->nogap_current; + } + return 0; +} + + +/* message handlers */ +int +lame_set_errorf(lame_global_flags * gfp, void (*func) (const char *, va_list)) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->report.errorf = func; + return 0; + } + return -1; +} + +int +lame_set_debugf(lame_global_flags * gfp, void (*func) (const char *, va_list)) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->report.debugf = func; + return 0; + } + return -1; +} + +int +lame_set_msgf(lame_global_flags * gfp, void (*func) (const char *, va_list)) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->report.msgf = func; + return 0; + } + return -1; +} + + +/* + * Set one of + * - brate + * - compression ratio. + * + * Default is compression ratio of 11. + */ +int +lame_set_brate(lame_global_flags * gfp, int brate) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->brate = brate; + if (brate > 320) { + gfp->disable_reservoir = 1; + } + return 0; + } + return -1; +} + +int +lame_get_brate(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->brate; + } + return 0; +} + +int +lame_set_compression_ratio(lame_global_flags * gfp, float compression_ratio) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->compression_ratio = compression_ratio; + return 0; + } + return -1; +} + +float +lame_get_compression_ratio(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->compression_ratio; + } + return 0; +} + + + + +/* + * frame parameters + */ + +/* Mark as copyright protected. */ +int +lame_set_copyright(lame_global_flags * gfp, int copyright) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > copyright || 1 < copyright) + return -1; + gfp->copyright = copyright; + return 0; + } + return -1; +} + +int +lame_get_copyright(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->copyright && 1 >= gfp->copyright); + return gfp->copyright; + } + return 0; +} + + +/* Mark as original. */ +int +lame_set_original(lame_global_flags * gfp, int original) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 1 (enabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > original || 1 < original) + return -1; + gfp->original = original; + return 0; + } + return -1; +} + +int +lame_get_original(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->original && 1 >= gfp->original); + return gfp->original; + } + return 0; +} + + +/* + * error_protection. + * Use 2 bytes from each frame for CRC checksum. + */ +int +lame_set_error_protection(lame_global_flags * gfp, int error_protection) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > error_protection || 1 < error_protection) + return -1; + gfp->error_protection = error_protection; + return 0; + } + return -1; +} + +int +lame_get_error_protection(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->error_protection && 1 >= gfp->error_protection); + return gfp->error_protection; + } + return 0; +} + + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +/* padding_type. 0=pad no frames 1=pad all frames 2=adjust padding(default) */ +int CDECL lame_set_padding_type(lame_global_flags *, Padding_type); +Padding_type CDECL lame_get_padding_type(const lame_global_flags *); +#else +#endif + +/* + * padding_type. + * PAD_NO = pad no frames + * PAD_ALL = pad all frames + * PAD_ADJUST = adjust padding + */ +int +lame_set_padding_type(lame_global_flags * gfp, Padding_type padding_type) +{ + (void) gfp; + (void) padding_type; + return 0; +} + +Padding_type +lame_get_padding_type(const lame_global_flags * gfp) +{ + (void) gfp; + return PAD_ADJUST; +} + + +/* MP3 'private extension' bit. Meaningless. */ +int +lame_set_extension(lame_global_flags * gfp, int extension) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > extension || 1 < extension) + return -1; + gfp->extension = extension; + return 0; + } + return -1; +} + +int +lame_get_extension(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->extension && 1 >= gfp->extension); + return gfp->extension; + } + return 0; +} + + +/* Enforce strict ISO compliance. */ +int +lame_set_strict_ISO(lame_global_flags * gfp, int val) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (val < MDB_DEFAULT || MDB_MAXIMUM < val) + return -1; + gfp->strict_ISO = val; + return 0; + } + return -1; +} + +int +lame_get_strict_ISO(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->strict_ISO; + } + return 0; +} + + + + +/******************************************************************** + * quantization/noise shaping + ***********************************************************************/ + +/* Disable the bit reservoir. For testing only. */ +int +lame_set_disable_reservoir(lame_global_flags * gfp, int disable_reservoir) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > disable_reservoir || 1 < disable_reservoir) + return -1; + gfp->disable_reservoir = disable_reservoir; + return 0; + } + return -1; +} + +int +lame_get_disable_reservoir(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->disable_reservoir && 1 >= gfp->disable_reservoir); + return gfp->disable_reservoir; + } + return 0; +} + + + + +int +lame_set_experimentalX(lame_global_flags * gfp, int experimentalX) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_set_quant_comp(gfp, experimentalX); + lame_set_quant_comp_short(gfp, experimentalX); + return 0; + } + return -1; +} + +int +lame_get_experimentalX(const lame_global_flags * gfp) +{ + return lame_get_quant_comp(gfp); +} + + +/* Select a different "best quantization" function. default = 0 */ +int +lame_set_quant_comp(lame_global_flags * gfp, int quant_type) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->quant_comp = quant_type; + return 0; + } + return -1; +} + +int +lame_get_quant_comp(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->quant_comp; + } + return 0; +} + + +/* Select a different "best quantization" function. default = 0 */ +int +lame_set_quant_comp_short(lame_global_flags * gfp, int quant_type) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->quant_comp_short = quant_type; + return 0; + } + return -1; +} + +int +lame_get_quant_comp_short(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->quant_comp_short; + } + return 0; +} + + +/* Another experimental option. For testing only. */ +int +lame_set_experimentalY(lame_global_flags * gfp, int experimentalY) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->experimentalY = experimentalY; + return 0; + } + return -1; +} + +int +lame_get_experimentalY(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->experimentalY; + } + return 0; +} + + +int +lame_set_experimentalZ(lame_global_flags * gfp, int experimentalZ) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->experimentalZ = experimentalZ; + return 0; + } + return -1; +} + +int +lame_get_experimentalZ(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->experimentalZ; + } + return 0; +} + + +/* Naoki's psycho acoustic model. */ +int +lame_set_exp_nspsytune(lame_global_flags * gfp, int exp_nspsytune) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + gfp->exp_nspsytune = exp_nspsytune; + return 0; + } + return -1; +} + +int +lame_get_exp_nspsytune(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->exp_nspsytune; + } + return 0; +} + + + + +/******************************************************************** + * VBR control + ***********************************************************************/ + +/* Types of VBR. default = vbr_off = CBR */ +int +lame_set_VBR(lame_global_flags * gfp, vbr_mode VBR) +{ + if (is_lame_global_flags_valid(gfp)) { + int vbr_q = VBR; + if (0 > vbr_q || vbr_max_indicator <= vbr_q) + return -1; /* Unknown VBR mode! */ + gfp->VBR = VBR; + return 0; + } + return -1; +} + +vbr_mode +lame_get_VBR(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(gfp->VBR < vbr_max_indicator); + return gfp->VBR; + } + return vbr_off; +} + + +/* + * VBR quality level. + * 0 = highest + * 9 = lowest + */ +int +lame_set_VBR_q(lame_global_flags * gfp, int VBR_q) +{ + if (is_lame_global_flags_valid(gfp)) { + int ret = 0; + + if (0 > VBR_q) { + ret = -1; /* Unknown VBR quality level! */ + VBR_q = 0; + } + if (9 < VBR_q) { + ret = -1; + VBR_q = 9; + } + gfp->VBR_q = VBR_q; + gfp->VBR_q_frac = 0; + return ret; + } + return -1; +} + +int +lame_get_VBR_q(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->VBR_q && 10 > gfp->VBR_q); + return gfp->VBR_q; + } + return 0; +} + +int +lame_set_VBR_quality(lame_global_flags * gfp, float VBR_q) +{ + if (is_lame_global_flags_valid(gfp)) { + int ret = 0; + + if (0 > VBR_q) { + ret = -1; /* Unknown VBR quality level! */ + VBR_q = 0; + } + if (9.999 < VBR_q) { + ret = -1; + VBR_q = 9.999; + } + + gfp->VBR_q = (int) VBR_q; + gfp->VBR_q_frac = VBR_q - gfp->VBR_q; + + return ret; + } + return -1; +} + +float +lame_get_VBR_quality(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->VBR_q + gfp->VBR_q_frac; + } + return 0; +} + + +/* Ignored except for VBR = vbr_abr (ABR mode) */ +int +lame_set_VBR_mean_bitrate_kbps(lame_global_flags * gfp, int VBR_mean_bitrate_kbps) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->VBR_mean_bitrate_kbps = VBR_mean_bitrate_kbps; + return 0; + } + return -1; +} + +int +lame_get_VBR_mean_bitrate_kbps(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->VBR_mean_bitrate_kbps; + } + return 0; +} + +int +lame_set_VBR_min_bitrate_kbps(lame_global_flags * gfp, int VBR_min_bitrate_kbps) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->VBR_min_bitrate_kbps = VBR_min_bitrate_kbps; + return 0; + } + return -1; +} + +int +lame_get_VBR_min_bitrate_kbps(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->VBR_min_bitrate_kbps; + } + return 0; +} + +int +lame_set_VBR_max_bitrate_kbps(lame_global_flags * gfp, int VBR_max_bitrate_kbps) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->VBR_max_bitrate_kbps = VBR_max_bitrate_kbps; + return 0; + } + return -1; +} + +int +lame_get_VBR_max_bitrate_kbps(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->VBR_max_bitrate_kbps; + } + return 0; +} + + +/* + * Strictly enforce VBR_min_bitrate. + * Normally it will be violated for analog silence. + */ +int +lame_set_VBR_hard_min(lame_global_flags * gfp, int VBR_hard_min) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 (disabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > VBR_hard_min || 1 < VBR_hard_min) + return -1; + + gfp->VBR_hard_min = VBR_hard_min; + + return 0; + } + return -1; +} + +int +lame_get_VBR_hard_min(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->VBR_hard_min && 1 >= gfp->VBR_hard_min); + return gfp->VBR_hard_min; + } + return 0; +} + + +/******************************************************************** + * Filtering control + ***********************************************************************/ + +/* + * Freqency in Hz to apply lowpass. + * 0 = default = lame chooses + * -1 = disabled + */ +int +lame_set_lowpassfreq(lame_global_flags * gfp, int lowpassfreq) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->lowpassfreq = lowpassfreq; + return 0; + } + return -1; +} + +int +lame_get_lowpassfreq(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->lowpassfreq; + } + return 0; +} + + +/* + * Width of transition band (in Hz). + * default = one polyphase filter band + */ +int +lame_set_lowpasswidth(lame_global_flags * gfp, int lowpasswidth) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->lowpasswidth = lowpasswidth; + return 0; + } + return -1; +} + +int +lame_get_lowpasswidth(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->lowpasswidth; + } + return 0; +} + + +/* + * Frequency in Hz to apply highpass. + * 0 = default = lame chooses + * -1 = disabled + */ +int +lame_set_highpassfreq(lame_global_flags * gfp, int highpassfreq) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->highpassfreq = highpassfreq; + return 0; + } + return -1; +} + +int +lame_get_highpassfreq(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->highpassfreq; + } + return 0; +} + + +/* + * Width of transition band (in Hz). + * default = one polyphase filter band + */ +int +lame_set_highpasswidth(lame_global_flags * gfp, int highpasswidth) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->highpasswidth = highpasswidth; + return 0; + } + return -1; +} + +int +lame_get_highpasswidth(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->highpasswidth; + } + return 0; +} + + + + +/* + * psycho acoustics and other arguments which you should not change + * unless you know what you are doing + */ + + +/* Adjust masking values. */ +int +lame_set_maskingadjust(lame_global_flags * gfp, float adjust) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->maskingadjust = adjust; + return 0; + } + return -1; +} + +float +lame_get_maskingadjust(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->maskingadjust; + } + return 0; +} + +int +lame_set_maskingadjust_short(lame_global_flags * gfp, float adjust) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->maskingadjust_short = adjust; + return 0; + } + return -1; +} + +float +lame_get_maskingadjust_short(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->maskingadjust_short; + } + return 0; +} + +/* Only use ATH for masking. */ +int +lame_set_ATHonly(lame_global_flags * gfp, int ATHonly) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->ATHonly = ATHonly; + return 0; + } + return -1; +} + +int +lame_get_ATHonly(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->ATHonly; + } + return 0; +} + + +/* Only use ATH for short blocks. */ +int +lame_set_ATHshort(lame_global_flags * gfp, int ATHshort) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->ATHshort = ATHshort; + return 0; + } + return -1; +} + +int +lame_get_ATHshort(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->ATHshort; + } + return 0; +} + + +/* Disable ATH. */ +int +lame_set_noATH(lame_global_flags * gfp, int noATH) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->noATH = noATH; + return 0; + } + return -1; +} + +int +lame_get_noATH(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->noATH; + } + return 0; +} + + +/* Select ATH formula. */ +int +lame_set_ATHtype(lame_global_flags * gfp, int ATHtype) +{ + if (is_lame_global_flags_valid(gfp)) { + /* XXX: ATHtype should be converted to an enum. */ + gfp->ATHtype = ATHtype; + return 0; + } + return -1; +} + +int +lame_get_ATHtype(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->ATHtype; + } + return 0; +} + + +/* Select ATH formula 4 shape. */ +int +lame_set_ATHcurve(lame_global_flags * gfp, float ATHcurve) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->ATHcurve = ATHcurve; + return 0; + } + return -1; +} + +float +lame_get_ATHcurve(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->ATHcurve; + } + return 0; +} + + +/* Lower ATH by this many db. */ +int +lame_set_ATHlower(lame_global_flags * gfp, float ATHlower) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->ATH_lower_db = ATHlower; + return 0; + } + return -1; +} + +float +lame_get_ATHlower(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->ATH_lower_db; + } + return 0; +} + + +/* Select ATH adaptive adjustment scheme. */ +int +lame_set_athaa_type(lame_global_flags * gfp, int athaa_type) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->athaa_type = athaa_type; + return 0; + } + return -1; +} + +int +lame_get_athaa_type(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->athaa_type; + } + return 0; +} + + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +int CDECL lame_set_athaa_loudapprox(lame_global_flags * gfp, int athaa_loudapprox); +int CDECL lame_get_athaa_loudapprox(const lame_global_flags * gfp); +#else +#endif + +/* Select the loudness approximation used by the ATH adaptive auto-leveling. */ +int +lame_set_athaa_loudapprox(lame_global_flags * gfp, int athaa_loudapprox) +{ + (void) gfp; + (void) athaa_loudapprox; + return 0; +} + +int +lame_get_athaa_loudapprox(const lame_global_flags * gfp) +{ + (void) gfp; + /* obsolete, the type known under number 2 is the only survival */ + return 2; +} + + +/* Adjust (in dB) the point below which adaptive ATH level adjustment occurs. */ +int +lame_set_athaa_sensitivity(lame_global_flags * gfp, float athaa_sensitivity) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->athaa_sensitivity = athaa_sensitivity; + return 0; + } + return -1; +} + +float +lame_get_athaa_sensitivity(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->athaa_sensitivity; + } + return 0; +} + + +/* Predictability limit (ISO tonality formula) */ +int lame_set_cwlimit(lame_global_flags * gfp, int cwlimit); +int lame_get_cwlimit(const lame_global_flags * gfp); + +int +lame_set_cwlimit(lame_global_flags * gfp, int cwlimit) +{ + (void) gfp; + (void) cwlimit; + return 0; +} + +int +lame_get_cwlimit(const lame_global_flags * gfp) +{ + (void) gfp; + return 0; +} + + + +/* + * Allow blocktypes to differ between channels. + * default: + * 0 for jstereo => block types coupled + * 1 for stereo => block types may differ + */ +int +lame_set_allow_diff_short(lame_global_flags * gfp, int allow_diff_short) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->short_blocks = allow_diff_short ? short_block_allowed : short_block_coupled; + return 0; + } + return -1; +} + +int +lame_get_allow_diff_short(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + if (gfp->short_blocks == short_block_allowed) + return 1; /* short blocks allowed to differ */ + else + return 0; /* not set, dispensed, forced or coupled */ + } + return 0; +} + + +/* Use temporal masking effect */ +int +lame_set_useTemporal(lame_global_flags * gfp, int useTemporal) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 1 (enabled) */ + + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 <= useTemporal && useTemporal <= 1) { + gfp->useTemporal = useTemporal; + return 0; + } + } + return -1; +} + +int +lame_get_useTemporal(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->useTemporal && 1 >= gfp->useTemporal); + return gfp->useTemporal; + } + return 0; +} + + +/* Use inter-channel masking effect */ +int +lame_set_interChRatio(lame_global_flags * gfp, float ratio) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0.0 (no inter-channel maskin) */ + if (0 <= ratio && ratio <= 1.0) { + gfp->interChRatio = ratio; + return 0; + } + } + return -1; +} + +float +lame_get_interChRatio(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert((0 <= gfp->interChRatio && gfp->interChRatio <= 1.0) || EQ(gfp->interChRatio, -1)); + return gfp->interChRatio; + } + return 0; +} + + +/* Use pseudo substep shaping method */ +int +lame_set_substep(lame_global_flags * gfp, int method) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0.0 (no substep noise shaping) */ + if (0 <= method && method <= 7) { + gfp->substep_shaping = method; + return 0; + } + } + return -1; +} + +int +lame_get_substep(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->substep_shaping && gfp->substep_shaping <= 7); + return gfp->substep_shaping; + } + return 0; +} + +/* scalefactors scale */ +int +lame_set_sfscale(lame_global_flags * gfp, int val) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->noise_shaping = (val != 0) ? 2 : 1; + return 0; + } + return -1; +} + +int +lame_get_sfscale(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return (gfp->noise_shaping == 2) ? 1 : 0; + } + return 0; +} + +/* subblock gain */ +int +lame_set_subblock_gain(lame_global_flags * gfp, int sbgain) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->subblock_gain = sbgain; + return 0; + } + return -1; +} + +int +lame_get_subblock_gain(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->subblock_gain; + } + return 0; +} + + +/* Disable short blocks. */ +int +lame_set_no_short_blocks(lame_global_flags * gfp, int no_short_blocks) +{ + if (is_lame_global_flags_valid(gfp)) { + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 <= no_short_blocks && no_short_blocks <= 1) { + gfp->short_blocks = no_short_blocks ? short_block_dispensed : short_block_allowed; + return 0; + } + } + return -1; +} + +int +lame_get_no_short_blocks(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + switch (gfp->short_blocks) { + default: + case short_block_not_set: + return -1; + case short_block_dispensed: + return 1; + case short_block_allowed: + case short_block_coupled: + case short_block_forced: + return 0; + } + } + return -1; +} + + +/* Force short blocks. */ +int +lame_set_force_short_blocks(lame_global_flags * gfp, int short_blocks) +{ + if (is_lame_global_flags_valid(gfp)) { + /* enforce disable/enable meaning, if we need more than two values + we need to switch to an enum to have an apropriate representation + of the possible meanings of the value */ + if (0 > short_blocks || 1 < short_blocks) + return -1; + + if (short_blocks == 1) + gfp->short_blocks = short_block_forced; + else if (gfp->short_blocks == short_block_forced) + gfp->short_blocks = short_block_allowed; + + return 0; + } + return -1; +} + +int +lame_get_force_short_blocks(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + switch (gfp->short_blocks) { + default: + case short_block_not_set: + return -1; + case short_block_dispensed: + case short_block_allowed: + case short_block_coupled: + return 0; + case short_block_forced: + return 1; + } + } + return -1; +} + +int +lame_set_short_threshold_lrm(lame_global_flags * gfp, float lrm) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->attackthre = lrm; + return 0; + } + return -1; +} + +float +lame_get_short_threshold_lrm(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->attackthre; + } + return 0; +} + +int +lame_set_short_threshold_s(lame_global_flags * gfp, float s) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->attackthre_s = s; + return 0; + } + return -1; +} + +float +lame_get_short_threshold_s(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->attackthre_s; + } + return 0; +} + +int +lame_set_short_threshold(lame_global_flags * gfp, float lrm, float s) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_set_short_threshold_lrm(gfp, lrm); + lame_set_short_threshold_s(gfp, s); + return 0; + } + return -1; +} + + +/* + * Input PCM is emphased PCM + * (for instance from one of the rarely emphased CDs). + * + * It is STRONGLY not recommended to use this, because psycho does not + * take it into account, and last but not least many decoders + * ignore these bits + */ +int +lame_set_emphasis(lame_global_flags * gfp, int emphasis) +{ + if (is_lame_global_flags_valid(gfp)) { + /* XXX: emphasis should be converted to an enum */ + if (0 <= emphasis && emphasis < 4) { + gfp->emphasis = emphasis; + return 0; + } + } + return -1; +} + +int +lame_get_emphasis(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + assert(0 <= gfp->emphasis && gfp->emphasis < 4); + return gfp->emphasis; + } + return 0; +} + + + + +/***************************************************************/ +/* internal variables, cannot be set... */ +/* provided because they may be of use to calling application */ +/***************************************************************/ + +/* MPEG version. + * 0 = MPEG-2 + * 1 = MPEG-1 + * (2 = MPEG-2.5) + */ +int +lame_get_version(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + return gfc->cfg.version; + } + } + return 0; +} + + +/* Encoder delay. */ +int +lame_get_encoder_delay(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + return gfc->ov_enc.encoder_delay; + } + } + return 0; +} + +/* padding added to the end of the input */ +int +lame_get_encoder_padding(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + return gfc->ov_enc.encoder_padding; + } + } + return 0; +} + + +/* Size of MPEG frame. */ +int +lame_get_framesize(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + SessionConfig_t const *const cfg = &gfc->cfg; + return 576 * cfg->mode_gr; + } + } + return 0; +} + + +/* Number of frames encoded so far. */ +int +lame_get_frameNum(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + return gfc->ov_enc.frame_number; + } + } + return 0; +} + +int +lame_get_mf_samples_to_encode(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + return gfc->sv_enc.mf_samples_to_encode; + } + } + return 0; +} + +int CDECL +lame_get_size_mp3buffer(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + int size; + compute_flushbits(gfc, &size); + return size; + } + } + return 0; +} + +int +lame_get_RadioGain(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + return gfc->ov_rpg.RadioGain; + } + } + return 0; +} + +int +lame_get_AudiophileGain(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + return 0; + } + } + return 0; +} + +float +lame_get_PeakSample(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + return (float) gfc->ov_rpg.PeakSample; + } + } + return 0; +} + +int +lame_get_noclipGainChange(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + return gfc->ov_rpg.noclipGainChange; + } + } + return 0; +} + +float +lame_get_noclipScale(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + return gfc->ov_rpg.noclipScale; + } + } + return 0; +} + + +/* + * LAME's estimate of the total number of frames to be encoded. + * Only valid if calling program set num_samples. + */ +int +lame_get_totalframes(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + lame_internal_flags const *const gfc = gfp->internal_flags; + if (is_lame_internal_flags_valid(gfc)) { + SessionConfig_t const *const cfg = &gfc->cfg; + unsigned long const pcm_samples_per_frame = 576 * cfg->mode_gr; + unsigned long pcm_samples_to_encode = gfp->num_samples; + unsigned long end_padding = 0; + + /* estimate based on user set num_samples: */ + if (pcm_samples_to_encode == (0ul-1ul)) { + return 0; + } + if (gfp->samplerate_in != gfp->samplerate_out && gfp->samplerate_in > 0) { + double const q = (double)gfp->samplerate_out / gfp->samplerate_in; + pcm_samples_to_encode *= q; + } + pcm_samples_to_encode += 576; + end_padding = pcm_samples_per_frame - (pcm_samples_to_encode % pcm_samples_per_frame); + if (end_padding < 576) { + end_padding += pcm_samples_per_frame; + } + pcm_samples_to_encode += end_padding; + /* check to see if we underestimated totalframes */ + /* if (totalframes < gfp->frameNum) */ + /* totalframes = gfp->frameNum; */ + return pcm_samples_to_encode / pcm_samples_per_frame; + } + } + return 0; +} + + + + + +int +lame_set_preset(lame_global_flags * gfp, int preset) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->preset = preset; + return apply_preset(gfp, preset, 1); + } + return -1; +} + + + +int +lame_set_asm_optimizations(lame_global_flags * gfp, int optim, int mode) +{ + if (is_lame_global_flags_valid(gfp)) { + mode = (mode == 1 ? 1 : 0); + switch (optim) { + case MMX:{ + gfp->asm_optimizations.mmx = mode; + return optim; + } + case AMD_3DNOW:{ + gfp->asm_optimizations.amd3dnow = mode; + return optim; + } + case SSE:{ + gfp->asm_optimizations.sse = mode; + return optim; + } + default: + return optim; + } + } + return -1; +} + + +void +lame_set_write_id3tag_automatic(lame_global_flags * gfp, int v) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->write_id3tag_automatic = v; + } +} + + +int +lame_get_write_id3tag_automatic(lame_global_flags const *gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->write_id3tag_automatic; + } + return 1; +} + + +/* + +UNDOCUMENTED, experimental settings. These routines are not prototyped +in lame.h. You should not use them, they are experimental and may +change. + +*/ + + +/* + * just another daily changing developer switch + */ +void CDECL lame_set_tune(lame_global_flags *, float); + +void +lame_set_tune(lame_global_flags * gfp, float val) +{ + if (is_lame_global_flags_valid(gfp)) { + gfp->tune_value_a = val; + gfp->tune = 1; + } +} + +/* Custom msfix hack */ +void +lame_set_msfix(lame_global_flags * gfp, double msfix) +{ + if (is_lame_global_flags_valid(gfp)) { + /* default = 0 */ + gfp->msfix = msfix; + } +} + +float +lame_get_msfix(const lame_global_flags * gfp) +{ + if (is_lame_global_flags_valid(gfp)) { + return gfp->msfix; + } + return 0; +} + +#if DEPRECATED_OR_OBSOLETE_CODE_REMOVED +int CDECL lame_set_preset_expopts(lame_global_flags *, int); +#else +#endif + +int +lame_set_preset_expopts(lame_global_flags * gfp, int preset_expopts) +{ + (void) gfp; + (void) preset_expopts; + return 0; +} + + +int +lame_set_preset_notune(lame_global_flags * gfp, int preset_notune) +{ + (void) gfp; + (void) preset_notune; + return 0; +} diff --git a/node_modules/lame/deps/lame/libmp3lame/set_get.h b/node_modules/lame/deps/lame/libmp3lame/set_get.h new file mode 100644 index 0000000..37e4bcd --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/set_get.h @@ -0,0 +1,76 @@ +/* + * set_get.h -- Internal set/get definitions + * + * Copyright (C) 2003 Gabriel Bouvigne / Lame project + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __SET_GET_H__ +#define __SET_GET_H__ + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +/* select psychoacoustic model */ + +/* manage short blocks */ + int CDECL lame_set_short_threshold(lame_global_flags *, float, float); + int CDECL lame_set_short_threshold_lrm(lame_global_flags *, float); + float CDECL lame_get_short_threshold_lrm(const lame_global_flags *); + int CDECL lame_set_short_threshold_s(lame_global_flags *, float); + float CDECL lame_get_short_threshold_s(const lame_global_flags *); + + + int CDECL lame_set_maskingadjust(lame_global_flags *, float); + float CDECL lame_get_maskingadjust(const lame_global_flags *); + + int CDECL lame_set_maskingadjust_short(lame_global_flags *, float); + float CDECL lame_get_maskingadjust_short(const lame_global_flags *); + +/* select ATH formula 4 shape */ + int CDECL lame_set_ATHcurve(lame_global_flags *, float); + float CDECL lame_get_ATHcurve(const lame_global_flags *); + + int CDECL lame_set_preset_notune(lame_global_flags *, int); + +/* substep shaping method */ + int CDECL lame_set_substep(lame_global_flags *, int); + int CDECL lame_get_substep(const lame_global_flags *); + +/* scalefactors scale */ + int CDECL lame_set_sfscale(lame_global_flags *, int); + int CDECL lame_get_sfscale(const lame_global_flags *); + +/* subblock gain */ + int CDECL lame_set_subblock_gain(lame_global_flags *, int); + int CDECL lame_get_subblock_gain(const lame_global_flags *); + + + +/*presets*/ + int apply_preset(lame_global_flags *, int preset, int enforce); + + void CDECL lame_set_tune(lame_t, float); /* FOR INTERNAL USE ONLY */ + void CDECL lame_set_msfix(lame_t gfp, double msfix); + + +#if defined(__cplusplus) +} +#endif +#endif diff --git a/node_modules/lame/deps/lame/libmp3lame/tables.c b/node_modules/lame/deps/lame/libmp3lame/tables.c new file mode 100644 index 0000000..a023099 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/tables.c @@ -0,0 +1,564 @@ +/* + * MPEG layer 3 tables source file + * + * Copyright (c) 1999 Albert L Faber + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: tables.c,v 1.29 2011/05/07 16:05:17 rbrito Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "machine.h" + +#include "lame.h" +#include "tables.h" + + +static const uint16_t t1HB[] = { + 1, 1, + 1, 0 +}; + +static const uint16_t t2HB[] = { + 1, 2, 1, + 3, 1, 1, + 3, 2, 0 +}; + +static const uint16_t t3HB[] = { + 3, 2, 1, + 1, 1, 1, + 3, 2, 0 +}; + +static const uint16_t t5HB[] = { + 1, 2, 6, 5, + 3, 1, 4, 4, + 7, 5, 7, 1, + 6, 1, 1, 0 +}; + +static const uint16_t t6HB[] = { + 7, 3, 5, 1, + 6, 2, 3, 2, + 5, 4, 4, 1, + 3, 3, 2, 0 +}; + +static const uint16_t t7HB[] = { + 1, 2, 10, 19, 16, 10, + 3, 3, 7, 10, 5, 3, + 11, 4, 13, 17, 8, 4, + 12, 11, 18, 15, 11, 2, + 7, 6, 9, 14, 3, 1, + 6, 4, 5, 3, 2, 0 +}; + +static const uint16_t t8HB[] = { + 3, 4, 6, 18, 12, 5, + 5, 1, 2, 16, 9, 3, + 7, 3, 5, 14, 7, 3, + 19, 17, 15, 13, 10, 4, + 13, 5, 8, 11, 5, 1, + 12, 4, 4, 1, 1, 0 +}; + +static const uint16_t t9HB[] = { + 7, 5, 9, 14, 15, 7, + 6, 4, 5, 5, 6, 7, + 7, 6, 8, 8, 8, 5, + 15, 6, 9, 10, 5, 1, + 11, 7, 9, 6, 4, 1, + 14, 4, 6, 2, 6, 0 +}; + +static const uint16_t t10HB[] = { + 1, 2, 10, 23, 35, 30, 12, 17, + 3, 3, 8, 12, 18, 21, 12, 7, + 11, 9, 15, 21, 32, 40, 19, 6, + 14, 13, 22, 34, 46, 23, 18, 7, + 20, 19, 33, 47, 27, 22, 9, 3, + 31, 22, 41, 26, 21, 20, 5, 3, + 14, 13, 10, 11, 16, 6, 5, 1, + 9, 8, 7, 8, 4, 4, 2, 0 +}; + +static const uint16_t t11HB[] = { + 3, 4, 10, 24, 34, 33, 21, 15, + 5, 3, 4, 10, 32, 17, 11, 10, + 11, 7, 13, 18, 30, 31, 20, 5, + 25, 11, 19, 59, 27, 18, 12, 5, + 35, 33, 31, 58, 30, 16, 7, 5, + 28, 26, 32, 19, 17, 15, 8, 14, + 14, 12, 9, 13, 14, 9, 4, 1, + 11, 4, 6, 6, 6, 3, 2, 0 +}; + +static const uint16_t t12HB[] = { + 9, 6, 16, 33, 41, 39, 38, 26, + 7, 5, 6, 9, 23, 16, 26, 11, + 17, 7, 11, 14, 21, 30, 10, 7, + 17, 10, 15, 12, 18, 28, 14, 5, + 32, 13, 22, 19, 18, 16, 9, 5, + 40, 17, 31, 29, 17, 13, 4, 2, + 27, 12, 11, 15, 10, 7, 4, 1, + 27, 12, 8, 12, 6, 3, 1, 0 +}; + +static const uint16_t t13HB[] = { + 1, 5, 14, 21, 34, 51, 46, 71, 42, 52, 68, 52, 67, 44, 43, 19, + 3, 4, 12, 19, 31, 26, 44, 33, 31, 24, 32, 24, 31, 35, 22, 14, + 15, 13, 23, 36, 59, 49, 77, 65, 29, 40, 30, 40, 27, 33, 42, 16, + 22, 20, 37, 61, 56, 79, 73, 64, 43, 76, 56, 37, 26, 31, 25, 14, + 35, 16, 60, 57, 97, 75, 114, 91, 54, 73, 55, 41, 48, 53, 23, 24, + 58, 27, 50, 96, 76, 70, 93, 84, 77, 58, 79, 29, 74, 49, 41, 17, + 47, 45, 78, 74, 115, 94, 90, 79, 69, 83, 71, 50, 59, 38, 36, 15, + 72, 34, 56, 95, 92, 85, 91, 90, 86, 73, 77, 65, 51, 44, 43, 42, + 43, 20, 30, 44, 55, 78, 72, 87, 78, 61, 46, 54, 37, 30, 20, 16, + 53, 25, 41, 37, 44, 59, 54, 81, 66, 76, 57, 54, 37, 18, 39, 11, + 35, 33, 31, 57, 42, 82, 72, 80, 47, 58, 55, 21, 22, 26, 38, 22, + 53, 25, 23, 38, 70, 60, 51, 36, 55, 26, 34, 23, 27, 14, 9, 7, + 34, 32, 28, 39, 49, 75, 30, 52, 48, 40, 52, 28, 18, 17, 9, 5, + 45, 21, 34, 64, 56, 50, 49, 45, 31, 19, 12, 15, 10, 7, 6, 3, + 48, 23, 20, 39, 36, 35, 53, 21, 16, 23, 13, 10, 6, 1, 4, 2, + 16, 15, 17, 27, 25, 20, 29, 11, 17, 12, 16, 8, 1, 1, 0, 1 +}; + +static const uint16_t t15HB[] = { + 7, 12, 18, 53, 47, 76, 124, 108, 89, 123, 108, 119, 107, 81, 122, 63, + 13, 5, 16, 27, 46, 36, 61, 51, 42, 70, 52, 83, 65, 41, 59, 36, + 19, 17, 15, 24, 41, 34, 59, 48, 40, 64, 50, 78, 62, 80, 56, 33, + 29, 28, 25, 43, 39, 63, 55, 93, 76, 59, 93, 72, 54, 75, 50, 29, + 52, 22, 42, 40, 67, 57, 95, 79, 72, 57, 89, 69, 49, 66, 46, 27, + 77, 37, 35, 66, 58, 52, 91, 74, 62, 48, 79, 63, 90, 62, 40, 38, + 125, 32, 60, 56, 50, 92, 78, 65, 55, 87, 71, 51, 73, 51, 70, 30, + 109, 53, 49, 94, 88, 75, 66, 122, 91, 73, 56, 42, 64, 44, 21, 25, + 90, 43, 41, 77, 73, 63, 56, 92, 77, 66, 47, 67, 48, 53, 36, 20, + 71, 34, 67, 60, 58, 49, 88, 76, 67, 106, 71, 54, 38, 39, 23, 15, + 109, 53, 51, 47, 90, 82, 58, 57, 48, 72, 57, 41, 23, 27, 62, 9, + 86, 42, 40, 37, 70, 64, 52, 43, 70, 55, 42, 25, 29, 18, 11, 11, + 118, 68, 30, 55, 50, 46, 74, 65, 49, 39, 24, 16, 22, 13, 14, 7, + 91, 44, 39, 38, 34, 63, 52, 45, 31, 52, 28, 19, 14, 8, 9, 3, + 123, 60, 58, 53, 47, 43, 32, 22, 37, 24, 17, 12, 15, 10, 2, 1, + 71, 37, 34, 30, 28, 20, 17, 26, 21, 16, 10, 6, 8, 6, 2, 0 +}; + +static const uint16_t t16HB[] = { + 1, 5, 14, 44, 74, 63, 110, 93, 172, 149, 138, 242, 225, 195, 376, 17, + 3, 4, 12, 20, 35, 62, 53, 47, 83, 75, 68, 119, 201, 107, 207, 9, + 15, 13, 23, 38, 67, 58, 103, 90, 161, 72, 127, 117, 110, 209, 206, 16, + 45, 21, 39, 69, 64, 114, 99, 87, 158, 140, 252, 212, 199, 387, 365, 26, + 75, 36, 68, 65, 115, 101, 179, 164, 155, 264, 246, 226, 395, 382, 362, 9, + 66, 30, 59, 56, 102, 185, 173, 265, 142, 253, 232, 400, 388, 378, 445, 16, + 111, 54, 52, 100, 184, 178, 160, 133, 257, 244, 228, 217, 385, 366, 715, 10, + 98, 48, 91, 88, 165, 157, 148, 261, 248, 407, 397, 372, 380, 889, 884, 8, + 85, 84, 81, 159, 156, 143, 260, 249, 427, 401, 392, 383, 727, 713, 708, 7, + 154, 76, 73, 141, 131, 256, 245, 426, 406, 394, 384, 735, 359, 710, 352, 11, + 139, 129, 67, 125, 247, 233, 229, 219, 393, 743, 737, 720, 885, 882, 439, 4, + 243, 120, 118, 115, 227, 223, 396, 746, 742, 736, 721, 712, 706, 223, 436, 6, + 202, 224, 222, 218, 216, 389, 386, 381, 364, 888, 443, 707, 440, 437, 1728, 4, + 747, 211, 210, 208, 370, 379, 734, 723, 714, 1735, 883, 877, 876, 3459, 865, 2, + 377, 369, 102, 187, 726, 722, 358, 711, 709, 866, 1734, 871, 3458, 870, 434, 0, + 12, 10, 7, 11, 10, 17, 11, 9, 13, 12, 10, 7, 5, 3, 1, 3 +}; + +static const uint16_t t24HB[] = { + 15, 13, 46, 80, 146, 262, 248, 434, 426, 669, 653, 649, 621, 517, 1032, 88, + 14, 12, 21, 38, 71, 130, 122, 216, 209, 198, 327, 345, 319, 297, 279, 42, + 47, 22, 41, 74, 68, 128, 120, 221, 207, 194, 182, 340, 315, 295, 541, 18, + 81, 39, 75, 70, 134, 125, 116, 220, 204, 190, 178, 325, 311, 293, 271, 16, + 147, 72, 69, 135, 127, 118, 112, 210, 200, 188, 352, 323, 306, 285, 540, 14, + 263, 66, 129, 126, 119, 114, 214, 202, 192, 180, 341, 317, 301, 281, 262, 12, + 249, 123, 121, 117, 113, 215, 206, 195, 185, 347, 330, 308, 291, 272, 520, 10, + 435, 115, 111, 109, 211, 203, 196, 187, 353, 332, 313, 298, 283, 531, 381, 17, + 427, 212, 208, 205, 201, 193, 186, 177, 169, 320, 303, 286, 268, 514, 377, 16, + 335, 199, 197, 191, 189, 181, 174, 333, 321, 305, 289, 275, 521, 379, 371, 11, + 668, 184, 183, 179, 175, 344, 331, 314, 304, 290, 277, 530, 383, 373, 366, 10, + 652, 346, 171, 168, 164, 318, 309, 299, 287, 276, 263, 513, 375, 368, 362, 6, + 648, 322, 316, 312, 307, 302, 292, 284, 269, 261, 512, 376, 370, 364, 359, 4, + 620, 300, 296, 294, 288, 282, 273, 266, 515, 380, 374, 369, 365, 361, 357, 2, + 1033, 280, 278, 274, 267, 264, 259, 382, 378, 372, 367, 363, 360, 358, 356, 0, + 43, 20, 19, 17, 15, 13, 11, 9, 7, 6, 4, 7, 5, 3, 1, 3 +}; + +static const uint16_t t32HB[] = { + 1 << 0, 5 << 1, 4 << 1, 5 << 2, 6 << 1, 5 << 2, 4 << 2, 4 << 3, + 7 << 1, 3 << 2, 6 << 2, 0 << 3, 7 << 2, 2 << 3, 3 << 3, 1 << 4 +}; + +static const uint16_t t33HB[] = { + 15 << 0, 14 << 1, 13 << 1, 12 << 2, 11 << 1, 10 << 2, 9 << 2, 8 << 3, + 7 << 1, 6 << 2, 5 << 2, 4 << 3, 3 << 2, 2 << 3, 1 << 3, 0 << 4 +}; + + +const uint8_t t1l[] = { + 1, 4, + 3, 5 +}; + +static const uint8_t t2l[] = { + 1, 4, 7, + 4, 5, 7, + 6, 7, 8 +}; + +static const uint8_t t3l[] = { + 2, 3, 7, + 4, 4, 7, + 6, 7, 8 +}; + +static const uint8_t t5l[] = { + 1, 4, 7, 8, + 4, 5, 8, 9, + 7, 8, 9, 10, + 8, 8, 9, 10 +}; + +static const uint8_t t6l[] = { + 3, 4, 6, 8, + 4, 4, 6, 7, + 5, 6, 7, 8, + 7, 7, 8, 9 +}; + +static const uint8_t t7l[] = { + 1, 4, 7, 9, 9, 10, + 4, 6, 8, 9, 9, 10, + 7, 7, 9, 10, 10, 11, + 8, 9, 10, 11, 11, 11, + 8, 9, 10, 11, 11, 12, + 9, 10, 11, 12, 12, 12 +}; + +static const uint8_t t8l[] = { + 2, 4, 7, 9, 9, 10, + 4, 4, 6, 10, 10, 10, + 7, 6, 8, 10, 10, 11, + 9, 10, 10, 11, 11, 12, + 9, 9, 10, 11, 12, 12, + 10, 10, 11, 11, 13, 13 +}; + +static const uint8_t t9l[] = { + 3, 4, 6, 7, 9, 10, + 4, 5, 6, 7, 8, 10, + 5, 6, 7, 8, 9, 10, + 7, 7, 8, 9, 9, 10, + 8, 8, 9, 9, 10, 11, + 9, 9, 10, 10, 11, 11 +}; + +static const uint8_t t10l[] = { + 1, 4, 7, 9, 10, 10, 10, 11, + 4, 6, 8, 9, 10, 11, 10, 10, + 7, 8, 9, 10, 11, 12, 11, 11, + 8, 9, 10, 11, 12, 12, 11, 12, + 9, 10, 11, 12, 12, 12, 12, 12, + 10, 11, 12, 12, 13, 13, 12, 13, + 9, 10, 11, 12, 12, 12, 13, 13, + 10, 10, 11, 12, 12, 13, 13, 13 +}; + +static const uint8_t t11l[] = { + 2, 4, 6, 8, 9, 10, 9, 10, + 4, 5, 6, 8, 10, 10, 9, 10, + 6, 7, 8, 9, 10, 11, 10, 10, + 8, 8, 9, 11, 10, 12, 10, 11, + 9, 10, 10, 11, 11, 12, 11, 12, + 9, 10, 11, 12, 12, 13, 12, 13, + 9, 9, 9, 10, 11, 12, 12, 12, + 9, 9, 10, 11, 12, 12, 12, 12 +}; + +static const uint8_t t12l[] = { + 4, 4, 6, 8, 9, 10, 10, 10, + 4, 5, 6, 7, 9, 9, 10, 10, + 6, 6, 7, 8, 9, 10, 9, 10, + 7, 7, 8, 8, 9, 10, 10, 10, + 8, 8, 9, 9, 10, 10, 10, 11, + 9, 9, 10, 10, 10, 11, 10, 11, + 9, 9, 9, 10, 10, 11, 11, 12, + 10, 10, 10, 11, 11, 11, 11, 12 +}; + +static const uint8_t t13l[] = { + 1, 5, 7, 8, 9, 10, 10, 11, 10, 11, 12, 12, 13, 13, 14, 14, + 4, 6, 8, 9, 10, 10, 11, 11, 11, 11, 12, 12, 13, 14, 14, 14, + 7, 8, 9, 10, 11, 11, 12, 12, 11, 12, 12, 13, 13, 14, 15, 15, + 8, 9, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 15, 15, + 9, 9, 11, 11, 12, 12, 13, 13, 12, 13, 13, 14, 14, 15, 15, 16, + 10, 10, 11, 12, 12, 12, 13, 13, 13, 13, 14, 13, 15, 15, 16, 16, + 10, 11, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 15, 15, 16, 16, + 11, 11, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 18, 18, + 10, 10, 11, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 16, 17, 17, + 11, 11, 12, 12, 13, 13, 13, 15, 14, 15, 15, 16, 16, 16, 18, 17, + 11, 12, 12, 13, 13, 14, 14, 15, 14, 15, 16, 15, 16, 17, 18, 19, + 12, 12, 12, 13, 14, 14, 14, 14, 15, 15, 15, 16, 17, 17, 17, 18, + 12, 13, 13, 14, 14, 15, 14, 15, 16, 16, 17, 17, 17, 18, 18, 18, + 13, 13, 14, 15, 15, 15, 16, 16, 16, 16, 16, 17, 18, 17, 18, 18, + 14, 14, 14, 15, 15, 15, 17, 16, 16, 19, 17, 17, 17, 19, 18, 18, + 13, 14, 15, 16, 16, 16, 17, 16, 17, 17, 18, 18, 21, 20, 21, 18 +}; + +static const uint8_t t15l[] = { + 3, 5, 6, 8, 8, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 14, + 5, 5, 7, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, + 6, 7, 7, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 13, + 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, + 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, + 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 13, 13, 13, 14, + 10, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 14, 14, + 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 14, + 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, + 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, + 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 15, 14, + 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 15, + 12, 12, 11, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 15, 15, + 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, + 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 14, 15, + 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15 +}; + +static const uint8_t t16_5l[] = { + 1, 5, 7, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 11, + 4, 6, 8, 9, 10, 11, 11, 11, 12, 12, 12, 13, 14, 13, 14, 11, + 7, 8, 9, 10, 11, 11, 12, 12, 13, 12, 13, 13, 13, 14, 14, 12, + 9, 9, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 13, + 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 12, + 10, 10, 11, 11, 12, 13, 13, 14, 13, 14, 14, 15, 15, 15, 16, 13, + 11, 11, 11, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 16, 13, + 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 15, 17, 17, 13, + 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 13, + 12, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 15, 16, 15, 14, + 12, 13, 12, 13, 14, 14, 14, 14, 15, 16, 16, 16, 17, 17, 16, 13, + 13, 13, 13, 13, 14, 14, 15, 16, 16, 16, 16, 16, 16, 15, 16, 14, + 13, 14, 14, 14, 14, 15, 15, 15, 15, 17, 16, 16, 16, 16, 18, 14, + 15, 14, 14, 14, 15, 15, 16, 16, 16, 18, 17, 17, 17, 19, 17, 14, + 14, 15, 13, 14, 16, 16, 15, 16, 16, 17, 18, 17, 19, 17, 16, 14, + 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 12 +}; + +static const uint8_t t16l[] = { + 1, 5, 7, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 10, + 4, 6, 8, 9, 10, 11, 11, 11, 12, 12, 12, 13, 14, 13, 14, 10, + 7, 8, 9, 10, 11, 11, 12, 12, 13, 12, 13, 13, 13, 14, 14, 11, + 9, 9, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 12, + 10, 10, 11, 11, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 11, + 10, 10, 11, 11, 12, 13, 13, 14, 13, 14, 14, 15, 15, 15, 16, 12, + 11, 11, 11, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 16, 12, + 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 15, 17, 17, 12, + 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 12, + 12, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 15, 16, 15, 13, + 12, 13, 12, 13, 14, 14, 14, 14, 15, 16, 16, 16, 17, 17, 16, 12, + 13, 13, 13, 13, 14, 14, 15, 16, 16, 16, 16, 16, 16, 15, 16, 13, + 13, 14, 14, 14, 14, 15, 15, 15, 15, 17, 16, 16, 16, 16, 18, 13, + 15, 14, 14, 14, 15, 15, 16, 16, 16, 18, 17, 17, 17, 19, 17, 13, + 14, 15, 13, 14, 16, 16, 15, 16, 16, 17, 18, 17, 19, 17, 16, 13, + 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 10 +}; + +static const uint8_t t24l[] = { + 4, 5, 7, 8, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 13, 10, + 5, 6, 7, 8, 9, 10, 10, 11, 11, 11, 12, 12, 12, 12, 12, 10, + 7, 7, 8, 9, 9, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 9, + 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 9, + 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 9, + 10, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 9, + 10, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 9, + 11, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 10, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 10, + 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 10, + 12, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 10, + 12, 12, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 10, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 10, + 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 10, + 13, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 10, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 6 +}; + +const uint8_t t32l[] = { + 1 + 0, 4 + 1, 4 + 1, 5 + 2, 4 + 1, 6 + 2, 5 + 2, 6 + 3, + 4 + 1, 5 + 2, 5 + 2, 6 + 3, 5 + 2, 6 + 3, 6 + 3, 6 + 4 +}; + +const uint8_t t33l[] = { + 4 + 0, 4 + 1, 4 + 1, 4 + 2, 4 + 1, 4 + 2, 4 + 2, 4 + 3, + 4 + 1, 4 + 2, 4 + 2, 4 + 3, 4 + 2, 4 + 3, 4 + 3, 4 + 4 +}; + + +const struct huffcodetab ht[HTN] = { + /* xlen, linmax, table, hlen */ + {0, 0, NULL, NULL}, + {2, 0, t1HB, t1l}, + {3, 0, t2HB, t2l}, + {3, 0, t3HB, t3l}, + {0, 0, NULL, NULL}, /* Apparently not used */ + {4, 0, t5HB, t5l}, + {4, 0, t6HB, t6l}, + {6, 0, t7HB, t7l}, + {6, 0, t8HB, t8l}, + {6, 0, t9HB, t9l}, + {8, 0, t10HB, t10l}, + {8, 0, t11HB, t11l}, + {8, 0, t12HB, t12l}, + {16, 0, t13HB, t13l}, + {0, 0, NULL, t16_5l}, /* Apparently not used */ + {16, 0, t15HB, t15l}, + + {1, 1, t16HB, t16l}, + {2, 3, t16HB, t16l}, + {3, 7, t16HB, t16l}, + {4, 15, t16HB, t16l}, + {6, 63, t16HB, t16l}, + {8, 255, t16HB, t16l}, + {10, 1023, t16HB, t16l}, + {13, 8191, t16HB, t16l}, + + {4, 15, t24HB, t24l}, + {5, 31, t24HB, t24l}, + {6, 63, t24HB, t24l}, + {7, 127, t24HB, t24l}, + {8, 255, t24HB, t24l}, + {9, 511, t24HB, t24l}, + {11, 2047, t24HB, t24l}, + {13, 8191, t24HB, t24l}, + + {0, 0, t32HB, t32l}, + {0, 0, t33HB, t33l}, +}; + + + + + +/* for (i = 0; i < 16*16; i++) { + * largetbl[i] = ((ht[16].hlen[i]) << 16) + ht[24].hlen[i]; + * } + */ +const uint32_t largetbl[16 * 16] = { + 0x010004, 0x050005, 0x070007, 0x090008, 0x0a0009, 0x0a000a, 0x0b000a, 0x0b000b, + 0x0c000b, 0x0c000c, 0x0c000c, 0x0d000c, 0x0d000c, 0x0d000c, 0x0e000d, 0x0a000a, + 0x040005, 0x060006, 0x080007, 0x090008, 0x0a0009, 0x0b000a, 0x0b000a, 0x0b000b, + 0x0c000b, 0x0c000b, 0x0c000c, 0x0d000c, 0x0e000c, 0x0d000c, 0x0e000c, 0x0a000a, + 0x070007, 0x080007, 0x090008, 0x0a0009, 0x0b0009, 0x0b000a, 0x0c000a, 0x0c000b, + 0x0d000b, 0x0c000b, 0x0d000b, 0x0d000c, 0x0d000c, 0x0e000c, 0x0e000d, 0x0b0009, + 0x090008, 0x090008, 0x0a0009, 0x0b0009, 0x0b000a, 0x0c000a, 0x0c000a, 0x0c000b, + 0x0d000b, 0x0d000b, 0x0e000b, 0x0e000c, 0x0e000c, 0x0f000c, 0x0f000c, 0x0c0009, + 0x0a0009, 0x0a0009, 0x0b0009, 0x0b000a, 0x0c000a, 0x0c000a, 0x0d000a, 0x0d000b, + 0x0d000b, 0x0e000b, 0x0e000c, 0x0e000c, 0x0f000c, 0x0f000c, 0x0f000d, 0x0b0009, + 0x0a000a, 0x0a0009, 0x0b000a, 0x0b000a, 0x0c000a, 0x0d000a, 0x0d000b, 0x0e000b, + 0x0d000b, 0x0e000b, 0x0e000c, 0x0f000c, 0x0f000c, 0x0f000c, 0x10000c, 0x0c0009, + 0x0b000a, 0x0b000a, 0x0b000a, 0x0c000a, 0x0d000a, 0x0d000b, 0x0d000b, 0x0d000b, + 0x0e000b, 0x0e000c, 0x0e000c, 0x0e000c, 0x0f000c, 0x0f000c, 0x10000d, 0x0c0009, + 0x0b000b, 0x0b000a, 0x0c000a, 0x0c000a, 0x0d000b, 0x0d000b, 0x0d000b, 0x0e000b, + 0x0e000c, 0x0f000c, 0x0f000c, 0x0f000c, 0x0f000c, 0x11000d, 0x11000d, 0x0c000a, + 0x0b000b, 0x0c000b, 0x0c000b, 0x0d000b, 0x0d000b, 0x0d000b, 0x0e000b, 0x0e000b, + 0x0f000b, 0x0f000c, 0x0f000c, 0x0f000c, 0x10000c, 0x10000d, 0x10000d, 0x0c000a, + 0x0c000b, 0x0c000b, 0x0c000b, 0x0d000b, 0x0d000b, 0x0e000b, 0x0e000b, 0x0f000c, + 0x0f000c, 0x0f000c, 0x0f000c, 0x10000c, 0x0f000d, 0x10000d, 0x0f000d, 0x0d000a, + 0x0c000c, 0x0d000b, 0x0c000b, 0x0d000b, 0x0e000b, 0x0e000c, 0x0e000c, 0x0e000c, + 0x0f000c, 0x10000c, 0x10000c, 0x10000d, 0x11000d, 0x11000d, 0x10000d, 0x0c000a, + 0x0d000c, 0x0d000c, 0x0d000b, 0x0d000b, 0x0e000b, 0x0e000c, 0x0f000c, 0x10000c, + 0x10000c, 0x10000c, 0x10000c, 0x10000d, 0x10000d, 0x0f000d, 0x10000d, 0x0d000a, + 0x0d000c, 0x0e000c, 0x0e000c, 0x0e000c, 0x0e000c, 0x0f000c, 0x0f000c, 0x0f000c, + 0x0f000c, 0x11000c, 0x10000d, 0x10000d, 0x10000d, 0x10000d, 0x12000d, 0x0d000a, + 0x0f000c, 0x0e000c, 0x0e000c, 0x0e000c, 0x0f000c, 0x0f000c, 0x10000c, 0x10000c, + 0x10000d, 0x12000d, 0x11000d, 0x11000d, 0x11000d, 0x13000d, 0x11000d, 0x0d000a, + 0x0e000d, 0x0f000c, 0x0d000c, 0x0e000c, 0x10000c, 0x10000c, 0x0f000c, 0x10000d, + 0x10000d, 0x11000d, 0x12000d, 0x11000d, 0x13000d, 0x11000d, 0x10000d, 0x0d000a, + 0x0a0009, 0x0a0009, 0x0a0009, 0x0b0009, 0x0b0009, 0x0c0009, 0x0c0009, 0x0c0009, + 0x0d0009, 0x0d0009, 0x0d0009, 0x0d000a, 0x0d000a, 0x0d000a, 0x0d000a, 0x0a0006 +}; + +/* for (i = 0; i < 3*3; i++) { + * table23[i] = ((ht[2].hlen[i]) << 16) + ht[3].hlen[i]; + * } + */ +const uint32_t table23[3 * 3] = { + 0x010002, 0x040003, 0x070007, + 0x040004, 0x050004, 0x070007, + 0x060006, 0x070007, 0x080008 +}; + +/* for (i = 0; i < 4*4; i++) { + * table56[i] = ((ht[5].hlen[i]) << 16) + ht[6].hlen[i]; + * } + */ +const uint32_t table56[4 * 4] = { + 0x010003, 0x040004, 0x070006, 0x080008, 0x040004, 0x050004, 0x080006, 0x090007, + 0x070005, 0x080006, 0x090007, 0x0a0008, 0x080007, 0x080007, 0x090008, 0x0a0009 +}; + + + +/* + * 0: MPEG-2 LSF + * 1: MPEG-1 + * 2: MPEG-2.5 LSF FhG extention (1995-07-11 shn) + */ + +typedef enum { + MPEG_2 = 0, + MPEG_1 = 1, + MPEG_25 = 2 +} MPEG_t; + +const int bitrate_table[3][16] = { + {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1}, /* MPEG 2 */ + {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1}, /* MPEG 1 */ + {0, 8, 16, 24, 32, 40, 48, 56, 64, -1, -1, -1, -1, -1, -1, -1}, /* MPEG 2.5 */ +}; + +const int samplerate_table[3][4] = { + {22050, 24000, 16000, -1}, /* MPEG 2 */ + {44100, 48000, 32000, -1}, /* MPEG 1 */ + {11025, 12000, 8000, -1}, /* MPEG 2.5 */ +}; + +int +lame_get_bitrate(int mpeg_version, int table_index) +{ + if (0 <= mpeg_version && mpeg_version <= 2) { + if (0 <= table_index && table_index <= 15) { + return bitrate_table[mpeg_version][table_index]; + } + } + return -1; +} + +int +lame_get_samplerate(int mpeg_version, int table_index) +{ + if (0 <= mpeg_version && mpeg_version <= 2) { + if (0 <= table_index && table_index <= 3) { + return samplerate_table[mpeg_version][table_index]; + } + } + return -1; +} + + +/* This is the scfsi_band table from 2.4.2.7 of the IS */ +const int scfsi_band[5] = { 0, 6, 11, 16, 21 }; + +/* end of tables.c */ diff --git a/node_modules/lame/deps/lame/libmp3lame/tables.h b/node_modules/lame/deps/lame/libmp3lame/tables.h new file mode 100644 index 0000000..0dd7deb --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/tables.h @@ -0,0 +1,95 @@ +/* + * MPEG layer 3 tables include file + * + * Copyright (c) 1999 Albert L Faber + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_TABLES_H +#define LAME_TABLES_H + +#if 0 +typedef struct { + unsigned char no; + unsigned char width; + unsigned char minval_2; + float quiet_thr; + float norm; + float bark; +} type1_t; + +typedef struct { + unsigned char no; + unsigned char width; + float quiet_thr; + float norm; + float SNR; + float bark; +} type2_t; + +typedef struct { + unsigned int no:5; + unsigned int cbw:3; + unsigned int bu:6; + unsigned int bo:6; + unsigned int w1_576:10; + unsigned int w2_576:10; +} type34_t; + +typedef struct { + size_t len1; + const type1_t *const tab1; + size_t len2; + const type2_t *const tab2; + size_t len3; + const type34_t *const tab3; + size_t len4; + const type34_t *const tab4; +} type5_t; + +extern const type5_t table5[6]; + +#endif + +#define HTN 34 + +struct huffcodetab { + const unsigned int xlen; /* max. x-index+ */ + const unsigned int linmax; /* max number to be stored in linbits */ + const uint16_t *table; /* pointer to array[xlen][ylen] */ + const uint8_t *hlen; /* pointer to array[xlen][ylen] */ +}; + +extern const struct huffcodetab ht[HTN]; + /* global memory block */ + /* array of all huffcodtable headers */ + /* 0..31 Huffman code table 0..31 */ + /* 32,33 count1-tables */ + +extern const uint8_t t32l[]; +extern const uint8_t t33l[]; + +extern const uint32_t largetbl[16 * 16]; +extern const uint32_t table23[3 * 3]; +extern const uint32_t table56[4 * 4]; + +extern const int scfsi_band[5]; + +extern const int bitrate_table [3][16]; +extern const int samplerate_table [3][ 4]; + +#endif /* LAME_TABLES_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/takehiro.c b/node_modules/lame/deps/lame/libmp3lame/takehiro.c new file mode 100644 index 0000000..9781feb --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/takehiro.c @@ -0,0 +1,1375 @@ +/* + * MP3 huffman table selecting and bit counting + * + * Copyright (c) 1999-2005 Takehiro TOMINAGA + * Copyright (c) 2002-2005 Gabriel Bouvigne + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: takehiro.c,v 1.79 2011/05/07 16:05:17 rbrito Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "quantize_pvt.h" +#include "tables.h" + + +static const struct { + const int region0_count; + const int region1_count; +} subdv_table[23] = { + { + 0, 0}, /* 0 bands */ + { + 0, 0}, /* 1 bands */ + { + 0, 0}, /* 2 bands */ + { + 0, 0}, /* 3 bands */ + { + 0, 0}, /* 4 bands */ + { + 0, 1}, /* 5 bands */ + { + 1, 1}, /* 6 bands */ + { + 1, 1}, /* 7 bands */ + { + 1, 2}, /* 8 bands */ + { + 2, 2}, /* 9 bands */ + { + 2, 3}, /* 10 bands */ + { + 2, 3}, /* 11 bands */ + { + 3, 4}, /* 12 bands */ + { + 3, 4}, /* 13 bands */ + { + 3, 4}, /* 14 bands */ + { + 4, 5}, /* 15 bands */ + { + 4, 5}, /* 16 bands */ + { + 4, 6}, /* 17 bands */ + { + 5, 6}, /* 18 bands */ + { + 5, 6}, /* 19 bands */ + { + 5, 7}, /* 20 bands */ + { + 6, 7}, /* 21 bands */ + { + 6, 7}, /* 22 bands */ +}; + + + + + +/********************************************************************* + * nonlinear quantization of xr + * More accurate formula than the ISO formula. Takes into account + * the fact that we are quantizing xr -> ix, but we want ix^4/3 to be + * as close as possible to x^4/3. (taking the nearest int would mean + * ix is as close as possible to xr, which is different.) + * + * From Segher Boessenkool 11/1999 + * + * 09/2000: ASM code removed in favor of IEEE754 hack by Takehiro + * Tominaga. If you need the ASM code, check CVS circa Aug 2000. + * + * 01/2004: Optimizations by Gabriel Bouvigne + *********************************************************************/ + + + + + +static void +quantize_lines_xrpow_01(unsigned int l, FLOAT istep, const FLOAT * xr, int *ix) +{ + const FLOAT compareval0 = (1.0f - 0.4054f) / istep; + unsigned int i; + + assert(l > 0); + assert(l % 2 == 0); + for (i = 0; i < l; i += 2) { + FLOAT const xr_0 = xr[i+0]; + FLOAT const xr_1 = xr[i+1]; + int const ix_0 = (compareval0 > xr_0) ? 0 : 1; + int const ix_1 = (compareval0 > xr_1) ? 0 : 1; + ix[i+0] = ix_0; + ix[i+1] = ix_1; + } +} + + + +#ifdef TAKEHIRO_IEEE754_HACK + +typedef union { + float f; + int i; +} fi_union; + +#define MAGIC_FLOAT (65536*(128)) +#define MAGIC_INT 0x4b000000 + + +static void +quantize_lines_xrpow(unsigned int l, FLOAT istep, const FLOAT * xp, int *pi) +{ + fi_union *fi; + unsigned int remaining; + + assert(l > 0); + + fi = (fi_union *) pi; + + l = l >> 1; + remaining = l % 2; + l = l >> 1; + while (l--) { + double x0 = istep * xp[0]; + double x1 = istep * xp[1]; + double x2 = istep * xp[2]; + double x3 = istep * xp[3]; + + x0 += MAGIC_FLOAT; + fi[0].f = x0; + x1 += MAGIC_FLOAT; + fi[1].f = x1; + x2 += MAGIC_FLOAT; + fi[2].f = x2; + x3 += MAGIC_FLOAT; + fi[3].f = x3; + + fi[0].f = x0 + adj43asm[fi[0].i - MAGIC_INT]; + fi[1].f = x1 + adj43asm[fi[1].i - MAGIC_INT]; + fi[2].f = x2 + adj43asm[fi[2].i - MAGIC_INT]; + fi[3].f = x3 + adj43asm[fi[3].i - MAGIC_INT]; + + fi[0].i -= MAGIC_INT; + fi[1].i -= MAGIC_INT; + fi[2].i -= MAGIC_INT; + fi[3].i -= MAGIC_INT; + fi += 4; + xp += 4; + }; + if (remaining) { + double x0 = istep * xp[0]; + double x1 = istep * xp[1]; + + x0 += MAGIC_FLOAT; + fi[0].f = x0; + x1 += MAGIC_FLOAT; + fi[1].f = x1; + + fi[0].f = x0 + adj43asm[fi[0].i - MAGIC_INT]; + fi[1].f = x1 + adj43asm[fi[1].i - MAGIC_INT]; + + fi[0].i -= MAGIC_INT; + fi[1].i -= MAGIC_INT; + } + +} + + +#else + +/********************************************************************* + * XRPOW_FTOI is a macro to convert floats to ints. + * if XRPOW_FTOI(x) = nearest_int(x), then QUANTFAC(x)=adj43asm[x] + * ROUNDFAC= -0.0946 + * + * if XRPOW_FTOI(x) = floor(x), then QUANTFAC(x)=asj43[x] + * ROUNDFAC=0.4054 + * + * Note: using floor() or (int) is extremely slow. On machines where + * the TAKEHIRO_IEEE754_HACK code above does not work, it is worthwile + * to write some ASM for XRPOW_FTOI(). + *********************************************************************/ +#define XRPOW_FTOI(src,dest) ((dest) = (int)(src)) +#define QUANTFAC(rx) adj43[rx] +#define ROUNDFAC 0.4054 + + +static void +quantize_lines_xrpow(unsigned int l, FLOAT istep, const FLOAT * xr, int *ix) +{ + unsigned int remaining; + + assert(l > 0); + + l = l >> 1; + remaining = l % 2; + l = l >> 1; + while (l--) { + FLOAT x0, x1, x2, x3; + int rx0, rx1, rx2, rx3; + + x0 = *xr++ * istep; + x1 = *xr++ * istep; + XRPOW_FTOI(x0, rx0); + x2 = *xr++ * istep; + XRPOW_FTOI(x1, rx1); + x3 = *xr++ * istep; + XRPOW_FTOI(x2, rx2); + x0 += QUANTFAC(rx0); + XRPOW_FTOI(x3, rx3); + x1 += QUANTFAC(rx1); + XRPOW_FTOI(x0, *ix++); + x2 += QUANTFAC(rx2); + XRPOW_FTOI(x1, *ix++); + x3 += QUANTFAC(rx3); + XRPOW_FTOI(x2, *ix++); + XRPOW_FTOI(x3, *ix++); + }; + if (remaining) { + FLOAT x0, x1; + int rx0, rx1; + + x0 = *xr++ * istep; + x1 = *xr++ * istep; + XRPOW_FTOI(x0, rx0); + XRPOW_FTOI(x1, rx1); + x0 += QUANTFAC(rx0); + x1 += QUANTFAC(rx1); + XRPOW_FTOI(x0, *ix++); + XRPOW_FTOI(x1, *ix++); + } + +} + + + +#endif + + + +/********************************************************************* + * Quantization function + * This function will select which lines to quantize and call the + * proper quantization function + *********************************************************************/ + +static void +quantize_xrpow(const FLOAT * xp, int *pi, FLOAT istep, gr_info const *const cod_info, + calc_noise_data const *prev_noise) +{ + /* quantize on xr^(3/4) instead of xr */ + int sfb; + int sfbmax; + int j = 0; + int prev_data_use; + int *iData; + int accumulate = 0; + int accumulate01 = 0; + int *acc_iData; + const FLOAT *acc_xp; + + iData = pi; + acc_xp = xp; + acc_iData = iData; + + + /* Reusing previously computed data does not seems to work if global gain + is changed. Finding why it behaves this way would allow to use a cache of + previously computed values (let's 10 cached values per sfb) that would + probably provide a noticeable speedup */ + prev_data_use = (prev_noise && (cod_info->global_gain == prev_noise->global_gain)); + + if (cod_info->block_type == SHORT_TYPE) + sfbmax = 38; + else + sfbmax = 21; + + for (sfb = 0; sfb <= sfbmax; sfb++) { + int step = -1; + + if (prev_data_use || cod_info->block_type == NORM_TYPE) { + step = + cod_info->global_gain + - ((cod_info->scalefac[sfb] + (cod_info->preflag ? pretab[sfb] : 0)) + << (cod_info->scalefac_scale + 1)) + - cod_info->subblock_gain[cod_info->window[sfb]] * 8; + } + assert(cod_info->width[sfb] >= 0); + if (prev_data_use && (prev_noise->step[sfb] == step)) { + /* do not recompute this part, + but compute accumulated lines */ + if (accumulate) { + quantize_lines_xrpow(accumulate, istep, acc_xp, acc_iData); + accumulate = 0; + } + if (accumulate01) { + quantize_lines_xrpow_01(accumulate01, istep, acc_xp, acc_iData); + accumulate01 = 0; + } + } + else { /*should compute this part */ + int l; + l = cod_info->width[sfb]; + + if ((j + cod_info->width[sfb]) > cod_info->max_nonzero_coeff) { + /*do not compute upper zero part */ + int usefullsize; + usefullsize = cod_info->max_nonzero_coeff - j + 1; + memset(&pi[cod_info->max_nonzero_coeff], 0, + sizeof(int) * (576 - cod_info->max_nonzero_coeff)); + l = usefullsize; + + if (l < 0) { + l = 0; + } + + /* no need to compute higher sfb values */ + sfb = sfbmax + 1; + } + + /*accumulate lines to quantize */ + if (!accumulate && !accumulate01) { + acc_iData = iData; + acc_xp = xp; + } + if (prev_noise && + prev_noise->sfb_count1 > 0 && + sfb >= prev_noise->sfb_count1 && + prev_noise->step[sfb] > 0 && step >= prev_noise->step[sfb]) { + + if (accumulate) { + quantize_lines_xrpow(accumulate, istep, acc_xp, acc_iData); + accumulate = 0; + acc_iData = iData; + acc_xp = xp; + } + accumulate01 += l; + } + else { + if (accumulate01) { + quantize_lines_xrpow_01(accumulate01, istep, acc_xp, acc_iData); + accumulate01 = 0; + acc_iData = iData; + acc_xp = xp; + } + accumulate += l; + } + + if (l <= 0) { + /* rh: 20040215 + * may happen due to "prev_data_use" optimization + */ + if (accumulate01) { + quantize_lines_xrpow_01(accumulate01, istep, acc_xp, acc_iData); + accumulate01 = 0; + } + if (accumulate) { + quantize_lines_xrpow(accumulate, istep, acc_xp, acc_iData); + accumulate = 0; + } + + break; /* ends for-loop */ + } + } + if (sfb <= sfbmax) { + iData += cod_info->width[sfb]; + xp += cod_info->width[sfb]; + j += cod_info->width[sfb]; + } + } + if (accumulate) { /*last data part */ + quantize_lines_xrpow(accumulate, istep, acc_xp, acc_iData); + accumulate = 0; + } + if (accumulate01) { /*last data part */ + quantize_lines_xrpow_01(accumulate01, istep, acc_xp, acc_iData); + accumulate01 = 0; + } + +} + + + + +/*************************************************************************/ +/* ix_max */ +/*************************************************************************/ + +static int +ix_max(const int *ix, const int *end) +{ + int max1 = 0, max2 = 0; + + do { + int const x1 = *ix++; + int const x2 = *ix++; + if (max1 < x1) + max1 = x1; + + if (max2 < x2) + max2 = x2; + } while (ix < end); + if (max1 < max2) + max1 = max2; + return max1; +} + + + + + + + + +static int +count_bit_ESC(const int *ix, const int *const end, int t1, const int t2, unsigned int *const s) +{ + /* ESC-table is used */ + unsigned int const linbits = ht[t1].xlen * 65536u + ht[t2].xlen; + unsigned int sum = 0, sum2; + + do { + unsigned int x = *ix++; + unsigned int y = *ix++; + + if (x >= 15u) { + x = 15u; + sum += linbits; + } + if (y >= 15u) { + y = 15u; + sum += linbits; + } + x <<= 4u; + x += y; + sum += largetbl[x]; + } while (ix < end); + + sum2 = sum & 0xffffu; + sum >>= 16u; + + if (sum > sum2) { + sum = sum2; + t1 = t2; + } + + *s += sum; + return t1; +} + + +static int +count_bit_noESC(const int *ix, const int *end, int mx, unsigned int *s) +{ + /* No ESC-words */ + unsigned int sum1 = 0; + const uint8_t *const hlen1 = ht[1].hlen; + (void) mx; + + do { + unsigned int const x0 = *ix++; + unsigned int const x1 = *ix++; + sum1 += hlen1[ x0+x0 + x1 ]; + } while (ix < end); + + *s += sum1; + return 1; +} + + +static const int huf_tbl_noESC[] = { + 1, 2, 5, 7, 7, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13 +}; + + +static int +count_bit_noESC_from2(const int *ix, const int *end, int max, unsigned int *s) +{ + int t1 = huf_tbl_noESC[max - 1]; + /* No ESC-words */ + const unsigned int xlen = ht[t1].xlen; + uint32_t const* table = (t1 == 2) ? &table23[0] : &table56[0]; + unsigned int sum = 0, sum2; + + do { + unsigned int const x0 = *ix++; + unsigned int const x1 = *ix++; + sum += table[ x0 * xlen + x1 ]; + } while (ix < end); + + sum2 = sum & 0xffffu; + sum >>= 16u; + + if (sum > sum2) { + sum = sum2; + t1++; + } + + *s += sum; + return t1; +} + + +inline static int +count_bit_noESC_from3(const int *ix, const int *end, int max, unsigned int * s) +{ + int t1 = huf_tbl_noESC[max - 1]; + /* No ESC-words */ + unsigned int sum1 = 0; + unsigned int sum2 = 0; + unsigned int sum3 = 0; + const unsigned int xlen = ht[t1].xlen; + const uint8_t *const hlen1 = ht[t1].hlen; + const uint8_t *const hlen2 = ht[t1 + 1].hlen; + const uint8_t *const hlen3 = ht[t1 + 2].hlen; + int t; + + do { + unsigned int x0 = *ix++; + unsigned int x1 = *ix++; + unsigned int x = x0 * xlen + x1; + sum1 += hlen1[x]; + sum2 += hlen2[x]; + sum3 += hlen3[x]; + } while (ix < end); + + t = t1; + if (sum1 > sum2) { + sum1 = sum2; + t++; + } + if (sum1 > sum3) { + sum1 = sum3; + t = t1 + 2; + } + *s += sum1; + + return t; +} + + +/*************************************************************************/ +/* choose table */ +/*************************************************************************/ + +/* + Choose the Huffman table that will encode ix[begin..end] with + the fewest bits. + + Note: This code contains knowledge about the sizes and characteristics + of the Huffman tables as defined in the IS (Table B.7), and will not work + with any arbitrary tables. +*/ +static int count_bit_null(const int* ix, const int* end, int max, unsigned int* s) +{ + (void) ix; + (void) end; + (void) max; + (void) s; + return 0; +} + +typedef int (*count_fnc)(const int* ix, const int* end, int max, unsigned int* s); + +static count_fnc count_fncs[] = +{ &count_bit_null +, &count_bit_noESC +, &count_bit_noESC_from2 +, &count_bit_noESC_from2 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +, &count_bit_noESC_from3 +}; + +static int +choose_table_nonMMX(const int *ix, const int *const end, int *const _s) +{ + unsigned int* s = (unsigned int*)_s; + unsigned int max; + int choice, choice2; + max = ix_max(ix, end); + + if (max <= 15) { + return count_fncs[max](ix, end, max, s); + } + /* try tables with linbits */ + if (max > IXMAX_VAL) { + *s = LARGE_BITS; + return -1; + } + max -= 15u; + for (choice2 = 24; choice2 < 32; choice2++) { + if (ht[choice2].linmax >= max) { + break; + } + } + + for (choice = choice2 - 8; choice < 24; choice++) { + if (ht[choice].linmax >= max) { + break; + } + } + return count_bit_ESC(ix, end, choice, choice2, s); +} + + + +/*************************************************************************/ +/* count_bit */ +/*************************************************************************/ +int +noquant_count_bits(lame_internal_flags const *const gfc, + gr_info * const gi, calc_noise_data * prev_noise) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int bits = 0; + int i, a1, a2; + int const *const ix = gi->l3_enc; + + i = Min(576, ((gi->max_nonzero_coeff + 2) >> 1) << 1); + + if (prev_noise) + prev_noise->sfb_count1 = 0; + + /* Determine count1 region */ + for (; i > 1; i -= 2) + if (ix[i - 1] | ix[i - 2]) + break; + gi->count1 = i; + + /* Determines the number of bits to encode the quadruples. */ + a1 = a2 = 0; + for (; i > 3; i -= 4) { + int x4 = ix[i-4]; + int x3 = ix[i-3]; + int x2 = ix[i-2]; + int x1 = ix[i-1]; + int p; + /* hack to check if all values <= 1 */ + if ((unsigned int) (x4 | x3 | x2 | x1) > 1) + break; + + p = ((x4 * 2 + x3) * 2 + x2) * 2 + x1; + a1 += t32l[p]; + a2 += t33l[p]; + } + + bits = a1; + gi->count1table_select = 0; + if (a1 > a2) { + bits = a2; + gi->count1table_select = 1; + } + + gi->count1bits = bits; + gi->big_values = i; + if (i == 0) + return bits; + + if (gi->block_type == SHORT_TYPE) { + a1 = 3 * gfc->scalefac_band.s[3]; + if (a1 > gi->big_values) + a1 = gi->big_values; + a2 = gi->big_values; + + } + else if (gi->block_type == NORM_TYPE) { + assert(i <= 576); /* bv_scf has 576 entries (0..575) */ + a1 = gi->region0_count = gfc->sv_qnt.bv_scf[i - 2]; + a2 = gi->region1_count = gfc->sv_qnt.bv_scf[i - 1]; + + assert(a1 + a2 + 2 < SBPSY_l); + a2 = gfc->scalefac_band.l[a1 + a2 + 2]; + a1 = gfc->scalefac_band.l[a1 + 1]; + if (a2 < i) + gi->table_select[2] = gfc->choose_table(ix + a2, ix + i, &bits); + + } + else { + gi->region0_count = 7; + /*gi->region1_count = SBPSY_l - 7 - 1; */ + gi->region1_count = SBMAX_l - 1 - 7 - 1; + a1 = gfc->scalefac_band.l[7 + 1]; + a2 = i; + if (a1 > a2) { + a1 = a2; + } + } + + + /* have to allow for the case when bigvalues < region0 < region1 */ + /* (and region0, region1 are ignored) */ + a1 = Min(a1, i); + a2 = Min(a2, i); + + assert(a1 >= 0); + assert(a2 >= 0); + + /* Count the number of bits necessary to code the bigvalues region. */ + if (0 < a1) + gi->table_select[0] = gfc->choose_table(ix, ix + a1, &bits); + if (a1 < a2) + gi->table_select[1] = gfc->choose_table(ix + a1, ix + a2, &bits); + if (cfg->use_best_huffman == 2) { + gi->part2_3_length = bits; + best_huffman_divide(gfc, gi); + bits = gi->part2_3_length; + } + + + if (prev_noise) { + if (gi->block_type == NORM_TYPE) { + int sfb = 0; + while (gfc->scalefac_band.l[sfb] < gi->big_values) { + sfb++; + } + prev_noise->sfb_count1 = sfb; + } + } + + return bits; +} + +int +count_bits(lame_internal_flags const *const gfc, + const FLOAT * const xr, gr_info * const gi, calc_noise_data * prev_noise) +{ + int *const ix = gi->l3_enc; + + /* since quantize_xrpow uses table lookup, we need to check this first: */ + FLOAT const w = (IXMAX_VAL) / IPOW20(gi->global_gain); + + if (gi->xrpow_max > w) + return LARGE_BITS; + + quantize_xrpow(xr, ix, IPOW20(gi->global_gain), gi, prev_noise); + + if (gfc->sv_qnt.substep_shaping & 2) { + int sfb, j = 0; + /* 0.634521682242439 = 0.5946*2**(.5*0.1875) */ + int const gain = gi->global_gain + gi->scalefac_scale; + const FLOAT roundfac = 0.634521682242439 / IPOW20(gain); + for (sfb = 0; sfb < gi->sfbmax; sfb++) { + int const width = gi->width[sfb]; + assert(width >= 0); + if (!gfc->sv_qnt.pseudohalf[sfb]) { + j += width; + } + else { + int k; + for (k = j, j += width; k < j; ++k) { + ix[k] = (xr[k] >= roundfac) ? ix[k] : 0; + } + } + } + } + return noquant_count_bits(gfc, gi, prev_noise); +} + +/*********************************************************************** + re-calculate the best scalefac_compress using scfsi + the saved bits are kept in the bit reservoir. + **********************************************************************/ + + +inline static void +recalc_divide_init(const lame_internal_flags * const gfc, + gr_info const *cod_info, + int const *const ix, int r01_bits[], int r01_div[], int r0_tbl[], int r1_tbl[]) +{ + int r0, r1, bigv, r0t, r1t, bits; + + bigv = cod_info->big_values; + + for (r0 = 0; r0 <= 7 + 15; r0++) { + r01_bits[r0] = LARGE_BITS; + } + + for (r0 = 0; r0 < 16; r0++) { + int const a1 = gfc->scalefac_band.l[r0 + 1]; + int r0bits; + if (a1 >= bigv) + break; + r0bits = 0; + r0t = gfc->choose_table(ix, ix + a1, &r0bits); + + for (r1 = 0; r1 < 8; r1++) { + int const a2 = gfc->scalefac_band.l[r0 + r1 + 2]; + if (a2 >= bigv) + break; + + bits = r0bits; + r1t = gfc->choose_table(ix + a1, ix + a2, &bits); + if (r01_bits[r0 + r1] > bits) { + r01_bits[r0 + r1] = bits; + r01_div[r0 + r1] = r0; + r0_tbl[r0 + r1] = r0t; + r1_tbl[r0 + r1] = r1t; + } + } + } +} + +inline static void +recalc_divide_sub(const lame_internal_flags * const gfc, + const gr_info * cod_info2, + gr_info * const gi, + const int *const ix, + const int r01_bits[], const int r01_div[], const int r0_tbl[], const int r1_tbl[]) +{ + int bits, r2, a2, bigv, r2t; + + bigv = cod_info2->big_values; + + for (r2 = 2; r2 < SBMAX_l + 1; r2++) { + a2 = gfc->scalefac_band.l[r2]; + if (a2 >= bigv) + break; + + bits = r01_bits[r2 - 2] + cod_info2->count1bits; + if (gi->part2_3_length <= bits) + break; + + r2t = gfc->choose_table(ix + a2, ix + bigv, &bits); + if (gi->part2_3_length <= bits) + continue; + + memcpy(gi, cod_info2, sizeof(gr_info)); + gi->part2_3_length = bits; + gi->region0_count = r01_div[r2 - 2]; + gi->region1_count = r2 - 2 - r01_div[r2 - 2]; + gi->table_select[0] = r0_tbl[r2 - 2]; + gi->table_select[1] = r1_tbl[r2 - 2]; + gi->table_select[2] = r2t; + } +} + + + + +void +best_huffman_divide(const lame_internal_flags * const gfc, gr_info * const gi) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int i, a1, a2; + gr_info cod_info2; + int const *const ix = gi->l3_enc; + + int r01_bits[7 + 15 + 1]; + int r01_div[7 + 15 + 1]; + int r0_tbl[7 + 15 + 1]; + int r1_tbl[7 + 15 + 1]; + + + /* SHORT BLOCK stuff fails for MPEG2 */ + if (gi->block_type == SHORT_TYPE && cfg->mode_gr == 1) + return; + + + memcpy(&cod_info2, gi, sizeof(gr_info)); + if (gi->block_type == NORM_TYPE) { + recalc_divide_init(gfc, gi, ix, r01_bits, r01_div, r0_tbl, r1_tbl); + recalc_divide_sub(gfc, &cod_info2, gi, ix, r01_bits, r01_div, r0_tbl, r1_tbl); + } + + i = cod_info2.big_values; + if (i == 0 || (unsigned int) (ix[i - 2] | ix[i - 1]) > 1) + return; + + i = gi->count1 + 2; + if (i > 576) + return; + + /* Determines the number of bits to encode the quadruples. */ + memcpy(&cod_info2, gi, sizeof(gr_info)); + cod_info2.count1 = i; + a1 = a2 = 0; + + assert(i <= 576); + + for (; i > cod_info2.big_values; i -= 4) { + int const p = ((ix[i - 4] * 2 + ix[i - 3]) * 2 + ix[i - 2]) * 2 + ix[i - 1]; + a1 += t32l[p]; + a2 += t33l[p]; + } + cod_info2.big_values = i; + + cod_info2.count1table_select = 0; + if (a1 > a2) { + a1 = a2; + cod_info2.count1table_select = 1; + } + + cod_info2.count1bits = a1; + + if (cod_info2.block_type == NORM_TYPE) + recalc_divide_sub(gfc, &cod_info2, gi, ix, r01_bits, r01_div, r0_tbl, r1_tbl); + else { + /* Count the number of bits necessary to code the bigvalues region. */ + cod_info2.part2_3_length = a1; + a1 = gfc->scalefac_band.l[7 + 1]; + if (a1 > i) { + a1 = i; + } + if (a1 > 0) + cod_info2.table_select[0] = + gfc->choose_table(ix, ix + a1, (int *) &cod_info2.part2_3_length); + if (i > a1) + cod_info2.table_select[1] = + gfc->choose_table(ix + a1, ix + i, (int *) &cod_info2.part2_3_length); + if (gi->part2_3_length > cod_info2.part2_3_length) + memcpy(gi, &cod_info2, sizeof(gr_info)); + } +} + +static const int slen1_n[16] = { 1, 1, 1, 1, 8, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16 }; +static const int slen2_n[16] = { 1, 2, 4, 8, 1, 2, 4, 8, 2, 4, 8, 2, 4, 8, 4, 8 }; +const int slen1_tab[16] = { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }; +const int slen2_tab[16] = { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 }; + +static void +scfsi_calc(int ch, III_side_info_t * l3_side) +{ + unsigned int i; + int s1, s2, c1, c2; + int sfb; + gr_info *const gi = &l3_side->tt[1][ch]; + gr_info const *const g0 = &l3_side->tt[0][ch]; + + for (i = 0; i < (sizeof(scfsi_band) / sizeof(int)) - 1; i++) { + for (sfb = scfsi_band[i]; sfb < scfsi_band[i + 1]; sfb++) { + if (g0->scalefac[sfb] != gi->scalefac[sfb] + && gi->scalefac[sfb] >= 0) + break; + } + if (sfb == scfsi_band[i + 1]) { + for (sfb = scfsi_band[i]; sfb < scfsi_band[i + 1]; sfb++) { + gi->scalefac[sfb] = -1; + } + l3_side->scfsi[ch][i] = 1; + } + } + + s1 = c1 = 0; + for (sfb = 0; sfb < 11; sfb++) { + if (gi->scalefac[sfb] == -1) + continue; + c1++; + if (s1 < gi->scalefac[sfb]) + s1 = gi->scalefac[sfb]; + } + + s2 = c2 = 0; + for (; sfb < SBPSY_l; sfb++) { + if (gi->scalefac[sfb] == -1) + continue; + c2++; + if (s2 < gi->scalefac[sfb]) + s2 = gi->scalefac[sfb]; + } + + for (i = 0; i < 16; i++) { + if (s1 < slen1_n[i] && s2 < slen2_n[i]) { + int const c = slen1_tab[i] * c1 + slen2_tab[i] * c2; + if (gi->part2_length > c) { + gi->part2_length = c; + gi->scalefac_compress = (int)i; + } + } + } +} + +/* +Find the optimal way to store the scalefactors. +Only call this routine after final scalefactors have been +chosen and the channel/granule will not be re-encoded. + */ +void +best_scalefac_store(const lame_internal_flags * gfc, + const int gr, const int ch, III_side_info_t * const l3_side) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + /* use scalefac_scale if we can */ + gr_info *const gi = &l3_side->tt[gr][ch]; + int sfb, i, j, l; + int recalc = 0; + + /* remove scalefacs from bands with ix=0. This idea comes + * from the AAC ISO docs. added mt 3/00 */ + /* check if l3_enc=0 */ + j = 0; + for (sfb = 0; sfb < gi->sfbmax; sfb++) { + int const width = gi->width[sfb]; + assert(width >= 0); + for (l = j, j += width; l < j; ++l) { + if (gi->l3_enc[l] != 0) + break; + } + if (l == j) + gi->scalefac[sfb] = recalc = -2; /* anything goes. */ + /* only best_scalefac_store and calc_scfsi + * know--and only they should know--about the magic number -2. + */ + } + + if (!gi->scalefac_scale && !gi->preflag) { + int s = 0; + for (sfb = 0; sfb < gi->sfbmax; sfb++) + if (gi->scalefac[sfb] > 0) + s |= gi->scalefac[sfb]; + + if (!(s & 1) && s != 0) { + for (sfb = 0; sfb < gi->sfbmax; sfb++) + if (gi->scalefac[sfb] > 0) + gi->scalefac[sfb] >>= 1; + + gi->scalefac_scale = recalc = 1; + } + } + + if (!gi->preflag && gi->block_type != SHORT_TYPE && cfg->mode_gr == 2) { + for (sfb = 11; sfb < SBPSY_l; sfb++) + if (gi->scalefac[sfb] < pretab[sfb] && gi->scalefac[sfb] != -2) + break; + if (sfb == SBPSY_l) { + for (sfb = 11; sfb < SBPSY_l; sfb++) + if (gi->scalefac[sfb] > 0) + gi->scalefac[sfb] -= pretab[sfb]; + + gi->preflag = recalc = 1; + } + } + + for (i = 0; i < 4; i++) + l3_side->scfsi[ch][i] = 0; + + if (cfg->mode_gr == 2 && gr == 1 + && l3_side->tt[0][ch].block_type != SHORT_TYPE + && l3_side->tt[1][ch].block_type != SHORT_TYPE) { + scfsi_calc(ch, l3_side); + recalc = 0; + } + for (sfb = 0; sfb < gi->sfbmax; sfb++) { + if (gi->scalefac[sfb] == -2) { + gi->scalefac[sfb] = 0; /* if anything goes, then 0 is a good choice */ + } + } + if (recalc) { + (void) scale_bitcount(gfc, gi); + } +} + + +#ifndef NDEBUG +static int +all_scalefactors_not_negative(int const *scalefac, int n) +{ + int i; + for (i = 0; i < n; ++i) { + if (scalefac[i] < 0) + return 0; + } + return 1; +} +#endif + + +/* number of bits used to encode scalefacs */ + +/* 18*slen1_tab[i] + 18*slen2_tab[i] */ +static const int scale_short[16] = { + 0, 18, 36, 54, 54, 36, 54, 72, 54, 72, 90, 72, 90, 108, 108, 126 +}; + +/* 17*slen1_tab[i] + 18*slen2_tab[i] */ +static const int scale_mixed[16] = { + 0, 18, 36, 54, 51, 35, 53, 71, 52, 70, 88, 69, 87, 105, 104, 122 +}; + +/* 11*slen1_tab[i] + 10*slen2_tab[i] */ +static const int scale_long[16] = { + 0, 10, 20, 30, 33, 21, 31, 41, 32, 42, 52, 43, 53, 63, 64, 74 +}; + + +/*************************************************************************/ +/* scale_bitcount */ +/*************************************************************************/ + +/* Also calculates the number of bits necessary to code the scalefactors. */ + +static int +mpeg1_scale_bitcount(const lame_internal_flags * gfc, gr_info * const cod_info) +{ + int k, sfb, max_slen1 = 0, max_slen2 = 0; + + /* maximum values */ + const int *tab; + int *const scalefac = cod_info->scalefac; + + (void) gfc; + assert(all_scalefactors_not_negative(scalefac, cod_info->sfbmax)); + + if (cod_info->block_type == SHORT_TYPE) { + tab = scale_short; + if (cod_info->mixed_block_flag) + tab = scale_mixed; + } + else { /* block_type == 1,2,or 3 */ + tab = scale_long; + if (!cod_info->preflag) { + for (sfb = 11; sfb < SBPSY_l; sfb++) + if (scalefac[sfb] < pretab[sfb]) + break; + + if (sfb == SBPSY_l) { + cod_info->preflag = 1; + for (sfb = 11; sfb < SBPSY_l; sfb++) + scalefac[sfb] -= pretab[sfb]; + } + } + } + + for (sfb = 0; sfb < cod_info->sfbdivide; sfb++) + if (max_slen1 < scalefac[sfb]) + max_slen1 = scalefac[sfb]; + + for (; sfb < cod_info->sfbmax; sfb++) + if (max_slen2 < scalefac[sfb]) + max_slen2 = scalefac[sfb]; + + /* from Takehiro TOMINAGA 10/99 + * loop over *all* posible values of scalefac_compress to find the + * one which uses the smallest number of bits. ISO would stop + * at first valid index */ + cod_info->part2_length = LARGE_BITS; + for (k = 0; k < 16; k++) { + if (max_slen1 < slen1_n[k] && max_slen2 < slen2_n[k] + && cod_info->part2_length > tab[k]) { + cod_info->part2_length = tab[k]; + cod_info->scalefac_compress = k; + } + } + return cod_info->part2_length == LARGE_BITS; +} + + + +/* + table of largest scalefactor values for MPEG2 +*/ +static const int max_range_sfac_tab[6][4] = { + {15, 15, 7, 7}, + {15, 15, 7, 0}, + {7, 3, 0, 0}, + {15, 31, 31, 0}, + {7, 7, 7, 0}, + {3, 3, 0, 0} +}; + + + + +/*************************************************************************/ +/* scale_bitcount_lsf */ +/*************************************************************************/ + +/* Also counts the number of bits to encode the scalefacs but for MPEG 2 */ +/* Lower sampling frequencies (24, 22.05 and 16 kHz.) */ + +/* This is reverse-engineered from section 2.4.3.2 of the MPEG2 IS, */ +/* "Audio Decoding Layer III" */ + +static int +mpeg2_scale_bitcount(const lame_internal_flags * gfc, gr_info * const cod_info) +{ + int table_number, row_in_table, partition, nr_sfb, window, over; + int i, sfb, max_sfac[4]; + const int *partition_table; + int const *const scalefac = cod_info->scalefac; + + /* + Set partition table. Note that should try to use table one, + but do not yet... + */ + if (cod_info->preflag) + table_number = 2; + else + table_number = 0; + + for (i = 0; i < 4; i++) + max_sfac[i] = 0; + + if (cod_info->block_type == SHORT_TYPE) { + row_in_table = 1; + partition_table = &nr_of_sfb_block[table_number][row_in_table][0]; + for (sfb = 0, partition = 0; partition < 4; partition++) { + nr_sfb = partition_table[partition] / 3; + for (i = 0; i < nr_sfb; i++, sfb++) + for (window = 0; window < 3; window++) + if (scalefac[sfb * 3 + window] > max_sfac[partition]) + max_sfac[partition] = scalefac[sfb * 3 + window]; + } + } + else { + row_in_table = 0; + partition_table = &nr_of_sfb_block[table_number][row_in_table][0]; + for (sfb = 0, partition = 0; partition < 4; partition++) { + nr_sfb = partition_table[partition]; + for (i = 0; i < nr_sfb; i++, sfb++) + if (scalefac[sfb] > max_sfac[partition]) + max_sfac[partition] = scalefac[sfb]; + } + } + + for (over = 0, partition = 0; partition < 4; partition++) { + if (max_sfac[partition] > max_range_sfac_tab[table_number][partition]) + over++; + } + if (!over) { + /* + Since no bands have been over-amplified, we can set scalefac_compress + and slen[] for the formatter + */ + static const int log2tab[] = { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4 }; + + int slen1, slen2, slen3, slen4; + + cod_info->sfb_partition_table = nr_of_sfb_block[table_number][row_in_table]; + for (partition = 0; partition < 4; partition++) + cod_info->slen[partition] = log2tab[max_sfac[partition]]; + + /* set scalefac_compress */ + slen1 = cod_info->slen[0]; + slen2 = cod_info->slen[1]; + slen3 = cod_info->slen[2]; + slen4 = cod_info->slen[3]; + + switch (table_number) { + case 0: + cod_info->scalefac_compress = (((slen1 * 5) + slen2) << 4) + + (slen3 << 2) + + slen4; + break; + + case 1: + cod_info->scalefac_compress = 400 + (((slen1 * 5) + slen2) << 2) + + slen3; + break; + + case 2: + cod_info->scalefac_compress = 500 + (slen1 * 3) + slen2; + break; + + default: + ERRORF(gfc, "intensity stereo not implemented yet\n"); + break; + } + } +#ifdef DEBUG + if (over) + ERRORF(gfc, "---WARNING !! Amplification of some bands over limits\n"); +#endif + if (!over) { + assert(cod_info->sfb_partition_table); + cod_info->part2_length = 0; + for (partition = 0; partition < 4; partition++) + cod_info->part2_length += + cod_info->slen[partition] * cod_info->sfb_partition_table[partition]; + } + return over; +} + + +int +scale_bitcount(const lame_internal_flags * gfc, gr_info * cod_info) +{ + if (gfc->cfg.mode_gr == 2) { + return mpeg1_scale_bitcount(gfc, cod_info); + } + else { + return mpeg2_scale_bitcount(gfc, cod_info); + } +} + + +#ifdef MMX_choose_table +extern int choose_table_MMX(const int *ix, const int *const end, int *const s); +#endif + +void +huffman_init(lame_internal_flags * const gfc) +{ + int i; + + gfc->choose_table = choose_table_nonMMX; + +#ifdef MMX_choose_table + if (gfc->CPU_features.MMX) { + gfc->choose_table = choose_table_MMX; + } +#endif + + for (i = 2; i <= 576; i += 2) { + int scfb_anz = 0, bv_index; + while (gfc->scalefac_band.l[++scfb_anz] < i); + + bv_index = subdv_table[scfb_anz].region0_count; + while (gfc->scalefac_band.l[bv_index + 1] > i) + bv_index--; + + if (bv_index < 0) { + /* this is an indication that everything is going to + be encoded as region0: bigvalues < region0 < region1 + so lets set region0, region1 to some value larger + than bigvalues */ + bv_index = subdv_table[scfb_anz].region0_count; + } + + gfc->sv_qnt.bv_scf[i - 2] = bv_index; + + bv_index = subdv_table[scfb_anz].region1_count; + while (gfc->scalefac_band.l[bv_index + gfc->sv_qnt.bv_scf[i - 2] + 2] > i) + bv_index--; + + if (bv_index < 0) { + bv_index = subdv_table[scfb_anz].region1_count; + } + + gfc->sv_qnt.bv_scf[i - 1] = bv_index; + } +} diff --git a/node_modules/lame/deps/lame/libmp3lame/util.c b/node_modules/lame/deps/lame/libmp3lame/util.c new file mode 100644 index 0000000..e0d48d3 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/util.c @@ -0,0 +1,1009 @@ +/* + * lame utility library source file + * + * Copyright (c) 1999 Albert L Faber + * Copyright (c) 2000-2005 Alexander Leidinger + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: util.c,v 1.154.2.1 2012/01/08 23:49:58 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "tables.h" + +#define PRECOMPUTE +#if defined(__FreeBSD__) && !defined(__alpha__) +# include +#endif + + +/*********************************************************************** +* +* Global Function Definitions +* +***********************************************************************/ +/*empty and close mallocs in gfc */ + +void +free_id3tag(lame_internal_flags * const gfc) +{ + if (gfc->tag_spec.title != 0) { + free(gfc->tag_spec.title); + gfc->tag_spec.title = 0; + } + if (gfc->tag_spec.artist != 0) { + free(gfc->tag_spec.artist); + gfc->tag_spec.artist = 0; + } + if (gfc->tag_spec.album != 0) { + free(gfc->tag_spec.album); + gfc->tag_spec.album = 0; + } + if (gfc->tag_spec.comment != 0) { + free(gfc->tag_spec.comment); + gfc->tag_spec.comment = 0; + } + + if (gfc->tag_spec.albumart != 0) { + free(gfc->tag_spec.albumart); + gfc->tag_spec.albumart = 0; + gfc->tag_spec.albumart_size = 0; + gfc->tag_spec.albumart_mimetype = MIMETYPE_NONE; + } + if (gfc->tag_spec.v2_head != 0) { + FrameDataNode *node = gfc->tag_spec.v2_head; + do { + void *p = node->dsc.ptr.b; + void *q = node->txt.ptr.b; + void *r = node; + node = node->nxt; + free(p); + free(q); + free(r); + } while (node != 0); + gfc->tag_spec.v2_head = 0; + gfc->tag_spec.v2_tail = 0; + } +} + + +static void +free_global_data(lame_internal_flags * gfc) +{ + if (gfc && gfc->cd_psy) { + if (gfc->cd_psy->l.s3) { + /* XXX allocated in psymodel_init() */ + free(gfc->cd_psy->l.s3); + } + if (gfc->cd_psy->s.s3) { + /* XXX allocated in psymodel_init() */ + free(gfc->cd_psy->s.s3); + } + free(gfc->cd_psy); + gfc->cd_psy = 0; + } +} + + +void +freegfc(lame_internal_flags * const gfc) +{ /* bit stream structure */ + int i; + + + for (i = 0; i <= 2 * BPC; i++) + if (gfc->sv_enc.blackfilt[i] != NULL) { + free(gfc->sv_enc.blackfilt[i]); + gfc->sv_enc.blackfilt[i] = NULL; + } + if (gfc->sv_enc.inbuf_old[0]) { + free(gfc->sv_enc.inbuf_old[0]); + gfc->sv_enc.inbuf_old[0] = NULL; + } + if (gfc->sv_enc.inbuf_old[1]) { + free(gfc->sv_enc.inbuf_old[1]); + gfc->sv_enc.inbuf_old[1] = NULL; + } + + if (gfc->bs.buf != NULL) { + free(gfc->bs.buf); + gfc->bs.buf = NULL; + } + + if (gfc->VBR_seek_table.bag) { + free(gfc->VBR_seek_table.bag); + gfc->VBR_seek_table.bag = NULL; + gfc->VBR_seek_table.size = 0; + } + if (gfc->ATH) { + free(gfc->ATH); + } + if (gfc->sv_rpg.rgdata) { + free(gfc->sv_rpg.rgdata); + } + if (gfc->sv_enc.in_buffer_0) { + free(gfc->sv_enc.in_buffer_0); + } + if (gfc->sv_enc.in_buffer_1) { + free(gfc->sv_enc.in_buffer_1); + } + free_id3tag(gfc); + +#ifdef DECODE_ON_THE_FLY + if (gfc->hip) { + hip_decode_exit(gfc->hip); + gfc->hip = 0; + } +#endif + + free_global_data(gfc); + + free(gfc); +} + +void +malloc_aligned(aligned_pointer_t * ptr, unsigned int size, unsigned int bytes) +{ + if (ptr) { + if (!ptr->pointer) { + ptr->pointer = malloc(size + bytes); + if (bytes > 0) { + ptr->aligned = (void *) ((((size_t) ptr->pointer + bytes - 1) / bytes) * bytes); + } + else { + ptr->aligned = ptr->pointer; + } + } + } +} + +void +free_aligned(aligned_pointer_t * ptr) +{ + if (ptr) { + if (ptr->pointer) { + free(ptr->pointer); + ptr->pointer = 0; + ptr->aligned = 0; + } + } +} + +/*those ATH formulas are returning +their minimum value for input = -1*/ + +static FLOAT +ATHformula_GB(FLOAT f, FLOAT value, FLOAT f_min, FLOAT f_max) +{ + /* from Painter & Spanias + modified by Gabriel Bouvigne to better fit the reality + ath = 3.640 * pow(f,-0.8) + - 6.800 * exp(-0.6*pow(f-3.4,2.0)) + + 6.000 * exp(-0.15*pow(f-8.7,2.0)) + + 0.6* 0.001 * pow(f,4.0); + + + In the past LAME was using the Painter &Spanias formula. + But we had some recurrent problems with HF content. + We measured real ATH values, and found the older formula + to be inacurate in the higher part. So we made this new + formula and this solved most of HF problematic testcases. + The tradeoff is that in VBR mode it increases a lot the + bitrate. */ + + +/*this curve can be udjusted according to the VBR scale: +it adjusts from something close to Painter & Spanias +on V9 up to Bouvigne's formula for V0. This way the VBR +bitrate is more balanced according to the -V value.*/ + + FLOAT ath; + + /* the following Hack allows to ask for the lowest value */ + if (f < -.3) + f = 3410; + + f /= 1000; /* convert to khz */ + f = Max(f_min, f); + f = Min(f_max, f); + + ath = 3.640 * pow(f, -0.8) + - 6.800 * exp(-0.6 * pow(f - 3.4, 2.0)) + + 6.000 * exp(-0.15 * pow(f - 8.7, 2.0)) + + (0.6 + 0.04 * value) * 0.001 * pow(f, 4.0); + return ath; +} + + + +FLOAT +ATHformula(SessionConfig_t const *cfg, FLOAT f) +{ + FLOAT ath; + switch (cfg->ATHtype) { + case 0: + ath = ATHformula_GB(f, 9, 0.1f, 24.0f); + break; + case 1: + ath = ATHformula_GB(f, -1, 0.1f, 24.0f); /*over sensitive, should probably be removed */ + break; + case 2: + ath = ATHformula_GB(f, 0, 0.1f, 24.0f); + break; + case 3: + ath = ATHformula_GB(f, 1, 0.1f, 24.0f) + 6; /*modification of GB formula by Roel */ + break; + case 4: + ath = ATHformula_GB(f, cfg->ATHcurve, 0.1f, 24.0f); + break; + case 5: + ath = ATHformula_GB(f, cfg->ATHcurve, 3.41f, 16.1f); + break; + default: + ath = ATHformula_GB(f, 0, 0.1f, 24.0f); + break; + } + return ath; +} + +/* see for example "Zwicker: Psychoakustik, 1982; ISBN 3-540-11401-7 */ +FLOAT +freq2bark(FLOAT freq) +{ + /* input: freq in hz output: barks */ + if (freq < 0) + freq = 0; + freq = freq * 0.001; + return 13.0 * atan(.76 * freq) + 3.5 * atan(freq * freq / (7.5 * 7.5)); +} + +#if 0 +extern FLOAT freq2cbw(FLOAT freq); + +/* see for example "Zwicker: Psychoakustik, 1982; ISBN 3-540-11401-7 */ +FLOAT +freq2cbw(FLOAT freq) +{ + /* input: freq in hz output: critical band width */ + freq = freq * 0.001; + return 25 + 75 * pow(1 + 1.4 * (freq * freq), 0.69); +} + +#endif + + + + +#define ABS(A) (((A)>0) ? (A) : -(A)) + +int +FindNearestBitrate(int bRate, /* legal rates from 8 to 320 */ + int version, int samplerate) +{ /* MPEG-1 or MPEG-2 LSF */ + int bitrate; + int i; + + if (samplerate < 16000) + version = 2; + + bitrate = bitrate_table[version][1]; + + for (i = 2; i <= 14; i++) { + if (bitrate_table[version][i] > 0) { + if (ABS(bitrate_table[version][i] - bRate) < ABS(bitrate - bRate)) + bitrate = bitrate_table[version][i]; + } + } + return bitrate; +} + + + + + +#ifndef Min +#define Min(A, B) ((A) < (B) ? (A) : (B)) +#endif +#ifndef Max +#define Max(A, B) ((A) > (B) ? (A) : (B)) +#endif + + +/* Used to find table index when + * we need bitrate-based values + * determined using tables + * + * bitrate in kbps + * + * Gabriel Bouvigne 2002-11-03 + */ +int +nearestBitrateFullIndex(uint16_t bitrate) +{ + /* borrowed from DM abr presets */ + + const int full_bitrate_table[] = + { 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 }; + + + int lower_range = 0, lower_range_kbps = 0, upper_range = 0, upper_range_kbps = 0; + + + int b; + + + /* We assume specified bitrate will be 320kbps */ + upper_range_kbps = full_bitrate_table[16]; + upper_range = 16; + lower_range_kbps = full_bitrate_table[16]; + lower_range = 16; + + /* Determine which significant bitrates the value specified falls between, + * if loop ends without breaking then we were correct above that the value was 320 + */ + for (b = 0; b < 16; b++) { + if ((Max(bitrate, full_bitrate_table[b + 1])) != bitrate) { + upper_range_kbps = full_bitrate_table[b + 1]; + upper_range = b + 1; + lower_range_kbps = full_bitrate_table[b]; + lower_range = (b); + break; /* We found upper range */ + } + } + + /* Determine which range the value specified is closer to */ + if ((upper_range_kbps - bitrate) > (bitrate - lower_range_kbps)) { + return lower_range; + } + return upper_range; +} + + + + + +/* map frequency to a valid MP3 sample frequency + * + * Robert Hegemann 2000-07-01 + */ +int +map2MP3Frequency(int freq) +{ + if (freq <= 8000) + return 8000; + if (freq <= 11025) + return 11025; + if (freq <= 12000) + return 12000; + if (freq <= 16000) + return 16000; + if (freq <= 22050) + return 22050; + if (freq <= 24000) + return 24000; + if (freq <= 32000) + return 32000; + if (freq <= 44100) + return 44100; + + return 48000; +} + +int +BitrateIndex(int bRate, /* legal rates from 32 to 448 kbps */ + int version, /* MPEG-1 or MPEG-2/2.5 LSF */ + int samplerate) +{ /* convert bitrate in kbps to index */ + int i; + if (samplerate < 16000) + version = 2; + for (i = 0; i <= 14; i++) { + if (bitrate_table[version][i] > 0) { + if (bitrate_table[version][i] == bRate) { + return i; + } + } + } + return -1; +} + +/* convert samp freq in Hz to index */ + +int +SmpFrqIndex(int sample_freq, int *const version) +{ + switch (sample_freq) { + case 44100: + *version = 1; + return 0; + case 48000: + *version = 1; + return 1; + case 32000: + *version = 1; + return 2; + case 22050: + *version = 0; + return 0; + case 24000: + *version = 0; + return 1; + case 16000: + *version = 0; + return 2; + case 11025: + *version = 0; + return 0; + case 12000: + *version = 0; + return 1; + case 8000: + *version = 0; + return 2; + default: + *version = 0; + return -1; + } +} + + +/***************************************************************************** +* +* End of bit_stream.c package +* +*****************************************************************************/ + + + + + + + + + + +/* resampling via FIR filter, blackman window */ +inline static FLOAT +blackman(FLOAT x, FLOAT fcn, int l) +{ + /* This algorithm from: + SIGNAL PROCESSING ALGORITHMS IN FORTRAN AND C + S.D. Stearns and R.A. David, Prentice-Hall, 1992 + */ + FLOAT bkwn, x2; + FLOAT const wcn = (PI * fcn); + + x /= l; + if (x < 0) + x = 0; + if (x > 1) + x = 1; + x2 = x - .5; + + bkwn = 0.42 - 0.5 * cos(2 * x * PI) + 0.08 * cos(4 * x * PI); + if (fabs(x2) < 1e-9) + return wcn / PI; + else + return (bkwn * sin(l * wcn * x2) / (PI * l * x2)); + + +} + + + + +/* gcd - greatest common divisor */ +/* Joint work of Euclid and M. Hendry */ + +static int +gcd(int i, int j) +{ + /* assert ( i > 0 && j > 0 ); */ + return j ? gcd(j, i % j) : i; +} + + + +static int +fill_buffer_resample(lame_internal_flags * gfc, + sample_t * outbuf, + int desired_len, sample_t const *inbuf, int len, int *num_used, int ch) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + EncStateVar_t *esv = &gfc->sv_enc; + double resample_ratio = (double)cfg->samplerate_in / (double)cfg->samplerate_out; + int BLACKSIZE; + FLOAT offset, xvalue; + int i, j = 0, k; + int filter_l; + FLOAT fcn, intratio; + FLOAT *inbuf_old; + int bpc; /* number of convolution functions to pre-compute */ + bpc = cfg->samplerate_out / gcd(cfg->samplerate_out, cfg->samplerate_in); + if (bpc > BPC) + bpc = BPC; + + intratio = (fabs(resample_ratio - floor(.5 + resample_ratio)) < .0001); + fcn = 1.00 / resample_ratio; + if (fcn > 1.00) + fcn = 1.00; + filter_l = 31; /* must be odd */ + filter_l += intratio; /* unless resample_ratio=int, it must be even */ + + + BLACKSIZE = filter_l + 1; /* size of data needed for FIR */ + + if (gfc->fill_buffer_resample_init == 0) { + esv->inbuf_old[0] = calloc(BLACKSIZE, sizeof(esv->inbuf_old[0][0])); + esv->inbuf_old[1] = calloc(BLACKSIZE, sizeof(esv->inbuf_old[0][0])); + for (i = 0; i <= 2 * bpc; ++i) + esv->blackfilt[i] = calloc(BLACKSIZE, sizeof(esv->blackfilt[0][0])); + + esv->itime[0] = 0; + esv->itime[1] = 0; + + /* precompute blackman filter coefficients */ + for (j = 0; j <= 2 * bpc; j++) { + FLOAT sum = 0.; + offset = (j - bpc) / (2. * bpc); + for (i = 0; i <= filter_l; i++) + sum += esv->blackfilt[j][i] = blackman(i - offset, fcn, filter_l); + for (i = 0; i <= filter_l; i++) + esv->blackfilt[j][i] /= sum; + } + gfc->fill_buffer_resample_init = 1; + } + + inbuf_old = esv->inbuf_old[ch]; + + /* time of j'th element in inbuf = itime + j/ifreq; */ + /* time of k'th element in outbuf = j/ofreq */ + for (k = 0; k < desired_len; k++) { + double time0 = k * resample_ratio; /* time of k'th output sample */ + int joff; + + j = floor(time0 - esv->itime[ch]); + + /* check if we need more input data */ + if ((filter_l + j - filter_l / 2) >= len) + break; + + /* blackman filter. by default, window centered at j+.5(filter_l%2) */ + /* but we want a window centered at time0. */ + offset = (time0 - esv->itime[ch] - (j + .5 * (filter_l % 2))); + assert(fabs(offset) <= .501); + + /* find the closest precomputed window for this offset: */ + joff = floor((offset * 2 * bpc) + bpc + .5); + + xvalue = 0.; + for (i = 0; i <= filter_l; ++i) { + int const j2 = i + j - filter_l / 2; + sample_t y; + assert(j2 < len); + assert(j2 + BLACKSIZE >= 0); + y = (j2 < 0) ? inbuf_old[BLACKSIZE + j2] : inbuf[j2]; +#ifdef PRECOMPUTE + xvalue += y * esv->blackfilt[joff][i]; +#else + xvalue += y * blackman(i - offset, fcn, filter_l); /* very slow! */ +#endif + } + outbuf[k] = xvalue; + } + + + /* k = number of samples added to outbuf */ + /* last k sample used data from [j-filter_l/2,j+filter_l-filter_l/2] */ + + /* how many samples of input data were used: */ + *num_used = Min(len, filter_l + j - filter_l / 2); + + /* adjust our input time counter. Incriment by the number of samples used, + * then normalize so that next output sample is at time 0, next + * input buffer is at time itime[ch] */ + esv->itime[ch] += *num_used - k * resample_ratio; + + /* save the last BLACKSIZE samples into the inbuf_old buffer */ + if (*num_used >= BLACKSIZE) { + for (i = 0; i < BLACKSIZE; i++) + inbuf_old[i] = inbuf[*num_used + i - BLACKSIZE]; + } + else { + /* shift in *num_used samples into inbuf_old */ + int const n_shift = BLACKSIZE - *num_used; /* number of samples to shift */ + + /* shift n_shift samples by *num_used, to make room for the + * num_used new samples */ + for (i = 0; i < n_shift; ++i) + inbuf_old[i] = inbuf_old[i + *num_used]; + + /* shift in the *num_used samples */ + for (j = 0; i < BLACKSIZE; ++i, ++j) + inbuf_old[i] = inbuf[j]; + + assert(j == *num_used); + } + return k; /* return the number samples created at the new samplerate */ +} + +int +isResamplingNecessary(SessionConfig_t const* cfg) +{ + int const l = cfg->samplerate_out * 0.9995f; + int const h = cfg->samplerate_out * 1.0005f; + return (cfg->samplerate_in < l) || (h < cfg->samplerate_in) ? 1 : 0; +} + +/* copy in new samples from in_buffer into mfbuf, with resampling + if necessary. n_in = number of samples from the input buffer that + were used. n_out = number of samples copied into mfbuf */ + +void +fill_buffer(lame_internal_flags * gfc, + sample_t * const mfbuf[2], sample_t const * const in_buffer[2], int nsamples, int *n_in, int *n_out) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int mf_size = gfc->sv_enc.mf_size; + int framesize = 576 * cfg->mode_gr; + int nout, ch = 0; + int nch = cfg->channels_out; + + /* copy in new samples into mfbuf, with resampling if necessary */ + if (isResamplingNecessary(cfg)) { + do { + nout = + fill_buffer_resample(gfc, &mfbuf[ch][mf_size], + framesize, in_buffer[ch], nsamples, n_in, ch); + } while (++ch < nch); + *n_out = nout; + } + else { + nout = Min(framesize, nsamples); + do { + memcpy(&mfbuf[ch][mf_size], &in_buffer[ch][0], nout * sizeof(mfbuf[0][0])); + } while (++ch < nch); + *n_out = nout; + *n_in = nout; + } +} + + + + + + + +/*********************************************************************** +* +* Message Output +* +***********************************************************************/ + +void +lame_report_def(const char *format, va_list args) +{ + (void) vfprintf(stderr, format, args); + fflush(stderr); /* an debug function should flush immediately */ +} + +void +lame_report_fnc(lame_report_function print_f, const char *format, ...) +{ + if (print_f) { + va_list args; + va_start(args, format); + print_f(format, args); + va_end(args); + } +} + + +void +lame_debugf(const lame_internal_flags* gfc, const char *format, ...) +{ + if (gfc && gfc->report_dbg) { + va_list args; + va_start(args, format); + gfc->report_dbg(format, args); + va_end(args); + } +} + + +void +lame_msgf(const lame_internal_flags* gfc, const char *format, ...) +{ + if (gfc && gfc->report_msg) { + va_list args; + va_start(args, format); + gfc->report_msg(format, args); + va_end(args); + } +} + + +void +lame_errorf(const lame_internal_flags* gfc, const char *format, ...) +{ + if (gfc && gfc->report_err) { + va_list args; + va_start(args, format); + gfc->report_err(format, args); + va_end(args); + } +} + + + +/*********************************************************************** + * + * routines to detect CPU specific features like 3DNow, MMX, SSE + * + * donated by Frank Klemm + * added Robert Hegemann 2000-10-10 + * + ***********************************************************************/ + +#ifdef HAVE_NASM +extern int has_MMX_nasm(void); +extern int has_3DNow_nasm(void); +extern int has_SSE_nasm(void); +extern int has_SSE2_nasm(void); +#endif + +int +has_MMX(void) +{ +#ifdef HAVE_NASM + return has_MMX_nasm(); +#else + return 0; /* don't know, assume not */ +#endif +} + +int +has_3DNow(void) +{ +#ifdef HAVE_NASM + return has_3DNow_nasm(); +#else + return 0; /* don't know, assume not */ +#endif +} + +int +has_SSE(void) +{ +#ifdef HAVE_NASM + return has_SSE_nasm(); +#else +#if defined( _M_X64 ) || defined( MIN_ARCH_SSE ) + return 1; +#else + return 0; /* don't know, assume not */ +#endif +#endif +} + +int +has_SSE2(void) +{ +#ifdef HAVE_NASM + return has_SSE2_nasm(); +#else +#if defined( _M_X64 ) || defined( MIN_ARCH_SSE ) + return 1; +#else + return 0; /* don't know, assume not */ +#endif +#endif +} + +void +disable_FPE(void) +{ +/* extremly system dependent stuff, move to a lib to make the code readable */ +/*==========================================================================*/ + + + + /* + * Disable floating point exceptions + */ + + + + +#if defined(__FreeBSD__) && !defined(__alpha__) + { + /* seet floating point mask to the Linux default */ + fp_except_t mask; + mask = fpgetmask(); + /* if bit is set, we get SIGFPE on that error! */ + fpsetmask(mask & ~(FP_X_INV | FP_X_DZ)); + /* DEBUGF("FreeBSD mask is 0x%x\n",mask); */ + } +#endif + +#if defined(__riscos__) && !defined(ABORTFP) + /* Disable FPE's under RISC OS */ + /* if bit is set, we disable trapping that error! */ + /* _FPE_IVO : invalid operation */ + /* _FPE_DVZ : divide by zero */ + /* _FPE_OFL : overflow */ + /* _FPE_UFL : underflow */ + /* _FPE_INX : inexact */ + DisableFPETraps(_FPE_IVO | _FPE_DVZ | _FPE_OFL); +#endif + + /* + * Debugging stuff + * The default is to ignore FPE's, unless compiled with -DABORTFP + * so add code below to ENABLE FPE's. + */ + +#if defined(ABORTFP) +#if defined(_MSC_VER) + { +#if 0 + /* rh 061207 + the following fix seems to be a workaround for a problem in the + parent process calling LAME. It would be better to fix the broken + application => code disabled. + */ + + /* set affinity to a single CPU. Fix for EAC/lame on SMP systems from + "Todd Richmond" */ + SYSTEM_INFO si; + GetSystemInfo(&si); + SetProcessAffinityMask(GetCurrentProcess(), si.dwActiveProcessorMask); +#endif +#include + unsigned int mask; + mask = _controlfp(0, 0); + mask &= ~(_EM_OVERFLOW | _EM_UNDERFLOW | _EM_ZERODIVIDE | _EM_INVALID); + mask = _controlfp(mask, _MCW_EM); + } +#elif defined(__CYGWIN__) +# define _FPU_GETCW(cw) __asm__ ("fnstcw %0" : "=m" (*&cw)) +# define _FPU_SETCW(cw) __asm__ ("fldcw %0" : : "m" (*&cw)) + +# define _EM_INEXACT 0x00000020 /* inexact (precision) */ +# define _EM_UNDERFLOW 0x00000010 /* underflow */ +# define _EM_OVERFLOW 0x00000008 /* overflow */ +# define _EM_ZERODIVIDE 0x00000004 /* zero divide */ +# define _EM_INVALID 0x00000001 /* invalid */ + { + unsigned int mask; + _FPU_GETCW(mask); + /* Set the FPU control word to abort on most FPEs */ + mask &= ~(_EM_OVERFLOW | _EM_ZERODIVIDE | _EM_INVALID); + _FPU_SETCW(mask); + } +# elif defined(__linux__) + { + +# include +# ifndef _FPU_GETCW +# define _FPU_GETCW(cw) __asm__ ("fnstcw %0" : "=m" (*&cw)) +# endif +# ifndef _FPU_SETCW +# define _FPU_SETCW(cw) __asm__ ("fldcw %0" : : "m" (*&cw)) +# endif + + /* + * Set the Linux mask to abort on most FPE's + * if bit is set, we _mask_ SIGFPE on that error! + * mask &= ~( _FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM ); + */ + + unsigned int mask; + _FPU_GETCW(mask); + mask &= ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM); + _FPU_SETCW(mask); + } +#endif +#endif /* ABORTFP */ +} + + + + + +#ifdef USE_FAST_LOG +/*********************************************************************** + * + * Fast Log Approximation for log2, used to approximate every other log + * (log10 and log) + * maximum absolute error for log10 is around 10-6 + * maximum *relative* error can be high when x is almost 1 because error/log10(x) tends toward x/e + * + * use it if typical RESULT values are > 1e-5 (for example if x>1.00001 or x<0.99999) + * or if the relative precision in the domain around 1 is not important (result in 1 is exact and 0) + * + ***********************************************************************/ + + +#define LOG2_SIZE (512) +#define LOG2_SIZE_L2 (9) + +static ieee754_float32_t log_table[LOG2_SIZE + 1]; + + + +void +init_log_table(void) +{ + int j; + static int init = 0; + + /* Range for log2(x) over [1,2[ is [0,1[ */ + assert((1 << LOG2_SIZE_L2) == LOG2_SIZE); + + if (!init) { + for (j = 0; j < LOG2_SIZE + 1; j++) + log_table[j] = log(1.0f + j / (ieee754_float32_t) LOG2_SIZE) / log(2.0f); + } + init = 1; +} + + + +ieee754_float32_t +fast_log2(ieee754_float32_t x) +{ + ieee754_float32_t log2val, partial; + union { + ieee754_float32_t f; + int i; + } fi; + int mantisse; + fi.f = x; + mantisse = fi.i & 0x7fffff; + log2val = ((fi.i >> 23) & 0xFF) - 0x7f; + partial = (mantisse & ((1 << (23 - LOG2_SIZE_L2)) - 1)); + partial *= 1.0f / ((1 << (23 - LOG2_SIZE_L2))); + + + mantisse >>= (23 - LOG2_SIZE_L2); + + /* log2val += log_table[mantisse]; without interpolation the results are not good */ + log2val += log_table[mantisse] * (1.0f - partial) + log_table[mantisse + 1] * partial; + + return log2val; +} + +#else /* Don't use FAST_LOG */ + + +void +init_log_table(void) +{ +} + + +#endif + +/* end of util.c */ diff --git a/node_modules/lame/deps/lame/libmp3lame/util.h b/node_modules/lame/deps/lame/libmp3lame/util.h new file mode 100644 index 0000000..1b277d9 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/util.h @@ -0,0 +1,620 @@ +/* + * lame utility library include file + * + * Copyright (c) 1999 Albert L Faber + * Copyright (c) 2008 Robert Hegemann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_UTIL_H +#define LAME_UTIL_H + +#include "l3side.h" +#include "id3tag.h" +#include "lame_global_flags.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*********************************************************************** +* +* Global Definitions +* +***********************************************************************/ + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE (!FALSE) +#endif + +#ifdef UINT_MAX +# define MAX_U_32_NUM UINT_MAX +#else +# define MAX_U_32_NUM 0xFFFFFFFF +#endif + +#ifndef PI +# ifdef M_PI +# define PI M_PI +# else +# define PI 3.14159265358979323846 +# endif +#endif + + +#ifdef M_LN2 +# define LOG2 M_LN2 +#else +# define LOG2 0.69314718055994530942 +#endif + +#ifdef M_LN10 +# define LOG10 M_LN10 +#else +# define LOG10 2.30258509299404568402 +#endif + + +#ifdef M_SQRT2 +# define SQRT2 M_SQRT2 +#else +# define SQRT2 1.41421356237309504880 +#endif + + +#define CRC16_POLYNOMIAL 0x8005 + +#define MAX_BITS_PER_CHANNEL 4095 +#define MAX_BITS_PER_GRANULE 7680 + +/* "bit_stream.h" Definitions */ +#define BUFFER_SIZE LAME_MAXMP3BUFFER + +#define Min(A, B) ((A) < (B) ? (A) : (B)) +#define Max(A, B) ((A) > (B) ? (A) : (B)) + +/* log/log10 approximations */ +#ifdef USE_FAST_LOG +#define FAST_LOG10(x) (fast_log2(x)*(LOG2/LOG10)) +#define FAST_LOG(x) (fast_log2(x)*LOG2) +#define FAST_LOG10_X(x,y) (fast_log2(x)*(LOG2/LOG10*(y))) +#define FAST_LOG_X(x,y) (fast_log2(x)*(LOG2*(y))) +#else +#define FAST_LOG10(x) log10(x) +#define FAST_LOG(x) log(x) +#define FAST_LOG10_X(x,y) (log10(x)*(y)) +#define FAST_LOG_X(x,y) (log(x)*(y)) +#endif + + + struct replaygain_data; +#ifndef replaygain_data_defined +#define replaygain_data_defined + typedef struct replaygain_data replaygain_t; +#endif + struct plotting_data; +#ifndef plotting_data_defined +#define plotting_data_defined + typedef struct plotting_data plotting_data; +#endif + +/*********************************************************************** +* +* Global Type Definitions +* +***********************************************************************/ + + typedef struct { + void *aligned; /* pointer to ie. 128 bit aligned memory */ + void *pointer; /* to use with malloc/free */ + } aligned_pointer_t; + + void malloc_aligned(aligned_pointer_t * ptr, unsigned int size, unsigned int bytes); + void free_aligned(aligned_pointer_t * ptr); + + + typedef void (*iteration_loop_t) (lame_internal_flags * gfc, const FLOAT pe[2][2], + const FLOAT ms_ratio[2], const III_psy_ratio ratio[2][2]); + + + /* "bit_stream.h" Type Definitions */ + + typedef struct bit_stream_struc { + unsigned char *buf; /* bit stream buffer */ + int buf_size; /* size of buffer (in number of bytes) */ + int totbit; /* bit counter of bit stream */ + int buf_byte_idx; /* pointer to top byte in buffer */ + int buf_bit_idx; /* pointer to top bit of top byte in buffer */ + + /* format of file in rd mode (BINARY/ASCII) */ + } Bit_stream_struc; + + + + typedef struct { + int sum; /* what we have seen so far */ + int seen; /* how many frames we have seen in this chunk */ + int want; /* how many frames we want to collect into one chunk */ + int pos; /* actual position in our bag */ + int size; /* size of our bag */ + int *bag; /* pointer to our bag */ + unsigned int nVbrNumFrames; + unsigned long nBytesWritten; + /* VBR tag data */ + unsigned int TotalFrameSize; + } VBR_seek_info_t; + + + /** + * ATH related stuff, if something new ATH related has to be added, + * please plugg it here into the ATH_t struct + */ + typedef struct { + int use_adjust; /* method for the auto adjustment */ + FLOAT aa_sensitivity_p; /* factor for tuning the (sample power) + point below which adaptive threshold + of hearing adjustment occurs */ + FLOAT adjust_factor; /* lowering based on peak volume, 1 = no lowering */ + FLOAT adjust_limit; /* limit for dynamic ATH adjust */ + FLOAT decay; /* determined to lower x dB each second */ + FLOAT floor; /* lowest ATH value */ + FLOAT l[SBMAX_l]; /* ATH for sfbs in long blocks */ + FLOAT s[SBMAX_s]; /* ATH for sfbs in short blocks */ + FLOAT psfb21[PSFB21]; /* ATH for partitionned sfb21 in long blocks */ + FLOAT psfb12[PSFB12]; /* ATH for partitionned sfb12 in short blocks */ + FLOAT cb_l[CBANDS]; /* ATH for long block convolution bands */ + FLOAT cb_s[CBANDS]; /* ATH for short block convolution bands */ + FLOAT eql_w[BLKSIZE / 2]; /* equal loudness weights (based on ATH) */ + } ATH_t; + + /** + * PSY Model related stuff + */ + + typedef struct { + FLOAT masking_lower[CBANDS]; + FLOAT minval[CBANDS]; + FLOAT rnumlines[CBANDS]; + FLOAT mld_cb[CBANDS]; + FLOAT mld[Max(SBMAX_l,SBMAX_s)]; + FLOAT bo_weight[Max(SBMAX_l,SBMAX_s)]; /* band weight long scalefactor bands, at transition */ + FLOAT attack_threshold; /* short block tuning */ + int s3ind[CBANDS][2]; + int numlines[CBANDS]; + int bm[Max(SBMAX_l,SBMAX_s)]; + int bo[Max(SBMAX_l,SBMAX_s)]; + int npart; + int n_sb; /* SBMAX_l or SBMAX_s */ + FLOAT *s3; + } PsyConst_CB2SB_t; + + + /** + * global data constants + */ + typedef struct { + PsyConst_CB2SB_t l; + PsyConst_CB2SB_t s; + PsyConst_CB2SB_t l_to_s; + FLOAT attack_threshold[4]; + FLOAT decay; + int force_short_block_calc; + } PsyConst_t; + + + typedef struct { + + FLOAT nb_l1[4][CBANDS], nb_l2[4][CBANDS]; + FLOAT nb_s1[4][CBANDS], nb_s2[4][CBANDS]; + + III_psy_xmin thm[4]; + III_psy_xmin en[4]; + + /* loudness calculation (for adaptive threshold of hearing) */ + FLOAT loudness_sq_save[2]; /* account for granule delay of L3psycho_anal */ + + FLOAT tot_ener[4]; + + FLOAT last_en_subshort[4][9]; + int last_attacks[4]; + + int blocktype_old[2]; + } PsyStateVar_t; + + + typedef struct { + /* loudness calculation (for adaptive threshold of hearing) */ + FLOAT loudness_sq[2][2]; /* loudness^2 approx. per granule and channel */ + } PsyResult_t; + + + /* variables used by encoder.c */ + typedef struct { + /* variables for newmdct.c */ + FLOAT sb_sample[2][2][18][SBLIMIT]; + FLOAT amp_filter[32]; + + /* variables used by util.c */ + /* BPC = maximum number of filter convolution windows to precompute */ +#define BPC 320 + double itime[2]; /* float precision seems to be not enough */ + sample_t *inbuf_old[2]; + sample_t *blackfilt[2 * BPC + 1]; + + FLOAT pefirbuf[19]; + + /* used for padding */ + int frac_SpF; + int slot_lag; + + /* variables for bitstream.c */ + /* mpeg1: buffer=511 bytes smallest frame: 96-38(sideinfo)=58 + * max number of frames in reservoir: 8 + * mpeg2: buffer=255 bytes. smallest frame: 24-23bytes=1 + * with VBR, if you are encoding all silence, it is possible to + * have 8kbs/24khz frames with 1byte of data each, which means we need + * to buffer up to 255 headers! */ + /* also, max_header_buf has to be a power of two */ +#define MAX_HEADER_BUF 256 +#define MAX_HEADER_LEN 40 /* max size of header is 38 */ + struct { + int write_timing; + int ptr; + char buf[MAX_HEADER_LEN]; + } header[MAX_HEADER_BUF]; + + int h_ptr; + int w_ptr; + int ancillary_flag; + + /* variables for reservoir.c */ + int ResvSize; /* in bits */ + int ResvMax; /* in bits */ + + int in_buffer_nsamples; + sample_t *in_buffer_0; + sample_t *in_buffer_1; + +#ifndef MFSIZE +# define MFSIZE ( 3*1152 + ENCDELAY - MDCTDELAY ) +#endif + sample_t mfbuf[2][MFSIZE]; + + int mf_samples_to_encode; + int mf_size; + + } EncStateVar_t; + + + typedef struct { + /* simple statistics */ + int bitrate_channelmode_hist[16][4 + 1]; + int bitrate_blocktype_hist[16][4 + 1 + 1]; /*norm/start/short/stop/mixed(short)/sum */ + + int bitrate_index; + int frame_number; /* number of frames encoded */ + int padding; /* padding for the current frame? */ + int mode_ext; + int encoder_delay; + int encoder_padding; /* number of samples of padding appended to input */ + } EncResult_t; + + + /* variables used by quantize.c */ + typedef struct { + /* variables for nspsytune */ + FLOAT longfact[SBMAX_l]; + FLOAT shortfact[SBMAX_s]; + FLOAT masking_lower; + FLOAT mask_adjust; /* the dbQ stuff */ + FLOAT mask_adjust_short; /* the dbQ stuff */ + int OldValue[2]; + int CurrentStep[2]; + int pseudohalf[SFBMAX]; + int sfb21_extra; /* will be set in lame_init_params */ + int substep_shaping; /* 0 = no substep + 1 = use substep shaping at last step(VBR only) + (not implemented yet) + 2 = use substep inside loop + 3 = use substep inside loop and last step + */ + + + char bv_scf[576]; + } QntStateVar_t; + + + typedef struct { + replaygain_t *rgdata; + /* ReplayGain */ + } RpgStateVar_t; + + + typedef struct { + FLOAT noclipScale; /* user-specified scale factor required for preventing clipping */ + sample_t PeakSample; + int RadioGain; + int noclipGainChange; /* gain change required for preventing clipping */ + } RpgResult_t; + + + typedef struct { + int version; /* 0=MPEG-2/2.5 1=MPEG-1 */ + int samplerate_index; + int sideinfo_len; + + int noise_shaping; /* 0 = none + 1 = ISO AAC model + 2 = allow scalefac_select=1 + */ + + int subblock_gain; /* 0 = no, 1 = yes */ + int use_best_huffman; /* 0 = no. 1=outside loop 2=inside loop(slow) */ + int noise_shaping_amp; /* 0 = ISO model: amplify all distorted bands + 1 = amplify within 50% of max (on db scale) + 2 = amplify only most distorted band + 3 = method 1 and refine with method 2 + */ + + int noise_shaping_stop; /* 0 = stop at over=0, all scalefacs amplified or + a scalefac has reached max value + 1 = stop when all scalefacs amplified or + a scalefac has reached max value + 2 = stop when all scalefacs amplified + */ + + + int full_outer_loop; /* 0 = stop early after 0 distortion found. 1 = full search */ + + int lowpassfreq; + int highpassfreq; + int samplerate_in; /* input_samp_rate in Hz. default=44.1 kHz */ + int samplerate_out; /* output_samp_rate. */ + int channels_in; /* number of channels in the input data stream (PCM or decoded PCM) */ + int channels_out; /* number of channels in the output data stream (not used for decoding) */ + int mode_gr; /* granules per frame */ + int force_ms; /* force M/S mode. requires mode=1 */ + + int quant_comp; + int quant_comp_short; + + int use_temporal_masking_effect; + int use_safe_joint_stereo; + + int preset; + + vbr_mode vbr; + int vbr_avg_bitrate_kbps; + int vbr_min_bitrate_index; /* min bitrate index */ + int vbr_max_bitrate_index; /* max bitrate index */ + int avg_bitrate; + int enforce_min_bitrate; /* strictly enforce VBR_min_bitrate normaly, it will be violated for analog silence */ + + int findReplayGain; /* find the RG value? default=0 */ + int findPeakSample; + int decode_on_the_fly; /* decode on the fly? default=0 */ + int analysis; + int disable_reservoir; + int buffer_constraint; /* enforce ISO spec as much as possible */ + int free_format; + int write_lame_tag; /* add Xing VBR tag? */ + + int error_protection; /* use 2 bytes per frame for a CRC checksum. default=0 */ + int copyright; /* mark as copyright. default=0 */ + int original; /* mark as original. default=1 */ + int extension; /* the MP3 'private extension' bit. Meaningless */ + int emphasis; /* Input PCM is emphased PCM (for + instance from one of the rarely + emphased CDs), it is STRONGLY not + recommended to use this, because + psycho does not take it into account, + and last but not least many decoders + don't care about these bits */ + + + MPEG_mode mode; + short_block_t short_blocks; + + float interChRatio; + float msfix; /* Naoki's adjustment of Mid/Side maskings */ + float ATH_offset_db;/* add to ATH this many db */ + float ATH_offset_factor;/* change ATH by this factor, derived from ATH_offset_db */ + float ATHcurve; /* change ATH formula 4 shape */ + int ATHtype; + int ATHonly; /* only use ATH */ + int ATHshort; /* only use ATH for short blocks */ + int noATH; /* disable ATH */ + + float ATHfixpoint; + + float adjust_alto_db; + float adjust_bass_db; + float adjust_treble_db; + float adjust_sfb21_db; + + float compression_ratio; /* sizeof(wav file)/sizeof(mp3 file) */ + + /* lowpass and highpass filter control */ + FLOAT lowpass1, lowpass2; /* normalized frequency bounds of passband */ + FLOAT highpass1, highpass2; /* normalized frequency bounds of passband */ + + /* scale input by this amount before encoding at least not used for MP3 decoding */ + FLOAT pcm_transform[2][2]; + + FLOAT minval; + } SessionConfig_t; + + + struct lame_internal_flags { + + /******************************************************************** + * internal variables NOT set by calling program, and should not be * + * modified by the calling program * + ********************************************************************/ + + /* + * Some remarks to the Class_ID field: + * The Class ID is an Identifier for a pointer to this struct. + * It is very unlikely that a pointer to lame_global_flags has the same 32 bits + * in it's structure (large and other special properties, for instance prime). + * + * To test that the structure is right and initialized, use: + * if ( gfc -> Class_ID == LAME_ID ) ... + * Other remark: + * If you set a flag to 0 for uninit data and 1 for init data, the right test + * should be "if (flag == 1)" and NOT "if (flag)". Unintended modification + * of this element will be otherwise misinterpreted as an init. + */ +# define LAME_ID 0xFFF88E3B + unsigned long class_id; + + int lame_encode_frame_init; + int iteration_init_init; + int fill_buffer_resample_init; + + SessionConfig_t cfg; + + /* variables used by lame.c */ + Bit_stream_struc bs; + III_side_info_t l3_side; + + scalefac_struct scalefac_band; + + PsyStateVar_t sv_psy; /* DATA FROM PSYMODEL.C */ + PsyResult_t ov_psy; + EncStateVar_t sv_enc; /* DATA FROM ENCODER.C */ + EncResult_t ov_enc; + QntStateVar_t sv_qnt; /* DATA FROM QUANTIZE.C */ + + RpgStateVar_t sv_rpg; + RpgResult_t ov_rpg; + + /* optional ID3 tags, used in id3tag.c */ + struct id3tag_spec tag_spec; + uint16_t nMusicCRC; + + uint16_t _unused; + + /* CPU features */ + struct { + unsigned int MMX:1; /* Pentium MMX, Pentium II...IV, K6, K6-2, + K6-III, Athlon */ + unsigned int AMD_3DNow:1; /* K6-2, K6-III, Athlon */ + unsigned int SSE:1; /* Pentium III, Pentium 4 */ + unsigned int SSE2:1; /* Pentium 4, K8 */ + unsigned int _unused:28; + } CPU_features; + + + VBR_seek_info_t VBR_seek_table; /* used for Xing VBR header */ + + ATH_t *ATH; /* all ATH related stuff */ + + PsyConst_t *cd_psy; + + /* used by the frame analyzer */ + plotting_data *pinfo; + hip_t hip; + + iteration_loop_t iteration_loop; + + /* functions to replace with CPU feature optimized versions in takehiro.c */ + int (*choose_table) (const int *ix, const int *const end, int *const s); + void (*fft_fht) (FLOAT *, int); + void (*init_xrpow_core) (gr_info * const cod_info, FLOAT xrpow[576], int upper, + FLOAT * sum); + + lame_report_function report_msg; + lame_report_function report_dbg; + lame_report_function report_err; + }; + +#ifndef lame_internal_flags_defined +#define lame_internal_flags_defined + typedef struct lame_internal_flags lame_internal_flags; +#endif + + +/*********************************************************************** +* +* Global Function Prototype Declarations +* +***********************************************************************/ + void freegfc(lame_internal_flags * const gfc); + void free_id3tag(lame_internal_flags * const gfc); + extern int BitrateIndex(int, int, int); + extern int FindNearestBitrate(int, int, int); + extern int map2MP3Frequency(int freq); + extern int SmpFrqIndex(int, int *const); + extern int nearestBitrateFullIndex(uint16_t brate); + extern FLOAT ATHformula(SessionConfig_t const *cfg, FLOAT freq); + extern FLOAT freq2bark(FLOAT freq); + void disable_FPE(void); + +/* log/log10 approximations */ + extern void init_log_table(void); + extern ieee754_float32_t fast_log2(ieee754_float32_t x); + + int isResamplingNecessary(SessionConfig_t const* cfg); + + void fill_buffer(lame_internal_flags * gfc, + sample_t *const mfbuf[2], + sample_t const *const in_buffer[2], int nsamples, int *n_in, int *n_out); + +/* same as lame_decode1 (look in lame.h), but returns + unclipped raw floating-point samples. It is declared + here, not in lame.h, because it returns LAME's + internal type sample_t. No more than 1152 samples + per channel are allowed. */ + int hip_decode1_unclipped(hip_t hip, unsigned char *mp3buf, + size_t len, sample_t pcm_l[], sample_t pcm_r[]); + + + extern int has_MMX(void); + extern int has_3DNow(void); + extern int has_SSE(void); + extern int has_SSE2(void); + + + +/*********************************************************************** +* +* Macros about Message Printing and Exit +* +***********************************************************************/ + + extern void lame_report_def(const char* format, va_list args); + extern void lame_report_fnc(lame_report_function print_f, const char *, ...); + extern void lame_errorf(const lame_internal_flags * gfc, const char *, ...); + extern void lame_debugf(const lame_internal_flags * gfc, const char *, ...); + extern void lame_msgf(const lame_internal_flags * gfc, const char *, ...); +#define DEBUGF lame_debugf +#define ERRORF lame_errorf +#define MSGF lame_msgf + + int is_lame_internal_flags_valid(const lame_internal_flags * gfp); + + extern void hip_set_pinfo(hip_t hip, plotting_data* pinfo); + +#ifdef __cplusplus +} +#endif +#endif /* LAME_UTIL_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/vbrquantize.c b/node_modules/lame/deps/lame/libmp3lame/vbrquantize.c new file mode 100644 index 0000000..e25e02d --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/vbrquantize.c @@ -0,0 +1,1580 @@ +/* + * MP3 quantization + * + * Copyright (c) 1999-2000 Mark Taylor + * Copyright (c) 2000-2012 Robert Hegemann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: vbrquantize.c,v 1.141.2.1 2012/02/07 13:40:37 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include +#endif + + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "vbrquantize.h" +#include "quantize_pvt.h" + + + + +struct algo_s; +typedef struct algo_s algo_t; + +typedef void (*alloc_sf_f) (const algo_t *, const int *, const int *, int); +typedef uint8_t (*find_sf_f) (const FLOAT *, const FLOAT *, FLOAT, unsigned int, uint8_t); + +struct algo_s { + alloc_sf_f alloc; + find_sf_f find; + const FLOAT *xr34orig; + lame_internal_flags *gfc; + gr_info *cod_info; + int mingain_l; + int mingain_s[3]; +}; + + + +/* Remarks on optimizing compilers: + * + * the MSVC compiler may get into aliasing problems when accessing + * memory through the fi_union. declaring it volatile does the trick here + * + * the calc_sfb_noise_* functions are not inlined because the intel compiler + * optimized executeables won't work as expected anymore + */ + +#ifdef _MSC_VER +# if _MSC_VER < 1400 +# define VOLATILE volatile +# else +# define VOLATILE +# endif +#else +# define VOLATILE +#endif + +typedef VOLATILE union { + float f; + int i; +} fi_union; + + + +#ifdef TAKEHIRO_IEEE754_HACK +#define DOUBLEX double +#else +#define DOUBLEX FLOAT +#endif + +#define MAGIC_FLOAT_def (65536*(128)) +#define MAGIC_INT_def 0x4b000000 + +#ifdef TAKEHIRO_IEEE754_HACK +#else +/********************************************************************* + * XRPOW_FTOI is a macro to convert floats to ints. + * if XRPOW_FTOI(x) = nearest_int(x), then QUANTFAC(x)=adj43asm[x] + * ROUNDFAC= -0.0946 + * + * if XRPOW_FTOI(x) = floor(x), then QUANTFAC(x)=asj43[x] + * ROUNDFAC=0.4054 + *********************************************************************/ +# define QUANTFAC(rx) adj43[rx] +# define ROUNDFAC_def 0.4054f +# define XRPOW_FTOI(src,dest) ((dest) = (int)(src)) +#endif + +static int const MAGIC_INT = MAGIC_INT_def; +#ifndef TAKEHIRO_IEEE754_HACK +static DOUBLEX const ROUNDFAC = ROUNDFAC_def; +#endif +static DOUBLEX const MAGIC_FLOAT = MAGIC_FLOAT_def; + + +inline static float +vec_max_c(const float * xr34, unsigned int bw) +{ + float xfsf = 0; + unsigned int i = bw >> 2u; + unsigned int const remaining = (bw & 0x03u); + + while (i-- > 0) { + if (xfsf < xr34[0]) { + xfsf = xr34[0]; + } + if (xfsf < xr34[1]) { + xfsf = xr34[1]; + } + if (xfsf < xr34[2]) { + xfsf = xr34[2]; + } + if (xfsf < xr34[3]) { + xfsf = xr34[3]; + } + xr34 += 4; + } + switch( remaining ) { + case 3: if (xfsf < xr34[2]) xfsf = xr34[2]; + case 2: if (xfsf < xr34[1]) xfsf = xr34[1]; + case 1: if (xfsf < xr34[0]) xfsf = xr34[0]; + default: break; + } + return xfsf; +} + + +inline static uint8_t +find_lowest_scalefac(const FLOAT xr34) +{ + uint8_t sf_ok = 255; + uint8_t sf = 128, delsf = 64; + uint8_t i; + FLOAT const ixmax_val = IXMAX_VAL; + for (i = 0; i < 8; ++i) { + FLOAT const xfsf = ipow20[sf] * xr34; + if (xfsf <= ixmax_val) { + sf_ok = sf; + sf -= delsf; + } + else { + sf += delsf; + } + delsf >>= 1; + } + return sf_ok; +} + + +inline static void +k_34_4(DOUBLEX x[4], int l3[4]) +{ +#ifdef TAKEHIRO_IEEE754_HACK + fi_union fi[4]; + + assert(x[0] <= IXMAX_VAL && x[1] <= IXMAX_VAL && x[2] <= IXMAX_VAL && x[3] <= IXMAX_VAL); + x[0] += MAGIC_FLOAT; + fi[0].f = x[0]; + x[1] += MAGIC_FLOAT; + fi[1].f = x[1]; + x[2] += MAGIC_FLOAT; + fi[2].f = x[2]; + x[3] += MAGIC_FLOAT; + fi[3].f = x[3]; + fi[0].f = x[0] + adj43asm[fi[0].i - MAGIC_INT]; + fi[1].f = x[1] + adj43asm[fi[1].i - MAGIC_INT]; + fi[2].f = x[2] + adj43asm[fi[2].i - MAGIC_INT]; + fi[3].f = x[3] + adj43asm[fi[3].i - MAGIC_INT]; + l3[0] = fi[0].i - MAGIC_INT; + l3[1] = fi[1].i - MAGIC_INT; + l3[2] = fi[2].i - MAGIC_INT; + l3[3] = fi[3].i - MAGIC_INT; +#else + assert(x[0] <= IXMAX_VAL && x[1] <= IXMAX_VAL && x[2] <= IXMAX_VAL && x[3] <= IXMAX_VAL); + XRPOW_FTOI(x[0], l3[0]); + XRPOW_FTOI(x[1], l3[1]); + XRPOW_FTOI(x[2], l3[2]); + XRPOW_FTOI(x[3], l3[3]); + x[0] += QUANTFAC(l3[0]); + x[1] += QUANTFAC(l3[1]); + x[2] += QUANTFAC(l3[2]); + x[3] += QUANTFAC(l3[3]); + XRPOW_FTOI(x[0], l3[0]); + XRPOW_FTOI(x[1], l3[1]); + XRPOW_FTOI(x[2], l3[2]); + XRPOW_FTOI(x[3], l3[3]); +#endif +} + + + + + +/* do call the calc_sfb_noise_* functions only with sf values + * for which holds: sfpow34*xr34 <= IXMAX_VAL + */ + +static FLOAT +calc_sfb_noise_x34(const FLOAT * xr, const FLOAT * xr34, unsigned int bw, uint8_t sf) +{ + DOUBLEX x[4]; + int l3[4]; + const FLOAT sfpow = pow20[sf + Q_MAX2]; /*pow(2.0,sf/4.0); */ + const FLOAT sfpow34 = ipow20[sf]; /*pow(sfpow,-3.0/4.0); */ + + FLOAT xfsf = 0; + unsigned int i = bw >> 2u; + unsigned int const remaining = (bw & 0x03u); + + while (i-- > 0) { + x[0] = sfpow34 * xr34[0]; + x[1] = sfpow34 * xr34[1]; + x[2] = sfpow34 * xr34[2]; + x[3] = sfpow34 * xr34[3]; + + k_34_4(x, l3); + + x[0] = fabsf(xr[0]) - sfpow * pow43[l3[0]]; + x[1] = fabsf(xr[1]) - sfpow * pow43[l3[1]]; + x[2] = fabsf(xr[2]) - sfpow * pow43[l3[2]]; + x[3] = fabsf(xr[3]) - sfpow * pow43[l3[3]]; + xfsf += (x[0] * x[0] + x[1] * x[1]) + (x[2] * x[2] + x[3] * x[3]); + + xr += 4; + xr34 += 4; + } + if (remaining) { + x[0] = x[1] = x[2] = x[3] = 0; + switch( remaining ) { + case 3: x[2] = sfpow34 * xr34[2]; + case 2: x[1] = sfpow34 * xr34[1]; + case 1: x[0] = sfpow34 * xr34[0]; + } + + k_34_4(x, l3); + x[0] = x[1] = x[2] = x[3] = 0; + + switch( remaining ) { + case 3: x[2] = fabsf(xr[2]) - sfpow * pow43[l3[2]]; + case 2: x[1] = fabsf(xr[1]) - sfpow * pow43[l3[1]]; + case 1: x[0] = fabsf(xr[0]) - sfpow * pow43[l3[0]]; + } + xfsf += (x[0] * x[0] + x[1] * x[1]) + (x[2] * x[2] + x[3] * x[3]); + } + return xfsf; +} + + + +struct calc_noise_cache { + int valid; + FLOAT value; +}; + +typedef struct calc_noise_cache calc_noise_cache_t; + + +static uint8_t +tri_calc_sfb_noise_x34(const FLOAT * xr, const FLOAT * xr34, FLOAT l3_xmin, unsigned int bw, + uint8_t sf, calc_noise_cache_t * did_it) +{ + if (did_it[sf].valid == 0) { + did_it[sf].valid = 1; + did_it[sf].value = calc_sfb_noise_x34(xr, xr34, bw, sf); + } + if (l3_xmin < did_it[sf].value) { + return 1; + } + if (sf < 255) { + uint8_t const sf_x = sf + 1; + if (did_it[sf_x].valid == 0) { + did_it[sf_x].valid = 1; + did_it[sf_x].value = calc_sfb_noise_x34(xr, xr34, bw, sf_x); + } + if (l3_xmin < did_it[sf_x].value) { + return 1; + } + } + if (sf > 0) { + uint8_t const sf_x = sf - 1; + if (did_it[sf_x].valid == 0) { + did_it[sf_x].valid = 1; + did_it[sf_x].value = calc_sfb_noise_x34(xr, xr34, bw, sf_x); + } + if (l3_xmin < did_it[sf_x].value) { + return 1; + } + } + return 0; +} + + +/** + * Robert Hegemann 2001-05-01 + * calculates quantization step size determined by allowed masking + */ +static int +calc_scalefac(FLOAT l3_xmin, int bw) +{ + FLOAT const c = 5.799142446; /* 10 * 10^(2/3) * log10(4/3) */ + return 210 + (int) (c * log10f(l3_xmin / bw) - .5f); +} + +static uint8_t +guess_scalefac_x34(const FLOAT * xr, const FLOAT * xr34, FLOAT l3_xmin, unsigned int bw, uint8_t sf_min) +{ + int const guess = calc_scalefac(l3_xmin, bw); + if (guess < sf_min) return sf_min; + if (guess >= 255) return 255; + (void) xr; + (void) xr34; + return guess; +} + + +/* the find_scalefac* routines calculate + * a quantization step size which would + * introduce as much noise as is allowed. + * The larger the step size the more + * quantization noise we'll get. The + * scalefactors are there to lower the + * global step size, allowing limited + * differences in quantization step sizes + * per band (shaping the noise). + */ + +static uint8_t +find_scalefac_x34(const FLOAT * xr, const FLOAT * xr34, FLOAT l3_xmin, unsigned int bw, + uint8_t sf_min) +{ + calc_noise_cache_t did_it[256]; + uint8_t sf = 128, sf_ok = 255, delsf = 128, seen_good_one = 0, i; + memset(did_it, 0, sizeof(did_it)); + for (i = 0; i < 8; ++i) { + delsf >>= 1; + if (sf <= sf_min) { + sf += delsf; + } + else { + uint8_t const bad = tri_calc_sfb_noise_x34(xr, xr34, l3_xmin, bw, sf, did_it); + if (bad) { /* distortion. try a smaller scalefactor */ + sf -= delsf; + } + else { + sf_ok = sf; + sf += delsf; + seen_good_one = 1; + } + } + } + /* returning a scalefac without distortion, if possible + */ + if (seen_good_one > 0) { + sf = sf_ok; + } + if (sf <= sf_min) { + sf = sf_min; + } + return sf; +} + + + +/*********************************************************************** + * + * calc_short_block_vbr_sf() + * calc_long_block_vbr_sf() + * + * Mark Taylor 2000-??-?? + * Robert Hegemann 2000-10-25 made functions of it + * + ***********************************************************************/ + +/* a variation for vbr-mtrh */ +static int +block_sf(algo_t * that, const FLOAT l3_xmin[SFBMAX], int vbrsf[SFBMAX], int vbrsfmin[SFBMAX]) +{ + FLOAT max_xr34; + const FLOAT *const xr = &that->cod_info->xr[0]; + const FLOAT *const xr34_orig = &that->xr34orig[0]; + const int *const width = &that->cod_info->width[0]; + const char *const energy_above_cutoff = &that->cod_info->energy_above_cutoff[0]; + unsigned int const max_nonzero_coeff = (unsigned int) that->cod_info->max_nonzero_coeff; + uint8_t maxsf = 0; + int sfb = 0, m_o = -1; + unsigned int j = 0, i = 0; + int const psymax = that->cod_info->psymax; + + assert(that->cod_info->max_nonzero_coeff >= 0); + + that->mingain_l = 0; + that->mingain_s[0] = 0; + that->mingain_s[1] = 0; + that->mingain_s[2] = 0; + while (j <= max_nonzero_coeff) { + unsigned int const w = (unsigned int) width[sfb]; + unsigned int const m = (unsigned int) (max_nonzero_coeff - j + 1); + unsigned int l = w; + uint8_t m1, m2; + if (l > m) { + l = m; + } + max_xr34 = vec_max_c(&xr34_orig[j], l); + + m1 = find_lowest_scalefac(max_xr34); + vbrsfmin[sfb] = m1; + if (that->mingain_l < m1) { + that->mingain_l = m1; + } + if (that->mingain_s[i] < m1) { + that->mingain_s[i] = m1; + } + if (++i > 2) { + i = 0; + } + if (sfb < psymax && w > 2) { /* mpeg2.5 at 8 kHz doesn't use all scalefactors, unused have width 2 */ + if (energy_above_cutoff[sfb]) { + m2 = that->find(&xr[j], &xr34_orig[j], l3_xmin[sfb], l, m1); +#if 0 + if (0) { + /** Robert Hegemann 2007-09-29: + * It seems here is some more potential for speed improvements. + * Current find method does 11-18 quantization calculations. + * Using a "good guess" may help to reduce this amount. + */ + uint8_t guess = calc_scalefac(l3_xmin[sfb], l); + DEBUGF(that->gfc, "sfb=%3d guess=%3d found=%3d diff=%3d\n", sfb, guess, m2, + m2 - guess); + } +#endif + if (maxsf < m2) { + maxsf = m2; + } + if (m_o < m2 && m2 < 255) { + m_o = m2; + } + } + else { + m2 = 255; + maxsf = 255; + } + } + else { + if (maxsf < m1) { + maxsf = m1; + } + m2 = maxsf; + } + vbrsf[sfb] = m2; + ++sfb; + j += w; + } + for (; sfb < SFBMAX; ++sfb) { + vbrsf[sfb] = maxsf; + vbrsfmin[sfb] = 0; + } + if (m_o > -1) { + maxsf = m_o; + for (sfb = 0; sfb < SFBMAX; ++sfb) { + if (vbrsf[sfb] == 255) { + vbrsf[sfb] = m_o; + } + } + } + return maxsf; +} + + + +/*********************************************************************** + * + * quantize xr34 based on scalefactors + * + * block_xr34 + * + * Mark Taylor 2000-??-?? + * Robert Hegemann 2000-10-20 made functions of them + * + ***********************************************************************/ + +static void +quantize_x34(const algo_t * that) +{ + DOUBLEX x[4]; + const FLOAT *xr34_orig = that->xr34orig; + gr_info *const cod_info = that->cod_info; + int const ifqstep = (cod_info->scalefac_scale == 0) ? 2 : 4; + int *l3 = cod_info->l3_enc; + unsigned int j = 0, sfb = 0; + unsigned int const max_nonzero_coeff = (unsigned int) cod_info->max_nonzero_coeff; + + assert(cod_info->max_nonzero_coeff >= 0); + assert(cod_info->max_nonzero_coeff < 576); + + while (j <= max_nonzero_coeff) { + int const s = + (cod_info->scalefac[sfb] + (cod_info->preflag ? pretab[sfb] : 0)) * ifqstep + + cod_info->subblock_gain[cod_info->window[sfb]] * 8; + uint8_t const sfac = (uint8_t) (cod_info->global_gain - s); + FLOAT const sfpow34 = ipow20[sfac]; + unsigned int const w = (unsigned int) cod_info->width[sfb]; + unsigned int const m = (unsigned int) (max_nonzero_coeff - j + 1); + unsigned int i, remaining; + + assert((cod_info->global_gain - s) >= 0); + assert(cod_info->width[sfb] >= 0); + j += w; + ++sfb; + + i = (w <= m) ? w : m; + remaining = (i & 0x03u); + i >>= 2u; + + while (i-- > 0) { + x[0] = sfpow34 * xr34_orig[0]; + x[1] = sfpow34 * xr34_orig[1]; + x[2] = sfpow34 * xr34_orig[2]; + x[3] = sfpow34 * xr34_orig[3]; + + k_34_4(x, l3); + + l3 += 4; + xr34_orig += 4; + } + if (remaining) { + int tmp_l3[4]; + x[0] = x[1] = x[2] = x[3] = 0; + switch( remaining ) { + case 3: x[2] = sfpow34 * xr34_orig[2]; + case 2: x[1] = sfpow34 * xr34_orig[1]; + case 1: x[0] = sfpow34 * xr34_orig[0]; + } + + k_34_4(x, tmp_l3); + + switch( remaining ) { + case 3: l3[2] = tmp_l3[2]; + case 2: l3[1] = tmp_l3[1]; + case 1: l3[0] = tmp_l3[0]; + } + + l3 += remaining; + xr34_orig += remaining; + } + } +} + + + +static const uint8_t max_range_short[SBMAX_s * 3] = { + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 0, 0, 0 +}; + +static const uint8_t max_range_long[SBMAX_l] = { + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0 +}; + +static const uint8_t max_range_long_lsf_pretab[SBMAX_l] = { + 7, 7, 7, 7, 7, 7, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + + + +/* + sfb=0..5 scalefac < 16 + sfb>5 scalefac < 8 + + ifqstep = ( cod_info->scalefac_scale == 0 ) ? 2 : 4; + ol_sf = (cod_info->global_gain-210.0); + ol_sf -= 8*cod_info->subblock_gain[i]; + ol_sf -= ifqstep*scalefac[gr][ch].s[sfb][i]; +*/ + +static void +set_subblock_gain(gr_info * cod_info, const int mingain_s[3], int sf[]) +{ + const int maxrange1 = 15, maxrange2 = 7; + const int ifqstepShift = (cod_info->scalefac_scale == 0) ? 1 : 2; + int *const sbg = cod_info->subblock_gain; + unsigned int const psymax = (unsigned int) cod_info->psymax; + unsigned int psydiv = 18; + int sbg0, sbg1, sbg2; + unsigned int sfb, i; + int min_sbg = 7; + + if (psydiv > psymax) { + psydiv = psymax; + } + for (i = 0; i < 3; ++i) { + int maxsf1 = 0, maxsf2 = 0, minsf = 1000; + /* see if we should use subblock gain */ + for (sfb = i; sfb < psydiv; sfb += 3) { /* part 1 */ + int const v = -sf[sfb]; + if (maxsf1 < v) { + maxsf1 = v; + } + if (minsf > v) { + minsf = v; + } + } + for (; sfb < SFBMAX; sfb += 3) { /* part 2 */ + int const v = -sf[sfb]; + if (maxsf2 < v) { + maxsf2 = v; + } + if (minsf > v) { + minsf = v; + } + } + + /* boost subblock gain as little as possible so we can + * reach maxsf1 with scalefactors + * 8*sbg >= maxsf1 + */ + { + int const m1 = maxsf1 - (maxrange1 << ifqstepShift); + int const m2 = maxsf2 - (maxrange2 << ifqstepShift); + + maxsf1 = Max(m1, m2); + } + if (minsf > 0) { + sbg[i] = minsf >> 3; + } + else { + sbg[i] = 0; + } + if (maxsf1 > 0) { + int const m1 = sbg[i]; + int const m2 = (maxsf1 + 7) >> 3; + sbg[i] = Max(m1, m2); + } + if (sbg[i] > 0 && mingain_s[i] > (cod_info->global_gain - sbg[i] * 8)) { + sbg[i] = (cod_info->global_gain - mingain_s[i]) >> 3; + } + if (sbg[i] > 7) { + sbg[i] = 7; + } + if (min_sbg > sbg[i]) { + min_sbg = sbg[i]; + } + } + sbg0 = sbg[0] * 8; + sbg1 = sbg[1] * 8; + sbg2 = sbg[2] * 8; + for (sfb = 0; sfb < SFBMAX; sfb += 3) { + sf[sfb + 0] += sbg0; + sf[sfb + 1] += sbg1; + sf[sfb + 2] += sbg2; + } + if (min_sbg > 0) { + for (i = 0; i < 3; ++i) { + sbg[i] -= min_sbg; + } + cod_info->global_gain -= min_sbg * 8; + } +} + + + +/* + ifqstep = ( cod_info->scalefac_scale == 0 ) ? 2 : 4; + ol_sf = (cod_info->global_gain-210.0); + ol_sf -= ifqstep*scalefac[gr][ch].l[sfb]; + if (cod_info->preflag && sfb>=11) + ol_sf -= ifqstep*pretab[sfb]; +*/ +static void +set_scalefacs(gr_info * cod_info, const int *vbrsfmin, int sf[], const uint8_t * max_range) +{ + const int ifqstep = (cod_info->scalefac_scale == 0) ? 2 : 4; + const int ifqstepShift = (cod_info->scalefac_scale == 0) ? 1 : 2; + int *const scalefac = cod_info->scalefac; + int const sfbmax = cod_info->sfbmax; + int sfb; + int const *const sbg = cod_info->subblock_gain; + int const *const window = cod_info->window; + int const preflag = cod_info->preflag; + + if (preflag) { + for (sfb = 11; sfb < sfbmax; ++sfb) { + sf[sfb] += pretab[sfb] * ifqstep; + } + } + for (sfb = 0; sfb < sfbmax; ++sfb) { + int const gain = cod_info->global_gain - (sbg[window[sfb]] * 8) + - ((preflag ? pretab[sfb] : 0) * ifqstep); + + if (sf[sfb] < 0) { + int const m = gain - vbrsfmin[sfb]; + /* ifqstep*scalefac >= -sf[sfb], so round UP */ + scalefac[sfb] = (ifqstep - 1 - sf[sfb]) >> ifqstepShift; + + if (scalefac[sfb] > max_range[sfb]) { + scalefac[sfb] = max_range[sfb]; + } + if (scalefac[sfb] > 0 && (scalefac[sfb] << ifqstepShift) > m) { + scalefac[sfb] = m >> ifqstepShift; + } + } + else { + scalefac[sfb] = 0; + } + } + for (; sfb < SFBMAX; ++sfb) { + scalefac[sfb] = 0; /* sfb21 */ + } +} + + +#ifndef NDEBUG +static int +checkScalefactor(const gr_info * cod_info, const int vbrsfmin[SFBMAX]) +{ + int const ifqstep = cod_info->scalefac_scale == 0 ? 2 : 4; + int sfb; + for (sfb = 0; sfb < cod_info->psymax; ++sfb) { + const int s = + ((cod_info->scalefac[sfb] + + (cod_info->preflag ? pretab[sfb] : 0)) * ifqstep) + + cod_info->subblock_gain[cod_info->window[sfb]] * 8; + + if ((cod_info->global_gain - s) < vbrsfmin[sfb]) { + /* + fprintf( stdout, "sf %d\n", sfb ); + fprintf( stdout, "min %d\n", vbrsfmin[sfb] ); + fprintf( stdout, "ggain %d\n", cod_info->global_gain ); + fprintf( stdout, "scalefac %d\n", cod_info->scalefac[sfb] ); + fprintf( stdout, "pretab %d\n", (cod_info->preflag ? pretab[sfb] : 0) ); + fprintf( stdout, "scale %d\n", (cod_info->scalefac_scale + 1) ); + fprintf( stdout, "subgain %d\n", cod_info->subblock_gain[cod_info->window[sfb]] * 8 ); + fflush( stdout ); + exit(-1); + */ + return 0; + } + } + return 1; +} +#endif + + +/****************************************************************** + * + * short block scalefacs + * + ******************************************************************/ + +static void +short_block_constrain(const algo_t * that, const int vbrsf[SFBMAX], + const int vbrsfmin[SFBMAX], int vbrmax) +{ + gr_info *const cod_info = that->cod_info; + lame_internal_flags const *const gfc = that->gfc; + SessionConfig_t const *const cfg = &gfc->cfg; + int const maxminsfb = that->mingain_l; + int mover, maxover0 = 0, maxover1 = 0, delta = 0; + int v, v0, v1; + int sfb; + int const psymax = cod_info->psymax; + + for (sfb = 0; sfb < psymax; ++sfb) { + assert(vbrsf[sfb] >= vbrsfmin[sfb]); + v = vbrmax - vbrsf[sfb]; + if (delta < v) { + delta = v; + } + v0 = v - (4 * 14 + 2 * max_range_short[sfb]); + v1 = v - (4 * 14 + 4 * max_range_short[sfb]); + if (maxover0 < v0) { + maxover0 = v0; + } + if (maxover1 < v1) { + maxover1 = v1; + } + } + if (cfg->noise_shaping == 2) { + /* allow scalefac_scale=1 */ + mover = Min(maxover0, maxover1); + } + else { + mover = maxover0; + } + if (delta > mover) { + delta = mover; + } + vbrmax -= delta; + maxover0 -= mover; + maxover1 -= mover; + + if (maxover0 == 0) { + cod_info->scalefac_scale = 0; + } + else if (maxover1 == 0) { + cod_info->scalefac_scale = 1; + } + if (vbrmax < maxminsfb) { + vbrmax = maxminsfb; + } + cod_info->global_gain = vbrmax; + + if (cod_info->global_gain < 0) { + cod_info->global_gain = 0; + } + else if (cod_info->global_gain > 255) { + cod_info->global_gain = 255; + } + { + int sf_temp[SFBMAX]; + for (sfb = 0; sfb < SFBMAX; ++sfb) { + sf_temp[sfb] = vbrsf[sfb] - vbrmax; + } + set_subblock_gain(cod_info, &that->mingain_s[0], sf_temp); + set_scalefacs(cod_info, vbrsfmin, sf_temp, max_range_short); + } + assert(checkScalefactor(cod_info, vbrsfmin)); +} + + + +/****************************************************************** + * + * long block scalefacs + * + ******************************************************************/ + +static void +long_block_constrain(const algo_t * that, const int vbrsf[SFBMAX], const int vbrsfmin[SFBMAX], + int vbrmax) +{ + gr_info *const cod_info = that->cod_info; + lame_internal_flags const *const gfc = that->gfc; + SessionConfig_t const *const cfg = &gfc->cfg; + uint8_t const *max_rangep; + int const maxminsfb = that->mingain_l; + int sfb; + int maxover0, maxover1, maxover0p, maxover1p, mover, delta = 0; + int v, v0, v1, v0p, v1p, vm0p = 1, vm1p = 1; + int const psymax = cod_info->psymax; + + max_rangep = cfg->mode_gr == 2 ? max_range_long : max_range_long_lsf_pretab; + + maxover0 = 0; + maxover1 = 0; + maxover0p = 0; /* pretab */ + maxover1p = 0; /* pretab */ + + for (sfb = 0; sfb < psymax; ++sfb) { + assert(vbrsf[sfb] >= vbrsfmin[sfb]); + v = vbrmax - vbrsf[sfb]; + if (delta < v) { + delta = v; + } + v0 = v - 2 * max_range_long[sfb]; + v1 = v - 4 * max_range_long[sfb]; + v0p = v - 2 * (max_rangep[sfb] + pretab[sfb]); + v1p = v - 4 * (max_rangep[sfb] + pretab[sfb]); + if (maxover0 < v0) { + maxover0 = v0; + } + if (maxover1 < v1) { + maxover1 = v1; + } + if (maxover0p < v0p) { + maxover0p = v0p; + } + if (maxover1p < v1p) { + maxover1p = v1p; + } + } + if (vm0p == 1) { + int gain = vbrmax - maxover0p; + if (gain < maxminsfb) { + gain = maxminsfb; + } + for (sfb = 0; sfb < psymax; ++sfb) { + int const a = (gain - vbrsfmin[sfb]) - 2 * pretab[sfb]; + if (a <= 0) { + vm0p = 0; + vm1p = 0; + break; + } + } + } + if (vm1p == 1) { + int gain = vbrmax - maxover1p; + if (gain < maxminsfb) { + gain = maxminsfb; + } + for (sfb = 0; sfb < psymax; ++sfb) { + int const b = (gain - vbrsfmin[sfb]) - 4 * pretab[sfb]; + if (b <= 0) { + vm1p = 0; + break; + } + } + } + if (vm0p == 0) { + maxover0p = maxover0; + } + if (vm1p == 0) { + maxover1p = maxover1; + } + if (cfg->noise_shaping != 2) { + maxover1 = maxover0; + maxover1p = maxover0p; + } + mover = Min(maxover0, maxover0p); + mover = Min(mover, maxover1); + mover = Min(mover, maxover1p); + + if (delta > mover) { + delta = mover; + } + vbrmax -= delta; + if (vbrmax < maxminsfb) { + vbrmax = maxminsfb; + } + maxover0 -= mover; + maxover0p -= mover; + maxover1 -= mover; + maxover1p -= mover; + + if (maxover0 == 0) { + cod_info->scalefac_scale = 0; + cod_info->preflag = 0; + max_rangep = max_range_long; + } + else if (maxover0p == 0) { + cod_info->scalefac_scale = 0; + cod_info->preflag = 1; + } + else if (maxover1 == 0) { + cod_info->scalefac_scale = 1; + cod_info->preflag = 0; + max_rangep = max_range_long; + } + else if (maxover1p == 0) { + cod_info->scalefac_scale = 1; + cod_info->preflag = 1; + } + else { + assert(0); /* this should not happen */ + } + cod_info->global_gain = vbrmax; + if (cod_info->global_gain < 0) { + cod_info->global_gain = 0; + } + else if (cod_info->global_gain > 255) { + cod_info->global_gain = 255; + } + { + int sf_temp[SFBMAX]; + for (sfb = 0; sfb < SFBMAX; ++sfb) { + sf_temp[sfb] = vbrsf[sfb] - vbrmax; + } + set_scalefacs(cod_info, vbrsfmin, sf_temp, max_rangep); + } + assert(checkScalefactor(cod_info, vbrsfmin)); +} + + + +static void +bitcount(const algo_t * that) +{ + int rc = scale_bitcount(that->gfc, that->cod_info); + + if (rc == 0) { + return; + } + /* this should not happen due to the way the scalefactors are selected */ + ERRORF(that->gfc, "INTERNAL ERROR IN VBR NEW CODE (986), please send bug report\n"); + exit(-1); +} + + + +static int +quantizeAndCountBits(const algo_t * that) +{ + quantize_x34(that); + that->cod_info->part2_3_length = noquant_count_bits(that->gfc, that->cod_info, 0); + return that->cod_info->part2_3_length; +} + + + + + +static int +tryGlobalStepsize(const algo_t * that, const int sfwork[SFBMAX], + const int vbrsfmin[SFBMAX], int delta) +{ + FLOAT const xrpow_max = that->cod_info->xrpow_max; + int sftemp[SFBMAX], i, nbits; + int gain, vbrmax = 0; + for (i = 0; i < SFBMAX; ++i) { + gain = sfwork[i] + delta; + if (gain < vbrsfmin[i]) { + gain = vbrsfmin[i]; + } + if (gain > 255) { + gain = 255; + } + if (vbrmax < gain) { + vbrmax = gain; + } + sftemp[i] = gain; + } + that->alloc(that, sftemp, vbrsfmin, vbrmax); + bitcount(that); + nbits = quantizeAndCountBits(that); + that->cod_info->xrpow_max = xrpow_max; + return nbits; +} + + + +static void +searchGlobalStepsizeMax(const algo_t * that, const int sfwork[SFBMAX], + const int vbrsfmin[SFBMAX], int target) +{ + gr_info const *const cod_info = that->cod_info; + const int gain = cod_info->global_gain; + int curr = gain; + int gain_ok = 1024; + int nbits = LARGE_BITS; + int l = gain, r = 512; + + assert(gain >= 0); + while (l <= r) { + curr = (l + r) >> 1; + nbits = tryGlobalStepsize(that, sfwork, vbrsfmin, curr - gain); + if (nbits == 0 || (nbits + cod_info->part2_length) < target) { + r = curr - 1; + gain_ok = curr; + } + else { + l = curr + 1; + if (gain_ok == 1024) { + gain_ok = curr; + } + } + } + if (gain_ok != curr) { + curr = gain_ok; + nbits = tryGlobalStepsize(that, sfwork, vbrsfmin, curr - gain); + } +} + + + +static int +sfDepth(const int sfwork[SFBMAX]) +{ + int m = 0; + unsigned int i, j; + for (j = SFBMAX, i = 0; j > 0; --j, ++i) { + int const di = 255 - sfwork[i]; + if (m < di) { + m = di; + } + assert(sfwork[i] >= 0); + assert(sfwork[i] <= 255); + } + assert(m >= 0); + assert(m <= 255); + return m; +} + + +static void +cutDistribution(const int sfwork[SFBMAX], int sf_out[SFBMAX], int cut) +{ + unsigned int i, j; + for (j = SFBMAX, i = 0; j > 0; --j, ++i) { + int const x = sfwork[i]; + sf_out[i] = x < cut ? x : cut; + } +} + + +static int +flattenDistribution(const int sfwork[SFBMAX], int sf_out[SFBMAX], int dm, int k, int p) +{ + unsigned int i, j; + int x, sfmax = 0; + if (dm > 0) { + for (j = SFBMAX, i = 0; j > 0; --j, ++i) { + int const di = p - sfwork[i]; + x = sfwork[i] + (k * di) / dm; + if (x < 0) { + x = 0; + } + else { + if (x > 255) { + x = 255; + } + } + sf_out[i] = x; + if (sfmax < x) { + sfmax = x; + } + } + } + else { + for (j = SFBMAX, i = 0; j > 0u; --j, ++i) { + x = sfwork[i]; + sf_out[i] = x; + if (sfmax < x) { + sfmax = x; + } + } + } + return sfmax; +} + + +static int +tryThatOne(algo_t const* that, const int sftemp[SFBMAX], const int vbrsfmin[SFBMAX], int vbrmax) +{ + FLOAT const xrpow_max = that->cod_info->xrpow_max; + int nbits = LARGE_BITS; + that->alloc(that, sftemp, vbrsfmin, vbrmax); + bitcount(that); + nbits = quantizeAndCountBits(that); + nbits += that->cod_info->part2_length; + that->cod_info->xrpow_max = xrpow_max; + return nbits; +} + + +static void +outOfBitsStrategy(algo_t const* that, const int sfwork[SFBMAX], const int vbrsfmin[SFBMAX], int target) +{ + int wrk[SFBMAX]; + int const dm = sfDepth(sfwork); + int const p = that->cod_info->global_gain; + int nbits; + + /* PART 1 */ + { + int bi = dm / 2; + int bi_ok = -1; + int bu = 0; + int bo = dm; + for (;;) { + int const sfmax = flattenDistribution(sfwork, wrk, dm, bi, p); + nbits = tryThatOne(that, wrk, vbrsfmin, sfmax); + if (nbits <= target) { + bi_ok = bi; + bo = bi - 1; + } + else { + bu = bi + 1; + } + if (bu <= bo) { + bi = (bu + bo) / 2; + } + else { + break; + } + } + if (bi_ok >= 0) { + if (bi != bi_ok) { + int const sfmax = flattenDistribution(sfwork, wrk, dm, bi_ok, p); + nbits = tryThatOne(that, wrk, vbrsfmin, sfmax); + } + return; + } + } + + /* PART 2: */ + { + int bi = (255 + p) / 2; + int bi_ok = -1; + int bu = p; + int bo = 255; + for (;;) { + int const sfmax = flattenDistribution(sfwork, wrk, dm, dm, bi); + nbits = tryThatOne(that, wrk, vbrsfmin, sfmax); + if (nbits <= target) { + bi_ok = bi; + bo = bi - 1; + } + else { + bu = bi + 1; + } + if (bu <= bo) { + bi = (bu + bo) / 2; + } + else { + break; + } + } + if (bi_ok >= 0) { + if (bi != bi_ok) { + int const sfmax = flattenDistribution(sfwork, wrk, dm, dm, bi_ok); + nbits = tryThatOne(that, wrk, vbrsfmin, sfmax); + } + return; + } + } + + /* fall back to old code, likely to be never called */ + searchGlobalStepsizeMax(that, wrk, vbrsfmin, target); +} + + +static int +reduce_bit_usage(lame_internal_flags * gfc, int gr, int ch +#if 0 + , const FLOAT xr34orig[576], const FLOAT l3_xmin[SFBMAX], int maxbits +#endif + ) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + gr_info *const cod_info = &gfc->l3_side.tt[gr][ch]; + /* try some better scalefac storage + */ + best_scalefac_store(gfc, gr, ch, &gfc->l3_side); + + /* best huffman_divide may save some bits too + */ + if (cfg->use_best_huffman == 1) + best_huffman_divide(gfc, cod_info); + return cod_info->part2_3_length + cod_info->part2_length; +} + + + + +int +VBR_encode_frame(lame_internal_flags * gfc, const FLOAT xr34orig[2][2][576], + const FLOAT l3_xmin[2][2][SFBMAX], const int max_bits[2][2]) +{ + SessionConfig_t const *const cfg = &gfc->cfg; + int sfwork_[2][2][SFBMAX]; + int vbrsfmin_[2][2][SFBMAX]; + algo_t that_[2][2]; + int const ngr = cfg->mode_gr; + int const nch = cfg->channels_out; + int max_nbits_ch[2][2] = {{0, 0}, {0 ,0}}; + int max_nbits_gr[2] = {0, 0}; + int max_nbits_fr = 0; + int use_nbits_ch[2][2] = {{MAX_BITS_PER_CHANNEL+1, MAX_BITS_PER_CHANNEL+1} + ,{MAX_BITS_PER_CHANNEL+1, MAX_BITS_PER_CHANNEL+1}}; + int use_nbits_gr[2] = { MAX_BITS_PER_GRANULE+1, MAX_BITS_PER_GRANULE+1 }; + int use_nbits_fr = MAX_BITS_PER_GRANULE+MAX_BITS_PER_GRANULE; + int gr, ch; + int ok, sum_fr; + + /* set up some encoding parameters + */ + for (gr = 0; gr < ngr; ++gr) { + max_nbits_gr[gr] = 0; + for (ch = 0; ch < nch; ++ch) { + max_nbits_ch[gr][ch] = max_bits[gr][ch]; + use_nbits_ch[gr][ch] = 0; + max_nbits_gr[gr] += max_bits[gr][ch]; + max_nbits_fr += max_bits[gr][ch]; + that_[gr][ch].find = (cfg->full_outer_loop < 0) ? guess_scalefac_x34 : find_scalefac_x34; + that_[gr][ch].gfc = gfc; + that_[gr][ch].cod_info = &gfc->l3_side.tt[gr][ch]; + that_[gr][ch].xr34orig = xr34orig[gr][ch]; + if (that_[gr][ch].cod_info->block_type == SHORT_TYPE) { + that_[gr][ch].alloc = short_block_constrain; + } + else { + that_[gr][ch].alloc = long_block_constrain; + } + } /* for ch */ + } + /* searches scalefactors + */ + for (gr = 0; gr < ngr; ++gr) { + for (ch = 0; ch < nch; ++ch) { + if (max_bits[gr][ch] > 0) { + algo_t *that = &that_[gr][ch]; + int *sfwork = sfwork_[gr][ch]; + int *vbrsfmin = vbrsfmin_[gr][ch]; + int vbrmax; + + vbrmax = block_sf(that, l3_xmin[gr][ch], sfwork, vbrsfmin); + that->alloc(that, sfwork, vbrsfmin, vbrmax); + bitcount(that); + } + else { + /* xr contains no energy + * l3_enc, our encoding data, will be quantized to zero + * continue with next channel + */ + } + } /* for ch */ + } + /* encode 'as is' + */ + use_nbits_fr = 0; + for (gr = 0; gr < ngr; ++gr) { + use_nbits_gr[gr] = 0; + for (ch = 0; ch < nch; ++ch) { + algo_t const *that = &that_[gr][ch]; + if (max_bits[gr][ch] > 0) { + memset(&that->cod_info->l3_enc[0], 0, sizeof(that->cod_info->l3_enc)); + (void) quantizeAndCountBits(that); + } + else { + /* xr contains no energy + * l3_enc, our encoding data, will be quantized to zero + * continue with next channel + */ + } + use_nbits_ch[gr][ch] = reduce_bit_usage(gfc, gr, ch); + use_nbits_gr[gr] += use_nbits_ch[gr][ch]; + } /* for ch */ + use_nbits_fr += use_nbits_gr[gr]; + } + + /* check bit constrains + */ + if (use_nbits_fr <= max_nbits_fr) { + ok = 1; + for (gr = 0; gr < ngr; ++gr) { + if (use_nbits_gr[gr] > MAX_BITS_PER_GRANULE) { + /* violates the rule that every granule has to use no more + * bits than MAX_BITS_PER_GRANULE + */ + ok = 0; + } + for (ch = 0; ch < nch; ++ch) { + if (use_nbits_ch[gr][ch] > MAX_BITS_PER_CHANNEL) { + /* violates the rule that every gr_ch has to use no more + * bits than MAX_BITS_PER_CHANNEL + * + * This isn't explicitly stated in the ISO docs, but the + * part2_3_length field has only 12 bits, that makes it + * up to a maximum size of 4095 bits!!! + */ + ok = 0; + } + } + } + if (ok) { + return use_nbits_fr; + } + } + + /* OK, we are in trouble and have to define how many bits are + * to be used for each granule + */ + { + ok = 1; + sum_fr = 0; + + for (gr = 0; gr < ngr; ++gr) { + max_nbits_gr[gr] = 0; + for (ch = 0; ch < nch; ++ch) { + if (use_nbits_ch[gr][ch] > MAX_BITS_PER_CHANNEL) { + max_nbits_ch[gr][ch] = MAX_BITS_PER_CHANNEL; + } + else { + max_nbits_ch[gr][ch] = use_nbits_ch[gr][ch]; + } + max_nbits_gr[gr] += max_nbits_ch[gr][ch]; + } + if (max_nbits_gr[gr] > MAX_BITS_PER_GRANULE) { + float f[2] = {0.0f, 0.0f}, s = 0.0f; + for (ch = 0; ch < nch; ++ch) { + if (max_nbits_ch[gr][ch] > 0) { + f[ch] = sqrt(sqrt(max_nbits_ch[gr][ch])); + s += f[ch]; + } + else { + f[ch] = 0; + } + } + for (ch = 0; ch < nch; ++ch) { + if (s > 0) { + max_nbits_ch[gr][ch] = MAX_BITS_PER_GRANULE * f[ch] / s; + } + else { + max_nbits_ch[gr][ch] = 0; + } + } + if (nch > 1) { + if (max_nbits_ch[gr][0] > use_nbits_ch[gr][0] + 32) { + max_nbits_ch[gr][1] += max_nbits_ch[gr][0]; + max_nbits_ch[gr][1] -= use_nbits_ch[gr][0] + 32; + max_nbits_ch[gr][0] = use_nbits_ch[gr][0] + 32; + } + if (max_nbits_ch[gr][1] > use_nbits_ch[gr][1] + 32) { + max_nbits_ch[gr][0] += max_nbits_ch[gr][1]; + max_nbits_ch[gr][0] -= use_nbits_ch[gr][1] + 32; + max_nbits_ch[gr][1] = use_nbits_ch[gr][1] + 32; + } + if (max_nbits_ch[gr][0] > MAX_BITS_PER_CHANNEL) { + max_nbits_ch[gr][0] = MAX_BITS_PER_CHANNEL; + } + if (max_nbits_ch[gr][1] > MAX_BITS_PER_CHANNEL) { + max_nbits_ch[gr][1] = MAX_BITS_PER_CHANNEL; + } + } + max_nbits_gr[gr] = 0; + for (ch = 0; ch < nch; ++ch) { + max_nbits_gr[gr] += max_nbits_ch[gr][ch]; + } + } + sum_fr += max_nbits_gr[gr]; + } + if (sum_fr > max_nbits_fr) { + { + float f[2] = {0.0f, 0.0f}, s = 0.0f; + for (gr = 0; gr < ngr; ++gr) { + if (max_nbits_gr[gr] > 0) { + f[gr] = sqrt(max_nbits_gr[gr]); + s += f[gr]; + } + else { + f[gr] = 0; + } + } + for (gr = 0; gr < ngr; ++gr) { + if (s > 0) { + max_nbits_gr[gr] = max_nbits_fr * f[gr] / s; + } + else { + max_nbits_gr[gr] = 0; + } + } + } + if (ngr > 1) { + if (max_nbits_gr[0] > use_nbits_gr[0] + 125) { + max_nbits_gr[1] += max_nbits_gr[0]; + max_nbits_gr[1] -= use_nbits_gr[0] + 125; + max_nbits_gr[0] = use_nbits_gr[0] + 125; + } + if (max_nbits_gr[1] > use_nbits_gr[1] + 125) { + max_nbits_gr[0] += max_nbits_gr[1]; + max_nbits_gr[0] -= use_nbits_gr[1] + 125; + max_nbits_gr[1] = use_nbits_gr[1] + 125; + } + for (gr = 0; gr < ngr; ++gr) { + if (max_nbits_gr[gr] > MAX_BITS_PER_GRANULE) { + max_nbits_gr[gr] = MAX_BITS_PER_GRANULE; + } + } + } + for (gr = 0; gr < ngr; ++gr) { + float f[2] = {0.0f, 0.0f}, s = 0.0f; + for (ch = 0; ch < nch; ++ch) { + if (max_nbits_ch[gr][ch] > 0) { + f[ch] = sqrt(max_nbits_ch[gr][ch]); + s += f[ch]; + } + else { + f[ch] = 0; + } + } + for (ch = 0; ch < nch; ++ch) { + if (s > 0) { + max_nbits_ch[gr][ch] = max_nbits_gr[gr] * f[ch] / s; + } + else { + max_nbits_ch[gr][ch] = 0; + } + } + if (nch > 1) { + if (max_nbits_ch[gr][0] > use_nbits_ch[gr][0] + 32) { + max_nbits_ch[gr][1] += max_nbits_ch[gr][0]; + max_nbits_ch[gr][1] -= use_nbits_ch[gr][0] + 32; + max_nbits_ch[gr][0] = use_nbits_ch[gr][0] + 32; + } + if (max_nbits_ch[gr][1] > use_nbits_ch[gr][1] + 32) { + max_nbits_ch[gr][0] += max_nbits_ch[gr][1]; + max_nbits_ch[gr][0] -= use_nbits_ch[gr][1] + 32; + max_nbits_ch[gr][1] = use_nbits_ch[gr][1] + 32; + } + for (ch = 0; ch < nch; ++ch) { + if (max_nbits_ch[gr][ch] > MAX_BITS_PER_CHANNEL) { + max_nbits_ch[gr][ch] = MAX_BITS_PER_CHANNEL; + } + } + } + } + } + /* sanity check */ + sum_fr = 0; + for (gr = 0; gr < ngr; ++gr) { + int sum_gr = 0; + for (ch = 0; ch < nch; ++ch) { + sum_gr += max_nbits_ch[gr][ch]; + if (max_nbits_ch[gr][ch] > MAX_BITS_PER_CHANNEL) { + ok = 0; + } + } + sum_fr += sum_gr; + if (sum_gr > MAX_BITS_PER_GRANULE) { + ok = 0; + } + } + if (sum_fr > max_nbits_fr) { + ok = 0; + } + if (!ok) { + /* we must have done something wrong, fallback to 'on_pe' based constrain */ + for (gr = 0; gr < ngr; ++gr) { + for (ch = 0; ch < nch; ++ch) { + max_nbits_ch[gr][ch] = max_bits[gr][ch]; + } + } + } + } + + /* we already called the 'best_scalefac_store' function, so we need to reset some + * variables before we can do it again. + */ + for (ch = 0; ch < nch; ++ch) { + gfc->l3_side.scfsi[ch][0] = 0; + gfc->l3_side.scfsi[ch][1] = 0; + gfc->l3_side.scfsi[ch][2] = 0; + gfc->l3_side.scfsi[ch][3] = 0; + } + for (gr = 0; gr < ngr; ++gr) { + for (ch = 0; ch < nch; ++ch) { + gfc->l3_side.tt[gr][ch].scalefac_compress = 0; + } + } + + /* alter our encoded data, until it fits into the target bitrate + */ + use_nbits_fr = 0; + for (gr = 0; gr < ngr; ++gr) { + use_nbits_gr[gr] = 0; + for (ch = 0; ch < nch; ++ch) { + algo_t const *that = &that_[gr][ch]; + use_nbits_ch[gr][ch] = 0; + if (max_bits[gr][ch] > 0) { + int *sfwork = sfwork_[gr][ch]; + int const *vbrsfmin = vbrsfmin_[gr][ch]; + cutDistribution(sfwork, sfwork, that->cod_info->global_gain); + outOfBitsStrategy(that, sfwork, vbrsfmin, max_nbits_ch[gr][ch]); + } + use_nbits_ch[gr][ch] = reduce_bit_usage(gfc, gr, ch); + assert(use_nbits_ch[gr][ch] <= max_nbits_ch[gr][ch]); + use_nbits_gr[gr] += use_nbits_ch[gr][ch]; + } /* for ch */ + use_nbits_fr += use_nbits_gr[gr]; + } + + /* check bit constrains, but it should always be ok, iff there are no bugs ;-) + */ + if (use_nbits_fr <= max_nbits_fr) { + return use_nbits_fr; + } + + ERRORF(gfc, "INTERNAL ERROR IN VBR NEW CODE (1313), please send bug report\n" + "maxbits=%d usedbits=%d\n", max_nbits_fr, use_nbits_fr); + exit(-1); +} diff --git a/node_modules/lame/deps/lame/libmp3lame/vbrquantize.h b/node_modules/lame/deps/lame/libmp3lame/vbrquantize.h new file mode 100644 index 0000000..1c0d18f --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/vbrquantize.h @@ -0,0 +1,28 @@ +/* + * MP3 VBR quantization + * + * Copyright (c) 1999 Mark Taylor + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_VBRQUANTIZE_H +#define LAME_VBRQUANTIZE_H + +int VBR_encode_frame(lame_internal_flags * gfc, const FLOAT xr34orig[2][2][576], + const FLOAT l3_xmin[2][2][SFBMAX], const int maxbits[2][2]); + +#endif /* LAME_VBRQUANTIZE_H */ diff --git a/node_modules/lame/deps/lame/libmp3lame/vector/Makefile.am b/node_modules/lame/deps/lame/libmp3lame/vector/Makefile.am new file mode 100644 index 0000000..ac595b1 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/vector/Makefile.am @@ -0,0 +1,49 @@ +## $Id: Makefile.am,v 1.1 2007/01/09 10:15:53 aleidinger Exp $ + +include $(top_srcdir)/Makefile.am.global + +if WITH_XMM +noinst_LTLIBRARIES = liblamevectorroutines.la +endif + +##liblamecpuroutines_la_LIBADD = +##liblamecpuroutines_la_LDFLAGS = + +INCLUDES = @INCLUDES@ \ + -I$(top_srcdir)/libmp3lame \ + -I$(top_srcdir)/mpglib \ + -I$(top_builddir) + +DEFS = @DEFS@ @CONFIG_DEFS@ + +xmm_sources = xmm_quantize_sub.c + +if WITH_XMM +liblamevectorroutines_la_SOURCES = $(xmm_sources) +endif + +noinst_HEADERS = lame_intrin.h + +EXTRA_liblamevectorroutines_la_SOURCES = $(xmm_sources) + +CLEANFILES = lclint.txt + +LCLINTFLAGS= \ + +posixlib \ + +showsummary \ + +showalluses \ + +whichlib \ + +forcehints \ + -fixedformalarray \ + +matchanyintegral \ + -Dlint + +lclint.txt: ${liblamecpuroutines_la_SOURCES} ${noinst_HEADERS} + @lclint ${LCLINTFLAGS} ${INCLUDES} ${DEFS} ${liblamecpuroutines_la_SOURCES} 2>&1 >lclint.txt || true + +lclint: lclint.txt + more lclint.txt + +#$(OBJECTS): libtool +#libtool: $(LIBTOOL_DEPS) +# $(SHELL) $(top_builddir)/config.status --recheck diff --git a/node_modules/lame/deps/lame/libmp3lame/vector/Makefile.in b/node_modules/lame/deps/lame/libmp3lame/vector/Makefile.in new file mode 100644 index 0000000..3916b15 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/vector/Makefile.in @@ -0,0 +1,548 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# global section for every Makefile.am + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +ANSI2KNR = $(top_srcdir)/ansi2knr +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.am.global +subdir = libmp3lame/vector +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +liblamevectorroutines_la_LIBADD = +am__liblamevectorroutines_la_SOURCES_DIST = xmm_quantize_sub.c +am__objects_1 = xmm_quantize_sub$U.lo +@WITH_XMM_TRUE@am_liblamevectorroutines_la_OBJECTS = $(am__objects_1) +liblamevectorroutines_la_OBJECTS = \ + $(am_liblamevectorroutines_la_OBJECTS) +@WITH_XMM_TRUE@am_liblamevectorroutines_la_rpath = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(liblamevectorroutines_la_SOURCES) \ + $(EXTRA_liblamevectorroutines_la_SOURCES) +DIST_SOURCES = $(am__liblamevectorroutines_la_SOURCES_DIST) \ + $(EXTRA_liblamevectorroutines_la_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ @CONFIG_DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ \ + -I$(top_srcdir)/libmp3lame \ + -I$(top_srcdir)/mpglib \ + -I$(top_builddir) + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.11 foreign $(top_srcdir)/ansi2knr +@WITH_XMM_TRUE@noinst_LTLIBRARIES = liblamevectorroutines.la +xmm_sources = xmm_quantize_sub.c +@WITH_XMM_TRUE@liblamevectorroutines_la_SOURCES = $(xmm_sources) +noinst_HEADERS = lame_intrin.h +EXTRA_liblamevectorroutines_la_SOURCES = $(xmm_sources) +CLEANFILES = lclint.txt +LCLINTFLAGS = \ + +posixlib \ + +showsummary \ + +showalluses \ + +whichlib \ + +forcehints \ + -fixedformalarray \ + +matchanyintegral \ + -Dlint + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libmp3lame/vector/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign libmp3lame/vector/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +liblamevectorroutines.la: $(liblamevectorroutines_la_OBJECTS) $(liblamevectorroutines_la_DEPENDENCIES) + $(LINK) $(am_liblamevectorroutines_la_rpath) $(liblamevectorroutines_la_OBJECTS) $(liblamevectorroutines_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c +$(top_srcdir)/ansi2knr: + $(am__cd) $(top_srcdir) && $(MAKE) $(AM_MAKEFLAGS) ./ansi2knr + +mostlyclean-kr: + -test "$U" = "" || rm -f *_.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmm_quantize_sub$U.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +xmm_quantize_sub_.c: xmm_quantize_sub.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xmm_quantize_sub.c; then echo $(srcdir)/xmm_quantize_sub.c; else echo xmm_quantize_sub.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +xmm_quantize_sub_.$(OBJEXT) xmm_quantize_sub_.lo : $(ANSI2KNR) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: $(top_srcdir)/ansi2knr install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + + +# end global section + +lclint.txt: ${liblamecpuroutines_la_SOURCES} ${noinst_HEADERS} + @lclint ${LCLINTFLAGS} ${INCLUDES} ${DEFS} ${liblamecpuroutines_la_SOURCES} 2>&1 >lclint.txt || true + +lclint: lclint.txt + more lclint.txt + +#$(OBJECTS): libtool +#libtool: $(LIBTOOL_DEPS) +# $(SHELL) $(top_builddir)/config.status --recheck + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/libmp3lame/vector/lame_intrin.h b/node_modules/lame/deps/lame/libmp3lame/vector/lame_intrin.h new file mode 100644 index 0000000..bc4c189 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/vector/lame_intrin.h @@ -0,0 +1,33 @@ +/* + * lame_intrin.h include file + * + * Copyright (c) 2006 Gabriel Bouvigne + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#ifndef LAME_INTRIN_H +#define LAME_INTRIN_H + + +void +init_xrpow_core_sse(gr_info * const cod_info, FLOAT xrpow[576], int upper, FLOAT * sum); + +void +fht_SSE2(FLOAT* , int); + +#endif diff --git a/node_modules/lame/deps/lame/libmp3lame/vector/xmm_quantize_sub.c b/node_modules/lame/deps/lame/libmp3lame/vector/xmm_quantize_sub.c new file mode 100644 index 0000000..1375aa2 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/vector/xmm_quantize_sub.c @@ -0,0 +1,232 @@ +/* + * MP3 quantization, intrinsics functions + * + * Copyright (c) 2005-2006 Gabriel Bouvigne + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "util.h" +#include "lame_intrin.h" + + + +#ifdef HAVE_XMMINTRIN_H + +#include + +typedef union { + int32_t _i_32[4]; /* unions are initialized by its first member */ + float _float[4]; + __m128 _m128; +} vecfloat_union; + +#define TRI_SIZE (5-1) /* 1024 = 4**5 */ +static const FLOAT costab[TRI_SIZE * 2] = { + 9.238795325112867e-01, 3.826834323650898e-01, + 9.951847266721969e-01, 9.801714032956060e-02, + 9.996988186962042e-01, 2.454122852291229e-02, + 9.999811752826011e-01, 6.135884649154475e-03 +}; + + + +void +init_xrpow_core_sse(gr_info * const cod_info, FLOAT xrpow[576], int upper, FLOAT * sum) +{ + int i; + float tmp_max = 0; + float tmp_sum = 0; + int upper4 = (upper / 4) * 4; + int rest = upper-upper4; + + const vecfloat_union fabs_mask = {{ 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }}; + const __m128 vec_fabs_mask = _mm_loadu_ps(&fabs_mask._float[0]); + vecfloat_union vec_xrpow_max; + vecfloat_union vec_sum; + vecfloat_union vec_tmp; + + _mm_prefetch((char *) cod_info->xr, _MM_HINT_T0); + _mm_prefetch((char *) xrpow, _MM_HINT_T0); + + vec_xrpow_max._m128 = _mm_set_ps1(0); + vec_sum._m128 = _mm_set_ps1(0); + + for (i = 0; i < upper4; i += 4) { + vec_tmp._m128 = _mm_loadu_ps(&(cod_info->xr[i])); /* load */ + vec_tmp._m128 = _mm_and_ps(vec_tmp._m128, vec_fabs_mask); /* fabs */ + vec_sum._m128 = _mm_add_ps(vec_sum._m128, vec_tmp._m128); + vec_tmp._m128 = _mm_sqrt_ps(_mm_mul_ps(vec_tmp._m128, _mm_sqrt_ps(vec_tmp._m128))); + vec_xrpow_max._m128 = _mm_max_ps(vec_xrpow_max._m128, vec_tmp._m128); /* retrieve max */ + _mm_storeu_ps(&(xrpow[i]), vec_tmp._m128); /* store into xrpow[] */ + } + vec_tmp._m128 = _mm_set_ps1(0); + switch (rest) { + case 3: vec_tmp._float[2] = cod_info->xr[upper4+2]; + case 2: vec_tmp._float[1] = cod_info->xr[upper4+1]; + case 1: vec_tmp._float[0] = cod_info->xr[upper4+0]; + vec_tmp._m128 = _mm_and_ps(vec_tmp._m128, vec_fabs_mask); /* fabs */ + vec_sum._m128 = _mm_add_ps(vec_sum._m128, vec_tmp._m128); + vec_tmp._m128 = _mm_sqrt_ps(_mm_mul_ps(vec_tmp._m128, _mm_sqrt_ps(vec_tmp._m128))); + vec_xrpow_max._m128 = _mm_max_ps(vec_xrpow_max._m128, vec_tmp._m128); /* retrieve max */ + switch (rest) { + case 3: xrpow[upper4+2] = vec_tmp._float[2]; + case 2: xrpow[upper4+1] = vec_tmp._float[1]; + case 1: xrpow[upper4+0] = vec_tmp._float[0]; + default: + break; + } + default: + break; + } + tmp_sum = vec_sum._float[0] + vec_sum._float[1] + vec_sum._float[2] + vec_sum._float[3]; + { + float ma = vec_xrpow_max._float[0] > vec_xrpow_max._float[1] + ? vec_xrpow_max._float[0] : vec_xrpow_max._float[1]; + float mb = vec_xrpow_max._float[2] > vec_xrpow_max._float[3] + ? vec_xrpow_max._float[2] : vec_xrpow_max._float[3]; + tmp_max = ma > mb ? ma : mb; + } + cod_info->xrpow_max = tmp_max; + *sum = tmp_sum; +} + + +static void store4(__m128 v, float* f0, float* f1, float* f2, float* f3) +{ + vecfloat_union r; + r._m128 = v; + *f0 = r._float[0]; + *f1 = r._float[1]; + *f2 = r._float[2]; + *f3 = r._float[3]; +} + + +void +fht_SSE2(FLOAT * fz, int n) +{ + const FLOAT *tri = costab; + int k4; + FLOAT *fi, *gi; + FLOAT const *fn; + + n <<= 1; /* to get BLKSIZE, because of 3DNow! ASM routine */ + fn = fz + n; + k4 = 4; + do { + FLOAT s1, c1; + int i, k1, k2, k3, kx; + kx = k4 >> 1; + k1 = k4; + k2 = k4 << 1; + k3 = k2 + k1; + k4 = k2 << 1; + fi = fz; + gi = fi + kx; + do { + FLOAT f0, f1, f2, f3; + f1 = fi[0] - fi[k1]; + f0 = fi[0] + fi[k1]; + f3 = fi[k2] - fi[k3]; + f2 = fi[k2] + fi[k3]; + fi[k2] = f0 - f2; + fi[0] = f0 + f2; + fi[k3] = f1 - f3; + fi[k1] = f1 + f3; + f1 = gi[0] - gi[k1]; + f0 = gi[0] + gi[k1]; + f3 = SQRT2 * gi[k3]; + f2 = SQRT2 * gi[k2]; + gi[k2] = f0 - f2; + gi[0] = f0 + f2; + gi[k3] = f1 - f3; + gi[k1] = f1 + f3; + gi += k4; + fi += k4; + } while (fi < fn); + c1 = tri[0]; + s1 = tri[1]; + for (i = 1; i < kx; i++) { + __m128 v_s2; + __m128 v_c2; + __m128 v_c1; + __m128 v_s1; + FLOAT c2, s2, s1_2 = s1+s1; + c2 = 1 - s1_2 * s1; + s2 = s1_2 * c1; + fi = fz + i; + gi = fz + k1 - i; + v_c1 = _mm_set_ps1(c1); + v_s1 = _mm_set_ps1(s1); + v_c2 = _mm_set_ps1(c2); + v_s2 = _mm_set_ps1(s2); + { + static const vecfloat_union sign_mask = {{0x80000000,0,0,0}}; + v_c1 = _mm_xor_ps(sign_mask._m128, v_c1); /* v_c1 := {-c1, +c1, +c1, +c1} */ + } + { + static const vecfloat_union sign_mask = {{0,0x80000000,0,0}}; + v_s1 = _mm_xor_ps(sign_mask._m128, v_s1); /* v_s1 := {+s1, -s1, +s1, +s1} */ + } + { + static const vecfloat_union sign_mask = {{0,0,0x80000000,0x80000000}}; + v_c2 = _mm_xor_ps(sign_mask._m128, v_c2); /* v_c2 := {+c2, +c2, -c2, -c2} */ + } + do { + __m128 p, q, r; + + q = _mm_setr_ps(fi[k1], fi[k3], gi[k1], gi[k3]); /* Q := {fi_k1,fi_k3,gi_k1,gi_k3}*/ + p = _mm_mul_ps(_mm_set_ps1(s2), q); /* P := s2 * Q */ + q = _mm_mul_ps(v_c2, q); /* Q := c2 * Q */ + q = _mm_shuffle_ps(q, q, _MM_SHUFFLE(1,0,3,2)); /* Q := {-c2*gi_k1,-c2*gi_k3,c2*fi_k1,c2*fi_k3} */ + p = _mm_add_ps(p, q); + + r = _mm_setr_ps(gi[0], gi[k2], fi[0], fi[k2]); /* R := {gi_0,gi_k2,fi_0,fi_k2} */ + q = _mm_sub_ps(r, p); /* Q := {gi_0-p0,gi_k2-p1,fi_0-p2,fi_k2-p3} */ + r = _mm_add_ps(r, p); /* R := {gi_0+p0,gi_k2+p1,fi_0+p2,fi_k2+p3} */ + p = _mm_shuffle_ps(q, r, _MM_SHUFFLE(2,0,2,0)); /* P := {q0,q2,r0,r2} */ + p = _mm_shuffle_ps(p, p, _MM_SHUFFLE(3,1,2,0)); /* P := {q0,r0,q2,r2} */ + q = _mm_shuffle_ps(q, r, _MM_SHUFFLE(3,1,3,1)); /* Q := {q1,q3,r1,r3} */ + r = _mm_mul_ps(v_c1, q); + q = _mm_mul_ps(v_s1, q); + q = _mm_shuffle_ps(q, q, _MM_SHUFFLE(0,1,2,3)); /* Q := {q3,q2,q1,q0} */ + q = _mm_add_ps(q, r); + + store4(_mm_sub_ps(p, q), &gi[k3], &gi[k2], &fi[k3], &fi[k2]); + store4(_mm_add_ps(p, q), &gi[k1], &gi[ 0], &fi[k1], &fi[ 0]); + + gi += k4; + fi += k4; + } while (fi < fn); + c2 = c1; + c1 = c2 * tri[0] - s1 * tri[1]; + s1 = c2 * tri[1] + s1 * tri[0]; + } + tri += 2; + } while (k4 < n); +} + +#endif /* HAVE_XMMINTRIN_H */ + diff --git a/node_modules/lame/deps/lame/libmp3lame/version.c b/node_modules/lame/deps/lame/libmp3lame/version.c new file mode 100644 index 0000000..8205812 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/version.c @@ -0,0 +1,254 @@ +/* + * Version numbering for LAME. + * + * Copyright (c) 1999 A.L. Faber + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/*! + \file version.c + \brief Version numbering for LAME. + + Contains functions which describe the version of LAME. + + \author A.L. Faber + \version \$Id: version.c,v 1.32.2.2 2011/11/18 09:18:28 robert Exp $ + \ingroup libmp3lame +*/ + + +#ifdef HAVE_CONFIG_H +# include +#endif + + +#include "lame.h" +#include "machine.h" + +#include "version.h" /* macros of version numbers */ + + + + + +/*! Get the LAME version string. */ +/*! + \param void + \return a pointer to a string which describes the version of LAME. +*/ +const char * +get_lame_version(void) +{ /* primary to write screen reports */ + /* Here we can also add informations about compile time configurations */ + +#if LAME_ALPHA_VERSION + static /*@observer@ */ const char *const str = + STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " " + "(alpha " STR(LAME_PATCH_VERSION) ", " __DATE__ " " __TIME__ ")"; +#elif LAME_BETA_VERSION + static /*@observer@ */ const char *const str = + STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " " + "(beta " STR(LAME_PATCH_VERSION) ", " __DATE__ ")"; +#elif LAME_RELEASE_VERSION && (LAME_PATCH_VERSION > 0) + static /*@observer@ */ const char *const str = + STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) "." STR(LAME_PATCH_VERSION); +#else + static /*@observer@ */ const char *const str = + STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION); +#endif + + return str; +} + + +/*! Get the short LAME version string. */ +/*! + It's mainly for inclusion into the MP3 stream. + + \param void + \return a pointer to the short version of the LAME version string. +*/ +const char * +get_lame_short_version(void) +{ + /* adding date and time to version string makes it harder for output + validation */ + +#if LAME_ALPHA_VERSION + static /*@observer@ */ const char *const str = + STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " (alpha " STR(LAME_PATCH_VERSION) ")"; +#elif LAME_BETA_VERSION + static /*@observer@ */ const char *const str = + STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " (beta " STR(LAME_PATCH_VERSION) ")"; +#elif LAME_RELEASE_VERSION && (LAME_PATCH_VERSION > 0) + static /*@observer@ */ const char *const str = + STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) "." STR(LAME_PATCH_VERSION); +#else + static /*@observer@ */ const char *const str = + STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION); +#endif + + return str; +} + +/*! Get the _very_ short LAME version string. */ +/*! + It's used in the LAME VBR tag only. + + \param void + \return a pointer to the short version of the LAME version string. +*/ +const char * +get_lame_very_short_version(void) +{ + /* adding date and time to version string makes it harder for output + validation */ +#if LAME_ALPHA_VERSION +#define P "a" +#elif LAME_BETA_VERSION +#define P "b" +#elif LAME_RELEASE_VERSION && (LAME_PATCH_VERSION > 0) +#define P "r" +#else +#define P "" +#endif + static /*@observer@ */ const char *const str = +#if (LAME_PATCH_VERSION > 0) + "LAME" STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) P STR(LAME_PATCH_VERSION) +#else + "LAME" STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) P +#endif + ; + return str; +} + +/*! Get the _very_ short LAME version string. */ +/*! + It's used in the LAME VBR tag only, limited to 9 characters max. + Due to some 3rd party HW/SW decoders, it has to start with LAME. + + \param void + \return a pointer to the short version of the LAME version string. + */ +const char* +get_lame_tag_encoder_short_version(void) +{ + static /*@observer@ */ const char *const str = + /* FIXME: new scheme / new version counting / drop versioning here ? */ + "LAME" STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) P + ; + return str; +} + +/*! Get the version string for GPSYCHO. */ +/*! + \param void + \return a pointer to a string which describes the version of GPSYCHO. +*/ +const char * +get_psy_version(void) +{ +#if PSY_ALPHA_VERSION > 0 + static /*@observer@ */ const char *const str = + STR(PSY_MAJOR_VERSION) "." STR(PSY_MINOR_VERSION) + " (alpha " STR(PSY_ALPHA_VERSION) ", " __DATE__ " " __TIME__ ")"; +#elif PSY_BETA_VERSION > 0 + static /*@observer@ */ const char *const str = + STR(PSY_MAJOR_VERSION) "." STR(PSY_MINOR_VERSION) + " (beta " STR(PSY_BETA_VERSION) ", " __DATE__ ")"; +#else + static /*@observer@ */ const char *const str = + STR(PSY_MAJOR_VERSION) "." STR(PSY_MINOR_VERSION); +#endif + + return str; +} + + +/*! Get the URL for the LAME website. */ +/*! + \param void + \return a pointer to a string which is a URL for the LAME website. +*/ +const char * +get_lame_url(void) +{ + static /*@observer@ */ const char *const str = LAME_URL; + + return str; +} + + +/*! Get the numerical representation of the version. */ +/*! + Writes the numerical representation of the version of LAME and + GPSYCHO into lvp. + + \param lvp +*/ +void +get_lame_version_numerical(lame_version_t * lvp) +{ + static /*@observer@ */ const char *const features = ""; /* obsolete */ + + /* generic version */ + lvp->major = LAME_MAJOR_VERSION; + lvp->minor = LAME_MINOR_VERSION; +#if LAME_ALPHA_VERSION + lvp->alpha = LAME_PATCH_VERSION; + lvp->beta = 0; +#elif LAME_BETA_VERSION + lvp->alpha = 0; + lvp->beta = LAME_PATCH_VERSION; +#else + lvp->alpha = 0; + lvp->beta = 0; +#endif + + /* psy version */ + lvp->psy_major = PSY_MAJOR_VERSION; + lvp->psy_minor = PSY_MINOR_VERSION; + lvp->psy_alpha = PSY_ALPHA_VERSION; + lvp->psy_beta = PSY_BETA_VERSION; + + /* compile time features */ + /*@-mustfree@ */ + lvp->features = features; + /*@=mustfree@ */ +} + + +const char * +get_lame_os_bitness(void) +{ + static /*@observer@ */ const char *const strXX = ""; + static /*@observer@ */ const char *const str32 = "32bits"; + static /*@observer@ */ const char *const str64 = "64bits"; + + switch (sizeof(void *)) { + case 4: + return str32; + + case 8: + return str64; + + default: + return strXX; + } +} + +/* end of version.c */ diff --git a/node_modules/lame/deps/lame/libmp3lame/version.h b/node_modules/lame/deps/lame/libmp3lame/version.h new file mode 100644 index 0000000..640a0f3 --- /dev/null +++ b/node_modules/lame/deps/lame/libmp3lame/version.h @@ -0,0 +1,68 @@ +/* + * Version numbering for LAME. + * + * Copyright (c) 1999 A.L. Faber + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAME_VERSION_H +#define LAME_VERSION_H + + +/* + * To make a string from a token, use the # operator: + */ +#ifndef STR +# define __STR(x) #x +# define STR(x) __STR(x) +#endif + +# define LAME_URL "http://lame.sf.net" + + +# define LAME_MAJOR_VERSION 3 /* Major version number */ +# define LAME_MINOR_VERSION 99 /* Minor version number */ +# define LAME_TYPE_VERSION 2 /* 0:alpha 1:beta 2:release */ +# define LAME_PATCH_VERSION 5 /* Patch level */ +# define LAME_ALPHA_VERSION (LAME_TYPE_VERSION==0) +# define LAME_BETA_VERSION (LAME_TYPE_VERSION==1) +# define LAME_RELEASE_VERSION (LAME_TYPE_VERSION==2) + +# define PSY_MAJOR_VERSION 1 /* Major version number */ +# define PSY_MINOR_VERSION 0 /* Minor version number */ +# define PSY_ALPHA_VERSION 0 /* Set number if this is an alpha version, otherwise zero */ +# define PSY_BETA_VERSION 0 /* Set number if this is a beta version, otherwise zero */ + +#if LAME_ALPHA_VERSION +#define LAME_PATCH_LEVEL_STRING " alpha " STR(LAME_PATCH_VERSION) +#endif +#if LAME_BETA_VERSION +#define LAME_PATCH_LEVEL_STRING " beta " STR(LAME_PATCH_VERSION) +#endif +#if LAME_RELEASE_VERSION +#if LAME_PATCH_VERSION +#define LAME_PATCH_LEVEL_STRING " release " STR(LAME_PATCH_VERSION) +#else +#define LAME_PATCH_LEVEL_STRING "" +#endif +#endif + +# define LAME_VERSION_STRING STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) LAME_PATCH_LEVEL_STRING + +#endif /* LAME_VERSION_H */ + +/* End of version.h */ diff --git a/node_modules/lame/deps/lame/ltmain.sh b/node_modules/lame/deps/lame/ltmain.sh new file mode 100644 index 0000000..d41416a --- /dev/null +++ b/node_modules/lame/deps/lame/ltmain.sh @@ -0,0 +1,8796 @@ +# Generated from ltmain.m4sh. + +# libtool (GNU libtool) 2.2.10 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.10 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.2.10 +TIMESTAMP="" +package_revision=1.3175 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${EGREP="grep -E"} +: ${FGREP="grep -F"} +: ${GREP="grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="sed"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} + +# Generated shell functions inserted here. + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname${mode+: }$mode: $*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $SED -n '/^# Usage:/,/# Report bugs to/ { + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + }' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1." + exit_cmd=exit +} + +exit_cmd=: + + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +# $mode is unset +nonopt= +execute_dlfiles= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +opt_dry_run=false +opt_duplicate_deps=false +opt_silent=false +opt_debug=: + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. +{ + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Parse non-mode specific arguments: + while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" + func_echo "enabling shell trace mode" + opt_debug='set -x' + $opt_debug + ;; + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" + shift + ;; + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 in + # Valid mode arguments: + clean) ;; + compile) ;; + execute) ;; + finish) ;; + install) ;; + link) ;; + relink) ;; + uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" + shift + ;; + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" + opt_silent=: + opt_verbose=false + ;; + + --no-quiet|--no-silent) + preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + opt_verbose=: + ;; + + --no-verbose) preserve_args="$preserve_args $opt" + opt_verbose=false + ;; + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here + shift + ;; + + # Separate optargs to long options: + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + shift + ;; + + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --help-all) opt_help=': help-all' ;; + --version) func_version ;; + + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; + esac + done + + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + ;; + esac + + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +## ----------- ## +## Main. ## +## ----------- ## + +$opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$mode' for more information." +} + + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + + # FreeBSD-specific: where we install compilers with non-standard names + tag_compilers_CC="*cc cc* *gcc gcc* clang" + tag_compilers_CXX="*c++ c++* *g++ g++* clang++" + base_compiler=`set -- "$@"; echo $1` + + # If $tagname isn't set, then try to infer if the default "CC" tag applies + if test -z "$tagname"; then + for zp in $tag_compilers_CC; do + case $base_compiler in + $zp) tagname="CC"; break;; + esac + done + fi + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + + # FreeBSD-specific: try compilers based on inferred tag + if test -z "$tagname"; then + eval "tag_compilers=\$tag_compilers_${z}" + if test -n "$tag_compilers"; then + for zp in $tag_compilers; do + case $base_compiler in + $zp) tagname=$z; break;; + esac + done + if test -n "$tagname"; then + break + fi + fi + fi + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + removelist="$removelist $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + removelist="$removelist $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + command="$command -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + exit $EXIT_SUCCESS +} + +test "$mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + install_prog="$install_prog$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog="$install_prog $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + install_shared_prog="$install_shared_prog $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +" + case $host in + *cygwin* | *mingw* | *cegcc* ) + echo >> "$output_objdir/$my_dlsyms" "\ +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) + echo >> "$output_objdir/$my_dlsyms" "\ +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + + echo >> "$output_objdir/$my_dlsyms" "\ +extern $lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +$lt_dlsym_const lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) symtab_cflags="$symtab_cflags $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *-*-freebsd*) + # FreeBSD doesn't need this... + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + win32_nmres=`eval $NM -f posix -A $1 | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_to_host_path arg +# +# Convert paths to host format when used with build tools. +# Intended for use with "native" mingw (where libtool itself +# is running under the msys shell), or in the following cross- +# build environments: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# where wine is equipped with the `winepath' executable. +# In the native mingw case, the (msys) shell automatically +# converts paths for any non-msys applications it launches, +# but that facility isn't available from inside the cwrapper. +# Similar accommodations are necessary for $host mingw and +# $build cygwin. Calling this function does no harm for other +# $host/$build combinations not listed above. +# +# ARG is the path (on $build) that should be converted to +# the proper representation for $host. The result is stored +# in $func_to_host_path_result. +func_to_host_path () +{ + func_to_host_path_result="$1" + if test -n "$1"; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + case $build in + *mingw* ) # actually, msys + # awkward: cmd appends spaces to result + func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_result=`cygpath -w "$1" | + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then + func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" | + $SED -e "$lt_sed_naive_backslashify"` + else + # Allow warning below. + func_to_host_path_result= + fi + ;; + esac + if test -z "$func_to_host_path_result" ; then + func_error "Could not determine host path corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi + ;; + esac + fi +} +# end: func_to_host_path + +# func_to_host_pathlist arg +# +# Convert pathlists to host format when used with build tools. +# See func_to_host_path(), above. This function supports the +# following $build/$host combinations (but does no harm for +# combinations not listed here): +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# +# Path separators are also converted from $build format to +# $host format. If ARG begins or ends with a path separator +# character, it is preserved (but converted to $host format) +# on output. +# +# ARG is a pathlist (on $build) that should be converted to +# the proper representation on $host. The result is stored +# in $func_to_host_pathlist_result. +func_to_host_pathlist () +{ + func_to_host_pathlist_result="$1" + if test -n "$1"; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_pathlist_tmp1=$func_stripname_result + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + func_to_host_pathlist_result=` + ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # unfortunately, winepath doesn't convert pathlists + func_to_host_pathlist_result="" + func_to_host_pathlist_oldIFS=$IFS + IFS=: + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do + IFS=$func_to_host_pathlist_oldIFS + if test -n "$func_to_host_pathlist_f" ; then + func_to_host_path "$func_to_host_pathlist_f" + if test -n "$func_to_host_path_result" ; then + if test -z "$func_to_host_pathlist_result" ; then + func_to_host_pathlist_result="$func_to_host_path_result" + else + func_append func_to_host_pathlist_result ";$func_to_host_path_result" + fi + fi + fi + done + IFS=$func_to_host_pathlist_oldIFS + ;; + esac + if test -z "$func_to_host_pathlist_result"; then + func_error "Could not determine the host path(s) corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This may break if $1 contains DOS-style drive + # specifications. The fix is not to complicate the expression + # below, but for the user to provide a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works properly. + lt_replace_pathsep_nix_to_dos="s|:|;|g" + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_replace_pathsep_nix_to_dos"` + fi + # Now, add the leading and trailing path separators back + case "$1" in + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" + ;; + esac + case "$1" in + *: ) func_append func_to_host_pathlist_result ";" + ;; + esac + ;; + esac + fi +} +# end: func_to_host_pathlist + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + weak_libs="$weak_libs $arg" + prev= + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname '-L' '' "$arg" + dir=$func_stripname_result + if test -z "$dir"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + esac + deplibs="$deplibs $arg" + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $func_quote_for_eval_result" + compiler_flags="$compiler_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$linker_flags $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_duplicate_deps ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + case $lib in + *.la) func_source "$lib" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) deplibs="$deplibs $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + ;; + *) + ;; + esac # linkmode + + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + dir=$func_stripname_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) temp_rpath="$temp_rpath$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + notinst_deplibs="$notinst_deplibs $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_dirname "$deplib" "" "." + dir="$func_dirname_result" + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + libobjs="$libobjs $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + delfiles="$delfiles $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + func_len " $cmd" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + $ECHO "$obj" >> $output + done + echo ')' >> $output + delfiles="$delfiles $output" + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + $ECHO "$obj" >> $output + done + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + delfiles="$delfiles $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + libobjs="$libobjs $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + oldobjs="$oldobjs $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlfiles="$newdlfiles $libdir/$name" + ;; + *) newdlfiles="$newdlfiles $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + newdlprefiles="$newdlprefiles $libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$mode" = link || test "$mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) RM="$RM $arg"; rmforce=yes ;; + -*) RM="$RM $arg" ;; + *) files="$files $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$mode" = uninstall || test "$mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/node_modules/lame/deps/lame/mac/LAME.mcp b/node_modules/lame/deps/lame/mac/LAME.mcp new file mode 100755 index 0000000..cfe1c2c Binary files /dev/null and b/node_modules/lame/deps/lame/mac/LAME.mcp differ diff --git a/node_modules/lame/deps/lame/mac/LAME_Carbon_Debug.pch b/node_modules/lame/deps/lame/mac/LAME_Carbon_Debug.pch new file mode 100755 index 0000000..3e9dc29 --- /dev/null +++ b/node_modules/lame/deps/lame/mac/LAME_Carbon_Debug.pch @@ -0,0 +1 @@ +/* LAME Carbon Debug.pch Precompiled header sources for Carbon debug build of LAME on Macintosh */ #pragma precompile_target "LAME Carbon Debug Headers" #define TARGET_API_MAC_CARBON 1 #include "Precompile_Common.h" #define LAME_LIBRARY_BUILD 1 // Building library #undef LIBSNDFILE // Build with LIBSNDFILE #define NOANALYSIS 1 // Build without frame-analyzer hooks #undef HAVE_MPGLIB // Build without MPGLIB decoder (forces GPL) #undef USE_LAYER_1 // Build without layer-1 decoding (needs MPGLIB) #undef USE_LAYER_2 // Build without layer-2 decoding (needs MPGLIB) #undef HAVE_VORBIS // Build without Ogg Vorbis #undef BRHIST // Build without histogram (not CLI encoder) #define NDEBUG 1 // Build debug version \ No newline at end of file diff --git a/node_modules/lame/deps/lame/mac/LAME_Carbon_Final.pch b/node_modules/lame/deps/lame/mac/LAME_Carbon_Final.pch new file mode 100755 index 0000000..78650cb --- /dev/null +++ b/node_modules/lame/deps/lame/mac/LAME_Carbon_Final.pch @@ -0,0 +1 @@ +/* LAME Carbon Debug.pch Precompiled header sources for Carbon non-debug build of LAME on Macintosh */ #pragma precompile_target "LAME Carbon Final Headers" #define TARGET_API_MAC_CARBON 1 #include "Precompile_Common.h" #define LAME_LIBRARY_BUILD 1 // Building library #undef LIBSNDFILE // Build with LIBSNDFILE #define NOANALYSIS 1 // Build without frame-analyzer hooks #undef HAVE_MPGLIB // Build without MPGLIB decoder (forces GPL) #undef USE_LAYER_1 // Build without layer-1 decoding (needs MPGLIB) #undef USE_LAYER_2 // Build without layer-2 decoding (needs MPGLIB) #undef HAVE_VORBIS // Build without Ogg Vorbis #undef BRHIST // Build without histogram (not CLI encoder) #undef NDEBUG // Build final (non-debug) version \ No newline at end of file diff --git a/node_modules/lame/deps/lame/mac/LAME_Classic_Debug.pch b/node_modules/lame/deps/lame/mac/LAME_Classic_Debug.pch new file mode 100755 index 0000000..c400d3f --- /dev/null +++ b/node_modules/lame/deps/lame/mac/LAME_Classic_Debug.pch @@ -0,0 +1 @@ +/* LAME Classic Debug.pch Precompiled header sources for Classic debug build of LAME on Macintosh */ #pragma precompile_target "LAME Classic Debug Headers" #define TARGET_API_MAC_OS8 1 #include "Precompile_Common.h" #define LAME_LIBRARY_BUILD 1 // Building library #undef LIBSNDFILE // Build with LIBSNDFILE #define NOANALYSIS 1 // Build without frame-analyzer hooks #undef HAVE_MPGLIB // Build without MPGLIB decoder (forces GPL) #undef USE_LAYER_1 // Build without layer-1 decoding (needs MPGLIB) #undef USE_LAYER_2 // Build without layer-2 decoding (needs MPGLIB) #undef HAVE_VORBIS // Build without Ogg Vorbis #undef BRHIST // Build without histogram (not CLI encoder) #define NDEBUG 1 // Build debug version \ No newline at end of file diff --git a/node_modules/lame/deps/lame/mac/LAME_Classic_Final.pch b/node_modules/lame/deps/lame/mac/LAME_Classic_Final.pch new file mode 100755 index 0000000..326285e --- /dev/null +++ b/node_modules/lame/deps/lame/mac/LAME_Classic_Final.pch @@ -0,0 +1 @@ +/* LAME Classic Final.pch Precompiled header sources for Classic non-debug build of LAME on Macintosh */ #pragma precompile_target "LAME Classic Final Headers" #define TARGET_API_MAC_OS8 1 #include "Precompile_Common.h" #define LAME_LIBRARY_BUILD 1 // Building library #undef LIBSNDFILE // Build with LIBSNDFILE #define NOANALYSIS 1 // Build without frame-analyzer hooks #undef HAVE_MPGLIB // Build without MPGLIB decoder (forces GPL) #undef USE_LAYER_1 // Build without layer-1 decoding (needs MPGLIB) #undef USE_LAYER_2 // Build without layer-2 decoding (needs MPGLIB) #undef HAVE_VORBIS // Build without Ogg Vorbis #undef BRHIST // Build without histogram (not CLI encoder) #undef NDEBUG // Build final (non-debug) version \ No newline at end of file diff --git a/node_modules/lame/deps/lame/mac/MacDLLMain.c b/node_modules/lame/deps/lame/mac/MacDLLMain.c new file mode 100755 index 0000000..8654265 --- /dev/null +++ b/node_modules/lame/deps/lame/mac/MacDLLMain.c @@ -0,0 +1 @@ +/* MacDLLMain.c */ int main() { return 0; } \ No newline at end of file diff --git a/node_modules/lame/deps/lame/mac/Makefile.am b/node_modules/lame/deps/lame/mac/Makefile.am new file mode 100644 index 0000000..e1382cd --- /dev/null +++ b/node_modules/lame/deps/lame/mac/Makefile.am @@ -0,0 +1,13 @@ +## $Id: Makefile.am,v 1.1 2002/05/28 07:52:10 aleidinger Exp $ + +include $(top_srcdir)/Makefile.am.global + +EXTRA_DIST = \ + .DS_Store \ + LAME.mcp \ + LAME_Carbon_Debug.pch \ + LAME_Carbon_Final.pch \ + LAME_Classic_Debug.pch \ + LAME_Classic_Final.pch \ + MacDLLMain.c \ + Precompile_Common.h diff --git a/node_modules/lame/deps/lame/mac/Makefile.in b/node_modules/lame/deps/lame/mac/Makefile.in new file mode 100644 index 0000000..e837f48 --- /dev/null +++ b/node_modules/lame/deps/lame/mac/Makefile.in @@ -0,0 +1,395 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# global section for every Makefile.am +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.am.global +subdir = mac +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.11 foreign $(top_srcdir)/ansi2knr +EXTRA_DIST = \ + .DS_Store \ + LAME.mcp \ + LAME_Carbon_Debug.pch \ + LAME_Carbon_Final.pch \ + LAME_Classic_Debug.pch \ + LAME_Classic_Final.pch \ + MacDLLMain.c \ + Precompile_Common.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mac/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign mac/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# end global section + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/mac/Precompile_Common.h b/node_modules/lame/deps/lame/mac/Precompile_Common.h new file mode 100755 index 0000000..5d5bf2e --- /dev/null +++ b/node_modules/lame/deps/lame/mac/Precompile_Common.h @@ -0,0 +1 @@ +/* Common Precompiled headers for LAME on Macintosh Precompiled header source for building LAME on Macintosh using CodeWarrior. Includes most definitions normally generated by configure in config.h, except for the ones that vary from subproject to subproject */ #define TARGET_MAC_DLL 1 #ifndef _ALL_SOURCE /* #undef _ALL_SOURCE */ #endif #define HAVE_ALLOCA 1 #define HAVE_LONG_DOUBLE 1 #define STDC_HEADERS 1 #define TIME_WITH_SYS_TIME 1 #define WORDS_BIGENDIAN 1 #define uint8_t UInt8 #define uint16_t UInt16 #define uint32_t UInt32 #define uint64_t unsigned long long #define ieee854_float80_t long double #define ieee754_float64_t double #define ieee754_float32_t float #define SIZEOF_DOUBLE 8 #define SIZEOF_FLOAT 4 #define SIZEOF_INT 4 #define SIZEOF_LONG 4 #define SIZEOF_LONG_LONG 8 #define SIZEOF_SHORT 2 #define SIZEOF_UNSIGNED_INT 4 #define SIZEOF_UNSIGNED_LONG 4 #define SIZEOF_UNSIGNED_LONG_LONG 8 #define SIZEOF_UNSIGNED_SHORT 2 #define HAVE_GETTIMEOFDAY 1 #define HAVE_SOCKET 1 #define HAVE_STRTOL 1 #define HAVE_ERRNO_H 1 #define HAVE_FCNTL_H 1 #define HAVE_LIMITS_H 1 #define HAVE_STRING_H 1 #define HAVE_SYS_TIME_H 1 #define HAVE_UNISTD_H 1 #define PACKAGE "lame" #define VERSION "3.91" #define PROTOTYPES 1 #define HAVE_IEEE854_FLOAT80 1 #define LIMIT_STACK_USAGE 1 // The following definitions have been pulled out to specific targets' // pch files: // LAME_LIBRARY_BUILD 1 for building the DLL // LIBSNDFILE 1 for building with LibSndFile, applies // only to CLI encoder // NOANALYSIS 1 for building without hooks for the // MP3 frame analyzer // HAVE_MPGLIB 1 for building with MP3 decoding library. // Note MPGLIB, unlike LAME itself, is // GPL as opposed to LGPL and thus unsuitable // for compilation into a DLL that would be used // from a closed-source app. // USE_LAYER_1 1 for building layer-1 decoding into MPGLIB // USE_LAYER_2 1 for building layer-2 decoding into MPGLIB // HAVE_VORBIS 1 for building vorbis support // NDEBUG 1 for building with debug info // BRHIST 1 for histogram display in CLI encoder #define HAVE_TERMCAP 1 #include \ No newline at end of file diff --git a/node_modules/lame/deps/lame/macosx/English.lproj/InfoPlist.strings b/node_modules/lame/deps/lame/macosx/English.lproj/InfoPlist.strings new file mode 100644 index 0000000..f8ed77a Binary files /dev/null and b/node_modules/lame/deps/lame/macosx/English.lproj/InfoPlist.strings differ diff --git a/node_modules/lame/deps/lame/macosx/English.lproj/Makefile.am b/node_modules/lame/deps/lame/macosx/English.lproj/Makefile.am new file mode 100644 index 0000000..a08152e --- /dev/null +++ b/node_modules/lame/deps/lame/macosx/English.lproj/Makefile.am @@ -0,0 +1,7 @@ +## $Id: Makefile.am,v 1.1 2008/05/24 08:28:58 aleidinger Exp $ + +include $(top_srcdir)/Makefile.am.global + +EXTRA_DIST = \ + InfoPlist.strings + diff --git a/node_modules/lame/deps/lame/macosx/English.lproj/Makefile.in b/node_modules/lame/deps/lame/macosx/English.lproj/Makefile.in new file mode 100644 index 0000000..b66eedb --- /dev/null +++ b/node_modules/lame/deps/lame/macosx/English.lproj/Makefile.in @@ -0,0 +1,388 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# global section for every Makefile.am +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.am.global +subdir = macosx/English.lproj +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.11 foreign $(top_srcdir)/ansi2knr +EXTRA_DIST = \ + InfoPlist.strings + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign macosx/English.lproj/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign macosx/English.lproj/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# end global section + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/macosx/Info.plist b/node_modules/lame/deps/lame/macosx/Info.plist new file mode 100644 index 0000000..1a18a9b --- /dev/null +++ b/node_modules/lame/deps/lame/macosx/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + LAME + CFBundleIdentifier + net.sourceforge.LAMEframework + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleSignature + LAMh + CFBundleVersion + 1.0 + + diff --git a/node_modules/lame/deps/lame/macosx/LAME.xcodeproj/Makefile.am b/node_modules/lame/deps/lame/macosx/LAME.xcodeproj/Makefile.am new file mode 100644 index 0000000..509529c --- /dev/null +++ b/node_modules/lame/deps/lame/macosx/LAME.xcodeproj/Makefile.am @@ -0,0 +1,7 @@ +## $Id: Makefile.am,v 1.1 2008/05/24 08:28:58 aleidinger Exp $ + +include $(top_srcdir)/Makefile.am.global + +EXTRA_DIST = \ + project.pbxproj + diff --git a/node_modules/lame/deps/lame/macosx/LAME.xcodeproj/Makefile.in b/node_modules/lame/deps/lame/macosx/LAME.xcodeproj/Makefile.in new file mode 100644 index 0000000..35de9e5 --- /dev/null +++ b/node_modules/lame/deps/lame/macosx/LAME.xcodeproj/Makefile.in @@ -0,0 +1,388 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# global section for every Makefile.am +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.am.global +subdir = macosx/LAME.xcodeproj +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.11 foreign $(top_srcdir)/ansi2knr +EXTRA_DIST = \ + project.pbxproj + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign macosx/LAME.xcodeproj/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign macosx/LAME.xcodeproj/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# end global section + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/macosx/LAME.xcodeproj/project.pbxproj b/node_modules/lame/deps/lame/macosx/LAME.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d234d19 --- /dev/null +++ b/node_modules/lame/deps/lame/macosx/LAME.xcodeproj/project.pbxproj @@ -0,0 +1,520 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 8D07F2BE0486CC7A007CD1D0 /* LAME_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32BAE0B70371A74B00C91783 /* LAME_Prefix.pch */; }; + 8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; + EA0A6AD40BB84E38003C87B1 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA0A6AC20BB84D93003C87B1 /* Cocoa.framework */; }; + EA498C8D0DE5E37B00250F0E /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = EA498C8C0DE5E37B00250F0E /* config.h */; }; + EA8CC08809A39A49001379B8 /* lame.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC08709A39A49001379B8 /* lame.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EA8CC0A509A39A55001379B8 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC08A09A39A55001379B8 /* common.c */; }; + EA8CC0A609A39A55001379B8 /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC08B09A39A55001379B8 /* common.h */; }; + EA8CC0A709A39A55001379B8 /* dct64_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC08C09A39A55001379B8 /* dct64_i386.c */; }; + EA8CC0A809A39A55001379B8 /* dct64_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC08D09A39A55001379B8 /* dct64_i386.h */; }; + EA8CC0A909A39A55001379B8 /* decode_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC08E09A39A55001379B8 /* decode_i386.c */; }; + EA8CC0AA09A39A55001379B8 /* decode_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC08F09A39A55001379B8 /* decode_i386.h */; }; + EA8CC0AC09A39A55001379B8 /* huffman.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC09109A39A55001379B8 /* huffman.h */; }; + EA8CC0AD09A39A55001379B8 /* interface.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC09209A39A55001379B8 /* interface.c */; }; + EA8CC0AE09A39A55001379B8 /* interface.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC09309A39A55001379B8 /* interface.h */; }; + EA8CC0AF09A39A55001379B8 /* l2tables.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC09409A39A55001379B8 /* l2tables.h */; }; + EA8CC0B009A39A55001379B8 /* layer1.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC09509A39A55001379B8 /* layer1.c */; }; + EA8CC0B109A39A55001379B8 /* layer1.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC09609A39A55001379B8 /* layer1.h */; }; + EA8CC0B209A39A55001379B8 /* layer2.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC09709A39A55001379B8 /* layer2.c */; }; + EA8CC0B309A39A55001379B8 /* layer2.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC09809A39A55001379B8 /* layer2.h */; }; + EA8CC0B409A39A55001379B8 /* layer3.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC09909A39A55001379B8 /* layer3.c */; }; + EA8CC0B509A39A55001379B8 /* layer3.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC09A09A39A55001379B8 /* layer3.h */; }; + EA8CC0B809A39A55001379B8 /* mpg123.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC09D09A39A55001379B8 /* mpg123.h */; }; + EA8CC0B909A39A55001379B8 /* mpglib.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC09E09A39A55001379B8 /* mpglib.h */; }; + EA8CC0BD09A39A55001379B8 /* tabinit.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0A209A39A55001379B8 /* tabinit.c */; }; + EA8CC0BE09A39A55001379B8 /* tabinit.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0A309A39A55001379B8 /* tabinit.h */; }; + EA8CC0F909A39A5E001379B8 /* bitstream.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0C109A39A5E001379B8 /* bitstream.c */; }; + EA8CC0FA09A39A5E001379B8 /* bitstream.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0C209A39A5E001379B8 /* bitstream.h */; }; + EA8CC0FC09A39A5E001379B8 /* encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0C409A39A5E001379B8 /* encoder.c */; }; + EA8CC0FD09A39A5E001379B8 /* encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0C509A39A5E001379B8 /* encoder.h */; }; + EA8CC0FE09A39A5E001379B8 /* fft.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0C609A39A5E001379B8 /* fft.c */; }; + EA8CC0FF09A39A5E001379B8 /* fft.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0C709A39A5E001379B8 /* fft.h */; }; + EA8CC10009A39A5E001379B8 /* gain_analysis.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0C809A39A5E001379B8 /* gain_analysis.c */; }; + EA8CC10109A39A5E001379B8 /* gain_analysis.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0C909A39A5E001379B8 /* gain_analysis.h */; }; + EA8CC10C09A39A5E001379B8 /* id3tag.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0D509A39A5E001379B8 /* id3tag.c */; }; + EA8CC10D09A39A5E001379B8 /* id3tag.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0D609A39A5E001379B8 /* id3tag.h */; }; + EA8CC10E09A39A5E001379B8 /* l3side.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0D709A39A5E001379B8 /* l3side.h */; }; + EA8CC10F09A39A5E001379B8 /* lame-analysis.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0D809A39A5E001379B8 /* lame-analysis.h */; }; + EA8CC11009A39A5E001379B8 /* lame.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0D909A39A5E001379B8 /* lame.c */; }; + EA8CC11109A39A5E001379B8 /* lame_global_flags.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0DA09A39A5E001379B8 /* lame_global_flags.h */; }; + EA8CC11409A39A5E001379B8 /* machine.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0DD09A39A5E001379B8 /* machine.h */; }; + EA8CC11709A39A5E001379B8 /* mpglib_interface.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0E009A39A5E001379B8 /* mpglib_interface.c */; }; + EA8CC11809A39A5E001379B8 /* newmdct.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0E109A39A5E001379B8 /* newmdct.c */; }; + EA8CC11909A39A5E001379B8 /* newmdct.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0E209A39A5E001379B8 /* newmdct.h */; }; + EA8CC11A09A39A5E001379B8 /* presets.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0E309A39A5E001379B8 /* presets.c */; }; + EA8CC11B09A39A5E001379B8 /* psymodel.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0E409A39A5E001379B8 /* psymodel.c */; }; + EA8CC11C09A39A5E001379B8 /* psymodel.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0E509A39A5E001379B8 /* psymodel.h */; }; + EA8CC11D09A39A5E001379B8 /* quantize.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0E609A39A5E001379B8 /* quantize.c */; }; + EA8CC11E09A39A5E001379B8 /* quantize.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0E709A39A5E001379B8 /* quantize.h */; }; + EA8CC11F09A39A5E001379B8 /* quantize_pvt.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0E809A39A5E001379B8 /* quantize_pvt.c */; }; + EA8CC12009A39A5E001379B8 /* quantize_pvt.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0E909A39A5E001379B8 /* quantize_pvt.h */; }; + EA8CC12109A39A5E001379B8 /* reservoir.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0EA09A39A5E001379B8 /* reservoir.c */; }; + EA8CC12209A39A5E001379B8 /* reservoir.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0EB09A39A5E001379B8 /* reservoir.h */; }; + EA8CC12309A39A5E001379B8 /* set_get.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0EC09A39A5E001379B8 /* set_get.c */; }; + EA8CC12409A39A5E001379B8 /* set_get.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0ED09A39A5E001379B8 /* set_get.h */; }; + EA8CC12509A39A5E001379B8 /* tables.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0EE09A39A5E001379B8 /* tables.c */; }; + EA8CC12609A39A5E001379B8 /* tables.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0EF09A39A5E001379B8 /* tables.h */; }; + EA8CC12709A39A5E001379B8 /* takehiro.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0F009A39A5E001379B8 /* takehiro.c */; }; + EA8CC12809A39A5E001379B8 /* util.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0F109A39A5E001379B8 /* util.c */; }; + EA8CC12909A39A5E001379B8 /* util.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0F209A39A5E001379B8 /* util.h */; }; + EA8CC12A09A39A5E001379B8 /* vbrquantize.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0F309A39A5E001379B8 /* vbrquantize.c */; }; + EA8CC12B09A39A5E001379B8 /* vbrquantize.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0F409A39A5E001379B8 /* vbrquantize.h */; }; + EA8CC12C09A39A5E001379B8 /* VbrTag.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0F509A39A5E001379B8 /* VbrTag.c */; }; + EA8CC12D09A39A5E001379B8 /* VbrTag.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0F609A39A5E001379B8 /* VbrTag.h */; }; + EA8CC12E09A39A5E001379B8 /* version.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0F709A39A5E001379B8 /* version.c */; }; + EA8CC12F09A39A5E001379B8 /* version.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC0F809A39A5E001379B8 /* version.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 32BAE0B70371A74B00C91783 /* LAME_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LAME_Prefix.pch; sourceTree = ""; }; + 8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + 8D07F2C80486CC7A007CD1D0 /* LAME.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LAME.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + EA0A6AC20BB84D93003C87B1 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + EA498C8C0DE5E37B00250F0E /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; + EA8CC08709A39A49001379B8 /* lame.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lame.h; path = ../include/lame.h; sourceTree = ""; }; + EA8CC08A09A39A55001379B8 /* common.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = common.c; sourceTree = ""; }; + EA8CC08B09A39A55001379B8 /* common.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = ""; }; + EA8CC08C09A39A55001379B8 /* dct64_i386.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = dct64_i386.c; sourceTree = ""; }; + EA8CC08D09A39A55001379B8 /* dct64_i386.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dct64_i386.h; sourceTree = ""; }; + EA8CC08E09A39A55001379B8 /* decode_i386.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = decode_i386.c; sourceTree = ""; }; + EA8CC08F09A39A55001379B8 /* decode_i386.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = decode_i386.h; sourceTree = ""; }; + EA8CC09109A39A55001379B8 /* huffman.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = huffman.h; sourceTree = ""; }; + EA8CC09209A39A55001379B8 /* interface.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = interface.c; sourceTree = ""; }; + EA8CC09309A39A55001379B8 /* interface.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = interface.h; sourceTree = ""; }; + EA8CC09409A39A55001379B8 /* l2tables.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = l2tables.h; sourceTree = ""; }; + EA8CC09509A39A55001379B8 /* layer1.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = layer1.c; sourceTree = ""; }; + EA8CC09609A39A55001379B8 /* layer1.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = layer1.h; sourceTree = ""; }; + EA8CC09709A39A55001379B8 /* layer2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = layer2.c; sourceTree = ""; }; + EA8CC09809A39A55001379B8 /* layer2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = layer2.h; sourceTree = ""; }; + EA8CC09909A39A55001379B8 /* layer3.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = layer3.c; sourceTree = ""; }; + EA8CC09A09A39A55001379B8 /* layer3.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = layer3.h; sourceTree = ""; }; + EA8CC09D09A39A55001379B8 /* mpg123.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mpg123.h; sourceTree = ""; }; + EA8CC09E09A39A55001379B8 /* mpglib.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mpglib.h; sourceTree = ""; }; + EA8CC0A209A39A55001379B8 /* tabinit.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = tabinit.c; sourceTree = ""; }; + EA8CC0A309A39A55001379B8 /* tabinit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = tabinit.h; sourceTree = ""; }; + EA8CC0C109A39A5E001379B8 /* bitstream.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = bitstream.c; sourceTree = ""; }; + EA8CC0C209A39A5E001379B8 /* bitstream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = bitstream.h; sourceTree = ""; }; + EA8CC0C409A39A5E001379B8 /* encoder.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = encoder.c; sourceTree = ""; }; + EA8CC0C509A39A5E001379B8 /* encoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = encoder.h; sourceTree = ""; }; + EA8CC0C609A39A5E001379B8 /* fft.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = fft.c; sourceTree = ""; }; + EA8CC0C709A39A5E001379B8 /* fft.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = fft.h; sourceTree = ""; }; + EA8CC0C809A39A5E001379B8 /* gain_analysis.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = gain_analysis.c; sourceTree = ""; }; + EA8CC0C909A39A5E001379B8 /* gain_analysis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gain_analysis.h; sourceTree = ""; }; + EA8CC0D509A39A5E001379B8 /* id3tag.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = id3tag.c; sourceTree = ""; }; + EA8CC0D609A39A5E001379B8 /* id3tag.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = id3tag.h; sourceTree = ""; }; + EA8CC0D709A39A5E001379B8 /* l3side.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = l3side.h; sourceTree = ""; }; + EA8CC0D809A39A5E001379B8 /* lame-analysis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "lame-analysis.h"; sourceTree = ""; }; + EA8CC0D909A39A5E001379B8 /* lame.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = lame.c; sourceTree = ""; }; + EA8CC0DA09A39A5E001379B8 /* lame_global_flags.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = lame_global_flags.h; sourceTree = ""; }; + EA8CC0DD09A39A5E001379B8 /* machine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = machine.h; sourceTree = ""; }; + EA8CC0E009A39A5E001379B8 /* mpglib_interface.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mpglib_interface.c; sourceTree = ""; }; + EA8CC0E109A39A5E001379B8 /* newmdct.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = newmdct.c; sourceTree = ""; }; + EA8CC0E209A39A5E001379B8 /* newmdct.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = newmdct.h; sourceTree = ""; }; + EA8CC0E309A39A5E001379B8 /* presets.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = presets.c; sourceTree = ""; }; + EA8CC0E409A39A5E001379B8 /* psymodel.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = psymodel.c; sourceTree = ""; }; + EA8CC0E509A39A5E001379B8 /* psymodel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = psymodel.h; sourceTree = ""; }; + EA8CC0E609A39A5E001379B8 /* quantize.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = quantize.c; sourceTree = ""; }; + EA8CC0E709A39A5E001379B8 /* quantize.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = quantize.h; sourceTree = ""; }; + EA8CC0E809A39A5E001379B8 /* quantize_pvt.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = quantize_pvt.c; sourceTree = ""; }; + EA8CC0E909A39A5E001379B8 /* quantize_pvt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = quantize_pvt.h; sourceTree = ""; }; + EA8CC0EA09A39A5E001379B8 /* reservoir.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = reservoir.c; sourceTree = ""; }; + EA8CC0EB09A39A5E001379B8 /* reservoir.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = reservoir.h; sourceTree = ""; }; + EA8CC0EC09A39A5E001379B8 /* set_get.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = set_get.c; sourceTree = ""; }; + EA8CC0ED09A39A5E001379B8 /* set_get.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = set_get.h; sourceTree = ""; }; + EA8CC0EE09A39A5E001379B8 /* tables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = tables.c; sourceTree = ""; }; + EA8CC0EF09A39A5E001379B8 /* tables.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = tables.h; sourceTree = ""; }; + EA8CC0F009A39A5E001379B8 /* takehiro.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = takehiro.c; sourceTree = ""; }; + EA8CC0F109A39A5E001379B8 /* util.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = util.c; sourceTree = ""; }; + EA8CC0F209A39A5E001379B8 /* util.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = ""; }; + EA8CC0F309A39A5E001379B8 /* vbrquantize.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = vbrquantize.c; sourceTree = ""; }; + EA8CC0F409A39A5E001379B8 /* vbrquantize.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = vbrquantize.h; sourceTree = ""; }; + EA8CC0F509A39A5E001379B8 /* VbrTag.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = VbrTag.c; sourceTree = ""; }; + EA8CC0F609A39A5E001379B8 /* VbrTag.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VbrTag.h; sourceTree = ""; }; + EA8CC0F709A39A5E001379B8 /* version.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = version.c; sourceTree = ""; }; + EA8CC0F809A39A5E001379B8 /* version.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + EA0A6AD20BB84E32003C87B1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + EA0A6AD40BB84E38003C87B1 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 034768DDFF38A45A11DB9C8B /* Products */ = { + isa = PBXGroup; + children = ( + 8D07F2C80486CC7A007CD1D0 /* LAME.framework */, + ); + name = Products; + sourceTree = ""; + }; + 0867D691FE84028FC02AAC07 /* LAME */ = { + isa = PBXGroup; + children = ( + 08FB77ACFE841707C02AAC07 /* Source */, + 089C1665FE841158C02AAC07 /* Resources */, + 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, + 034768DDFF38A45A11DB9C8B /* Products */, + ); + name = LAME; + sourceTree = ""; + }; + 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + EA0A6AC20BB84D93003C87B1 /* Cocoa.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 089C1665FE841158C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 8D07F2C70486CC7A007CD1D0 /* Info.plist */, + 089C1666FE841158C02AAC07 /* InfoPlist.strings */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77ACFE841707C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 32BAE0B70371A74B00C91783 /* LAME_Prefix.pch */, + EA8CC08709A39A49001379B8 /* lame.h */, + EA498C8C0DE5E37B00250F0E /* config.h */, + EA8CC0C009A39A5E001379B8 /* libmp3lame */, + EA8CC08909A39A55001379B8 /* mpglib */, + ); + name = Source; + sourceTree = ""; + }; + EA8CC08909A39A55001379B8 /* mpglib */ = { + isa = PBXGroup; + children = ( + EA8CC08A09A39A55001379B8 /* common.c */, + EA8CC08B09A39A55001379B8 /* common.h */, + EA8CC08C09A39A55001379B8 /* dct64_i386.c */, + EA8CC08D09A39A55001379B8 /* dct64_i386.h */, + EA8CC08E09A39A55001379B8 /* decode_i386.c */, + EA8CC08F09A39A55001379B8 /* decode_i386.h */, + EA8CC09109A39A55001379B8 /* huffman.h */, + EA8CC09209A39A55001379B8 /* interface.c */, + EA8CC09309A39A55001379B8 /* interface.h */, + EA8CC09409A39A55001379B8 /* l2tables.h */, + EA8CC09509A39A55001379B8 /* layer1.c */, + EA8CC09609A39A55001379B8 /* layer1.h */, + EA8CC09709A39A55001379B8 /* layer2.c */, + EA8CC09809A39A55001379B8 /* layer2.h */, + EA8CC09909A39A55001379B8 /* layer3.c */, + EA8CC09A09A39A55001379B8 /* layer3.h */, + EA8CC09D09A39A55001379B8 /* mpg123.h */, + EA8CC09E09A39A55001379B8 /* mpglib.h */, + EA8CC0A209A39A55001379B8 /* tabinit.c */, + EA8CC0A309A39A55001379B8 /* tabinit.h */, + ); + name = mpglib; + path = ../mpglib; + sourceTree = ""; + }; + EA8CC0C009A39A5E001379B8 /* libmp3lame */ = { + isa = PBXGroup; + children = ( + EA8CC0C109A39A5E001379B8 /* bitstream.c */, + EA8CC0C209A39A5E001379B8 /* bitstream.h */, + EA8CC0C409A39A5E001379B8 /* encoder.c */, + EA8CC0C509A39A5E001379B8 /* encoder.h */, + EA8CC0C609A39A5E001379B8 /* fft.c */, + EA8CC0C709A39A5E001379B8 /* fft.h */, + EA8CC0C809A39A5E001379B8 /* gain_analysis.c */, + EA8CC0C909A39A5E001379B8 /* gain_analysis.h */, + EA8CC0D509A39A5E001379B8 /* id3tag.c */, + EA8CC0D609A39A5E001379B8 /* id3tag.h */, + EA8CC0D709A39A5E001379B8 /* l3side.h */, + EA8CC0D809A39A5E001379B8 /* lame-analysis.h */, + EA8CC0D909A39A5E001379B8 /* lame.c */, + EA8CC0DA09A39A5E001379B8 /* lame_global_flags.h */, + EA8CC0DD09A39A5E001379B8 /* machine.h */, + EA8CC0E009A39A5E001379B8 /* mpglib_interface.c */, + EA8CC0E109A39A5E001379B8 /* newmdct.c */, + EA8CC0E209A39A5E001379B8 /* newmdct.h */, + EA8CC0E309A39A5E001379B8 /* presets.c */, + EA8CC0E409A39A5E001379B8 /* psymodel.c */, + EA8CC0E509A39A5E001379B8 /* psymodel.h */, + EA8CC0E609A39A5E001379B8 /* quantize.c */, + EA8CC0E709A39A5E001379B8 /* quantize.h */, + EA8CC0E809A39A5E001379B8 /* quantize_pvt.c */, + EA8CC0E909A39A5E001379B8 /* quantize_pvt.h */, + EA8CC0EA09A39A5E001379B8 /* reservoir.c */, + EA8CC0EB09A39A5E001379B8 /* reservoir.h */, + EA8CC0EC09A39A5E001379B8 /* set_get.c */, + EA8CC0ED09A39A5E001379B8 /* set_get.h */, + EA8CC0EE09A39A5E001379B8 /* tables.c */, + EA8CC0EF09A39A5E001379B8 /* tables.h */, + EA8CC0F009A39A5E001379B8 /* takehiro.c */, + EA8CC0F109A39A5E001379B8 /* util.c */, + EA8CC0F209A39A5E001379B8 /* util.h */, + EA8CC0F309A39A5E001379B8 /* vbrquantize.c */, + EA8CC0F409A39A5E001379B8 /* vbrquantize.h */, + EA8CC0F509A39A5E001379B8 /* VbrTag.c */, + EA8CC0F609A39A5E001379B8 /* VbrTag.h */, + EA8CC0F709A39A5E001379B8 /* version.c */, + EA8CC0F809A39A5E001379B8 /* version.h */, + ); + name = libmp3lame; + path = ../libmp3lame; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D07F2BD0486CC7A007CD1D0 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D07F2BE0486CC7A007CD1D0 /* LAME_Prefix.pch in Headers */, + EA8CC08809A39A49001379B8 /* lame.h in Headers */, + EA8CC0A609A39A55001379B8 /* common.h in Headers */, + EA8CC0A809A39A55001379B8 /* dct64_i386.h in Headers */, + EA8CC0AA09A39A55001379B8 /* decode_i386.h in Headers */, + EA8CC0AC09A39A55001379B8 /* huffman.h in Headers */, + EA8CC0AE09A39A55001379B8 /* interface.h in Headers */, + EA8CC0AF09A39A55001379B8 /* l2tables.h in Headers */, + EA8CC0B109A39A55001379B8 /* layer1.h in Headers */, + EA8CC0B309A39A55001379B8 /* layer2.h in Headers */, + EA8CC0B509A39A55001379B8 /* layer3.h in Headers */, + EA8CC0B809A39A55001379B8 /* mpg123.h in Headers */, + EA8CC0B909A39A55001379B8 /* mpglib.h in Headers */, + EA8CC0BE09A39A55001379B8 /* tabinit.h in Headers */, + EA8CC0FA09A39A5E001379B8 /* bitstream.h in Headers */, + EA8CC0FD09A39A5E001379B8 /* encoder.h in Headers */, + EA8CC0FF09A39A5E001379B8 /* fft.h in Headers */, + EA8CC10109A39A5E001379B8 /* gain_analysis.h in Headers */, + EA8CC10D09A39A5E001379B8 /* id3tag.h in Headers */, + EA8CC10E09A39A5E001379B8 /* l3side.h in Headers */, + EA8CC10F09A39A5E001379B8 /* lame-analysis.h in Headers */, + EA8CC11109A39A5E001379B8 /* lame_global_flags.h in Headers */, + EA8CC11409A39A5E001379B8 /* machine.h in Headers */, + EA8CC11909A39A5E001379B8 /* newmdct.h in Headers */, + EA8CC11C09A39A5E001379B8 /* psymodel.h in Headers */, + EA8CC11E09A39A5E001379B8 /* quantize.h in Headers */, + EA8CC12009A39A5E001379B8 /* quantize_pvt.h in Headers */, + EA8CC12209A39A5E001379B8 /* reservoir.h in Headers */, + EA8CC12409A39A5E001379B8 /* set_get.h in Headers */, + EA8CC12609A39A5E001379B8 /* tables.h in Headers */, + EA8CC12909A39A5E001379B8 /* util.h in Headers */, + EA8CC12B09A39A5E001379B8 /* vbrquantize.h in Headers */, + EA8CC12D09A39A5E001379B8 /* VbrTag.h in Headers */, + EA8CC12F09A39A5E001379B8 /* version.h in Headers */, + EA498C8D0DE5E37B00250F0E /* config.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D07F2BC0486CC7A007CD1D0 /* LAME */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "LAME" */; + buildPhases = ( + 8D07F2BD0486CC7A007CD1D0 /* Headers */, + 8D07F2BF0486CC7A007CD1D0 /* Resources */, + 8D07F2C10486CC7A007CD1D0 /* Sources */, + EA0A6AD20BB84E32003C87B1 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = LAME; + productInstallPath = "$(HOME)/Library/Frameworks"; + productName = LAME; + productReference = 8D07F2C80486CC7A007CD1D0 /* LAME.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0867D690FE84028FC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "LAME" */; + compatibilityVersion = "Xcode 2.4"; + hasScannedForEncodings = 1; + mainGroup = 0867D691FE84028FC02AAC07 /* LAME */; + productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D07F2BC0486CC7A007CD1D0 /* LAME */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D07F2BF0486CC7A007CD1D0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D07F2C10486CC7A007CD1D0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EA8CC0A509A39A55001379B8 /* common.c in Sources */, + EA8CC0A709A39A55001379B8 /* dct64_i386.c in Sources */, + EA8CC0A909A39A55001379B8 /* decode_i386.c in Sources */, + EA8CC0AD09A39A55001379B8 /* interface.c in Sources */, + EA8CC0B009A39A55001379B8 /* layer1.c in Sources */, + EA8CC0B209A39A55001379B8 /* layer2.c in Sources */, + EA8CC0B409A39A55001379B8 /* layer3.c in Sources */, + EA8CC0BD09A39A55001379B8 /* tabinit.c in Sources */, + EA8CC0F909A39A5E001379B8 /* bitstream.c in Sources */, + EA8CC0FC09A39A5E001379B8 /* encoder.c in Sources */, + EA8CC0FE09A39A5E001379B8 /* fft.c in Sources */, + EA8CC10009A39A5E001379B8 /* gain_analysis.c in Sources */, + EA8CC10C09A39A5E001379B8 /* id3tag.c in Sources */, + EA8CC11009A39A5E001379B8 /* lame.c in Sources */, + EA8CC11709A39A5E001379B8 /* mpglib_interface.c in Sources */, + EA8CC11809A39A5E001379B8 /* newmdct.c in Sources */, + EA8CC11A09A39A5E001379B8 /* presets.c in Sources */, + EA8CC11B09A39A5E001379B8 /* psymodel.c in Sources */, + EA8CC11D09A39A5E001379B8 /* quantize.c in Sources */, + EA8CC11F09A39A5E001379B8 /* quantize_pvt.c in Sources */, + EA8CC12109A39A5E001379B8 /* reservoir.c in Sources */, + EA8CC12309A39A5E001379B8 /* set_get.c in Sources */, + EA8CC12509A39A5E001379B8 /* tables.c in Sources */, + EA8CC12709A39A5E001379B8 /* takehiro.c in Sources */, + EA8CC12809A39A5E001379B8 /* util.c in Sources */, + EA8CC12A09A39A5E001379B8 /* vbrquantize.c in Sources */, + EA8CC12C09A39A5E001379B8 /* VbrTag.c in Sources */, + EA8CC12E09A39A5E001379B8 /* version.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C1667FE841158C02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 4FADC24308B4156D00ABE55E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = LAME_Prefix.pch; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "@executable_path/../Frameworks/"; + LIBRARY_STYLE = DYNAMIC; + MACH_O_TYPE = mh_dylib; + PRODUCT_NAME = LAME; + WRAPPER_EXTENSION = framework; + ZERO_LINK = NO; + }; + name = Debug; + }; + 4FADC24408B4156D00ABE55E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_VERSION = A; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = LAME_Prefix.pch; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "@executable_path/../Frameworks/"; + LIBRARY_STYLE = DYNAMIC; + MACH_O_TYPE = mh_dylib; + PRODUCT_NAME = LAME; + WRAPPER_EXTENSION = framework; + ZERO_LINK = NO; + }; + name = Release; + }; + 4FADC24708B4156D00ABE55E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Debug; + }; + 4FADC24808B4156D00ABE55E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "LAME" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4FADC24308B4156D00ABE55E /* Debug */, + 4FADC24408B4156D00ABE55E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "LAME" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4FADC24708B4156D00ABE55E /* Debug */, + 4FADC24808B4156D00ABE55E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0867D690FE84028FC02AAC07 /* Project object */; +} diff --git a/node_modules/lame/deps/lame/macosx/LAME_Prefix.pch b/node_modules/lame/deps/lame/macosx/LAME_Prefix.pch new file mode 100644 index 0000000..aa1089d --- /dev/null +++ b/node_modules/lame/deps/lame/macosx/LAME_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'LAME' target in the 'LAME' project. +// + +#include + +#define HAVE_CONFIG_H diff --git a/node_modules/lame/deps/lame/macosx/Makefile.am b/node_modules/lame/deps/lame/macosx/Makefile.am new file mode 100644 index 0000000..4ef0d27 --- /dev/null +++ b/node_modules/lame/deps/lame/macosx/Makefile.am @@ -0,0 +1,10 @@ +## $Id: Makefile.am,v 1.2 2008/05/24 08:28:58 aleidinger Exp $ + +include $(top_srcdir)/Makefile.am.global + +SUBDIRS = English.lproj LAME.xcodeproj + + +EXTRA_DIST = \ + Info.plist \ + LAME_Prefix.pch diff --git a/node_modules/lame/deps/lame/macosx/Makefile.in b/node_modules/lame/deps/lame/macosx/Makefile.in new file mode 100644 index 0000000..a1da808 --- /dev/null +++ b/node_modules/lame/deps/lame/macosx/Makefile.in @@ -0,0 +1,592 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# global section for every Makefile.am +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.am.global +subdir = macosx +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.11 foreign $(top_srcdir)/ansi2knr +SUBDIRS = English.lproj LAME.xcodeproj +EXTRA_DIST = \ + Info.plist \ + LAME_Prefix.pch + +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign macosx/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign macosx/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# end global section + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/misc/Lame.vbs b/node_modules/lame/deps/lame/misc/Lame.vbs new file mode 100644 index 0000000..4e42002 --- /dev/null +++ b/node_modules/lame/deps/lame/misc/Lame.vbs @@ -0,0 +1,158 @@ +' lame.vbs WindowsScript wrapper v0.5, 06/15/2001 +' $id$ +' +' *Purpose* +' Use this WindowsScript to encode WAVs using drag&drop: +' 0. make sure you have windows script host v5.1 on your system +' (enter 'cscript' in a DOS-Box and compare version number) +' 1. adjust the path settings below to fit your needs +' 2a. put this file somewhere on the desktop +' 3a. drag one or more wav-files on the icon and watch them being lamed. +' +' 2b. start->execute, enter "sendto", drag the script or a link to it in +' sendto window (adjust names and icon as you like) +' 3b. select wave-file(s) and send it via the send-to menu to LAME! +' +' You may wish to create copies of this file with different options set. +' +' If you would like a GUI: try to enable the HTML UI (see below) +' +' Ralf Kempkens, ralf.kempkens@epost.de +' +' +' *History* +' V0.5 * lame.vbs will automatically decode if the file has a .mp3 extension +' * now explicitly refuses to accept folders +' V0.4 * creates single .mp3 extensions, now ID3 options in HTML interface +' V0.3 * fixed bug that prevented lame.exe to be located in a path that +' contained a space +' * experimental HTML UI support (disabled by default) +' V0.2 added multiple file support +' V0.1 initial release + +' *** change path to your needs *** + path = "D:\Audio\Lame\Lame386\" '!!! must end with a backslash !!! + lame = "lame.exe" + +' *** change default options to your needs *** + opts = "--preset hifi" + +' *** HTML GUI (experimental) *** + useGUI = False +' it set to True, opens file lameGUI.html residing in the same path as lame.exe +' to choose options. Please look at the example HTML-file for further information. + +' no changes needed below this line +' ########################################################################## +Dim wsh, args, infile, fs +title="LAME Script" + +' get input files +Set wsh = WScript.CreateObject("WScript.Shell") +Set args = WScript.Arguments +If args.Count = 0 Then + MsgBox "LAME mp3 encoder/decoder frontend script." & vbCR & _ + "Please use drag & drop to specify input files.", vbInformation, title + WScript.Quit +End If + +' check path +Set fso = CreateObject("Scripting.FileSystemObject") +If Not fso.FileExists(path & lame) Then + MsgBox "Could not find LAME!" & vbCR & "(looked for '" & path & lame & "')", vbCritical, title + WScript.Quit +End If + +' start GUI +if useGUI Then + set ie=WScript.CreateObject("InternetExplorer.Application", "ie_") + ie.navigate(path & "lameGUI.html") + do + WScript.Sleep 100 + loop until ie.ReadyState=4 'wait for GUI + + ie.Width=640 + ie.Height=600 + ie.Toolbar=false + ie.Statusbar=false + ie.visible=true + + 'link to GUI + set document=ie.document + document.forms.lameform.okbutton.onClick=GetRef("okbutton") + + 'wait for user pressing ok... + do + WScript.Sleep 300 + loop until process +end if + +'process files +For i = 0 To args.Count-1 + infile = args(i) + ' check input file + If fso.FolderExists(infile) Then + MsgBox "'" & infile & "' is a folder!" & vbCR & _ + title & " only handles proper files.", vbInformation, title + Else + If Not fso.FileExists(infile) Then + MsgBox "Error opening input-file" & vbCR & "'" & infile & "'", vbCritical , title + Else + ' run lame + If(LCase(getExtension(infile))="mp3") Then 'decode + ret = wsh.Run(Chr(34) & path & lame & CHR(34) & " --decode " & _ + Chr(34) & infile & Chr(34) & Chr(32) & Chr(34) & _ + getBasename(infile) & ".wav" & Chr(34), 1, True) + Else ' encode + ret = wsh.Run(Chr(34) & path & lame & CHR(34) & Chr(32) & opts & Chr(32) & _ + Chr(34) & infile & Chr(34) & Chr(32) & Chr(34) & _ + getBasename(infile) & ".mp3" & Chr(34), 1, True) + End If + ' diagnostics + Select Case ret + Case (0) 'okeydokey + Case (-1) + MsgBox "LAME aborted by user!", vbExclamation, title + Case (1) + MsgBox "Error returned by LAME!" & vbCR & "(Check LAME options and input file formats.)" & vbCR & "Used Options: " & opts, vbCritical, title + Case Else + MsgBox "Received unknown LAME return-code: " & ret, vbCritical, title + End Select + End If + End If +Next + +WScript.Quit +' ******************************************************************* +' utility functions + +Function getBasename(filespec) + Dim fso + Set fso = CreateObject("Scripting.FileSystemObject") + Set f = fso.GetFile(filespec) + + getBasename = f.ParentFolder & "\" & fso.GetBaseName(filespec) +End Function + +Function getExtension(filespec) + Dim fso + Set fso = CreateObject("Scripting.FileSystemObject") + Set f = fso.GetFile(filespec) + + getExtension = fso.GetExtensionName(filespec) +End Function + +' ******************************************************************* +' manage link to IE HTML-interface + +sub okbutton + 'process inputs + opts=document.all.lameoptions.Value + ie.Quit + MsgBox "LAME options:" & vbCR & opts, vbInformation, title +end sub + +sub ie_onQuit + process=True +end sub +'eof diff --git a/node_modules/lame/deps/lame/misc/Makefile.am b/node_modules/lame/deps/lame/misc/Makefile.am new file mode 100644 index 0000000..3e00fcd --- /dev/null +++ b/node_modules/lame/deps/lame/misc/Makefile.am @@ -0,0 +1,28 @@ +## $Id: Makefile.am,v 1.11 2011/11/05 16:32:13 robert Exp $ + +include $(top_srcdir)/Makefile.am.global + +EXTRA_PROGRAMS = abx ath scalartest + +CLEANFILES = $(EXTRA_PROGRAMS) + +EXTRA_SCRIPTS = \ + auenc \ + lameid3.pl \ + mugeco.sh \ + mlame \ + mk_mp3.sh + +EXTRA_DIST = \ + $(EXTRA_SCRIPTS) \ + Lame.vbs \ + lameGUI.html \ + lame4dos.bat \ + mlame_corr.c + +abx_SOURCES = abx.c + +ath_SOURCES = ath.c + +scalartest_SOURCES = scalartest.c + diff --git a/node_modules/lame/deps/lame/misc/Makefile.in b/node_modules/lame/deps/lame/misc/Makefile.in new file mode 100644 index 0000000..3d5487d --- /dev/null +++ b/node_modules/lame/deps/lame/misc/Makefile.in @@ -0,0 +1,539 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# global section for every Makefile.am +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +ANSI2KNR = $(top_srcdir)/ansi2knr +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.am.global depcomp +EXTRA_PROGRAMS = abx$(EXEEXT) ath$(EXEEXT) scalartest$(EXEEXT) +subdir = misc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am_abx_OBJECTS = abx$U.$(OBJEXT) +abx_OBJECTS = $(am_abx_OBJECTS) +abx_LDADD = $(LDADD) +abx_DEPENDENCIES = +am_ath_OBJECTS = ath$U.$(OBJEXT) +ath_OBJECTS = $(am_ath_OBJECTS) +ath_LDADD = $(LDADD) +ath_DEPENDENCIES = +am_scalartest_OBJECTS = scalartest$U.$(OBJEXT) +scalartest_OBJECTS = $(am_scalartest_OBJECTS) +scalartest_LDADD = $(LDADD) +scalartest_DEPENDENCIES = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(abx_SOURCES) $(ath_SOURCES) $(scalartest_SOURCES) +DIST_SOURCES = $(abx_SOURCES) $(ath_SOURCES) $(scalartest_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.11 foreign $(top_srcdir)/ansi2knr +CLEANFILES = $(EXTRA_PROGRAMS) +EXTRA_SCRIPTS = \ + auenc \ + lameid3.pl \ + mugeco.sh \ + mlame \ + mk_mp3.sh + +EXTRA_DIST = \ + $(EXTRA_SCRIPTS) \ + Lame.vbs \ + lameGUI.html \ + lame4dos.bat \ + mlame_corr.c + +abx_SOURCES = abx.c +ath_SOURCES = ath.c +scalartest_SOURCES = scalartest.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign misc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign misc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +abx$(EXEEXT): $(abx_OBJECTS) $(abx_DEPENDENCIES) + @rm -f abx$(EXEEXT) + $(LINK) $(abx_OBJECTS) $(abx_LDADD) $(LIBS) +ath$(EXEEXT): $(ath_OBJECTS) $(ath_DEPENDENCIES) + @rm -f ath$(EXEEXT) + $(LINK) $(ath_OBJECTS) $(ath_LDADD) $(LIBS) +scalartest$(EXEEXT): $(scalartest_OBJECTS) $(scalartest_DEPENDENCIES) + @rm -f scalartest$(EXEEXT) + $(LINK) $(scalartest_OBJECTS) $(scalartest_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c +$(top_srcdir)/ansi2knr: + $(am__cd) $(top_srcdir) && $(MAKE) $(AM_MAKEFLAGS) ./ansi2knr + +mostlyclean-kr: + -test "$U" = "" || rm -f *_.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abx$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ath$U.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scalartest$U.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +abx_.c: abx.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/abx.c; then echo $(srcdir)/abx.c; else echo abx.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +ath_.c: ath.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ath.c; then echo $(srcdir)/ath.c; else echo ath.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +scalartest_.c: scalartest.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/scalartest.c; then echo $(srcdir)/scalartest.c; else echo scalartest.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +abx_.$(OBJEXT) abx_.lo ath_.$(OBJEXT) ath_.lo scalartest_.$(OBJEXT) \ +scalartest_.lo : $(ANSI2KNR) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: $(top_srcdir)/ansi2knr install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-kr mostlyclean-libtool pdf \ + pdf-am ps ps-am tags uninstall uninstall-am + + +# end global section + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/misc/abx.c b/node_modules/lame/deps/lame/misc/abx.c new file mode 100644 index 0000000..c06364d --- /dev/null +++ b/node_modules/lame/deps/lame/misc/abx.c @@ -0,0 +1,1323 @@ +/* + * Usage: abx original_file test_file + * + * Ask you as long as the probability is below the given percentage that + * you recognize differences + * + * Example: abx music.wav music.mp3 + * abx music.wav music.mp3 --help + * + * Note: several 'decoding' utilites must be on the 'right' place + * + * Bugs: + * fix path of decoding utilities + * only 16 bit support + * only support of the same sample frequency + * no exact WAV file header analysis + * no mouse or joystick support + * don't uses functionality of ath.c + * only 2 files are comparable + * worse user interface + * quick & dirty hack + * wastes memory + * compile time warnings + * buffer overruns possible + * no dithering if recalcs are necessary + * correlation only done with one channel (2 channels, sum, what is better?) + * lowpass+highpass filtering (300 Hz+2*5 kHz) before delay+amplitude corr + * cross fade at start/stop + * non portable keyboard + * fade out on quit, fade in on start + * level/delay ajustment should be switchable + * pause key missing + * problems with digital silence files (division by 0) + * Gr��e cross corr fenster 2^16...18 + * Stellensuche, ab 0*len oder 0.1*len oder 0.25*len, nach Effektiv oder Spitzenwert + * Absturz bei LPAC feeding, warum? + * Als 'B' beim Ratespiel sollte auch '0'...'9' verwendbar sein + * Oder mit einem Filter 300 Hz...3 kHz vorher filtern? + * Multiple encoded differenziertes Signal + * Amplitudenanpassung schaltbar machen? + * Direkt auf der Kommandozeile kodieren: + * abx "test.wav" "!lame -b128 test.wav -" + */ + +// If the program should increase it priority while playing define USE_NICE. +// Program must be installed SUID root. Decompressing phase is using NORMAL priority +#define USE_NICE + +// Not only increase priority but change to relatime scheduling. Program must be installed SUID root +#define USE_REALTIME + +// Path of the programs: mpg123, mppdec, faad, ac3dec, ogg123, lpac, shorten, MAC, flac +//#define PATH_OF_EXTERNAL_TOOLS_FOR_UNCOMPRESSING "/usr/local/bin/" +#define PATH_OF_EXTERNAL_TOOLS_FOR_UNCOMPRESSING "" + + +#if defined HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX (1<<17) + +#if defined HAVE_SYS_SOUNDCARD_H +# include +#elif defined HAVE_LINUX_SOUNDCARD_H +# include +#else +# include /* stand alone compilable for my tests */ +#endif + +#if defined USE_NICE +# include +#endif +#if defined USE_REALTIME +# include +#endif + +#define BF ((freq)/25) +#define MAX_LEN (210 * 44100) +#define DMA_SAMPLES 512 /* My Linux driver uses a DMA buffer of 65536*16 bit, which is 32768 samples in 16 bit stereo mode */ + +void Set_Realtime ( void ) +{ +#if defined USE_REALTIME + struct sched_param sp; + int ret; + + memset ( &sp, 0, sizeof(sp) ); + seteuid ( 0 ); + sp.sched_priority = sched_get_priority_min ( SCHED_FIFO ); + ret = sched_setscheduler ( 0, SCHED_RR, &sp ); + seteuid ( getuid() ); +#endif + +#if defined USE_NICE + seteuid ( 0 ); + setpriority ( PRIO_PROCESS, getpid(), -20 ); + seteuid ( getuid() ); +#endif +} + +int verbose = 0; + +static struct termios stored_settings; + + +void reset ( void ) +{ + tcsetattr ( 0, TCSANOW, &stored_settings ); +} + + +void set ( void ) +{ + struct termios new_settings; + + tcgetattr ( 0, &stored_settings ); + new_settings = stored_settings; + + new_settings.c_lflag &= ~ECHO; + /* Disable canonical mode, and set buffer size to 1 byte */ + new_settings.c_lflag &= ~ICANON; + new_settings.c_cc[VTIME] = 0; + new_settings.c_cc[VMIN] = 1; + + tcsetattr(0,TCSANOW,&new_settings); + return; +} + + +int sel ( void ) +{ + struct timeval t; + fd_set fd [1]; + int ret; + unsigned char c; + + FD_SET (0, fd); + t.tv_sec = 0; + t.tv_usec = 0; + + ret = select ( 1, fd, NULL, NULL, &t ); + + switch ( ret ) { + case 0: + return -1; + case 1: + ret = read (0, &c, 1); + return ret == 1 ? c : -1; + default: + return -2; + } +} + +#define FFT_ERR_OK 0 // no error +#define FFT_ERR_LD 1 // len is not a power of 2 +#define FFT_ERR_MAX 2 // len too large + +typedef float f_t; +typedef f_t compl [2]; +compl root [MAX >> 1]; // Sinus-/Kosinustabelle +size_t shuffle [MAX >> 1] [2]; // Shuffle-Tabelle +size_t shuffle_len; + +// Bitinversion + +size_t swap ( size_t number, int bits ) +{ + size_t ret; + for ( ret = 0; bits--; number >>= 1 ) { + ret = ret + ret + (number & 1); + } + return ret; +} + +// Bestimmen des Logarithmus dualis + +int ld ( size_t number ) +{ + size_t i; + for ( i = 0; i < sizeof(size_t)*CHAR_BIT; i++ ) + if ( ((size_t)1 << i) == number ) + return i; + return -1; +} + +// Die eigentliche FFT + +int fft ( compl* fn, const size_t newlen ) +{ + static size_t len = 0; + static int bits = 0; + size_t i; + size_t j; + size_t k; + size_t p; + + /* Tabellen initialisieren */ + + if ( newlen != len ) { + len = newlen; + + if ( (bits=ld(len)) == -1 ) + return FFT_ERR_LD; + + for ( i = 0; i < len; i++ ) { + j = swap ( i, bits ); + if ( i < j ) { + shuffle [shuffle_len] [0] = i; + shuffle [shuffle_len] [1] = j; + shuffle_len++; + } + } + for ( i = 0; i < (len>>1); i++ ) { + double x = (double) swap ( i+i, bits ) * 2*M_PI/len; + root [i] [0] = cos (x); + root [i] [1] = sin (x); + } + } + + /* Eigentliche Transformation */ + + p = len >> 1; + do { + f_t* bp = (f_t*) root; + f_t* si = (f_t*) fn; + f_t* di = (f_t*) fn+p+p; + + do { + k = p; + do { + f_t mulr = bp[0]*di[0] - bp[1]*di[1]; + f_t muli = bp[1]*di[0] + bp[0]*di[1]; + + di[0] = si[0] - mulr; + di[1] = si[1] - muli; + si[0] += mulr; + si[1] += muli; + + si += 2, di += 2; + } while ( --k ); + si += p+p, di += p+p, bp += 2; + } while ( si < &fn[len][0] ); + } while (p >>= 1); + + /* Bitinversion */ + + for ( k = 0; k < shuffle_len; k++ ) { + f_t tmp; + i = shuffle [k] [0]; + j = shuffle [k] [1]; + tmp = fn [i][0]; fn [i][0] = fn [j][0]; fn [j][0] = tmp; + tmp = fn [i][1]; fn [i][1] = fn [j][1]; fn [j][1] = tmp; + } + + return FFT_ERR_OK; +} + +void printnumber ( long double x ) +{ + unsigned exp = 0; + + if ( x < 9.999995 ) fprintf ( stderr, "%7.5f", (double)x ); + else if ( x < 99.99995 ) fprintf ( stderr, "%7.4f", (double)x ); + else if ( x < 999.9995 ) fprintf ( stderr, "%7.3f", (double)x ); + else if ( x < 9999.995 ) fprintf ( stderr, "%7.2f", (double)x ); + else if ( x < 99999.95 ) fprintf ( stderr, "%7.1f", (double)x ); + else if ( x < 999999.5 ) fprintf ( stderr, "%6.0f.", (double)x ); + else if ( x < 9999999.5 ) fprintf ( stderr, "%7.0f", (double)x ); + else if ( x < 9.9995e9 ) { + while ( x >= 9.9995 ) exp++ , x /= 10; + fprintf ( stderr, "%5.3fe%01u", (double)x, exp ); + } else if ( x < 9.995e99 ) { + while ( x >= 9.5e6 ) exp+=6 , x /= 1.e6; + while ( x >= 9.995 ) exp++ , x /= 10; + fprintf ( stderr, "%4.2fe%02u", (double)x, exp ); + } else if ( x < 9.95e999L ) { + while ( x >= 9.5e18 ) exp+=18, x /= 1.e18; + while ( x >= 9.95 ) exp++ , x /= 10; + fprintf ( stderr, "%3.1fe%03u", (double)x, exp ); + } else { + while ( x >= 9.5e48 ) exp+=48, x /= 1.e48; + while ( x >= 9.5 ) exp++ , x /= 10; + fprintf ( stderr, "%1.0f.e%04u", (double)x, exp ); + } +} + +double logdual ( long double x ) +{ + unsigned exp = 0; + + while ( x >= 18446744073709551616. ) + x /= 18446744073709551616., exp += 64; + while ( x >= 256. ) + x /= 256., exp += 8; + while ( x >= 2. ) + x /= 2., exp += 1; + return exp + log (x)/log(2); +} + +int random_number ( void ) +{ + struct timeval t; + unsigned long val; + + gettimeofday ( &t, NULL ); + + val = t.tv_sec ^ t.tv_usec ^ rand(); + val ^= val >> 16; + val ^= val >> 8; + val ^= val >> 4; + val ^= val >> 2; + val ^= val >> 1; + + return val & 1; +} + +long double prob ( int last, int total ) +{ + long double sum = 0.; + long double tmp = 1.; + int i; + int j = total; + + if ( 2*last == total ) + return 1.; + if ( 2*last > total ) + last = total - last; + + for ( i = 0; i <= last; i++ ) { + sum += tmp; + tmp = tmp * (total-i) / (1+i); + while ( j > 0 && tmp > 1 ) + j--, sum *= 0.5, tmp *= 0.5; + } + while ( j > 0 ) + j--, sum *= 0.5; + + return 2.*sum; +} + + +void eval ( int right ) +{ + static int count = 0; + static int okay = 0; + long double val; + + count ++; + okay += right; + + val = 1.L / prob ( okay, count ); + + fprintf (stderr, " %s %5u/%-5u ", right ? "OK" : "- " , okay, count ); + printnumber (val); + if ( count > 1 ) + fprintf (stderr, " %4.2f bit", 0.01 * (int)(logdual(val) / (count-1) * 100.) ); + fprintf ( stderr, "\n" ); +} + + +typedef signed short sample_t; +typedef sample_t mono_t [1]; +typedef sample_t stereo_t [2]; +typedef struct { + unsigned long n; + long double x; + long double x2; + long double y; + long double y2; + long double xy; +} korr_t; + + +void analyze_stereo ( const stereo_t* p1, const stereo_t* p2, size_t len, korr_t* const k ) +{ + long double _x = 0, _x2 = 0, _y = 0, _y2 = 0, _xy = 0; + double t1; + double t2; + + k -> n += 2*len; + + for ( ; len--; p1++, p2++ ) { + _x += (t1 = (*p1)[0]); _x2 += t1 * t1; + _y += (t2 = (*p2)[0]); _y2 += t2 * t2; + _xy += t1 * t2; + _x += (t1 = (*p1)[1]); _x2 += t1 * t1; + _y += (t2 = (*p2)[1]); _y2 += t2 * t2; + _xy += t1 * t2; + } + + k -> x += _x ; + k -> x2 += _x2; + k -> y += _y ; + k -> y2 += _y2; + k -> xy += _xy; +} + +int sgn ( double x ) +{ + if ( x == 0 ) return 0; + if ( x < 0 ) return -1; + return +1; +} + +long double report ( const korr_t* const k ) +{ + long double r; + long double sx; + long double sy; + long double x; + long double y; + long double b; + + r = (k->x2*k->n - k->x*k->x) * (k->y2*k->n - k->y*k->y); + r = r > 0.l ? (k->xy*k->n - k->x*k->y) / sqrt (r) : 1.l; + sx = k->n > 1 ? sqrt ( (k->x2 - k->x*k->x/k->n) / (k->n - 1) ) : 0.l; + sy = k->n > 1 ? sqrt ( (k->y2 - k->y*k->y/k->n) / (k->n - 1) ) : 0.l; + x = k->n > 0 ? k->x/k->n : 0.l; + y = k->n > 0 ? k->y/k->n : 0.l; + + b = sx != 0 ? sy/sx * sgn(r) : 0.l; + if (verbose) + fprintf ( stderr, "r=%Lf sx=%Lf sy=%Lf x=%Lf y=%Lf b=%Lf\n", r, sx, sy, x, y, b ); + return b; +} + + +/* Input: an unsigned short n. + * Output: the swapped bytes of n if the arch is big-endian or n itself + * if the arch is little-endian. + * Comment: should be replaced latter with a better solution than this + * home-brewed hack (rbrito). The name should be better also. + */ +inline unsigned short be16_le(unsigned short n) +{ +#ifdef _WORDS_BIGENDIAN + return (n << 8) | (n >> 8); +#else + return n; +#endif +} + + +int feed ( int fd, const stereo_t* p, int len ) +{ + int i; + stereo_t tmp[30000]; /* An arbitrary size--to be changed latter */ + + if (len > sizeof(tmp)/sizeof(*tmp)) + len = sizeof(tmp)/sizeof(*tmp); + + for (i = 0; i < len; i++) { + tmp[i][0] = be16_le(p[i][0]); + tmp[i][1] = be16_le(p[i][1]); + } + + write ( fd, tmp, sizeof(stereo_t) * len ); + return len; +} + + +short round ( double f ) +{ + long x = (long) floor ( f + 0.5 ); + return x == (short)x ? (short)x : (short) ((x >> 31) ^ 0x7FFF); +} + + +int feed2 ( int fd, const stereo_t* p1, const stereo_t* p2, int len ) +{ + stereo_t tmp [30000]; /* An arbitrary size, hope that no overruns occure */ + int i; + + if (len > sizeof(tmp)/sizeof(*tmp)) + len = sizeof(tmp)/sizeof(*tmp); + for ( i = 0; i < len; i++ ) { + double f = cos ( M_PI/2*i/len ); + f *= f; + tmp [i] [0] = be16_le(round ( p1 [i] [0] * f + p2 [i] [0] * (1. - f) )); + tmp [i] [1] = be16_le(round ( p1 [i] [1] * f + p2 [i] [1] * (1. - f) )); + } + + write ( fd, tmp, sizeof(stereo_t) * len ); + return len; +} + + +int feedfac ( int fd, const stereo_t* p1, const stereo_t* p2, int len, double fac1, double fac2 ) +{ + stereo_t tmp [30000]; /* An arbitrary size, hope that no overruns occure */ + int i; + + if (len > sizeof(tmp)/sizeof(*tmp)) + len = sizeof(tmp)/sizeof(*tmp); + for ( i = 0; i < len; i++ ) { + tmp [i] [0] = be16_le(round ( p1 [i] [0] * fac1 + p2 [i] [0] * fac2 )); + tmp [i] [1] = be16_le(round ( p1 [i] [1] * fac1 + p2 [i] [1] * fac2 )); + } + + write ( fd, tmp, sizeof(stereo_t) * len ); + return len; +} + + +void setup ( int fdd, int samples, long freq ) +{ + int status, org, arg; + + // Nach vorn verschoben + if ( -1 == (status = ioctl (fdd, SOUND_PCM_SYNC, 0)) ) + perror ("SOUND_PCM_SYNC ioctl failed"); + + org = arg = 2; + if ( -1 == (status = ioctl (fdd, SOUND_PCM_WRITE_CHANNELS, &arg)) ) + perror ("SOUND_PCM_WRITE_CHANNELS ioctl failed"); + if (arg != org) + perror ("unable to set number of channels"); + fprintf (stderr, "%1u*", arg); + + org = arg = AFMT_S16_LE; + if ( -1 == ioctl (fdd, SNDCTL_DSP_SETFMT, &arg) ) + perror ("SNDCTL_DSP_SETFMT ioctl failed"); + if ((arg & org) == 0) + perror ("unable to set data format"); + + org = arg = freq; + if ( -1 == (status = ioctl (fdd, SNDCTL_DSP_SPEED, &arg)) ) + perror ("SNDCTL_DSP_SPEED ioctl failed"); + fprintf (stderr, "%5u Hz*%.3f sec\n", arg, (double)samples/arg ); + +} + + +void Message ( const char* s, size_t index, long freq, size_t start, size_t stop ) +{ + unsigned long norm_index = 100lu * index / freq; + unsigned long norm_start = 100lu * start / freq; + unsigned long norm_stop = 100lu * stop / freq; + + fprintf ( stderr, "\rListening %s %2lu:%02lu.%02lu (%1lu:%02lu.%02lu...%1lu:%02lu.%02lu)%*.*s\rListening %s", + s, + norm_index / 6000, norm_index / 100 % 60, norm_index % 100, + norm_start / 6000, norm_start / 100 % 60, norm_start % 100, + norm_stop / 6000, norm_stop / 100 % 60, norm_stop % 100, + 36 - (int)strlen(s), 36 - (int)strlen(s), "", + s ); + + fflush ( stderr ); +} + + +size_t calc_true_index ( size_t index, size_t start, size_t stop ) +{ + if ( start >= stop ) + return start; + while ( index - start < DMA_SAMPLES ) + index += stop - start; + return index - DMA_SAMPLES; +} + + +void testing ( const stereo_t* A, const stereo_t* B, size_t len, long freq ) +{ + int c; + int fd = open ( "/dev/dsp", O_WRONLY ); + int rnd = random_number (); /* Auswahl von X */ + int state = 0; /* derzeitiger F�ttungsmodus */ + float fac1 = 0.5; + float fac2 = 0.5; + size_t start = 0; + size_t stop = len; + size_t index = start; /* derzeitiger Offset auf den Audiostr�men */ + char message [80] = "A "; + + setup ( fd, len, freq ); + + while ( 1 ) { + c = sel (); + if ( c == 27 ) + c = sel () + 0x100; + + switch ( c ) { + case 'A' : + case 'a' : + strcpy ( message, "A " ); + if ( state != 0 ) + state = 2; + break; + + case 0x100+'0' : + case '0' : + case 'B' : + case 'b' : + strcpy ( message, " B" ); + if ( state != 1 ) + state = 3; + break; + + case 'X' : + case 'x' : + strcpy ( message, " X " ); + if ( state != rnd ) + state = rnd + 2; + break; + + case 'm' : + state = 8; + break; + + case 'M' : + state = (state & 1) + 4; + break; + + case 'x'&0x1F: + state = (state & 1) + 6; + break; + + case ' ': + start = 0; + stop = len; + break; + + case 'o' : + start = calc_true_index ( index, start, stop); + break; + case 'p' : + stop = calc_true_index ( index, start, stop); + break; + case 'h' : + if ( start > freq/100 ) + start -= freq/100; + else + start = 0; + index = start; + continue; + case 'j' : + if ( start < stop-freq/100 ) + start += freq/100; + else + start = stop; + index = start; + continue; + case 'k' : + if ( stop > start+freq/100 ) + stop -= freq/100; + else + stop = start; + continue; + case 'l' : + if ( stop < len-freq/100 ) + stop += freq/100; + else + stop = len; + continue; + case '\n': + index = start; + continue; + + case 'D'+0x100: + strcpy ( message, "Difference (+40 dB)" ); + state = 9; + fac1 = -100.; + fac2 = +100.; + break; + + case 'd'+0x100: + strcpy ( message, "Difference (+30 dB)" ); + state = 9; + fac1 = -32.; + fac2 = +32.; + break; + + case 'D' & 0x1F : + strcpy ( message, "Difference (+20 dB)" ); + state = 9; + fac1 = -10.; + fac2 = +10.; + break; + + case 'D' : + strcpy ( message, "Difference (+10 dB)" ); + state = 9; + fac1 = -3.; + fac2 = +3.; + break; + + case 'd' : + strcpy ( message, "Difference ( 0 dB)" ); + state = 9; + fac1 = -1.; + fac2 = +1.; + break; + + case 0x100+'1' : + case 0x100+'2' : + case 0x100+'3' : + case 0x100+'4' : + case 0x100+'5' : + case 0x100+'6' : + case 0x100+'7' : + case 0x100+'8' : + case 0x100+'9' : + sprintf ( message, " B (Errors -%c dB)", (char)c ); + state = 9; + fac2 = pow (10., -0.05*(c-0x100-'0') ); + fac1 = 1. - fac2; + break; + + case '1' : + case '2' : + case '3' : + case '4' : + case '5' : + case '6' : + case '7' : + case '8' : + case '9' : + sprintf ( message, " B (Errors +%c dB)", c ); + state = 9; + fac2 = pow (10., 0.05*(c-'0') ); + fac1 = 1. - fac2; + break; + + case 'A' & 0x1F: + fprintf (stderr, " Vote for X:=A" ); + eval ( rnd == 0 ); + rnd = random_number (); + if ( state == 6 && state == 7 ) + state = 6 + rnd; + else if ( state != rnd ) + state = rnd + 2; + strcpy ( message," X " ); + break; + + case 'B' & 0x1F: + fprintf (stderr, " Vote for X:=B" ); + eval ( rnd == 1 ); + rnd = random_number (); + if ( state == 6 && state == 7 ) + state = 6 + rnd; + else if ( state != rnd ) + state = rnd + 2; + strcpy ( message," X " ); + break; + + case -1: + break; + + default: + fprintf (stderr, "\a" ); + break; + + case 'Q': + case 'q': + fprintf ( stderr, "\n%-79.79s\r", "Quit program" ); + close (fd); + fprintf ( stderr, "\n\n"); + return; + } + + switch (state) { + case 0: /* A */ + if ( index + BF >= stop ) + index += feed (fd, A+index, stop-index ); + else + index += feed (fd, A+index, BF ); + break; + + case 1: /* B */ + if ( index + BF >= stop ) + index += feed (fd, B+index, stop-index ); + else + index += feed (fd, B+index, BF ); + break; + + case 2: /* B => A */ + if ( index + BF >= stop ) + index += feed2 (fd, B+index, A+index, stop-index ); + else + index += feed2 (fd, B+index, A+index, BF ); + state = 0; + break; + + case 3: /* A => B */ + if ( index + BF >= stop ) + index += feed2 (fd, A+index, B+index, stop-index ); + else + index += feed2 (fd, A+index, B+index, BF ); + state = 1; + break; + + case 4: /* A */ + strcpy ( message, "A " ); + if ( index + BF >= stop ) + index += feed (fd, A+index, stop-index ), + state++; + else + index += feed (fd, A+index, BF ); + break; + + case 5: /* B */ + strcpy ( message, " B" ); + if ( index + BF >= stop ) + index += feed (fd, B+index, stop-index ), + state--; + else + index += feed (fd, B+index, BF ); + break; + + case 6: /* X */ + strcpy ( message, " X " ); + if ( index + BF >= stop ) + index += feed (fd, (rnd ? B : A)+index, stop-index ), + state++; + else + index += feed (fd, (rnd ? B : A)+index, BF ); + break; + + case 7: /* !X */ + strcpy ( message, "!X " ); + if ( index + BF >= stop ) + index += feed (fd, (rnd ? A : B)+index, stop-index ), + state--; + else + index += feed (fd, (rnd ? A : B)+index, BF ); + break; + + case 8: + if ( index + BF/2 >= stop ) + index += feed2 (fd, A+index, B+index, stop-index ); + else + index += feed2 (fd, A+index, B+index, BF/2 ); + Message ( " B", index, freq, start, stop ); + if ( index + BF >= stop ) + index += feed (fd, B+index, stop-index ); + else + index += feed (fd, B+index, BF ); + if ( index + BF/2 >= stop ) + index += feed2 (fd, B+index, A+index, stop-index ); + else + index += feed2 (fd, B+index, A+index, BF/2 ); + Message ( "A ", index, freq, start, stop ); + if ( index + BF >= stop ) + index += feed (fd, A+index, stop-index ); + else + index += feed (fd, A+index, BF ); + break; + + case 9: /* Liko */ + if ( index + BF >= stop ) + index += feedfac (fd, A+index, B+index, stop-index, fac1, fac2 ); + else + index += feedfac (fd, A+index, B+index, BF , fac1, fac2 ); + break; + + default: + assert (0); + } + + if (index >= stop) + index = start; + Message ( message, calc_true_index ( index, start, stop), freq, start, stop ); + } +} + + +int has_ext ( const char* name, const char* ext ) +{ + if ( strlen (name) < strlen (ext) ) + return 0; + name += strlen (name) - strlen (ext); + return strcasecmp (name, ext) ? 0 : 1; +} + + +typedef struct { + const char* const extention; + const char* const command; +} decoder_t; + + +#define REDIR " 2> /dev/null" +#define STDOUT "/dev/fd/1" +#define PATH PATH_OF_EXTERNAL_TOOLS_FOR_UNCOMPRESSING + +const decoder_t decoder [] = { + { ".mp1" , PATH"mpg123 -w - %s" REDIR }, // MPEG Layer I : www.iis.fhg.de, www.mpeg.org + { ".mp2" , PATH"mpg123 -w - %s" REDIR }, // MPEG Layer II : www.iis.fhg.de, www.uq.net.au/~zzmcheng, www.mpeg.org + { ".mp3" , PATH"mpg123 -w - %s" REDIR }, // MPEG Layer III : www.iis.fhg.de, www.mp3dev.org, www.mpeg.org + { ".mp3pro" , PATH"mpg123 -w - %s" REDIR }, // MPEG Layer III : www.iis.fhg.de, www.mp3dev.org, www.mpeg.org + { ".mpt" , PATH"mpg123 -w - %s" REDIR }, // MPEG Layer III : www.iis.fhg.de, www.mp3dev.org, www.mpeg.org + { ".mpp" , PATH"mppdec %s -" REDIR }, // MPEGplus : www.stud.uni-hannover.de/user/73884 + { ".mpc" , PATH"mppdec %s -" REDIR }, // MPEGplus : www.stud.uni-hannover.de/user/73884 + { ".mp+" , PATH"mppdec %s -" REDIR }, // MPEGplus : www.stud.uni-hannover.de/user/73884 + { ".aac" , PATH"faad -t.wav -w %s" REDIR }, // Advanced Audio Coding: psytel.hypermart.net, www.aac-tech.com, sourceforge.net/projects/faac, www.aac-audio.com, www.mpeg.org + { "aac.lqt" , PATH"faad -t.wav -w %s" REDIR }, // Advanced Audio Coding: psytel.hypermart.net, www.aac-tech.com, sourceforge.net/projects/faac, www.aac-audio.com, www.mpeg.org + { ".ac3" , PATH"ac3dec %s" REDIR }, // Dolby AC3 : www.att.com + { "ac3.lqt" , PATH"ac3dec %s" REDIR }, // Dolby AC3 : www.att.com + { ".ogg" , PATH"ogg123 -d wav -o file:"STDOUT" %s" REDIR }, // Ogg Vorbis : www.xiph.org/ogg/vorbis/index.html + { ".pac" , PATH"lpac -x %s "STDOUT REDIR }, // Lossless predictive Audio Compression: www-ft.ee.tu-berlin.de/~liebchen/lpac.html (liebchen@ft.ee.tu-berlin.de) + { ".shn" , PATH"shorten -x < %s" REDIR }, // Shorten : shnutils.freeshell.org, www.softsound.com/Shorten.html (shnutils@freeshell.org, shorten@softsound.com) + { ".wav.gz" , PATH"gzip -d < %s | sox -twav - -twav -sw -"REDIR }, // gziped WAV + { ".wav.sz" , PATH"szip -d < %s | sox -twav - -twav -sw -"REDIR }, // sziped WAV + { ".wav.sz2", PATH"szip2 -d < %s | sox -twav - -twav -sw -"REDIR }, // sziped WAV + { ".raw" , PATH"sox -r44100 -sw -c2 -traw %s -twav -sw -"REDIR }, // raw files are treated as CD like audio + { ".cdr" , PATH"sox -r44100 -sw -c2 -traw %s -twav -sw -"REDIR }, // CD-DA files are treated as CD like audio, no preemphasis info available + { ".rm" , "echo %s '???'" REDIR }, // Real Audio : www.real.com + { ".epc" , "echo %s '???'" REDIR }, // ePAC : www.audioveda.com, www.lucent.com/ldr + { ".mov" , "echo %s '???'" REDIR }, // QDesign Music 2 : www.qdesign.com + { ".vqf" , "echo %s '???'" REDIR }, // TwinVQ : www.yamaha-xg.com/english/xg/SoundVQ, www.vqf.com, sound.splab.ecl.ntt.co.jp/twinvq-e + { ".wma" , "echo %s '???'" REDIR }, // Microsoft Media Audio: www.windowsmedia.com, www.microsoft.com/windows/windowsmedia + { ".flac" , PATH"flac -c -d %s" REDIR }, // Free Lossless Audio Coder: flac.sourceforge.net/ + { ".fla" , PATH"flac -c -d %s" REDIR }, // Free Lossless Audio Coder: flac.sourceforge.net/ + { ".ape" , "( "PATH"MAC %s _._.wav -d > /dev/null; cat _._.wav; rm _._.wav )" REDIR }, // Monkey's Audio Codec : www.monkeysaudio.com (email@monkeysaudio.com) + { ".rka" , "( "PATH"rkau %s _._.wav > /dev/null; cat _._.wav; rm _._.wav )" REDIR }, // RK Audio: + { ".rkau" , "( "PATH"rkau %s _._.wav > /dev/null; cat _._.wav; rm _._.wav )" REDIR }, // RK Audio: + { ".mod" , PATH"xmp -b16 -c -f44100 --stereo -o- %s | sox -r44100 -sw -c2 -traw - -twav -sw -" + REDIR }, // Amiga's Music on Disk: + { "" , PATH"sox %s -twav -sw -" REDIR }, // Rest, may be sox can handle it +}; + +#undef REDIR +#undef STDOUT +#undef PATH + + +int readwave ( stereo_t* buff, size_t maxlen, const char* name, size_t* len ) +{ + char* command = malloc (2*strlen(name) + 512); + char* name_q = malloc (2*strlen(name) + 128); + unsigned short header [22]; + FILE* fp; + size_t i; + size_t j; + + // The *nice* shell quoting + i = j = 0; + if ( name[i] == '-' ) + name_q[j++] = '.', + name_q[j++] = '/'; + + while (name[i]) { + if ( !isalnum (name[i]) && name[i]!='-' && name[i]!='_' && name[i]!='.' ) + name_q[j++] = '\\'; + name_q[j++] = name[i++]; + } + name_q[j] = '\0'; + + fprintf (stderr, "Reading %s", name ); + for ( i = 0; i < sizeof(decoder)/sizeof(*decoder); i++ ) + if ( has_ext (name, decoder[i].extention) ) { + sprintf ( command, decoder[i].command, name_q ); + break; + } + + free (name_q); + if ( (fp = popen (command, "r")) == NULL ) { + fprintf (stderr, "Can't exec:\n%s\n", command ); + exit (1); + } + free (command); + + fprintf (stderr, " ..." ); + fread ( header, sizeof(*header), sizeof(header)/sizeof(*header), fp ); + + switch (be16_le(header[11])) { + case 2: + *len = fread ( buff, sizeof(stereo_t), maxlen, fp ); + for (i = 0; i < *len; i ++) { + buff[i][0] = be16_le(buff[i][0]); + buff[i][1] = be16_le(buff[i][1]); + } + break; + case 1: + *len = fread ( buff, sizeof(sample_t), maxlen, fp ); + for ( i = *len; i-- > 0; ) + buff[i][0] = buff[i][1] = ((sample_t*)buff) [i]; + break; + case 0: + fprintf (stderr, "\b\b\b\b, Standard Open Source Bug detected, try murksaround ..." ); + *len = fread ( buff, sizeof(stereo_t), maxlen, fp ); + header[11] = 2; + header[12] = 65534; /* use that of the other channel */ + break; + default: + fprintf (stderr, "Only 1 or 2 channels are supported, not %u\n", header[11] ); + pclose (fp); + return -1; + } + pclose ( fp ); + fprintf (stderr, "\n" ); + return be16_le(header[12]) ? be16_le(header[12]) : 65534; +} + + +double cross_analyze ( const stereo_t* p1, const stereo_t *p2, size_t len ) +{ + float P1 [MAX] [2]; + float P2 [MAX] [2]; + int i; + int maxindex; + double sum1; + double sum2; + double max; + double y1; + double y2; + double y3; + double yo; + double xo; + double tmp; + double tmp1; + double tmp2; + int ret = 0; + int cnt = 5; + + // Calculating effective voltage + sum1 = sum2 = 0.; + for ( i = 0; i < len; i++ ) { + sum1 += (double)p1[i][0] * p1[i][0]; + sum2 += (double)p2[i][0] * p2[i][0]; + } + sum1 = sqrt ( sum1/len ); + sum2 = sqrt ( sum2/len ); + + // Searching beginning of signal (not stable for pathological signals) + for ( i = 0; i < len; i++ ) + if ( abs (p1[i][0]) >= sum1 && abs (p2[i][0]) >= sum2 ) + break; + p1 += i; + p2 += i; + len -= i; + + if ( len <= MAX ) + return 0; + + // Filling arrays for FFT + do { + sum1 = sum2 = 0.; + for ( i = 0; i < MAX; i++ ) { +#ifdef USEDIFF + tmp1 = p1 [i][0] - p1 [i+1][0]; + tmp2 = p2 [i+ret][0] - p2 [i+ret+1][0]; +#else + tmp1 = p1 [i][0]; + tmp2 = p2 [i+ret][0]; +#endif + sum1 += tmp1*tmp1; + sum2 += tmp2*tmp2; + P1 [i][0] = tmp1; + P2 [i][0] = tmp2; + P1 [i][1] = 0.; + P2 [i][1] = 0.; + } + + fft (P1, MAX); + fft (P2, MAX); + + for ( i = 0; i < MAX; i++ ) { + double a0 = P1 [i][0]; + double a1 = P1 [i][1]; + double b0 = P2 [(MAX-i)&(MAX-1)][0]; + double b1 = P2 [(MAX-i)&(MAX-1)][1]; + P1 [i][0] = a0*b0 - a1*b1; + P1 [i][1] = a0*b1 + a1*b0; + } + + fft (P1, MAX); + + max = P1 [maxindex = 0][0]; + for ( i = 1; i < MAX; i++ ) + if ( P1[i][0] > max ) + max = P1 [maxindex = i][0]; + + y2 = P1 [ maxindex ][0]; + y1 = P1 [(maxindex-1)&(MAX-1)][0] - y2; + y3 = P1 [(maxindex+1)&(MAX-1)][0] - y2; + + xo = 0.5 * (y1-y3) / (y1+y3); + yo = 0.5 * ( (y1+y3)*xo + (y3-y1) ) * xo; + + if (maxindex > MAX/2 ) + maxindex -= MAX; + + ret += maxindex; + tmp = 100./MAX/sqrt(sum1*sum2); + if (verbose) + printf ( "[%5d]%8.4f [%5d]%8.4f [%5d]%8.4f [%10.4f]%8.4f\n", + ret- 1, (y1+y2)*tmp, + ret , y2 *tmp, + ret+ 1, (y3+y2)*tmp, + ret+xo, (yo+y2)*tmp ); + + } while ( maxindex && cnt-- ); + + return ret + xo; +} + + +short to_short ( int x ) +{ + return x == (short)x ? (short)x : (short) ((x >> 31) ^ 0x7FFF); +} + + +void DC_cancel ( stereo_t* p, size_t len ) +{ + double sum1 = 0; + double sum2 = 0; + size_t i; + int diff1; + int diff2; + + for (i = 0; i < len; i++ ) { + sum1 += p[i][0]; + sum2 += p[i][1]; + } + if ( fabs(sum1) < len && fabs(sum2) < len ) + return; + + diff1 = round ( sum1 / len ); + diff2 = round ( sum2 / len ); + if (verbose) + fprintf (stderr, "Removing DC (left=%d, right=%d)\n", diff1, diff2 ); + + for (i = 0; i < len; i++ ) { + p[i][0] = to_short ( p[i][0] - diff1); + p[i][1] = to_short ( p[i][1] - diff2); + } +} + +void multiply ( char c, stereo_t* p, size_t len, double fact ) +{ + size_t i; + + if ( fact == 1. ) + return; + if (verbose) + fprintf (stderr, "Multiplying %c by %7.5f\n", c, fact ); + + for (i = 0; i < len; i++ ) { + p[i][0] = to_short ( p[i][0] * fact ); + p[i][1] = to_short ( p[i][1] * fact ); + } +} + + +int maximum ( stereo_t* p, size_t len ) +{ + int max = 0; + size_t i; + + for (i = 0; i < len; i++ ) { + if (abs(p[i][0]) > max) max = abs(p[i][0]); + if (abs(p[i][1]) > max) max = abs(p[i][1]); + } + return max; +} + + +void usage ( void ) +{ + fprintf ( stderr, + "usage: abx [-v] File_A File_B\n" + "\n" + "File_A and File_B loaded and played. File_A should be the better/reference\n" + "file, File_B the other. You can press the following keys:\n" + "\n" + " a/A: Listen to File A\n" + " b/B: Listen to File B\n" + " x/X: Listen to the randomly selected File X, which is A or B\n" + " Ctrl-A: You vote for X=A\n" + " Ctrl-B: You vote for X=B\n" + " m: Alternating playing A and B. Fast switching\n" + " M: Alternating playing A and B. Slow switching\n" + " d/D/Ctrl-D/Alt-d/Alt-D:\n" + " Listen to the difference A-B (+0 dB...+40 dB)\n" + " o/p: Chunk select\n" + " hjkl: Chunk fine adjust (hj: start, kl: stop)\n" + " Space: Chunk deselect\n" + " 0...9: Listen to B, but difference A-B is amplified by 0-9 dB\n" + " Q: Quit the program\n" + "\n" + ); +} + + +int main ( int argc, char** argv ) +{ + stereo_t* _A = calloc ( MAX_LEN, sizeof(stereo_t) ); + stereo_t* _B = calloc ( MAX_LEN, sizeof(stereo_t) ); + stereo_t* A = _A; + stereo_t* B = _B; + size_t len_A; + size_t len_B; + size_t len; + int max_A; + int max_B; + int max; + long freq1; + long freq2; + int shift; + double fshift; + double ampl; + int ampl_X; + korr_t k; + + if (argc > 1 && 0 == strcmp (argv[1], "-v") ) { + verbose = 1; + argc--; + argv++; + } + + switch ( argc ) { + case 0: + case 1: + case 2: + default: + usage (); + return 1; + case 3: + usage(); + break; + } + + freq1 = readwave ( A, MAX_LEN, argv[1], &len_A ); + DC_cancel ( A, len_A ); + freq2 = readwave ( B, MAX_LEN, argv[2], &len_B ); + DC_cancel ( B, len_B ); + + if ( freq1 == 65534 && freq2 != 65534 ) + freq1 = freq2; + else if ( freq2 == 65534 && freq1 != 65534 ) + freq2 = freq1; + else if ( freq1 == 65534 && freq2 == 65534 ) + freq1 = freq2 = 44100; + + if ( freq1 != freq2 ) { + fprintf ( stderr, "Different sample frequencies currently not supported\n"); + fprintf ( stderr, "A: %ld, B: %ld\n", freq1, freq2 ); + return 2; + } + + len = len_A < len_B ? len_A : len_B; + fshift = cross_analyze ( A, B, len ); + shift = floor ( fshift + 0.5 ); + + if ( verbose ) { + fprintf ( stderr, "Delay Ch1 is %.4f samples\n", fshift ); + fprintf ( stderr, "Delay Ch2 is %.4f samples\n", + cross_analyze ( (stereo_t*)(((sample_t*)A)+1), (stereo_t*)(((sample_t*)B)+1), len ) ); + } + + if (shift > 0) { + if (verbose) + fprintf ( stderr, "Delaying A by %d samples\n", +shift); + B += shift; + len_B -= shift; + } + if (shift < 0) { + if (verbose) + fprintf ( stderr, "Delaying B by %d samples\n", -shift); + A -= shift; + len_A += shift; + } + + len = len_A < len_B ? len_A : len_B; + memset ( &k, 0, sizeof(k) ); + analyze_stereo ( A, B, len, &k ); + ampl = report (&k); + max_A = maximum ( A, len ); + max_B = maximum ( B, len ); + + if ( ampl <= 0.98855 ) { /* < -0.05 dB */ + max = max_A*ampl < max_B ? max_B : max_A*ampl; + ampl_X = (int)(29203 / max); + if ( ampl_X < 2 ) ampl_X = 1; + multiply ( 'A', A, len, ampl*ampl_X ); + multiply ( 'B', B, len, ampl_X ); + } else if ( ampl >= 1.01158 ) { /* > +0.05 dB */ + max = max_A < max_B/ampl ? max_B/ampl : max_A; + ampl_X = (int)(29203 / max); + if ( ampl_X < 2 ) ampl_X = 1; + multiply ( 'A', A, len, ampl_X ); + multiply ( 'B', B, len, 1./ampl*ampl_X ); + } else { + max = max_A < max_B ? max_B : max_A; + ampl_X = (int)(29203 / max); + if ( ampl_X < 2 ) ampl_X = 1; + multiply ( 'A', A, len, ampl_X ); + multiply ( 'B', B, len, ampl_X ); + } + + set (); + Set_Realtime (); + testing ( A, B, len, freq1 ); + reset (); + + free (_A); + free (_B); + return 0; +} + +/* end of abx.c */ diff --git a/node_modules/lame/deps/lame/misc/ath.c b/node_modules/lame/deps/lame/misc/ath.c new file mode 100644 index 0000000..ee6cfda --- /dev/null +++ b/node_modules/lame/deps/lame/misc/ath.c @@ -0,0 +1,839 @@ +/* $Id: ath.c,v 1.12 2000/12/05 15:37:26 aleidinger Exp $ */ +/* + * Known bugs (sorted by importance): + * - human delay (ca. 200 ms or more???) and buffering delay (341 ms @48 kHz/64 KByte) + * should be subtracted + * - error handling + * - cos slope on direction changes + * - calibration file of soundcard/amplifier/head phone + * - worse handling + * - +/- handling via mouse (do you have code?) in a dark room + * - ENTER as direction change + * - finer precalculated ATH for pre-emphasis + */ + +/* + * Suggested level ranges: + * 180 Hz...13.5 kHz: 50...70 dB + * 100 Hz...15.0 kHz: 40...70 dB + * 70 Hz...16.0 kHz: 30...70 dB + * 45 Hz...16.5 kHz: 20...70 dB + * 30 Hz...17.5 kHz: 10...70 dB + * 25 Hz...18.0 kHz: 5...75 dB + * 20 Hz...19.0 kHz: 0...80 dB + * 16 Hz...20.0 kHz: -10...80 dB + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_SOUNDCARD_H +# include +#elif defined(HAVE_LINUX_SOUNDCARD_H) +# include +#else +# error no soundcard include +#endif + + + +#define AUDIO_DEVICE "/dev/dsp" +//#define COOLEDIT_FILE "/mnt/dosd/cooledit.wav" +#define DELAY_UNTIL_XCHG 2.5 +#define TURN_STEPS 2400 + +/****************************************************************************************************** + * soundcard stuff + ******************************************************************************************************/ + +const double dither_coeff [] [16] = { + { /* 48 kHz */ 3.35185352775391591311, 4.24914379295482032978, 1.78042251729150153086, -0.92601381419186201184, -1.37308596104182343645, -1.85951915999247704829, -3.28074437872632330526, -3.05496670185702990882, -1.22855462839450528837, -0.30291531959171267015, -0.18598486195652600770, 0.42010512205702003790, 0.92278786111368653452, 0.62102380451771775193, 0.14312897206650044828, -0.00454721508203927746 }, + { /* 56 kHz */ 3.86404134982280628749, 6.67195592701613291071, 5.90576195467245802046, 1.57589705921487261981, -2.10618201389737372178, -2.74191788822507184395, -2.62175070636849999396, -3.78505226463032808863, -4.45698848578010438284, -2.76825966243460536110, -0.26509931375584007312, 0.67853812028968716799, 0.17633528441477021892, -0.28511417191837823770, -0.21866605100975608470, -0.04751674094456833719 }, + { /* 64 kHz */ 4.09276938880098092172, 8.27424044674659812937, 10.11503162292146762880, 7.19159801569544317353, 1.39770070291739556523, -2.86595901981244688601, -3.76567274050094691362, -3.58051445684472378298, -4.78262917738758022539, -6.53075750894777650899, -6.31330514306857055627, -3.69971382767763534195, -0.78125094191744878298, 0.59027508113837267217, 0.53500264009607367648, 0.14860043567206217506 }, + { /* 72 kHz */ 4.13833553801985235465, 9.02461778089340082437, 12.93090366932740510782, 12.66372285767699051948, 7.76122176702274149630, 1.30617257555732278296, -2.92859120887121285358, -4.02438598495837830627, -4.16673068132491936262, -5.55618065300129916574, -7.82657788611231653103, -8.83055904466106668035, -7.34884789347713815672, -4.33977664906048314891, -1.67711310288611975398, -0.33086687044710235420 }, + { /* 80 kHz */ 4.22135293342667005517, 9.76639846582539722375, 15.46562682418357478290, 17.54378549927855248346, 13.29112084313158963396, 3.51512441998252657470, -7.51025671462502577300,-14.84164320864536219368,-16.10306907358826504148,-12.54775907691866414402, -7.40560667268782655149, -3.34708029482052565732, -1.19572214872925790860, -0.39582185216275086786, -0.14803160816846603424, -0.04292818488627011881 }, + { /* 88 kHz */ 4.18521467865996935325, 9.96765821475909556942, 16.91905760389390617551, 21.74016824668913557689, 20.96457146354060682367, 13.28640453421253890542, 0.85116933842171101587,-11.66054516261007127469,-19.62750656985581800169,-20.98831962473015904508,-16.95374072505042825458,-10.68848180295390154146, -5.17169792984369678908, -1.79975409439650319129, -0.38057073791415898674, -0.02672653932844656975 }, + { /* 96 kHz */ 4.09418877324899473189, 9.77977364010870211207, 17.10120082680385341159, 23.37356217615995036818, 25.27121942060722374276, 20.64059991613550174190, 9.99721445051475610371, -3.39833000550997938512,-15.03410054392933377278,-21.36704201000683067679,-21.40772859969388741685,-16.79355426136657673808,-10.48570200688141622163, -5.07642951516127438486, -1.75555240936989159436, -0.33817997298586054131 }, +}; + +typedef struct { + const char* device; + int fd; + long double sample_freq; + const double* dither; + int channels; + int bits; +} soundcard_t; + +typedef signed short sample_t; +typedef sample_t stereo_t [2]; + +int open_soundcard ( + soundcard_t* const k, + const char* device, + const int channels, + const int bits, + const long double freq ) +{ + int arg; + int org; + int index; + int status; + + k->device = device; + if ( -1 == (k->fd = open ( k->device, O_WRONLY )) ) { + perror("opening of audio device failed"); + return -1; + } + + if ( -1 == (status = ioctl (k->fd, SOUND_PCM_SYNC, 0))) { + fprintf ( stderr, "%s: SOUND_PCM_SYNC ioctl failed: %s\n", k->device, strerror (errno)); + return -1; + } + + org = arg = channels; + if ( -1 == (status = ioctl (k->fd, SOUND_PCM_WRITE_CHANNELS, &arg)) ) { + fprintf ( stderr, "%s: SOUND_PCM_WRITE_CHANNELS (%d) ioctl failed: %s\n" , k->device, channels, strerror (errno) ); + return -1; + } + if (arg != org) { + fprintf ( stderr, "%s: unable to set number of channels: %d instead of %d\n", k->device, arg, org ); + return -1; + } + k->channels = arg; + + org = arg = bits; + if ( -1 == (status = ioctl (k->fd, SOUND_PCM_WRITE_BITS, &arg)) ) { + fprintf ( stderr, "%s: SOUND_PCM_WRITE_BITS ioctl failed\n", k->device ); + return -1; + } + if (arg != org) { + fprintf ( stderr, "%s: unable to set sample size: %d instead of %d\n", k->device, arg, org ); + return -1; + } + k->bits = arg; + + org = arg = k->bits <= 8 ? AFMT_U8 : AFMT_S16_LE; + if ( -1 == ioctl (k->fd, SNDCTL_DSP_SETFMT, &arg) ) { + fprintf ( stderr, "%s: SNDCTL_DSP_SETFMT ioctl failed\n", k->device ); + return -1; + } + if ((arg & org) == 0) { + fprintf ( stderr, "%s: unable to set data format\n", k->device ); + return -1; + } + + org = arg = (int) floor ( freq + 0.5 ); + if ( -1 == (status = ioctl (k->fd, SOUND_PCM_WRITE_RATE, &arg)) ) { + fprintf ( stderr, "%s: SOUND_PCM_WRITE_WRITE ioctl failed\n", k->device ); + return -1; + } + k->sample_freq = (long double)arg; + index = (arg - 44000) / 8000; + if ( index < 0 ) index = 0; + if ( index >= sizeof(dither_coeff)/sizeof(*dither_coeff) ) index = sizeof(dither_coeff)/sizeof(*dither_coeff) - 1; + k->dither = dither_coeff [ index ]; + return 0; +} + +int play_soundcard ( soundcard_t* const k, stereo_t* samples, size_t length ) +{ + size_t bytes = length * sizeof (*samples); + +#ifdef COOLEDIT_FILE + static int fd = -1; + if ( fd < 0 ) fd = open ( COOLEDIT_FILE, O_WRONLY | O_CREAT ); + write ( fd, samples, bytes ); +#endif + + return write ( k->fd, samples, bytes ) == bytes ? 0 : -1; +} + +int close_soundcard ( soundcard_t* const k ) +{ + return close (k->fd); +} + + +/****************************************************************************************************** + * frequency stuff + ******************************************************************************************************/ + +typedef enum { + linear = 0, + logarithm = 1, + square = 2, + cubic = 3, + erb = 4, + recip = 5 +} genmode_t; + +static long double linear_f ( long double x ) { return x > 0.L ? x : 0.0L; } +static long double logarithm_f ( long double x ) { return x > 0.L ? log10 (x) : -3.5L; } +static long double square_f ( long double x ) { return x > 0.L ? sqrt (x) : 0.0L; } +static long double cubic_f ( long double x ) { return x > 0.L ? pow (x,1/3.) : 0.0L; } +static long double erb_f ( long double x ) { return log (1. + 0.00437*x); } +static long double recip_f ( long double x ) { return x > 1.L ? 1.L/x : 1.0L; } + +static long double inv_linear_f ( long double x ) { return x; } +static long double inv_logarithm_f ( long double x ) { return pow (10., x); } +static long double inv_square_f ( long double x ) { return x*x; } +static long double inv_cubic_f ( long double x ) { return x*x*x; } +static long double inv_erb_f ( long double x ) { return (exp(x) - 1.) * (1./0.00437); } +static long double inv_recip_f ( long double x ) { return x > 1.L ? 1.L/x : 1.0L; } + +typedef long double (*converter_fn_t) ( long double ); + +const converter_fn_t func [] = { linear_f, logarithm_f, square_f, cubic_f , erb_f , recip_f }; +const converter_fn_t inv_func [] = { inv_linear_f, inv_logarithm_f, inv_square_f, inv_cubic_f, inv_erb_f, inv_recip_f }; + +typedef struct { + genmode_t genmode; + long double start_freq; + long double stop_freq; + long double sample_freq; + unsigned long duration; + + long double phase; + long double param1; + long double param2; + unsigned long counter; +} generator_t; + +int open_generator ( + generator_t* const g, + const soundcard_t* const s, + const genmode_t genmode, + const long double duration, + const long double start_freq, + const long double stop_freq ) +{ + g->sample_freq = s->sample_freq; + g->genmode = genmode; + g->start_freq = start_freq; + g->stop_freq = stop_freq; + g->duration = (unsigned long) floor ( duration * g->sample_freq + 0.5 ); + + if ( g->duration < 2 ) + return -1; + + if ( g->genmode >= sizeof (func)/sizeof(*func) ) + return -1; + + g->param1 = func [g->genmode] ( g->start_freq / g->sample_freq ); + g->param2 = ( func [ g->genmode ] ( g->stop_freq / g->sample_freq ) - g->param1 ) + / ( g->duration - 1 ); + g->phase = 0.L; + g->counter= 0; + + return 0; +} + +long double iterate_generator ( generator_t* const g ) +{ + long double freq; + + freq = inv_func [ g->genmode ] ( g->param1 + g->counter++ * g->param2 ); + + g->phase += freq; + if (g->phase > 15.) + g->phase -= 16.; + return sin ( 2.*M_PI * g->phase ); +} + +long double get_sine ( generator_t* const g ) +{ + return sin ( 2.*M_PI * g->phase ); +} + +long double get_cosine ( generator_t* const g ) +{ + return cos ( 2.*M_PI * g->phase ); +} + + +long double frequency ( const generator_t* const g ) +{ + return inv_func [ g->genmode ] ( g->param1 + g->counter * g->param2 ) * g->sample_freq; +} + +int close_generator ( generator_t* const g ) +{ + return 0; +} + +/****************************************************************************************************** + * amplitude stuff + ******************************************************************************************************/ + +typedef enum { + up = 0, + down = 1, + turn_up = 2, + turn_down = 3, + still_up = 4, + still_down = 5, + change = 6 +} direction_t; + + +typedef struct { + long double sample_freq; + direction_t direction; // down, up, still_up, still_down, turn_down, turn_up + int multiplier; // -TURN_STEPS: down, +TURN_STEPS up + long double amplitude; + long double delta_amplitude; + long direction_change; +} amplitude_t; + +int open_amplifier ( + amplitude_t* const a, + const soundcard_t* const s, + const long double start_ampl, + const double dB_per_sec ) +{ + a->sample_freq = s->sample_freq; + a->direction = up; + a->multiplier = +TURN_STEPS; + a->amplitude = start_ampl * 32767.; + a->delta_amplitude = dB_per_sec * 0.1151292546497022842 / s->sample_freq / TURN_STEPS; + a->direction_change = 0; + + srand ( time (NULL) ); + return 0; +} + +long double iterate_amplifier ( amplitude_t* const a ) +{ + switch ( a->direction ) { + case still_up: + assert (a->multiplier == +TURN_STEPS); + if (a->direction_change > 0 ) + a->direction_change--; + else + a->direction = turn_down; + break; + case still_down: + assert (a->multiplier == -TURN_STEPS); + if (a->direction_change > 0 ) + a->direction_change--; + else + a->direction = turn_up; + break; + case turn_up: + assert (a->direction_change == 0); + if ( a->multiplier < +TURN_STEPS ) + a->multiplier++; + else + a->direction = up; + break; + case turn_down: + assert (a->direction_change == 0); + if ( a->multiplier > -TURN_STEPS ) + a->multiplier--; + else + a->direction = down; + break; + case up: + assert (a->multiplier == +TURN_STEPS); + assert (a->direction_change == 0); + break; + case down: + assert (a->multiplier == -TURN_STEPS); + assert (a->direction_change == 0); + break; + default: + fprintf ( stderr, "\n\r*** Bug! ***\n"); + break; + } + + a->amplitude *= 1.L + a->delta_amplitude * a->multiplier; + return a->amplitude; +} + +long double amplitude ( const amplitude_t* const a ) +{ + return a->amplitude / 32767.; +} + +int change_direction ( amplitude_t* const a, direction_t new_direction ) +{ + switch ( new_direction ) { + case up: + if (a->direction == down) { + a->direction = still_down; + } else { + fprintf ( stderr, "Direction not down, so ignored\n" ); + return -1; + } + break; + case down: + if (a->direction == up) { + a->direction = still_up; + } else { + fprintf ( stderr, "Direction not up, so ignored\n" ); + return -1; + } + break; + case change: + switch ( a->direction ) { + case up: + a->direction = still_up; + break; + case down: + a->direction = still_down; + break; + default: + fprintf ( stderr, "Direction still changing, so ignored\n" ); + return -1; + } + break; + + default: + fprintf ( stderr, "Direction unknown, so ignored\n" ); + return -1; + } + + a->direction_change = 1 + rand () * (a->sample_freq * DELAY_UNTIL_XCHG / RAND_MAX); + return 0; +} + +int close_amplifier ( amplitude_t* const a ) +{ + return 0; +} + + +double ATH ( double freq ) +{ + static float tab [] = { + /* 10.0 */ 96.69, 96.69, 96.26, 95.12, + /* 12.6 */ 93.53, 91.13, 88.82, 86.76, + /* 15.8 */ 84.69, 82.43, 79.97, 77.48, + /* 20.0 */ 74.92, 72.39, 70.00, 67.62, + /* 25.1 */ 65.29, 63.02, 60.84, 59.00, + /* 31.6 */ 57.17, 55.34, 53.51, 51.67, + /* 39.8 */ 50.04, 48.12, 46.38, 44.66, + /* 50.1 */ 43.10, 41.73, 40.50, 39.22, + /* 63.1 */ 37.23, 35.77, 34.51, 32.81, + /* 79.4 */ 31.32, 30.36, 29.02, 27.60, + /* 100.0 */ 26.58, 25.91, 24.41, 23.01, + /* 125.9 */ 22.12, 21.25, 20.18, 19.00, + /* 158.5 */ 17.70, 16.82, 15.94, 15.12, + /* 199.5 */ 14.30, 13.41, 12.60, 11.98, + /* 251.2 */ 11.36, 10.57, 9.98, 9.43, + /* 316.2 */ 8.87, 8.46, 7.44, 7.12, + /* 398.1 */ 6.93, 6.68, 6.37, 6.06, + /* 501.2 */ 5.80, 5.55, 5.29, 5.02, + /* 631.0 */ 4.75, 4.48, 4.22, 3.98, + /* 794.3 */ 3.75, 3.51, 3.27, 3.22, + /* 1000.0 */ 3.12, 3.01, 2.91, 2.68, + /* 1258.9 */ 2.46, 2.15, 1.82, 1.46, + /* 1584.9 */ 1.07, 0.61, 0.13, -0.35, + /* 1995.3 */ -0.96, -1.56, -1.79, -2.35, + /* 2511.9 */ -2.95, -3.50, -4.01, -4.21, + /* 3162.3 */ -4.46, -4.99, -5.32, -5.35, + /* 3981.1 */ -5.13, -4.76, -4.31, -3.13, + /* 5011.9 */ -1.79, 0.08, 2.03, 4.03, + /* 6309.6 */ 5.80, 7.36, 8.81, 10.22, + /* 7943.3 */ 11.54, 12.51, 13.48, 14.21, + /* 10000.0 */ 14.79, 13.99, 12.85, 11.93, + /* 12589.3 */ 12.87, 15.19, 19.14, 23.69, + /* 15848.9 */ 33.52, 48.65, 59.42, 61.77, + /* 19952.6 */ 63.85, 66.04, 68.33, 70.09, + /* 25118.9 */ 70.66, 71.27, 71.91, 72.60, + }; + double freq_log; + double dB; + unsigned index; + + if ( freq < 10. ) freq = 10.; + if ( freq > 25000. ) freq = 25000.; + + freq_log = 40. * log10 (0.1 * freq); /* 4 steps per third, starting at 10 Hz */ + index = (unsigned) freq_log; + assert ( index < sizeof(tab)/sizeof(*tab) ); + dB = tab [index] * (1 + index - freq_log) + tab [index+1] * (freq_log - index); + return pow ( 10., 0.05*dB ); +} + +/****************************************************************************************************** + * keyboard stuff + ******************************************************************************************************/ + +typedef struct { + int init; + struct termios stored_setting; + struct termios current_setting; +} keyboard_t; + +static keyboard_t* __k; + +/* Restore term-settings to those saved when term_init was called */ + +static void term_restore (void) +{ + tcsetattr ( 0, TCSANOW, &(__k->stored_setting) ); +} /* term_restore */ + +/* Clean up terminal; called on exit */ + +static void term_exit ( int sig ) +{ + term_restore (); +} /* term_exit */ + +/* Will be called when ctrl-Z is pressed, this correctly handles the terminal */ + +static void term_ctrl_z ( int sig ) +{ + signal ( SIGTSTP, term_ctrl_z ); + term_restore (); + kill ( getpid(), SIGSTOP ); +} /* term_ctrl_z */ + +/* Will be called when application is continued after having been stopped */ + +static void term_cont ( int sig ) +{ + signal ( SIGCONT, term_cont ); + tcsetattr ( 0, TCSANOW, &(__k->current_setting) ); +} /* term_cont() */ + +int open_keyboard ( keyboard_t* const k ) +{ + __k = k; + tcgetattr ( 0, &(k->stored_setting) ); + tcgetattr ( 0, &(k->current_setting) ); + + signal ( SIGINT, term_exit ); /* We _must_ clean up when we exit */ + signal ( SIGQUIT, term_exit ); + signal ( SIGTSTP, term_ctrl_z ); /* Ctrl-Z must also be handled */ + signal ( SIGCONT, term_cont ); +// atexit ( term_exit ); + + /* One or more characters are sufficient to cause a read to return */ + cfmakeraw ( &(k->current_setting) ); + k->current_setting.c_oflag |= ONLCR | OPOST; /* enables NL => CRLF on output */ + + tcsetattr ( 0, TCSANOW, &(k->current_setting) ); + return 0; +} + +int getchar_keyboard ( keyboard_t* const k ) +{ + struct timeval t; + fd_set fd [1]; + int ret; + unsigned char c; + + FD_SET (0, fd); + t.tv_sec = 0; + t.tv_usec = 0; + + ret = select ( 1, fd, NULL, NULL, &t ); + + switch ( ret ) { + case 0: + return -1; + case 1: + ret = read (0, &c, 1); + return ret == 1 ? c : -1; + default: + return -2; + } +} + +int close_keyboard ( keyboard_t* const k ) +{ + term_restore (); + return 0; +} + + +/****************************************************************************************************** + * reporting stuff + ******************************************************************************************************/ + +int report_open ( void ) +{ + static char buff [32767]; + fflush ( stdout ); + setvbuf ( stdout, buff, _IOFBF, sizeof(buff) ); + return 0; +} + +int report ( const generator_t* const g, const amplitude_t* const a ) +{ + static double last_freq = -1.; + static double last_level = -1.; + double freq; + double level; + + freq = frequency (g); + level = 20. * log10 (amplitude (a) * ATH (freq) ) + 80.; + + if ( last_freq >= 0 ) + printf ( "%11.3f %8.2f\n", sqrt (freq*last_freq), 0.5 * (level+last_level) ); + printf ( "# %9.3f %8.2f\n", freq, level ); + + fflush ( stdout ); + + last_freq = freq; + last_level = level; + return 0; +} + +int report_close ( void ) +{ + printf ( "%%%%\n\n" ); + fflush ( stdout ); + close ( dup ( fileno(stdout) ) ); + setvbuf ( stdout, NULL, _IONBF, 0 ); + return 0; +} + + +/****************************************************************************************************** + * main stuff + ******************************************************************************************************/ + +typedef enum { + left = 0, + right = 1, + phase0 = 2, + both = 2, + phase90 = 3, + phase180 = 4, + phasemod = 5 +} earmode_t; + +static long double scalar ( const double* a, const double* b ) +{ + return a[ 0]*b[ 0] + a[ 1]*b[ 1] + a[ 2]*b[ 2] + a[ 3]*b[ 3] + +a[ 4]*b[ 4] + a[ 5]*b[ 5] + a[ 6]*b[ 6] + a[ 7]*b[ 7] + +a[ 8]*b[ 8] + a[ 9]*b[ 9] + a[10]*b[10] + a[11]*b[11] + +a[12]*b[12] + a[13]*b[13] + a[14]*b[14] + a[15]*b[15]; +} + +int experiment ( generator_t* const g, + amplitude_t* const a, + keyboard_t* const k, + soundcard_t* const s, + earmode_t earmode ) +{ + long i; + int j; + stereo_t samples [512]; + static double quant_errors [2] [16]; + long double val; + double ampl; + long ival; + + fprintf ( stderr, "\r+++ up +++" ); + for ( i = 0; i < g->duration; i += sizeof(samples)/sizeof(*samples) ) { + fprintf ( stderr, "%3lu%%\b\b\b\b", i*100lu/g->duration ); + + for (j = 0; j < sizeof(samples)/sizeof(*samples); j++ ) { + ampl = iterate_amplifier (a) * ATH (frequency (g)); + val = ampl * iterate_generator (g); + ival = (long) floor ( val + 0.5 + scalar (quant_errors[0], s->dither) ); + + if ( ival != (sample_t) ival ) { + report (g, a); + fprintf ( stderr, "\rOverrun \n\n" ); + return -1; + } + memmove ( & quant_errors [0] [1], & quant_errors [0] [0], + sizeof(quant_errors[0]) - sizeof(quant_errors[0][0]) ); + quant_errors [0] [0] = val - ival; + switch ( earmode ) { + case both: + samples [j] [0] = samples [j] [1] = ival; + break; + case left: + samples [j] [0] = ival; + samples [j] [1] = 0; + break; + case right: + samples [j] [0] = 0; + samples [j] [1] = ival; + break; + case phase180: + samples [j] [0] = ival == -32768 ? 32767 : -ival; + samples [j] [1] = +ival; + break; + case phase90: + samples [j] [0] = ival; + val = ampl * get_cosine (g); + ival = (long) floor ( val + 0.5 + scalar (quant_errors[1], s->dither) ); + if ( ival != (sample_t) ival ) { + report (g, a); + fprintf ( stderr, "\rOverrun \n\n" ); + return -1; + } + memmove ( & quant_errors [1] [1], & quant_errors [1] [0], + sizeof(quant_errors[1]) - sizeof(quant_errors[1][0]) ); + quant_errors [1] [0] = val - ival; + samples [j] [1] = ival; + break; + default: + assert (0); + return -1; + } + } + play_soundcard ( s, samples, sizeof(samples)/sizeof(*samples) ); + if ( amplitude (a) * ATH (frequency (g)) <= 3.16227766e-6 ) { + report (g, a); + fprintf ( stderr, "\rUnderrun \n\n" ); + return -1; + } + + switch ( getchar_keyboard (k) ) { + case '+': + fprintf ( stderr, "\r+++ up +++" ); + report (g, a); + change_direction ( a, up ); + break; + case '-': + fprintf ( stderr, "\r--- down ---" ); + report (g, a); + change_direction ( a, down ); + break; + case '\r': + case '\n': + fprintf ( stderr, "\r** change **" ); + report (g, a); + change_direction ( a, change ); + break; + case 'C'&0x1F: + case 'q': + case 'Q': + case 'x': + case 'X': + fprintf ( stderr, "\rBreak \n\n" ); + fflush ( stderr ); + return -1; + default: + fprintf ( stderr, "\a" ); + break; + case -1: + break; + } + } + + fprintf ( stderr, "\rReady \n\n" ); + return 0; +} + +static void usage ( void ) +{ + static const char help[] = + "'Absolute Threshold of Hearing' -- Version 0.07 (C) Frank Klemm 2000\n" + "\n" + "usage:\n" + " ath type minfreq maxfreq duration ampl_speed [start_level [earmode] > reportfile\n" + "\n" + " type: linear, logarithm, square, cubic, erb, recip\n" + " minfreq: initial frequency [Hz]\n" + " maxfreq: end frequency [Hz]\n" + " duration: duration of the experiment [s]\n" + " ampl_speed: amplitude slope speed [phon/s]\n" + " start_level: absolute level at startup [0...1]\n" + " earmode: left, right, both, phase90, phase180\n" + "\n" + "example:\n" + " ath erb 700 22000 600 3 0.0001 > result1\n" + " ath erb 1400 16 360 3 0.0001 > result2\n" + "\n" + "handling:\n" + " press '-' once when you start hearing a tone\n" + " press '+' once when you stop hearing a tone\n" + " press 'q' to early leave the program\n" + " on errors the pressed key is ignored\n"; + + fprintf ( stderr, "%s\n", help ); +} + +int main ( int argc, char** argv ) +{ + generator_t g; + amplitude_t a; + soundcard_t s; + keyboard_t k; + genmode_t genmode; + earmode_t earmode; + + if ( argc == 1 ) { + usage (); + system ( "./ath erb 700 22000 600 3 0.0001 > result1" ); + system ( "./ath erb 1400 16 360 3 0.0001 > result2" ); + system ( "xmgr result1 result2 &> /dev/null &" ); + return 0; + } + + if ( argc < 6 ) { + usage (); + return 1; + } + + if ( 0 == strncmp ( argv[1], "li" , 2) ) genmode = linear; + else if ( 0 == strncmp ( argv[1], "lo" , 2) ) genmode = logarithm; + else if ( 0 == strncmp ( argv[1], "sq" , 2) ) genmode = square; + else if ( 0 == strncmp ( argv[1], "cu" , 2) ) genmode = cubic; + else if ( 0 == strncmp ( argv[1], "er" , 2) ) genmode = erb; + else if ( 0 == strncmp ( argv[1], "re" , 2) ) genmode = recip; + else { + usage (); + return 1; + } + + if ( argc < 8 ) earmode = both; + else if ( 0 == strncmp ( argv[7], "le" , 2) ) earmode = left; + else if ( 0 == strncmp ( argv[7], "ri" , 2) ) earmode = right; + else if ( 0 == strncmp ( argv[7], "bo" , 2) ) earmode = both; + else if ( 0 == strncmp ( argv[7], "phase9" , 6) ) earmode = phase90; + else if ( 0 == strncmp ( argv[7], "phase1" , 6) ) earmode = phase180; + else { + usage (); + return 1; + } + + + open_soundcard ( &s, AUDIO_DEVICE, sizeof(stereo_t)/sizeof(sample_t), CHAR_BIT*sizeof(sample_t), 96000.0 ); + open_generator ( &g, &s, genmode, atof (argv[4]), atof (argv[2]), atof (argv[3]) ); + open_amplifier ( &a, &s, argc > 6 ? atof (argv[6]) : 0.0001, atof (argv[5]) ); + open_keyboard ( &k ); + + report_open ( ); + experiment ( &g, &a, &k, &s, earmode ); + report_close ( ); + + close_keyboard ( &k ); + close_amplifier( &a ); + close_generator( &g ); + close_soundcard( &s ); + + return 0; +} + +/* end of ath.c */ + + diff --git a/node_modules/lame/deps/lame/misc/auenc b/node_modules/lame/deps/lame/misc/auenc new file mode 100755 index 0000000..50d9c81 --- /dev/null +++ b/node_modules/lame/deps/lame/misc/auenc @@ -0,0 +1,39 @@ +#!/bin/sh +# +# auenc -- version 0.1 +# +# A wrapper for lame to encode multiple files. By default, a .wav +# extension is removed and replaced by .mp3 . +# +# (C) 1999 Gerhard Wesp under the GPL. + +# set the variables below according to your taste +LAME=lame +LAME_OPTS="-S -h -v -V 0 -b 256" # high quality, silent operation + +if [ $# -lt 1 ] ; then + exec 1>&2 + cat << _EOF_ +usage: $0 [options] file... +options: + -d --delete: delete original file after successful encoding +_EOF_ + exit 1 +fi + +unset DELETE +case "$1" in + -d | --delete ) DELETE=1 ; shift ;; +esac + +for f +do + $LAME $LAME_OPTS "$f" `basename "$f" .wav`.mp3 || { + exec 1>&2 + echo "encoding of $f failed, aborting..." + exit 1 + } + if [ -n "$DELETE" ] ; then + rm -f "$f" + fi +done diff --git a/node_modules/lame/deps/lame/misc/depcomp b/node_modules/lame/deps/lame/misc/depcomp new file mode 100755 index 0000000..df8eea7 --- /dev/null +++ b/node_modules/lame/deps/lame/misc/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/node_modules/lame/deps/lame/misc/lame4dos.bat b/node_modules/lame/deps/lame/misc/lame4dos.bat new file mode 100644 index 0000000..b15cb3e --- /dev/null +++ b/node_modules/lame/deps/lame/misc/lame4dos.bat @@ -0,0 +1,41 @@ +@echo off +rem --------------------------------------------- +rem PURPOSE: +rem - put this Batch-Command on your Desktop, +rem so you can drag and drop wave files on it +rem and LAME will encode them to mp3 format. +rem - put this Batch-Command in a place mentioned +rem in your PATH environment, start the DOS-BOX +rem and change to a directory where your wave +rem files are located. the following line will +rem encode all your wave files to mp3 +rem "lame.bat *.wav" +rem --------------------------------------------- +rem C2000 Robert Hegemann +rem --------------------------------------------- +rem Changes to support long filenames using 4DOS +rem by Alexander Stumpf +rem --------------------------------------------- +rem please set LAME and LAMEOPTS +rem LAME - where the executeable is +rem OPTS - options you like LAME to use + + set LAME=c:\progra~1\sound&~1\lame\lame.exe + set OPTS=-h --lowpass-width 2 --lowpass 20.5 -b 112 --abr 180 + +rem --------------------------------------------- + + set thecmd=%LAME% %OPTS% + for %%f in (%&) do (%thecmd% %@sfn[%%f]^(ren %@sfn[%%f].mp3 "%@lfn[%%f].mp_">NUL)) + ren *.mp3.mp_ *.new.mp3 >& NUL + ren *.wav.mp_ *.mp3 >& NUL + goto endmark +:errormark + echo. + echo. + echo ERROR processing %1 + echo. +:endmark +rem +rem finished +rem diff --git a/node_modules/lame/deps/lame/misc/lameGUI.html b/node_modules/lame/deps/lame/misc/lameGUI.html new file mode 100644 index 0000000..db90fd0 --- /dev/null +++ b/node_modules/lame/deps/lame/misc/lameGUI.html @@ -0,0 +1,403 @@ + + + + + +Lame + + + + + + + +
+

LAME Frontend

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fixed Bitrate 
bitrate (-b) high quality (-h)
 fast (no noise shaping)
  
Variable Bitrate 
variable + bitrate (-v)VBR quality (-V)
maximum bitrate (-B) enforce min. bitrate (-F)
  
General 
mode (-m) disable all filters (-k)
copyrighted (-c)non-original (-o)
  
ID3-Tag 
title (--tt) artist (--ta)
album (--tl) year (--ty) track (--tn)
comment (--tc) genre (--tg)
   
+
+ + + + + + +
[LAME HELP] [LAME Readme] [LAME History] [LAME + Homepage] 
+ + diff --git a/node_modules/lame/deps/lame/misc/lameid3.pl b/node_modules/lame/deps/lame/misc/lameid3.pl new file mode 100644 index 0000000..5352877 --- /dev/null +++ b/node_modules/lame/deps/lame/misc/lameid3.pl @@ -0,0 +1,55 @@ +# +# From: Per Bolmstedt +# +# AC> If someone has scripts that read input ID3 tags and convert +# AC> them to args for lame (which then encodes the tags into the +# AC> output files), let me know, too! +# +# This is easy peasy using Perl. Especially using Chris Nandor's excellent +# MP3::Info package (available on CPAN). Here's a program I just wrote that +# I think does what you want. Invoke it with " [options]" +# (where the options can include an output filename), like for example: +# +# lameid3.pl HQ.mp3 LQ.mp3 -fv +# +# (Note how the syntax differs from that of Lame's.) The program will +# extract ID3 tags from the input file and invoke Lame with arguments for +# including them. (This program has not undergone any real testing..) + +use MP3::Info; +use strict; + +my %flds = ( + TITLE => 'tt', + ARTIST => 'ta', + ALBUM => 'tl', + YEAR => 'ty', + COMMENT => 'tc', + GENRE => 'tg', + TRACKNUM => 'tn' + ); + +my $f = shift @ARGV; +my $s = "lame ${f} " . &makeid3args( $f ) . join ' ', @ARGV; +print STDERR "[${s}]\n"; +system( $s ); + +sub makeid3args( $ ) +{ + my $s; + if ( my $tag = get_mp3tag( @_->[ 0 ] ) ) + { + for ( keys %flds ) + { + if ( $tag->{ $_ } ) + { + $s .= sprintf( + "--%s \"%s\" ", + %flds->{ $_ }, + $tag->{ $_ } ); + } + } + } + return $s || ""; +} + diff --git a/node_modules/lame/deps/lame/misc/mk_mp3.sh b/node_modules/lame/deps/lame/misc/mk_mp3.sh new file mode 100644 index 0000000..36b7b1b --- /dev/null +++ b/node_modules/lame/deps/lame/misc/mk_mp3.sh @@ -0,0 +1,170 @@ +### (c)2000-2011 Robert Hegemann +### +### ///-/ +### +### SRC_ROOT : where the CD are located +### DST_ROOT : where newly encoded tracks should go +### DONE_ROOT : where verified encoded tracks are located +### LAME_EXE : points to program +### LAME_OPT : what options to use +################################################################ +_V=2 +SRC_ROOT=/windows/W/CD +DST_ROOT=/windows/Z/mp3v${_V}wg +DONE_ROOT=/windows/Z/mp3v${_V}wg +LAME_EXE=lame-399 +LAME_OPT="-V${_V} --quiet --noreplaygain --id3v2-only" + +SKIP_DONE_FOLDER_EXISTS=1 +SKIP_DEST_FOLDER_EXISTS=1 +SCAN_ALBUM_GAIN_ONLY=0 + +case "$0" in + mk_album_gain.sh) SCAN_ALBUM_GAIN_ONLY=1;; +esac +case "$1" in + --scan-gain-only) SCAN_ALBUM_GAIN_ONLY=1;; +esac +if [ $SCAN_ALBUM_GAIN_ONLY = 1 ] +then + SKIP_DONE_FOLDER_EXISTS=0 + SKIP_DEST_FOLDER_EXISTS=0 +fi + +if (test -e "${SRC_ROOT}") +then + if test -e "${DST_ROOT}" + then + : + else + mkdir "${DST_ROOT}" + fi + + for _artist in "${SRC_ROOT}"/* + do + _ARTIST=$(basename "${_artist}") + DST_ARTIST=${DST_ROOT}/${_ARTIST} + DS2_ARTIST=${DONE_ROOT}/${_ARTIST} + echo "${_ARTIST}" + + VARIOUS_ARTISTS_MODE=0 + case "${_ARTIST}" in + "Various" | "Various Artists" ) + VARIOUS_ARTISTS_MODE=1 + ID3_ALBUM_ARTIST="Various Artists" + ;; + "Musik Express" ) + VARIOUS_ARTISTS_MODE=2 + ID3_ALBUM_ARTIST="Various (ME)" + ;; + *) + VARIOUS_ARTISTS_MODE=0 + ID3_ALBUM_ARTIST=${_ARTIST} + ;; + esac + + for _cd in "${_artist}"/* + do + _CD=$(basename "${_cd}") + DST_CD=${DST_ARTIST}/${_CD} + DS2_CD=${DS2_ARTIST}/${_CD} + ID3_YR=`echo "${_CD}"|cut -b 1-4` + ID3_CD=`echo "${_CD}"|cut -b 6-` + if [ $SKIP_DONE_FOLDER_EXISTS = 1 ] + then + if test -e "${DS2_CD}" + then + continue + fi + fi + if [ $SKIP_DEST_FOLDER_EXISTS = 1 ] + then + if test -e "${DST_CD}" + then + continue + fi + fi + echo "${_ARTIST} / ${_CD}" + + ALBUM_GAIN="1.0" + if test -e "${_cd}/album_gain_scale.txt" + then + ALBUM_GAIN=`cat "${_cd}/album_gain_scale.txt"` + elif test -e "${DS2_CD}/album_gain_scale.txt" + then + ALBUM_GAIN=`cat "${DS2_CD}/album_gain_scale.txt"` + elif test -e "${DST_CD}/album_gain_scale.txt" + then + ALBUM_GAIN=`cat "${DST_CD}/album_gain_scale.txt"` + else + unset ALBUM_GAIN + fi + if [ "${ALBUM_GAIN}" = "" ] + then + if test -e "${DST_ARTIST}" + then + : + else + mkdir "${DST_ARTIST}" + fi + if test -e "${DST_CD}" + then + : + else + mkdir "${DST_CD}" + fi + ALBUM_GAIN=`wavegain -x -a "${_cd}"/ 2>/dev/null` + echo ${ALBUM_GAIN} > "${DST_CD}/album_gain_scale.txt" + fi + if [ $SCAN_ALBUM_GAIN_ONLY = 1 ] + then + continue + fi + + for _song in "${_cd}"/*.wav + do + _SONG=$(basename "${_song}" .wav) + DST_SONG=${DST_CD}/$(basename "${_song}" .wav).mp3 + if test -e "${DST_SONG}" + then + : + else + if test -e "${DST_ARTIST}" + then + : + else + mkdir "${DST_ARTIST}" + fi + if test -e "${DST_CD}" + then + : + else + mkdir "${DST_CD}" + fi + ID3_TRACK=`echo "${_SONG}"|cut -b 1-2` + if [ $VARIOUS_ARTISTS_MODE = 0 ] + then + ID3_TITLE=`echo "${_SONG}"|cut -b 4-` + ID3_TRACK_ARTIST=${_ARTIST} + else + ID3_TITLE=`echo "${_SONG% - *}"|cut -b 4-` + ID3_TRACK_ARTIST=`echo "${_SONG#* - }"` + fi + ${LAME_EXE} ${LAME_OPT} \ + --scale ${ALBUM_GAIN} \ + --ta "${ID3_TRACK_ARTIST}" \ + --tl "${ID3_CD}" \ + --ty "${ID3_YR}" \ + --tt "${ID3_TITLE}" \ + --tn "${ID3_TRACK}" \ + --tv "TXXX=ALBUM ARTIST=${ID3_ALBUM_ARTIST}" \ + --tv "TXXX=LAME SCALE=${ALBUM_GAIN}" \ + "${_song}" "${DST_SONG}" & + fi + done + wait + done + done +else + echo Quellverzeichnis ${SRC_ROOT} existiert nicht. +fi diff --git a/node_modules/lame/deps/lame/misc/mlame b/node_modules/lame/deps/lame/misc/mlame new file mode 100755 index 0000000..23beab5 --- /dev/null +++ b/node_modules/lame/deps/lame/misc/mlame @@ -0,0 +1,195 @@ +#!/bin/sh + +############################################################################ +# +# Run the LAME encoder on multiple files, with option to delete .wav files +# after encoding. "mlame -?" will give instructions. +# +# Robert Hegemann +# modified on request: Frank Klemm <pfk@uni-jena.de> +# +############################################################################ + +# encoder path to use +mp3coder="lame" +mp3analyzer="mlame_corr" + +# default options to use +options_low="-h -d -mj -b 128" +options_high="-h -d -mj -V 1 -b 112 -B 320" +options=$options_high + +# remove source? +removesource=false + +# force overwrite of destination +testoverwrite=true + +# waiting after error report n seconds +errordelay=1 + +helptext="\n\ +This script runs the LAME mp3 encoder on multiple files: \n\n\ + $0 [options] <file 1> ... <file n>\n\ +\n\ + options:\n\ + -? this help text\n\ + -r remove files after encoding\n\ + -f force overwrite of destination if exists\n\ + -l low quality settings\n\ + -h high quality settings\n\ + -o \"<lame options>\" overrides script default options +\n\ + example:\n\ + $0 -r -f -o \"-v -V 0 -b 112\" a*.wav z*.aif g*.mp?\n\ +\n\ +" + +# process command-line options +# this could be extended to fake the +# commandline interface of the mp3encoder + +while getopts ":o:r:h:l:f" optn; do + case $optn in + o ) options=$OPTARG # replace default options + echo New lame options are \'$options\' + ;; + r ) removesource=true + echo Removing source files after successfully converting + ;; + f ) testoverwrite=false + echo Force overwriting existing destination files + ;; + h ) options=$options_high + ;; + l ) options=$options_low + ;; + \? ) printf "$helptext" + sleep $errordelay + exit 1 + ;; + esac +done +shift $(($OPTIND - 1)) + +# no files remaining? + +if [ "$1" = "" ]; then + printf "$helptext" + sleep $errordelay + exit 1 +fi + +# process input-files + +for src in "$@"; do + + case $src in + *[.][wW][aA][vV] ) + dst=${src%[.][wW][aA][vV]}.mp3 + if [ -f "$src" ]; then + if [ $testoverwrite = true -a -f "$dst" ]; then + echo \'$dst\' already exists, skipping + sleep $errordelay + elif $mp3coder $options `$mp3analyzer "$src"` "$src" "$dst"; then + if [ $removesource = true ]; then + rm -f "$src" + fi + else + echo converting of \'$src\' to \'$dst\' failed + sleep $errordelay + fi + else + echo No source file \'$src\' found. + sleep $errordelay + fi + ;; + + *[.][aA][iI][fF] ) + dst=${src%[.][aA][iI][fF]}.mp3 + if [ -f "$src" ]; then + if [ $testoverwrite = true -a -f "$dst" ]; then + echo \'$dst\' already exists, skipping + sleep $errordelay + elif $mp3coder $options "$src" "$dst"; then + if [ $removesource = true ]; then + rm -f "$src" + fi + else + echo converting of \'$src\' to \'$dst\' failed + sleep $errordelay + fi + else + echo No source file \'$src\' found. + sleep $errordelay + fi + ;; + + *[.][aA][iI][fF][fF] ) + dst=${src%[.][aA][iI][fF][fF]}.mp3 + if [ -f "$src" ]; then + if [ $testoverwrite = true -a -f "$dst" ]; then + echo \'$dst\' already exists, skipping + sleep $errordelay + elif $mp3coder $options "$src" "$dst"; then + if [ $removesource = true ]; then + rm -f "$src" + fi + else + echo converting of \'$src\' to \'$dst\' failed + sleep $errordelay + fi + else + echo No source file \'$src\' found. + sleep $errordelay + fi + ;; + + *[.][mM][pP][gG12] ) + dst=${src%[.][mM][pP][gG12]}.mp3 + if [ -f "$src" ]; then + if [ $testoverwrite = true -a -f "$dst" ]; then + echo \'$dst\' already exists, skipping + sleep $errordelay + elif $mp3coder $options "$src" "$dst"; then + if [ $removesource = true ]; then + rm -f "$src" + fi + else + echo converting of \'$src\' to \'$dst\' failed + sleep $errordelay + fi + else + echo No source file \'$src\' found. + sleep $errordelay + fi + ;; + + *[.][mM][pP]3 ) + dst=${src%[.][mM][pP]3}-new-converted-file.${src##*.} + if [ -f "$src" ]; then + if [ $testoverwrite = true -a -f "$dst" ]; then + echo \'$dst\' already exists, skipping + sleep $errordelay + elif $mp3coder $options "$src" "$dst"; then + if [ $removesource = true ]; then + mv -f "$dst" "$src" + fi + else + echo converting of \'$src\' to \'$dst\' failed + sleep $errordelay + fi + else + echo No source file \'$src\' found. + sleep $errordelay + fi + ;; + + * ) # the rest + echo warning: File extention \'.${src##*.}\' not supported + sleep $errordelay + ;; + + esac + +done diff --git a/node_modules/lame/deps/lame/misc/mlame_corr.c b/node_modules/lame/deps/lame/misc/mlame_corr.c new file mode 100644 index 0000000..4305b63 --- /dev/null +++ b/node_modules/lame/deps/lame/misc/mlame_corr.c @@ -0,0 +1,220 @@ +/* + Bug: + - runs only on little endian machines for WAV files + - Not all WAV files are recognized + */ + +#include <stdio.h> +#include <unistd.h> +#include <math.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <memory.h> + +typedef signed short stereo [2]; +typedef signed short mono; +typedef struct { + unsigned long long n; + long double x; + long double x2; + long double y; + long double y2; + long double xy; +} korr_t; + +void analyze_stereo ( const stereo* p, size_t len, korr_t* k ) +{ + long double _x = 0, _x2 = 0, _y = 0, _y2 = 0, _xy = 0; + double t1; + double t2; + + k -> n += len; + + for ( ; len--; p++ ) { + _x += (t1 = (*p)[0]); _x2 += t1 * t1; + _y += (t2 = (*p)[1]); _y2 += t2 * t2; + _xy += t1 * t2; + } + + k -> x += _x ; + k -> x2 += _x2; + k -> y += _y ; + k -> y2 += _y2; + k -> xy += _xy; +} + +void analyze_dstereo ( const stereo* p, size_t len, korr_t* k ) +{ + static double l0 = 0; + static double l1 = 0; + long double _x = 0, _x2 = 0, _y = 0, _y2 = 0, _xy = 0; + double t1; + double t2; + + k -> n += len; + + for ( ; len--; p++ ) { + _x += (t1 = (*p)[0] - l0); _x2 += t1 * t1; + _y += (t2 = (*p)[1] - l1); _y2 += t2 * t2; + _xy += t1 * t2; + l0 = (*p)[0]; + l1 = (*p)[1]; + } + + k -> x += _x ; + k -> x2 += _x2; + k -> y += _y ; + k -> y2 += _y2; + k -> xy += _xy; +} + + +void analyze_mono ( const mono* p, size_t len, korr_t* k ) +{ + long double _x = 0, _x2 = 0; + double t1; + + k -> n += len; + + for ( ; len--; p++ ) { + _x += (t1 = (*p)); _x2 += t1 * t1; + } + + k -> x += _x ; + k -> x2 += _x2; + k -> y += _x ; + k -> y2 += _x2; + k -> xy += _x2; +} + +void analyze_dmono ( const mono* p, size_t len, korr_t* k ) +{ + static double l0 = 0; + long double _x = 0, _x2 = 0; + double t1; + + k -> n += len; + + for ( ; len--; p++ ) { + _x += (t1 = (*p) - l0); _x2 += t1 * t1; + l0 = *p; + } + + k -> x += _x ; + k -> x2 += _x2; + k -> y += _x ; + k -> y2 += _x2; + k -> xy += _x2; +} + +int sgn ( long double x ) +{ + if ( x > 0 ) return +1; + if ( x < 0 ) return -1; + return 0; +} + +int report ( const korr_t* k ) +{ + long double scale = sqrt ( 1.e5 / (1<<29) ); // Sine Full Scale is +10 dB, 7327 = 100% + long double r; + long double rd; + long double sx; + long double sy; + long double x; + long double y; + long double b; + + r = (k->x2*k->n - k->x*k->x) * (k->y2*k->n - k->y*k->y); + r = r > 0.l ? (k->xy*k->n - k->x*k->y) / sqrt (r) : 1.l; + sx = k->n > 1 ? sqrt ( (k->x2 - k->x*k->x/k->n) / (k->n - 1) ) : 0.l; + sy = k->n > 1 ? sqrt ( (k->y2 - k->y*k->y/k->n) / (k->n - 1) ) : 0.l; + x = k->n > 0 ? k->x/k->n : 0.l; + y = k->n > 0 ? k->y/k->n : 0.l; + + b = atan2 ( sy, sx * sgn (r) ) * ( 8 / M_PI); + +// 6 5 4 3 2 +// _______________________________ +// |\ | /| +// 7 | \ | / | 1 +// | \ | / | +// | \ | / | +// | \ | / | +// 8 |--------------+--------------| 0 +// | / | \ | +// | / | \ | +// -7 | / | \ | -1 +// | / | \ | +// |/_____________|_____________\| +// +// -6 -5 -4 -3 -2 + + if ( r > 0.98 ) { + printf ("-mm"); // disguised mono file + return; + } + if ( fabs (b-2) > 0.666 ) { + printf ("-ms"); // low profit for joint stereo + return; + } + if ( r < 0.333 ) { + printf ("-ms"); // low profit for joint stereo + return; + } +} + +void readfile ( const char* name, int fd ) +{ + unsigned short header [22]; + stereo s [4096]; + mono m [8192]; + size_t samples; + korr_t k0; + korr_t k1; + + memset ( &k0, 0, sizeof(k0) ); + memset ( &k1, 0, sizeof(k1) ); + + read ( fd, header, sizeof(header) ); + + switch ( header[11] ) { + case 1: + printf ("-mm\n"); + break; + + case 2: + while ( ( samples = read (fd, s, sizeof(s)) ) > 0 ) { + analyze_stereo ( s, samples / sizeof (*s), &k0 ); + analyze_dstereo ( s, samples / sizeof (*s), &k1 ); + } + report (&k0); + report (&k1); + break; + + default: + fprintf ( stderr, "%u Channels not supported: %s\n", header[11], name ); + break; + } +} + +int main ( int argc, char** argv ) +{ + char* name; + int fd; + + if (argc < 2) + readfile ( "<stdin>", 0 ); + else + while ( (name = *++argv) != NULL ) { + if ( (fd = open ( name, O_RDONLY )) >= 0 ) { + readfile ( name, fd ); + close ( fd ); + } else { + fprintf ( stderr, "Can't open: %s\n", name ); + } + } + + return 0; +} diff --git a/node_modules/lame/deps/lame/misc/mugeco.sh b/node_modules/lame/deps/lame/misc/mugeco.sh new file mode 100755 index 0000000..6be2774 --- /dev/null +++ b/node_modules/lame/deps/lame/misc/mugeco.sh @@ -0,0 +1,137 @@ +#!/bin/sh +progname=mugeco version=0.1 +programr='Alexander Leidinger' +progdate='7 Dec 2000' +progdesc='MUltiGEnerationCOding' +# NEEDS: getopt, lame +# Please have a look at the DEFAULTS section. + +# $Id: mugeco.sh,v 1.6 2000/12/08 13:47:56 aleidinger Exp $ + +usage() { +cat << EOF +** $progname v$version, $progdate ** +by $programr +$progdesc +usage: $progname [ <flags> ] -g <num> <file> + -v use builtin VBR options + -g <num> number of generations + -h help + + used + - env vars: + * LAME : alternative encoder binary + * LAMEOPT: alternative encoder options + - VBR opts: $enc_vbr_opts + - CBR opts: $enc_cbr_opts +EOF +} + +# DEFAULTS + +# if you can, use getopt(1) (c)1997 by Frodo Looijaard <frodol@dds.nl> +# it's in most modern unixen, or look at http://huizen.dds.nl/~frodol/ +: ${GETOPT=getopt} # helper program +# mktemp (optional) is also in most modern unixen (originally from OpenBSD) +: ${MKTEMP=mktemp} # helper program +: ${TMPDIR:=/tmp} # set default temp directory +: ${LAME:=lame} # path to LAME + +enc_cbr_opts="-b192 -h --lowpass 18 --lowpass-width 0" +enc_vbr_opts="--vbr-mtrh --nspsytune -v -h -d -Y -X3" +enc_opts=${LAMEOPT:-$enc_cbr_opts} +num= # default number of generations + +# DEFINE FUNCTIONS + +e() { echo "$progname: $*"; } +die() { # usage: die [ <exitcode> [ <errormessage> ] ] + trap '' 1 2 3 13 15 + exitcode=0 + [ $# -gt 0 ] && { exitcode=$1; shift; } + [ $# -gt 0 ] && e "Error: $*" >&2 + exit $exitcode +} + +# tfile() +# this function creates temporary files. 'tfile temp' will make a tempfile +# and put the path to it in the variable $temp (defaults to variable $tf) +trap 'for f in $ztfiles; do rm -f "$f"; done' 0 +trap 'trap "" 1 2 3 13 15; exit 10' 1 2 3 13 15 +unset ztfiles +tfile() { # usage: tfile <variable_name> + ztf=`$MKTEMP -q $TMPDIR/$progname.XXXXXX 2>/dev/null` # try mktemp + if [ $? -gt 0 -o -z "$ztf" ]; then # if mktemp fails, do it unsafely + ztf=$TMPDIR/$LOGNAME.$progname.$$ + [ -e "$ztf" ] && ztf= || { touch $ztf && chmod 600 $ztf; } + fi + [ "$ztf" -a -f "$ztf" ] || { echo Could not make tempfile; exit 8; } + ztfiles="$ztfiles $ztf" + eval ${1:-tf}='$ztf' +} + +# PARSE COMMAND LINE + +options="g:vh" # option string for getopt(1) +help=; [ "$1" = -h -o "$1" = -help -o "$1" = --help ] && help=yes +[ "$help" ] && { usage; die; } +$GETOPT -T >/dev/null 2>&1 +[ $? -eq 4 ] && GETOPT="$GETOPT -n $progname -s sh" #frodol's getopt? +eval set -- `$GETOPT "$options" "$@"` +[ $# -lt 1 ] && { die 9 getopt failed; } +while [ $# -gt 0 ]; do + case "$1" in + -g) num=$2; shift ;; + -v) enc_opts=$enc_cbr_opts ;; + -h) help=y ;; + --) shift; break ;; + *) usage; die 9 "invalid command line syntax!" ;; + esac + shift +done +[ "$help" ] && { usage; die; } +[ $# -eq 0 ] && { usage; die 9 no arguments; } #change or remove if desired +# sanity checking +[ "$num" ] && echo "$num"|grep -q '^[0-9]*$' && [ $num -ge 1 ] \ + || die 1 please use the -g flag with a valid number + +# MAIN PROGRAM + +# what version of lame are we using? +lame_vers=`$LAME 2>&1 | awk 'NR==1{print $3}'` + +# check filename +[ -f "$1" ] || die 2 "'$1' isn't a file" +echo "$1"|grep -qi '\.wav$' || die 2 "'$1' isn't a .wav" + +# make tempfiles +base=`echo "$1"|sed 's/\.[^.]*$//'` +dest=${base}_generation_$num.wav +[ -e "$dest" ] && die 2 "'$dest' already exists" +touch "$dest" || die 2 "couldn't create '$dest'" +TMPDIR=. tfile tmpwav +TMPDIR=. tfile tmpmp3 +cp -f "$1" "$tmpwav" + +# do the loop +start=`date` +i=1 +while [ $i -le $num ]; do + e "Working on file '$1', generation number $i..." + + $LAME $enc_opts --tc "lame $lame_vers; Generation: $i" \ + "$tmpwav" "$tmpmp3" || die 3 encoding failed + $LAME --decode --mp3input "$tmpmp3" "$tmpwav" || die 3 decoding failed + + i=`expr $i + 1` +done +end=`date` + +# save the result +ln -f "$tmpwav" "$dest" + +echo +e "Start: $start" +e "Stop : $end" + +die diff --git a/node_modules/lame/deps/lame/misc/scalartest.c b/node_modules/lame/deps/lame/misc/scalartest.c new file mode 100644 index 0000000..01680d0 --- /dev/null +++ b/node_modules/lame/deps/lame/misc/scalartest.c @@ -0,0 +1,166 @@ +#include <stdio.h> +#include <math.h> +#include <asm/msr.h> +#include "resample.h" + +#define CLK 300.e6 +#define LOOPS 20000 + + +typedef double ( *ddf ) ( double ); + + +float a1 [256]; +float a2 [256]; + +void init ( void ) +{ + int i; + + for ( i = 0; i < sizeof(a1)/sizeof(*a1); i++ ) { + a1 [i] = sin(i)+0.2*sin(1.8*i)+log(2+i); + a2 [i] = cos(0.1*i); + } +} + +void test ( int no, scalar_t f ) +{ + unsigned long long t1; + unsigned long long t2; + unsigned long long t3; + unsigned long long t4; + int l; + double last = 0; + double curr = 0; + + printf ( "[%3u] %22.14f\t\t", no, (double)f (a1,a2) ); + fflush ( stdout ); + + do { + rdtscll (t1); + l = LOOPS; + do + ; + while (--l); + rdtscll (t2); + rdtscll (t3); + l = LOOPS; + do + f(a1,a2), f(a1,a2), f(a1,a2), f(a1,a2); + while (--l); + rdtscll (t4); + last = curr; + curr = (t4-t3-t2+t1) / CLK / LOOPS / 4 * 1.e9; + } while ( fabs(curr-last) > 1.e-4 * (curr+last) ); + printf ("%8.2f ns\n", (curr+last) / 2 ); +} + +void testn ( scalarn_t f ) +{ + unsigned long long t1; + unsigned long long t2; + unsigned long long t3; + unsigned long long t4; + int l; + int i; + double last = 0; + double curr = 0; + + for ( i = 1; i <= 64; i += i<6 ? 1 : i<8 ? 2 : i ) { + printf ( "[%3u] %22.14f\t\t", 4*i, (double)f (a1,a2,i) ); + fflush ( stdout ); + + do { + rdtscll (t1); + l = LOOPS; + do + ; + while (--l); + rdtscll (t2); + rdtscll (t3); + l = LOOPS; + do + f(a1,a2,i), f(a1,a2,i), f(a1,a2,i), f(a1,a2,i); + while (--l); + rdtscll (t4); + last = curr; + curr = (t4-t3-t2+t1) / CLK / LOOPS / 4 * 1.e9; + } while ( fabs(curr-last) > 1.e-4 * (curr+last) ); + printf ("%8.2f ns\n", (curr+last) / 2 ); + } +} + +void test2 ( const char* name, ddf f ) +{ + int i; + double x; + + printf ( "\n%%%% %s\n\n", name ); + + for ( i = -1000; i <= 1000; i++ ) { + x = 1.e-3 * i; + printf ( "%5d\t%12.8f\t%12.8f\t%12.8f\n", i, f(x), (f(x+5.e-5) - f(x-5.e-5))*1.e+4, (f(x+1.e-4) + f(x-1.e-4) - 2*f(x))*5.e+7 ); + } + printf ( "%%%%\n" ); + fflush ( stdout ); +} + + +int main ( int argc, char** argv ) +{ + +#if 0 + + test2 ( "Hann", hanning ); + test2 ( "Hamm", hamming ); + test2 ( "BM", blackman ); + test2 ( "BM1",blackman1 ); + test2 ( "BM2",blackman2 ); + test2 ( "BMH N",blackmanharris_nuttall ); + test2 ( "MNH Min",blackmanharris_min4 ); + +#else + + init (); + + test ( 4, scalar04_float32 ); + test ( 4, scalar04_float32_i387 ); + test ( 4, scalar04_float32_3DNow ); + test ( 4, scalar04_float32_SIMD ); + + test ( 8, scalar08_float32 ); + test ( 8, scalar08_float32_i387 ); + test ( 8, scalar08_float32_3DNow ); + test ( 8, scalar08_float32_SIMD ); + + test ( 12, scalar12_float32 ); + test ( 12, scalar12_float32_i387 ); + test ( 12, scalar12_float32_3DNow ); + test ( 12, scalar12_float32_SIMD ); + + test ( 16, scalar16_float32 ); + test ( 16, scalar16_float32_i387 ); + test ( 16, scalar16_float32_3DNow ); + test ( 16, scalar16_float32_SIMD ); + + test ( 20, scalar20_float32 ); + test ( 20, scalar20_float32_i387 ); + test ( 20, scalar20_float32_3DNow ); + test ( 20, scalar20_float32_SIMD ); + + test ( 24, scalar24_float32 ); + test ( 24, scalar24_float32_i387 ); + test ( 24, scalar24_float32_3DNow ); + test ( 24, scalar24_float32_SIMD ); + + testn( scalar4n_float32 ); + testn( scalar4n_float32_i387 ); + testn( scalar4n_float32_3DNow ); + testn( scalar4n_float32_SIMD ); + +#endif + + return 0; +} + +/* end of scalartest.c */ diff --git a/node_modules/lame/deps/lame/missing b/node_modules/lame/deps/lame/missing new file mode 100755 index 0000000..28055d2 --- /dev/null +++ b/node_modules/lame/deps/lame/missing @@ -0,0 +1,376 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to <bug-automake@gnu.org>." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + tar*) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar*) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/node_modules/lame/deps/lame/mpglib/AUTHORS b/node_modules/lame/deps/lame/mpglib/AUTHORS new file mode 100644 index 0000000..0a6a10b --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/AUTHORS @@ -0,0 +1,16 @@ +Michael Hipp <mh@mpg123.de> Author of orignal mpglib version 0.2a. + +Albert L. Faber <afaber@users.sf.net> +Aleksander Korzynski <olcios@users.sf.net> +Alexander Leidinger <aleidinger@users.sf.net> +Frank Klemm <pfk@users.sf.net> +Gabriel Bouvigne <bouvigne@users.sf.net> +Leigh Smith <leighsmith@users.sf.net> +Mark Taylor <markt@users.sf.net> +Myers Carpenter <myers@users.sf.net> +Naoki Shibata <shibatch@users.sf.net> +Robert Hegemann <robert@users.sf.net> +Sigbjorn Skjaeret <cisc@users.sf.net> +Stefan Bellon <sbellon@users.sf.net> +Steve Lhomme <robux4@users.sf.net> +Takehiro TOMINAGA <takehiro@users.sf.net> diff --git a/node_modules/lame/deps/lame/mpglib/Makefile.am b/node_modules/lame/deps/lame/mpglib/Makefile.am new file mode 100644 index 0000000..b521f20 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/Makefile.am @@ -0,0 +1,55 @@ +## $Id: Makefile.am,v 1.18 2010/10/30 13:21:02 robert Exp $ + +include $(top_srcdir)/Makefile.am.global + +INCLUDES = @INCLUDES@ -I$(top_srcdir)/libmp3lame -I$(top_builddir) + +EXTRA_DIST = \ + AUTHORS \ + README + +DEFS = @DEFS@ @CONFIG_DEFS@ + +noinst_LTLIBRARIES = libmpgdecoder.la + +libmpgdecoder_la_SOURCES = common.c \ + dct64_i386.c \ + decode_i386.c \ + interface.c \ + layer1.c \ + layer2.c \ + layer3.c \ + tabinit.c + +noinst_HEADERS = common.h \ + dct64_i386.h \ + decode_i386.h \ + huffman.h \ + interface.h \ + l2tables.h \ + layer1.h \ + layer2.h \ + layer3.h \ + mpg123.h \ + mpglib.h \ + tabinit.h + +LCLINTFLAGS= \ + +posixlib \ + +showsummary \ + +showalluses \ + +whichlib \ + +forcehints \ + -fixedformalarray \ + +matchanyintegral \ + -Dlint + +lclint.txt: ${libmpgdecoder_la_SOURCES} ${noinst_HEADERS} + @lclint ${LCLINTFLAGS} ${INCLUDES} ${DEFS} ${libmpgdecoder_la_SOURCES} 2>&1 >lclint.txt || true + +lclint: lclint.txt + more lclint.txt + +#$(OBJECTS): libtool +#libtool: $(LIBTOOL_DEPS) +# $(SHELL) $(top_builddir)/config.status --recheck diff --git a/node_modules/lame/deps/lame/mpglib/Makefile.in b/node_modules/lame/deps/lame/mpglib/Makefile.in new file mode 100644 index 0000000..bb97abb --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/Makefile.in @@ -0,0 +1,586 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# global section for every Makefile.am + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +ANSI2KNR = $(top_srcdir)/ansi2knr +DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/Makefile.am.global AUTHORS \ + depcomp +subdir = mpglib +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libmpgdecoder_la_LIBADD = +am_libmpgdecoder_la_OBJECTS = common$U.lo dct64_i386$U.lo \ + decode_i386$U.lo interface$U.lo layer1$U.lo layer2$U.lo \ + layer3$U.lo tabinit$U.lo +libmpgdecoder_la_OBJECTS = $(am_libmpgdecoder_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libmpgdecoder_la_SOURCES) +DIST_SOURCES = $(libmpgdecoder_la_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ @CONFIG_DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ -I$(top_srcdir)/libmp3lame -I$(top_builddir) +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.11 foreign $(top_srcdir)/ansi2knr +EXTRA_DIST = \ + AUTHORS \ + README + +noinst_LTLIBRARIES = libmpgdecoder.la +libmpgdecoder_la_SOURCES = common.c \ + dct64_i386.c \ + decode_i386.c \ + interface.c \ + layer1.c \ + layer2.c \ + layer3.c \ + tabinit.c + +noinst_HEADERS = common.h \ + dct64_i386.h \ + decode_i386.h \ + huffman.h \ + interface.h \ + l2tables.h \ + layer1.h \ + layer2.h \ + layer3.h \ + mpg123.h \ + mpglib.h \ + tabinit.h + +LCLINTFLAGS = \ + +posixlib \ + +showsummary \ + +showalluses \ + +whichlib \ + +forcehints \ + -fixedformalarray \ + +matchanyintegral \ + -Dlint + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mpglib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign mpglib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmpgdecoder.la: $(libmpgdecoder_la_OBJECTS) $(libmpgdecoder_la_DEPENDENCIES) + $(LINK) $(libmpgdecoder_la_OBJECTS) $(libmpgdecoder_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c +$(top_srcdir)/ansi2knr: + $(am__cd) $(top_srcdir) && $(MAKE) $(AM_MAKEFLAGS) ./ansi2knr + +mostlyclean-kr: + -test "$U" = "" || rm -f *_.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_i386$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decode_i386$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layer1$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layer2$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layer3$U.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tabinit$U.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +common_.c: common.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/common.c; then echo $(srcdir)/common.c; else echo common.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +dct64_i386_.c: dct64_i386.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dct64_i386.c; then echo $(srcdir)/dct64_i386.c; else echo dct64_i386.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +decode_i386_.c: decode_i386.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/decode_i386.c; then echo $(srcdir)/decode_i386.c; else echo decode_i386.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +interface_.c: interface.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/interface.c; then echo $(srcdir)/interface.c; else echo interface.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +layer1_.c: layer1.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/layer1.c; then echo $(srcdir)/layer1.c; else echo layer1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +layer2_.c: layer2.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/layer2.c; then echo $(srcdir)/layer2.c; else echo layer2.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +layer3_.c: layer3.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/layer3.c; then echo $(srcdir)/layer3.c; else echo layer3.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +tabinit_.c: tabinit.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/tabinit.c; then echo $(srcdir)/tabinit.c; else echo tabinit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ +common_.$(OBJEXT) common_.lo dct64_i386_.$(OBJEXT) dct64_i386_.lo \ +decode_i386_.$(OBJEXT) decode_i386_.lo interface_.$(OBJEXT) \ +interface_.lo layer1_.$(OBJEXT) layer1_.lo layer2_.$(OBJEXT) \ +layer2_.lo layer3_.$(OBJEXT) layer3_.lo tabinit_.$(OBJEXT) tabinit_.lo \ +: $(ANSI2KNR) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: $(top_srcdir)/ansi2knr install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + + +# end global section + +lclint.txt: ${libmpgdecoder_la_SOURCES} ${noinst_HEADERS} + @lclint ${LCLINTFLAGS} ${INCLUDES} ${DEFS} ${libmpgdecoder_la_SOURCES} 2>&1 >lclint.txt || true + +lclint: lclint.txt + more lclint.txt + +#$(OBJECTS): libtool +#libtool: $(LIBTOOL_DEPS) +# $(SHELL) $(top_builddir)/config.status --recheck + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/mpglib/README b/node_modules/lame/deps/lame/mpglib/README new file mode 100644 index 0000000..7155d00 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/README @@ -0,0 +1,26 @@ +hip - Hip Isn't a Player +A LGPLed mpeg audio decoding library. + +Based off of Michael Hipp's mpglib 0.2a <http://www.mpg123.de/>, with many +improvements by the lame development team (see AUTHORS). + +The interface to the library is based off of vorbisfile. If you add mp3 +support to your app using this library it should be a snap to add Ogg Vorbis +support as well. + +This isn't as fast as mpg123 will be for decoding as none of it is in +assmbler. + +Seeking currently isn't implemented. + + +From mpglib's orginal README: +============================= + +PLEASE NOTE: This software may contain patented algorithms (at least + patented in some countries). It may be not allowed to sell/use products + based on this source code in these countries. Check this out first! + +COPYRIGHT of MP3 music: + Please note, that the duplicating of copyrighted music without explicit + permission violates the rights of the owner. diff --git a/node_modules/lame/deps/lame/mpglib/common.c b/node_modules/lame/deps/lame/mpglib/common.c new file mode 100644 index 0000000..3cc136b --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/common.c @@ -0,0 +1,359 @@ +/* + * common.c: some common bitstream operations + * + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: common.c,v 1.40 2010/03/22 14:30:19 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <ctype.h> +#include <stdlib.h> +#include <signal.h> + +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif + +#ifdef macintosh +#include <types.h> +#include <stat.h> +#else +#include <sys/types.h> +#include <sys/stat.h> +#endif + +#include <assert.h> + +#include "common.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +/* In C++ the array first must be prototyped, why ? */ + + + /* *INDENT-OFF* */ +const int tabsel_123 [2] [3] [16] = { + { {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,}, + {0,32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,}, + {0,32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,} }, + + { {0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,}, + {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,}, + {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,} } +}; + +const long freqs[9] = { 44100, 48000, 32000, + 22050, 24000, 16000, + 11025, 12000, 8000 }; + + /* *INDENT-ON* */ + + +real muls[27][64]; + +#if 0 +static void +get_II_stuff(struct frame *fr) +{ + /* *INDENT-OFF* */ + static const int translate [3] [2] [16] = /* char ? */ + { { { 0,2,2,2,2,2,2,0,0,0,1,1,1,1,1,0 } , + { 0,2,2,0,0,0,1,1,1,1,1,1,1,1,1,0 } } , + { { 0,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0 } , + { 0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0 } } , + { { 0,3,3,3,3,3,3,0,0,0,1,1,1,1,1,0 } , + { 0,3,3,0,0,0,1,1,1,1,1,1,1,1,1,0 } } }; + /* *INDENT-ON* */ + + int table, sblim; + static const struct al_table2 *tables[5] = { alloc_0, alloc_1, alloc_2, alloc_3, alloc_4 }; + static int sblims[5] = { 27, 30, 8, 12, 30 }; + + if (fr->lsf) + table = 4; + else + table = translate[fr->sampling_frequency][2 - fr->stereo][fr->bitrate_index]; + sblim = sblims[table]; + + fr->alloc = tables[table]; + fr->II_sblimit = sblim; +} +#endif + +#define HDRCMPMASK 0xfffffd00 + +#define MAX_INPUT_FRAMESIZE 4096 + +int +head_check(unsigned long head, int check_layer) +{ + /* + look for a valid header. + if check_layer > 0, then require that + nLayer = check_layer. + */ + + /* bits 13-14 = layer 3 */ + int nLayer = 4 - ((head >> 17) & 3); + + if ((head & 0xffe00000) != 0xffe00000) { + /* syncword */ + return FALSE; + } + + if (nLayer == 4) + return FALSE; + + if (check_layer > 0 && nLayer != check_layer) + return FALSE; + + if (((head >> 12) & 0xf) == 0xf) { + /* bits 16,17,18,19 = 1111 invalid bitrate */ + return FALSE; + } + if (((head >> 10) & 0x3) == 0x3) { + /* bits 20,21 = 11 invalid sampling freq */ + return FALSE; + } + if ((head & 0x3) == 0x2) + /* invalid emphasis */ + return FALSE; + return TRUE; +} + + +#if 0 +static void +print_header(PMPSTR mp, struct frame *fr) +{ + static const char *modes[4] = { "Stereo", "Joint-Stereo", "Dual-Channel", "Single-Channel" }; + static const char *layers[4] = { "Unknown", "I", "II", "III" }; + + lame_report_fnc(mp->report_msg, "MPEG %s, Layer: %s, Freq: %ld, mode: %s, modext: %d, BPF : %d\n", + fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"), + layers[fr->lay], freqs[fr->sampling_frequency], + modes[fr->mode], fr->mode_ext, fr->framesize + 4); + lame_report_fnc(mp->report_msg, "Channels: %d, copyright: %s, original: %s, CRC: %s, emphasis: %d.\n", + fr->stereo, fr->copyright ? "Yes" : "No", + fr->original ? "Yes" : "No", fr->error_protection ? "Yes" : "No", fr->emphasis); + lame_report_fnc(mp->report_msg, "Bitrate: %d Kbits/s, Extension value: %d\n", + tabsel_123[fr->lsf][fr->lay - 1][fr->bitrate_index], fr->extension); +} + +static void +print_header_compact(PMPSTR mp, struct frame *fr) +{ + static const char *modes[4] = { "stereo", "joint-stereo", "dual-channel", "mono" }; + static const char *layers[4] = { "Unknown", "I", "II", "III" }; + + lame_report_fnc(mp->report_err, "MPEG %s layer %s, %d kbit/s, %ld Hz %s\n", + fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"), + layers[fr->lay], + tabsel_123[fr->lsf][fr->lay - 1][fr->bitrate_index], + freqs[fr->sampling_frequency], modes[fr->mode]); +} + +#endif + +/* + * decode a header and write the information + * into the frame structure + */ +int +decode_header(PMPSTR mp, struct frame *fr, unsigned long newhead) +{ + + + if (newhead & (1 << 20)) { + fr->lsf = (newhead & (1 << 19)) ? 0x0 : 0x1; + fr->mpeg25 = 0; + } + else { + fr->lsf = 1; + fr->mpeg25 = 1; + } + + + fr->lay = 4 - ((newhead >> 17) & 3); + if (((newhead >> 10) & 0x3) == 0x3) { + lame_report_fnc(mp->report_err, "Stream error\n"); + exit(1); + } + if (fr->mpeg25) { + fr->sampling_frequency = 6 + ((newhead >> 10) & 0x3); + } + else + fr->sampling_frequency = ((newhead >> 10) & 0x3) + (fr->lsf * 3); + + fr->error_protection = ((newhead >> 16) & 0x1) ^ 0x1; + + if (fr->mpeg25) /* allow Bitrate change for 2.5 ... */ + fr->bitrate_index = ((newhead >> 12) & 0xf); + + fr->bitrate_index = ((newhead >> 12) & 0xf); + fr->padding = ((newhead >> 9) & 0x1); + fr->extension = ((newhead >> 8) & 0x1); + fr->mode = ((newhead >> 6) & 0x3); + fr->mode_ext = ((newhead >> 4) & 0x3); + fr->copyright = ((newhead >> 3) & 0x1); + fr->original = ((newhead >> 2) & 0x1); + fr->emphasis = newhead & 0x3; + + fr->stereo = (fr->mode == MPG_MD_MONO) ? 1 : 2; + + switch (fr->lay) { + case 1: + fr->framesize = (long) tabsel_123[fr->lsf][0][fr->bitrate_index] * 12000; + fr->framesize /= freqs[fr->sampling_frequency]; + fr->framesize = ((fr->framesize + fr->padding) << 2) - 4; + fr->down_sample = 0; + fr->down_sample_sblimit = SBLIMIT >> (fr->down_sample); + break; + + case 2: + fr->framesize = (long) tabsel_123[fr->lsf][1][fr->bitrate_index] * 144000; + fr->framesize /= freqs[fr->sampling_frequency]; + fr->framesize += fr->padding - 4; + fr->down_sample = 0; + fr->down_sample_sblimit = SBLIMIT >> (fr->down_sample); + break; + + case 3: +#if 0 + fr->do_layer = do_layer3; + if (fr->lsf) + ssize = (fr->stereo == 1) ? 9 : 17; + else + ssize = (fr->stereo == 1) ? 17 : 32; +#endif + +#if 0 + if (fr->error_protection) + ssize += 2; +#endif + if (fr->framesize > MAX_INPUT_FRAMESIZE) { + lame_report_fnc(mp->report_err, "Frame size too big.\n"); + fr->framesize = MAX_INPUT_FRAMESIZE; + return (0); + } + + + if (fr->bitrate_index == 0) + fr->framesize = 0; + else { + fr->framesize = (long) tabsel_123[fr->lsf][2][fr->bitrate_index] * 144000; + fr->framesize /= freqs[fr->sampling_frequency] << (fr->lsf); + fr->framesize = fr->framesize + fr->padding - 4; + } + break; + default: + lame_report_fnc(mp->report_err, "Sorry, layer %d not supported\n", fr->lay); + return (0); + } + /* print_header(mp, fr); */ + + return 1; +} + + +unsigned int +getbits(PMPSTR mp, int number_of_bits) +{ + unsigned long rval; + + if (number_of_bits <= 0 || !mp->wordpointer) + return 0; + + { + rval = mp->wordpointer[0]; + rval <<= 8; + rval |= mp->wordpointer[1]; + rval <<= 8; + rval |= mp->wordpointer[2]; + rval <<= mp->bitindex; + rval &= 0xffffff; + + mp->bitindex += number_of_bits; + + rval >>= (24 - number_of_bits); + + mp->wordpointer += (mp->bitindex >> 3); + mp->bitindex &= 7; + } + return rval; +} + +unsigned int +getbits_fast(PMPSTR mp, int number_of_bits) +{ + unsigned long rval; + + { + rval = mp->wordpointer[0]; + rval <<= 8; + rval |= mp->wordpointer[1]; + rval <<= mp->bitindex; + rval &= 0xffff; + mp->bitindex += number_of_bits; + + rval >>= (16 - number_of_bits); + + mp->wordpointer += (mp->bitindex >> 3); + mp->bitindex &= 7; + } + return rval; +} + +unsigned char +get_leq_8_bits(PMPSTR mp, unsigned int number_of_bits) +{ + assert(number_of_bits <= 8); + return (unsigned char) getbits_fast(mp, number_of_bits); +} + +unsigned short +get_leq_16_bits(PMPSTR mp, unsigned int number_of_bits) +{ + assert(number_of_bits <= 16); + return (unsigned short) getbits_fast(mp, number_of_bits); +} + +int +set_pointer(PMPSTR mp, long backstep) +{ + unsigned char *bsbufold; + + if (mp->fsizeold < 0 && backstep > 0) { + lame_report_fnc(mp->report_err, "hip: Can't step back %ld bytes!\n", backstep); + return MP3_ERR; + } + bsbufold = mp->bsspace[1 - mp->bsnum] + 512; + mp->wordpointer -= backstep; + if (backstep) + memcpy(mp->wordpointer, bsbufold + mp->fsizeold - backstep, (size_t) backstep); + mp->bitindex = 0; + return MP3_OK; +} diff --git a/node_modules/lame/deps/lame/mpglib/common.h b/node_modules/lame/deps/lame/mpglib/common.h new file mode 100644 index 0000000..62cf17e --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/common.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#ifndef COMMON_H_INCLUDED +#define COMMON_H_INCLUDED + +#include "mpg123.h" +#include "mpglib.h" + +extern const int tabsel_123[2][3][16]; +extern const long freqs[9]; + +extern real muls[27][64]; + + +int head_check(unsigned long head, int check_layer); +int decode_header(PMPSTR mp, struct frame *fr, unsigned long newhead); +unsigned int getbits(PMPSTR mp, int number_of_bits); +unsigned int getbits_fast(PMPSTR mp, int number_of_bits); +unsigned char get_leq_8_bits(PMPSTR mp, unsigned int number_of_bits); +unsigned short get_leq_16_bits(PMPSTR mp, unsigned int number_of_bits); +int set_pointer(PMPSTR mp, long backstep); + +#endif diff --git a/node_modules/lame/deps/lame/mpglib/dct64_i386.c b/node_modules/lame/deps/lame/mpglib/dct64_i386.c new file mode 100644 index 0000000..0bf1509 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/dct64_i386.c @@ -0,0 +1,348 @@ +/* + * dct64_i368.c + * + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Discrete Cosine Tansform (DCT) for subband synthesis + * optimized for machines with no auto-increment. + * The performance is highly compiler dependend. Maybe + * the dct64.c version for 'normal' processor may be faster + * even for Intel processors. + */ + +/* $Id: dct64_i386.c,v 1.14 2010/03/22 14:30:19 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "dct64_i386.h" +#include "tabinit.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +static void +dct64_1(real * out0, real * out1, real * b1, real * b2, real * samples) +{ + + { + real *costab = pnts[0]; + + b1[0x00] = samples[0x00] + samples[0x1F]; + b1[0x1F] = (samples[0x00] - samples[0x1F]) * costab[0x0]; + + b1[0x01] = samples[0x01] + samples[0x1E]; + b1[0x1E] = (samples[0x01] - samples[0x1E]) * costab[0x1]; + + b1[0x02] = samples[0x02] + samples[0x1D]; + b1[0x1D] = (samples[0x02] - samples[0x1D]) * costab[0x2]; + + b1[0x03] = samples[0x03] + samples[0x1C]; + b1[0x1C] = (samples[0x03] - samples[0x1C]) * costab[0x3]; + + b1[0x04] = samples[0x04] + samples[0x1B]; + b1[0x1B] = (samples[0x04] - samples[0x1B]) * costab[0x4]; + + b1[0x05] = samples[0x05] + samples[0x1A]; + b1[0x1A] = (samples[0x05] - samples[0x1A]) * costab[0x5]; + + b1[0x06] = samples[0x06] + samples[0x19]; + b1[0x19] = (samples[0x06] - samples[0x19]) * costab[0x6]; + + b1[0x07] = samples[0x07] + samples[0x18]; + b1[0x18] = (samples[0x07] - samples[0x18]) * costab[0x7]; + + b1[0x08] = samples[0x08] + samples[0x17]; + b1[0x17] = (samples[0x08] - samples[0x17]) * costab[0x8]; + + b1[0x09] = samples[0x09] + samples[0x16]; + b1[0x16] = (samples[0x09] - samples[0x16]) * costab[0x9]; + + b1[0x0A] = samples[0x0A] + samples[0x15]; + b1[0x15] = (samples[0x0A] - samples[0x15]) * costab[0xA]; + + b1[0x0B] = samples[0x0B] + samples[0x14]; + b1[0x14] = (samples[0x0B] - samples[0x14]) * costab[0xB]; + + b1[0x0C] = samples[0x0C] + samples[0x13]; + b1[0x13] = (samples[0x0C] - samples[0x13]) * costab[0xC]; + + b1[0x0D] = samples[0x0D] + samples[0x12]; + b1[0x12] = (samples[0x0D] - samples[0x12]) * costab[0xD]; + + b1[0x0E] = samples[0x0E] + samples[0x11]; + b1[0x11] = (samples[0x0E] - samples[0x11]) * costab[0xE]; + + b1[0x0F] = samples[0x0F] + samples[0x10]; + b1[0x10] = (samples[0x0F] - samples[0x10]) * costab[0xF]; + } + + + { + real *costab = pnts[1]; + + b2[0x00] = b1[0x00] + b1[0x0F]; + b2[0x0F] = (b1[0x00] - b1[0x0F]) * costab[0]; + b2[0x01] = b1[0x01] + b1[0x0E]; + b2[0x0E] = (b1[0x01] - b1[0x0E]) * costab[1]; + b2[0x02] = b1[0x02] + b1[0x0D]; + b2[0x0D] = (b1[0x02] - b1[0x0D]) * costab[2]; + b2[0x03] = b1[0x03] + b1[0x0C]; + b2[0x0C] = (b1[0x03] - b1[0x0C]) * costab[3]; + b2[0x04] = b1[0x04] + b1[0x0B]; + b2[0x0B] = (b1[0x04] - b1[0x0B]) * costab[4]; + b2[0x05] = b1[0x05] + b1[0x0A]; + b2[0x0A] = (b1[0x05] - b1[0x0A]) * costab[5]; + b2[0x06] = b1[0x06] + b1[0x09]; + b2[0x09] = (b1[0x06] - b1[0x09]) * costab[6]; + b2[0x07] = b1[0x07] + b1[0x08]; + b2[0x08] = (b1[0x07] - b1[0x08]) * costab[7]; + + b2[0x10] = b1[0x10] + b1[0x1F]; + b2[0x1F] = (b1[0x1F] - b1[0x10]) * costab[0]; + b2[0x11] = b1[0x11] + b1[0x1E]; + b2[0x1E] = (b1[0x1E] - b1[0x11]) * costab[1]; + b2[0x12] = b1[0x12] + b1[0x1D]; + b2[0x1D] = (b1[0x1D] - b1[0x12]) * costab[2]; + b2[0x13] = b1[0x13] + b1[0x1C]; + b2[0x1C] = (b1[0x1C] - b1[0x13]) * costab[3]; + b2[0x14] = b1[0x14] + b1[0x1B]; + b2[0x1B] = (b1[0x1B] - b1[0x14]) * costab[4]; + b2[0x15] = b1[0x15] + b1[0x1A]; + b2[0x1A] = (b1[0x1A] - b1[0x15]) * costab[5]; + b2[0x16] = b1[0x16] + b1[0x19]; + b2[0x19] = (b1[0x19] - b1[0x16]) * costab[6]; + b2[0x17] = b1[0x17] + b1[0x18]; + b2[0x18] = (b1[0x18] - b1[0x17]) * costab[7]; + } + + { + real *costab = pnts[2]; + + b1[0x00] = b2[0x00] + b2[0x07]; + b1[0x07] = (b2[0x00] - b2[0x07]) * costab[0]; + b1[0x01] = b2[0x01] + b2[0x06]; + b1[0x06] = (b2[0x01] - b2[0x06]) * costab[1]; + b1[0x02] = b2[0x02] + b2[0x05]; + b1[0x05] = (b2[0x02] - b2[0x05]) * costab[2]; + b1[0x03] = b2[0x03] + b2[0x04]; + b1[0x04] = (b2[0x03] - b2[0x04]) * costab[3]; + + b1[0x08] = b2[0x08] + b2[0x0F]; + b1[0x0F] = (b2[0x0F] - b2[0x08]) * costab[0]; + b1[0x09] = b2[0x09] + b2[0x0E]; + b1[0x0E] = (b2[0x0E] - b2[0x09]) * costab[1]; + b1[0x0A] = b2[0x0A] + b2[0x0D]; + b1[0x0D] = (b2[0x0D] - b2[0x0A]) * costab[2]; + b1[0x0B] = b2[0x0B] + b2[0x0C]; + b1[0x0C] = (b2[0x0C] - b2[0x0B]) * costab[3]; + + b1[0x10] = b2[0x10] + b2[0x17]; + b1[0x17] = (b2[0x10] - b2[0x17]) * costab[0]; + b1[0x11] = b2[0x11] + b2[0x16]; + b1[0x16] = (b2[0x11] - b2[0x16]) * costab[1]; + b1[0x12] = b2[0x12] + b2[0x15]; + b1[0x15] = (b2[0x12] - b2[0x15]) * costab[2]; + b1[0x13] = b2[0x13] + b2[0x14]; + b1[0x14] = (b2[0x13] - b2[0x14]) * costab[3]; + + b1[0x18] = b2[0x18] + b2[0x1F]; + b1[0x1F] = (b2[0x1F] - b2[0x18]) * costab[0]; + b1[0x19] = b2[0x19] + b2[0x1E]; + b1[0x1E] = (b2[0x1E] - b2[0x19]) * costab[1]; + b1[0x1A] = b2[0x1A] + b2[0x1D]; + b1[0x1D] = (b2[0x1D] - b2[0x1A]) * costab[2]; + b1[0x1B] = b2[0x1B] + b2[0x1C]; + b1[0x1C] = (b2[0x1C] - b2[0x1B]) * costab[3]; + } + + { + real const cos0 = pnts[3][0]; + real const cos1 = pnts[3][1]; + + b2[0x00] = b1[0x00] + b1[0x03]; + b2[0x03] = (b1[0x00] - b1[0x03]) * cos0; + b2[0x01] = b1[0x01] + b1[0x02]; + b2[0x02] = (b1[0x01] - b1[0x02]) * cos1; + + b2[0x04] = b1[0x04] + b1[0x07]; + b2[0x07] = (b1[0x07] - b1[0x04]) * cos0; + b2[0x05] = b1[0x05] + b1[0x06]; + b2[0x06] = (b1[0x06] - b1[0x05]) * cos1; + + b2[0x08] = b1[0x08] + b1[0x0B]; + b2[0x0B] = (b1[0x08] - b1[0x0B]) * cos0; + b2[0x09] = b1[0x09] + b1[0x0A]; + b2[0x0A] = (b1[0x09] - b1[0x0A]) * cos1; + + b2[0x0C] = b1[0x0C] + b1[0x0F]; + b2[0x0F] = (b1[0x0F] - b1[0x0C]) * cos0; + b2[0x0D] = b1[0x0D] + b1[0x0E]; + b2[0x0E] = (b1[0x0E] - b1[0x0D]) * cos1; + + b2[0x10] = b1[0x10] + b1[0x13]; + b2[0x13] = (b1[0x10] - b1[0x13]) * cos0; + b2[0x11] = b1[0x11] + b1[0x12]; + b2[0x12] = (b1[0x11] - b1[0x12]) * cos1; + + b2[0x14] = b1[0x14] + b1[0x17]; + b2[0x17] = (b1[0x17] - b1[0x14]) * cos0; + b2[0x15] = b1[0x15] + b1[0x16]; + b2[0x16] = (b1[0x16] - b1[0x15]) * cos1; + + b2[0x18] = b1[0x18] + b1[0x1B]; + b2[0x1B] = (b1[0x18] - b1[0x1B]) * cos0; + b2[0x19] = b1[0x19] + b1[0x1A]; + b2[0x1A] = (b1[0x19] - b1[0x1A]) * cos1; + + b2[0x1C] = b1[0x1C] + b1[0x1F]; + b2[0x1F] = (b1[0x1F] - b1[0x1C]) * cos0; + b2[0x1D] = b1[0x1D] + b1[0x1E]; + b2[0x1E] = (b1[0x1E] - b1[0x1D]) * cos1; + } + + { + real const cos0 = pnts[4][0]; + + b1[0x00] = b2[0x00] + b2[0x01]; + b1[0x01] = (b2[0x00] - b2[0x01]) * cos0; + b1[0x02] = b2[0x02] + b2[0x03]; + b1[0x03] = (b2[0x03] - b2[0x02]) * cos0; + b1[0x02] += b1[0x03]; + + b1[0x04] = b2[0x04] + b2[0x05]; + b1[0x05] = (b2[0x04] - b2[0x05]) * cos0; + b1[0x06] = b2[0x06] + b2[0x07]; + b1[0x07] = (b2[0x07] - b2[0x06]) * cos0; + b1[0x06] += b1[0x07]; + b1[0x04] += b1[0x06]; + b1[0x06] += b1[0x05]; + b1[0x05] += b1[0x07]; + + b1[0x08] = b2[0x08] + b2[0x09]; + b1[0x09] = (b2[0x08] - b2[0x09]) * cos0; + b1[0x0A] = b2[0x0A] + b2[0x0B]; + b1[0x0B] = (b2[0x0B] - b2[0x0A]) * cos0; + b1[0x0A] += b1[0x0B]; + + b1[0x0C] = b2[0x0C] + b2[0x0D]; + b1[0x0D] = (b2[0x0C] - b2[0x0D]) * cos0; + b1[0x0E] = b2[0x0E] + b2[0x0F]; + b1[0x0F] = (b2[0x0F] - b2[0x0E]) * cos0; + b1[0x0E] += b1[0x0F]; + b1[0x0C] += b1[0x0E]; + b1[0x0E] += b1[0x0D]; + b1[0x0D] += b1[0x0F]; + + b1[0x10] = b2[0x10] + b2[0x11]; + b1[0x11] = (b2[0x10] - b2[0x11]) * cos0; + b1[0x12] = b2[0x12] + b2[0x13]; + b1[0x13] = (b2[0x13] - b2[0x12]) * cos0; + b1[0x12] += b1[0x13]; + + b1[0x14] = b2[0x14] + b2[0x15]; + b1[0x15] = (b2[0x14] - b2[0x15]) * cos0; + b1[0x16] = b2[0x16] + b2[0x17]; + b1[0x17] = (b2[0x17] - b2[0x16]) * cos0; + b1[0x16] += b1[0x17]; + b1[0x14] += b1[0x16]; + b1[0x16] += b1[0x15]; + b1[0x15] += b1[0x17]; + + b1[0x18] = b2[0x18] + b2[0x19]; + b1[0x19] = (b2[0x18] - b2[0x19]) * cos0; + b1[0x1A] = b2[0x1A] + b2[0x1B]; + b1[0x1B] = (b2[0x1B] - b2[0x1A]) * cos0; + b1[0x1A] += b1[0x1B]; + + b1[0x1C] = b2[0x1C] + b2[0x1D]; + b1[0x1D] = (b2[0x1C] - b2[0x1D]) * cos0; + b1[0x1E] = b2[0x1E] + b2[0x1F]; + b1[0x1F] = (b2[0x1F] - b2[0x1E]) * cos0; + b1[0x1E] += b1[0x1F]; + b1[0x1C] += b1[0x1E]; + b1[0x1E] += b1[0x1D]; + b1[0x1D] += b1[0x1F]; + } + + out0[0x10 * 16] = b1[0x00]; + out0[0x10 * 12] = b1[0x04]; + out0[0x10 * 8] = b1[0x02]; + out0[0x10 * 4] = b1[0x06]; + out0[0x10 * 0] = b1[0x01]; + out1[0x10 * 0] = b1[0x01]; + out1[0x10 * 4] = b1[0x05]; + out1[0x10 * 8] = b1[0x03]; + out1[0x10 * 12] = b1[0x07]; + + b1[0x08] += b1[0x0C]; + out0[0x10 * 14] = b1[0x08]; + b1[0x0C] += b1[0x0a]; + out0[0x10 * 10] = b1[0x0C]; + b1[0x0A] += b1[0x0E]; + out0[0x10 * 6] = b1[0x0A]; + b1[0x0E] += b1[0x09]; + out0[0x10 * 2] = b1[0x0E]; + b1[0x09] += b1[0x0D]; + out1[0x10 * 2] = b1[0x09]; + b1[0x0D] += b1[0x0B]; + out1[0x10 * 6] = b1[0x0D]; + b1[0x0B] += b1[0x0F]; + out1[0x10 * 10] = b1[0x0B]; + out1[0x10 * 14] = b1[0x0F]; + + b1[0x18] += b1[0x1C]; + out0[0x10 * 15] = b1[0x10] + b1[0x18]; + out0[0x10 * 13] = b1[0x18] + b1[0x14]; + b1[0x1C] += b1[0x1a]; + out0[0x10 * 11] = b1[0x14] + b1[0x1C]; + out0[0x10 * 9] = b1[0x1C] + b1[0x12]; + b1[0x1A] += b1[0x1E]; + out0[0x10 * 7] = b1[0x12] + b1[0x1A]; + out0[0x10 * 5] = b1[0x1A] + b1[0x16]; + b1[0x1E] += b1[0x19]; + out0[0x10 * 3] = b1[0x16] + b1[0x1E]; + out0[0x10 * 1] = b1[0x1E] + b1[0x11]; + b1[0x19] += b1[0x1D]; + out1[0x10 * 1] = b1[0x11] + b1[0x19]; + out1[0x10 * 3] = b1[0x19] + b1[0x15]; + b1[0x1D] += b1[0x1B]; + out1[0x10 * 5] = b1[0x15] + b1[0x1D]; + out1[0x10 * 7] = b1[0x1D] + b1[0x13]; + b1[0x1B] += b1[0x1F]; + out1[0x10 * 9] = b1[0x13] + b1[0x1B]; + out1[0x10 * 11] = b1[0x1B] + b1[0x17]; + out1[0x10 * 13] = b1[0x17] + b1[0x1F]; + out1[0x10 * 15] = b1[0x1F]; +} + +/* + * the call via dct64 is a trick to force GCC to use + * (new) registers for the b1,b2 pointer to the bufs[xx] field + */ +void +dct64(real * a, real * b, real * c) +{ + real bufs[0x40]; + dct64_1(a, b, bufs, bufs + 0x20, c); +} diff --git a/node_modules/lame/deps/lame/mpglib/dct64_i386.h b/node_modules/lame/deps/lame/mpglib/dct64_i386.h new file mode 100644 index 0000000..a140ee7 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/dct64_i386.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef MPGLIB_DCT64_I386_H_INCLUDED +#define MPGLIB_DCT64_I386_H_INCLUDED + +#include "common.h" + +void dct64(real * a, real * b, real * c); + + +#endif diff --git a/node_modules/lame/deps/lame/mpglib/decode_i386.c b/node_modules/lame/deps/lame/mpglib/decode_i386.c new file mode 100644 index 0000000..8ffcab3 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/decode_i386.c @@ -0,0 +1,224 @@ +/* + * decode_i396.c: Mpeg Layer-1,2,3 audio decoder + * + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * + * Slighlty optimized for machines without autoincrement/decrement. + * The performance is highly compiler dependend. Maybe + * the decode.c version for 'normal' processor may be faster + * even for Intel processors. + */ + +/* $Id: decode_i386.c,v 1.22 2010/03/22 14:30:19 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <string.h> +#else +# ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex +# endif +char *strchr(), *strrchr(); +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# define memmove(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#if defined(__riscos__) && defined(FPA10) +#include "ymath.h" +#else +#include <math.h> +#endif + +#include "decode_i386.h" +#include "dct64_i386.h" +#include "tabinit.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + + + /* old WRITE_SAMPLE_CLIPPED */ +#define WRITE_SAMPLE_CLIPPED(TYPE,samples,sum,clip) \ + if( (sum) > 32767.0) { *(samples) = 0x7fff; (clip)++; } \ + else if( (sum) < -32768.0) { *(samples) = -0x8000; (clip)++; } \ + else { *(samples) = (TYPE)((sum)>0 ? (sum)+0.5 : (sum)-0.5) ; } + +#define WRITE_SAMPLE_UNCLIPPED(TYPE,samples,sum,clip) \ + *samples = (TYPE)sum; + + /* *INDENT-OFF* */ + + /* versions: clipped (when TYPE == short) and unclipped (when TYPE == real) of synth_1to1_mono* functions */ +#define SYNTH_1TO1_MONO_CLIPCHOICE(TYPE,SYNTH_1TO1) \ + TYPE samples_tmp[64]; \ + TYPE *tmp1 = samples_tmp; \ + int i,ret; \ + int pnt1 = 0; \ + \ + ret = SYNTH_1TO1 (mp,bandPtr,0,(unsigned char *) samples_tmp,&pnt1); \ + out += *pnt; \ + \ + for(i=0;i<32;i++) { \ + *( (TYPE *) out) = *tmp1; \ + out += sizeof(TYPE); \ + tmp1 += 2; \ + } \ + *pnt += 32*sizeof(TYPE); \ + \ + return ret; + + /* *INDENT-ON* */ + + +int +synth_1to1_mono(PMPSTR mp, real * bandPtr, unsigned char *out, int *pnt) +{ + SYNTH_1TO1_MONO_CLIPCHOICE(short, synth_1to1) +} int +synth_1to1_mono_unclipped(PMPSTR mp, real * bandPtr, unsigned char *out, int *pnt) +{ + SYNTH_1TO1_MONO_CLIPCHOICE(real, synth_1to1_unclipped) +} + + /* *INDENT-OFF* */ +/* versions: clipped (when TYPE == short) and unclipped (when TYPE == real) of synth_1to1* functions */ +#define SYNTH_1TO1_CLIPCHOICE(TYPE,WRITE_SAMPLE) \ + static const int step = 2; \ + int bo; \ + TYPE *samples = (TYPE *) (out + *pnt); \ + \ + real *b0,(*buf)[0x110]; \ + int clip = 0; \ + int bo1; \ + \ + bo = mp->synth_bo; \ + \ + if(!channel) { \ + bo--; \ + bo &= 0xf; \ + buf = mp->synth_buffs[0]; \ + } \ + else { \ + samples++; \ + buf = mp->synth_buffs[1]; \ + } \ + \ + if(bo & 0x1) { \ + b0 = buf[0]; \ + bo1 = bo; \ + dct64(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr); \ + } \ + else { \ + b0 = buf[1]; \ + bo1 = bo+1; \ + dct64(buf[0]+bo,buf[1]+bo+1,bandPtr); \ + } \ + \ + mp->synth_bo = bo; \ + \ + { \ + int j; \ + real *window = decwin + 16 - bo1; \ + \ + for (j=16;j;j--,b0+=0x10,window+=0x20,samples+=step) \ + { \ + real sum; \ + sum = window[0x0] * b0[0x0]; \ + sum -= window[0x1] * b0[0x1]; \ + sum += window[0x2] * b0[0x2]; \ + sum -= window[0x3] * b0[0x3]; \ + sum += window[0x4] * b0[0x4]; \ + sum -= window[0x5] * b0[0x5]; \ + sum += window[0x6] * b0[0x6]; \ + sum -= window[0x7] * b0[0x7]; \ + sum += window[0x8] * b0[0x8]; \ + sum -= window[0x9] * b0[0x9]; \ + sum += window[0xA] * b0[0xA]; \ + sum -= window[0xB] * b0[0xB]; \ + sum += window[0xC] * b0[0xC]; \ + sum -= window[0xD] * b0[0xD]; \ + sum += window[0xE] * b0[0xE]; \ + sum -= window[0xF] * b0[0xF]; \ + \ + WRITE_SAMPLE (TYPE,samples,sum,clip); \ + } \ + \ + { \ + real sum; \ + sum = window[0x0] * b0[0x0]; \ + sum += window[0x2] * b0[0x2]; \ + sum += window[0x4] * b0[0x4]; \ + sum += window[0x6] * b0[0x6]; \ + sum += window[0x8] * b0[0x8]; \ + sum += window[0xA] * b0[0xA]; \ + sum += window[0xC] * b0[0xC]; \ + sum += window[0xE] * b0[0xE]; \ + WRITE_SAMPLE (TYPE,samples,sum,clip); \ + b0-=0x10,window-=0x20,samples+=step; \ + } \ + window += bo1<<1; \ + \ + for (j=15;j;j--,b0-=0x10,window-=0x20,samples+=step) \ + { \ + real sum; \ + sum = -window[-0x1] * b0[0x0]; \ + sum -= window[-0x2] * b0[0x1]; \ + sum -= window[-0x3] * b0[0x2]; \ + sum -= window[-0x4] * b0[0x3]; \ + sum -= window[-0x5] * b0[0x4]; \ + sum -= window[-0x6] * b0[0x5]; \ + sum -= window[-0x7] * b0[0x6]; \ + sum -= window[-0x8] * b0[0x7]; \ + sum -= window[-0x9] * b0[0x8]; \ + sum -= window[-0xA] * b0[0x9]; \ + sum -= window[-0xB] * b0[0xA]; \ + sum -= window[-0xC] * b0[0xB]; \ + sum -= window[-0xD] * b0[0xC]; \ + sum -= window[-0xE] * b0[0xD]; \ + sum -= window[-0xF] * b0[0xE]; \ + sum -= window[-0x0] * b0[0xF]; \ + \ + WRITE_SAMPLE (TYPE,samples,sum,clip); \ + } \ + } \ + *pnt += 64*sizeof(TYPE); \ + \ + return clip; + /* *INDENT-ON* */ + + +int +synth_1to1(PMPSTR mp, real * bandPtr, int channel, unsigned char *out, int *pnt) +{ + SYNTH_1TO1_CLIPCHOICE(short, WRITE_SAMPLE_CLIPPED) +} int +synth_1to1_unclipped(PMPSTR mp, real * bandPtr, int channel, unsigned char *out, int *pnt) +{ + SYNTH_1TO1_CLIPCHOICE(real, WRITE_SAMPLE_UNCLIPPED) +} diff --git a/node_modules/lame/deps/lame/mpglib/decode_i386.h b/node_modules/lame/deps/lame/mpglib/decode_i386.h new file mode 100644 index 0000000..8fc9dbe --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/decode_i386.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef DECODE_I386_H_INCLUDED +#define DECODE_I386_H_INCLUDED + +#include "common.h" + +int synth_1to1_mono(PMPSTR mp, real * bandPtr, unsigned char *out, int *pnt); +int synth_1to1(PMPSTR mp, real * bandPtr, int channel, unsigned char *out, int *pnt); + +int synth_1to1_mono_unclipped(PMPSTR mp, real * bandPtr, unsigned char *out, int *pnt); +int synth_1to1_unclipped(PMPSTR mp, real * bandPtr, int channel, unsigned char *out, int *pnt); + +#endif diff --git a/node_modules/lame/deps/lame/mpglib/depcomp b/node_modules/lame/deps/lame/mpglib/depcomp new file mode 100755 index 0000000..df8eea7 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/node_modules/lame/deps/lame/mpglib/huffman.h b/node_modules/lame/deps/lame/mpglib/huffman.h new file mode 100644 index 0000000..7d73a74 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/huffman.h @@ -0,0 +1,353 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * huffman tables ... recalcualted to work with my optimzed + * decoder scheme (MH) + * + * probably we could save a few bytes of memory, because the + * smaller tables are often the part of a bigger table + */ + +/* *INDENT-OFF* */ + + +struct newhuff +{ + const unsigned int linbits; + const short * const table; +}; + +static const short tab0[] = +{ + 0 +}; + +static const short tab1[] = +{ + -5, -3, -1, 17, 1, 16, 0 +}; + +static const short tab2[] = +{ + -15, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 17, -1, 1, 16, 0 +}; + +static const short tab3[] = +{ + -13, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 16, 17, -1, + 1, 0 +}; + +static const short tab5[] = +{ + -29, -25, -23, -15, -7, -5, -3, -1, 51, 35, 50, 49, -3, -1, 19, + 3, -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, 17, -1, 1, 16, + 0 +}; + +static const short tab6[] = +{ + -25, -19, -13, -9, -5, -3, -1, 51, 3, 35, -1, 50, 48, -1, 19, + 49, -3, -1, 34, 2, 18, -3, -1, 33, 32, 1, -1, 17, -1, 16, + 0 +}; + +static const short tab7[] = +{ + -69, -65, -57, -39, -29, -17, -11, -7, -3, -1, 85, 69, -1, 84, 83, + -1, 53, 68, -3, -1, 37, 82, 21, -5, -1, 81, -1, 5, 52, -1, + 80, -1, 67, 51, -5, -3, -1, 36, 66, 20, -1, 65, 64, -11, -7, + -3, -1, 4, 35, -1, 50, 3, -1, 19, 49, -3, -1, 48, 34, 18, + -5, -1, 33, -1, 2, 32, 17, -1, 1, 16, 0 +}; + +static const short tab8[] = +{ + -65, -63, -59, -45, -31, -19, -13, -7, -5, -3, -1, 85, 84, 69, 83, + -3, -1, 53, 68, 37, -3, -1, 82, 5, 21, -5, -1, 81, -1, 52, + 67, -3, -1, 80, 51, 36, -5, -3, -1, 66, 20, 65, -3, -1, 4, + 64, -1, 35, 50, -9, -7, -3, -1, 19, 49, -1, 3, 48, 34, -1, + 2, 32, -1, 18, 33, 17, -3, -1, 1, 16, 0 +}; + +static const short tab9[] = +{ + -63, -53, -41, -29, -19, -11, -5, -3, -1, 85, 69, 53, -1, 83, -1, + 84, 5, -3, -1, 68, 37, -1, 82, 21, -3, -1, 81, 52, -1, 67, + -1, 80, 4, -7, -3, -1, 36, 66, -1, 51, 64, -1, 20, 65, -5, + -3, -1, 35, 50, 19, -1, 49, -1, 3, 48, -5, -3, -1, 34, 2, + 18, -1, 33, 32, -3, -1, 17, 1, -1, 16, 0 +}; + +static const short tab10[] = +{ +-125,-121,-111, -83, -55, -35, -21, -13, -7, -3, -1, 119, 103, -1, 118, + 87, -3, -1, 117, 102, 71, -3, -1, 116, 86, -1, 101, 55, -9, -3, + -1, 115, 70, -3, -1, 85, 84, 99, -1, 39, 114, -11, -5, -3, -1, + 100, 7, 112, -1, 98, -1, 69, 53, -5, -1, 6, -1, 83, 68, 23, + -17, -5, -1, 113, -1, 54, 38, -5, -3, -1, 37, 82, 21, -1, 81, + -1, 52, 67, -3, -1, 22, 97, -1, 96, -1, 5, 80, -19, -11, -7, + -3, -1, 36, 66, -1, 51, 4, -1, 20, 65, -3, -1, 64, 35, -1, + 50, 3, -3, -1, 19, 49, -1, 48, 34, -7, -3, -1, 18, 33, -1, + 2, 32, 17, -1, 1, 16, 0 +}; + +static const short tab11[] = +{ +-121,-113, -89, -59, -43, -27, -17, -7, -3, -1, 119, 103, -1, 118, 117, + -3, -1, 102, 71, -1, 116, -1, 87, 85, -5, -3, -1, 86, 101, 55, + -1, 115, 70, -9, -7, -3, -1, 69, 84, -1, 53, 83, 39, -1, 114, + -1, 100, 7, -5, -1, 113, -1, 23, 112, -3, -1, 54, 99, -1, 96, + -1, 68, 37, -13, -7, -5, -3, -1, 82, 5, 21, 98, -3, -1, 38, + 6, 22, -5, -1, 97, -1, 81, 52, -5, -1, 80, -1, 67, 51, -1, + 36, 66, -15, -11, -7, -3, -1, 20, 65, -1, 4, 64, -1, 35, 50, + -1, 19, 49, -5, -3, -1, 3, 48, 34, 33, -5, -1, 18, -1, 2, + 32, 17, -3, -1, 1, 16, 0 +}; + +static const short tab12[] = +{ +-115, -99, -73, -45, -27, -17, -9, -5, -3, -1, 119, 103, 118, -1, 87, + 117, -3, -1, 102, 71, -1, 116, 101, -3, -1, 86, 55, -3, -1, 115, + 85, 39, -7, -3, -1, 114, 70, -1, 100, 23, -5, -1, 113, -1, 7, + 112, -1, 54, 99, -13, -9, -3, -1, 69, 84, -1, 68, -1, 6, 5, + -1, 38, 98, -5, -1, 97, -1, 22, 96, -3, -1, 53, 83, -1, 37, + 82, -17, -7, -3, -1, 21, 81, -1, 52, 67, -5, -3, -1, 80, 4, + 36, -1, 66, 20, -3, -1, 51, 65, -1, 35, 50, -11, -7, -5, -3, + -1, 64, 3, 48, 19, -1, 49, 34, -1, 18, 33, -7, -5, -3, -1, + 2, 32, 0, 17, -1, 1, 16 +}; + +static const short tab13[] = +{ +-509,-503,-475,-405,-333,-265,-205,-153,-115, -83, -53, -35, -21, -13, -9, + -7, -5, -3, -1, 254, 252, 253, 237, 255, -1, 239, 223, -3, -1, 238, + 207, -1, 222, 191, -9, -3, -1, 251, 206, -1, 220, -1, 175, 233, -1, + 236, 221, -9, -5, -3, -1, 250, 205, 190, -1, 235, 159, -3, -1, 249, + 234, -1, 189, 219, -17, -9, -3, -1, 143, 248, -1, 204, -1, 174, 158, + -5, -1, 142, -1, 127, 126, 247, -5, -1, 218, -1, 173, 188, -3, -1, + 203, 246, 111, -15, -7, -3, -1, 232, 95, -1, 157, 217, -3, -1, 245, + 231, -1, 172, 187, -9, -3, -1, 79, 244, -3, -1, 202, 230, 243, -1, + 63, -1, 141, 216, -21, -9, -3, -1, 47, 242, -3, -1, 110, 156, 15, + -5, -3, -1, 201, 94, 171, -3, -1, 125, 215, 78, -11, -5, -3, -1, + 200, 214, 62, -1, 185, -1, 155, 170, -1, 31, 241, -23, -13, -5, -1, + 240, -1, 186, 229, -3, -1, 228, 140, -1, 109, 227, -5, -1, 226, -1, + 46, 14, -1, 30, 225, -15, -7, -3, -1, 224, 93, -1, 213, 124, -3, + -1, 199, 77, -1, 139, 184, -7, -3, -1, 212, 154, -1, 169, 108, -1, + 198, 61, -37, -21, -9, -5, -3, -1, 211, 123, 45, -1, 210, 29, -5, + -1, 183, -1, 92, 197, -3, -1, 153, 122, 195, -7, -5, -3, -1, 167, + 151, 75, 209, -3, -1, 13, 208, -1, 138, 168, -11, -7, -3, -1, 76, + 196, -1, 107, 182, -1, 60, 44, -3, -1, 194, 91, -3, -1, 181, 137, + 28, -43, -23, -11, -5, -1, 193, -1, 152, 12, -1, 192, -1, 180, 106, + -5, -3, -1, 166, 121, 59, -1, 179, -1, 136, 90, -11, -5, -1, 43, + -1, 165, 105, -1, 164, -1, 120, 135, -5, -1, 148, -1, 119, 118, 178, + -11, -3, -1, 27, 177, -3, -1, 11, 176, -1, 150, 74, -7, -3, -1, + 58, 163, -1, 89, 149, -1, 42, 162, -47, -23, -9, -3, -1, 26, 161, + -3, -1, 10, 104, 160, -5, -3, -1, 134, 73, 147, -3, -1, 57, 88, + -1, 133, 103, -9, -3, -1, 41, 146, -3, -1, 87, 117, 56, -5, -1, + 131, -1, 102, 71, -3, -1, 116, 86, -1, 101, 115, -11, -3, -1, 25, + 145, -3, -1, 9, 144, -1, 72, 132, -7, -5, -1, 114, -1, 70, 100, + 40, -1, 130, 24, -41, -27, -11, -5, -3, -1, 55, 39, 23, -1, 113, + -1, 85, 7, -7, -3, -1, 112, 54, -1, 99, 69, -3, -1, 84, 38, + -1, 98, 53, -5, -1, 129, -1, 8, 128, -3, -1, 22, 97, -1, 6, + 96, -13, -9, -5, -3, -1, 83, 68, 37, -1, 82, 5, -1, 21, 81, + -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20, -19, -11, + -5, -1, 65, -1, 4, 64, -3, -1, 35, 50, 19, -3, -1, 49, 3, + -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16, + 0 +}; + +static const short tab15[] = +{ +-495,-445,-355,-263,-183,-115, -77, -43, -27, -13, -7, -3, -1, 255, 239, + -1, 254, 223, -1, 238, -1, 253, 207, -7, -3, -1, 252, 222, -1, 237, + 191, -1, 251, -1, 206, 236, -7, -3, -1, 221, 175, -1, 250, 190, -3, + -1, 235, 205, -1, 220, 159, -15, -7, -3, -1, 249, 234, -1, 189, 219, + -3, -1, 143, 248, -1, 204, 158, -7, -3, -1, 233, 127, -1, 247, 173, + -3, -1, 218, 188, -1, 111, -1, 174, 15, -19, -11, -3, -1, 203, 246, + -3, -1, 142, 232, -1, 95, 157, -3, -1, 245, 126, -1, 231, 172, -9, + -3, -1, 202, 187, -3, -1, 217, 141, 79, -3, -1, 244, 63, -1, 243, + 216, -33, -17, -9, -3, -1, 230, 47, -1, 242, -1, 110, 240, -3, -1, + 31, 241, -1, 156, 201, -7, -3, -1, 94, 171, -1, 186, 229, -3, -1, + 125, 215, -1, 78, 228, -15, -7, -3, -1, 140, 200, -1, 62, 109, -3, + -1, 214, 227, -1, 155, 185, -7, -3, -1, 46, 170, -1, 226, 30, -5, + -1, 225, -1, 14, 224, -1, 93, 213, -45, -25, -13, -7, -3, -1, 124, + 199, -1, 77, 139, -1, 212, -1, 184, 154, -7, -3, -1, 169, 108, -1, + 198, 61, -1, 211, 210, -9, -5, -3, -1, 45, 13, 29, -1, 123, 183, + -5, -1, 209, -1, 92, 208, -1, 197, 138, -17, -7, -3, -1, 168, 76, + -1, 196, 107, -5, -1, 182, -1, 153, 12, -1, 60, 195, -9, -3, -1, + 122, 167, -1, 166, -1, 192, 11, -1, 194, -1, 44, 91, -55, -29, -15, + -7, -3, -1, 181, 28, -1, 137, 152, -3, -1, 193, 75, -1, 180, 106, + -5, -3, -1, 59, 121, 179, -3, -1, 151, 136, -1, 43, 90, -11, -5, + -1, 178, -1, 165, 27, -1, 177, -1, 176, 105, -7, -3, -1, 150, 74, + -1, 164, 120, -3, -1, 135, 58, 163, -17, -7, -3, -1, 89, 149, -1, + 42, 162, -3, -1, 26, 161, -3, -1, 10, 160, 104, -7, -3, -1, 134, + 73, -1, 148, 57, -5, -1, 147, -1, 119, 9, -1, 88, 133, -53, -29, + -13, -7, -3, -1, 41, 103, -1, 118, 146, -1, 145, -1, 25, 144, -7, + -3, -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 71, -7, + -3, -1, 40, 130, -1, 24, 129, -7, -3, -1, 116, 8, -1, 128, 86, + -3, -1, 101, 55, -1, 115, 70, -17, -7, -3, -1, 39, 114, -1, 100, + 23, -3, -1, 85, 113, -3, -1, 7, 112, 54, -7, -3, -1, 99, 69, + -1, 84, 38, -3, -1, 98, 22, -3, -1, 6, 96, 53, -33, -19, -9, + -5, -1, 97, -1, 83, 68, -1, 37, 82, -3, -1, 21, 81, -3, -1, + 5, 80, 52, -7, -3, -1, 67, 36, -1, 66, 51, -1, 65, -1, 20, + 4, -9, -3, -1, 35, 50, -3, -1, 64, 3, 19, -3, -1, 49, 48, + 34, -9, -7, -3, -1, 18, 33, -1, 2, 32, 17, -3, -1, 1, 16, + 0 +}; + +static const short tab16[] = +{ +-509,-503,-461,-323,-103, -37, -27, -15, -7, -3, -1, 239, 254, -1, 223, + 253, -3, -1, 207, 252, -1, 191, 251, -5, -1, 175, -1, 250, 159, -3, + -1, 249, 248, 143, -7, -3, -1, 127, 247, -1, 111, 246, 255, -9, -5, + -3, -1, 95, 245, 79, -1, 244, 243, -53, -1, 240, -1, 63, -29, -19, + -13, -7, -5, -1, 206, -1, 236, 221, 222, -1, 233, -1, 234, 217, -1, + 238, -1, 237, 235, -3, -1, 190, 205, -3, -1, 220, 219, 174, -11, -5, + -1, 204, -1, 173, 218, -3, -1, 126, 172, 202, -5, -3, -1, 201, 125, + 94, 189, 242, -93, -5, -3, -1, 47, 15, 31, -1, 241, -49, -25, -13, + -5, -1, 158, -1, 188, 203, -3, -1, 142, 232, -1, 157, 231, -7, -3, + -1, 187, 141, -1, 216, 110, -1, 230, 156, -13, -7, -3, -1, 171, 186, + -1, 229, 215, -1, 78, -1, 228, 140, -3, -1, 200, 62, -1, 109, -1, + 214, 155, -19, -11, -5, -3, -1, 185, 170, 225, -1, 212, -1, 184, 169, + -5, -1, 123, -1, 183, 208, 227, -7, -3, -1, 14, 224, -1, 93, 213, + -3, -1, 124, 199, -1, 77, 139, -75, -45, -27, -13, -7, -3, -1, 154, + 108, -1, 198, 61, -3, -1, 92, 197, 13, -7, -3, -1, 138, 168, -1, + 153, 76, -3, -1, 182, 122, 60, -11, -5, -3, -1, 91, 137, 28, -1, + 192, -1, 152, 121, -1, 226, -1, 46, 30, -15, -7, -3, -1, 211, 45, + -1, 210, 209, -5, -1, 59, -1, 151, 136, 29, -7, -3, -1, 196, 107, + -1, 195, 167, -1, 44, -1, 194, 181, -23, -13, -7, -3, -1, 193, 12, + -1, 75, 180, -3, -1, 106, 166, 179, -5, -3, -1, 90, 165, 43, -1, + 178, 27, -13, -5, -1, 177, -1, 11, 176, -3, -1, 105, 150, -1, 74, + 164, -5, -3, -1, 120, 135, 163, -3, -1, 58, 89, 42, -97, -57, -33, + -19, -11, -5, -3, -1, 149, 104, 161, -3, -1, 134, 119, 148, -5, -3, + -1, 73, 87, 103, 162, -5, -1, 26, -1, 10, 160, -3, -1, 57, 147, + -1, 88, 133, -9, -3, -1, 41, 146, -3, -1, 118, 9, 25, -5, -1, + 145, -1, 144, 72, -3, -1, 132, 117, -1, 56, 131, -21, -11, -5, -3, + -1, 102, 40, 130, -3, -1, 71, 116, 24, -3, -1, 129, 128, -3, -1, + 8, 86, 55, -9, -5, -1, 115, -1, 101, 70, -1, 39, 114, -5, -3, + -1, 100, 85, 7, 23, -23, -13, -5, -1, 113, -1, 112, 54, -3, -1, + 99, 69, -1, 84, 38, -3, -1, 98, 22, -1, 97, -1, 6, 96, -9, + -5, -1, 83, -1, 53, 68, -1, 37, 82, -1, 81, -1, 21, 5, -33, + -23, -13, -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20, + -5, -1, 65, -1, 4, 64, -1, 35, 50, -3, -1, 19, 49, -3, -1, + 3, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16, + 0 +}; + +static const short tab24[] = +{ +-451,-117, -43, -25, -15, -7, -3, -1, 239, 254, -1, 223, 253, -3, -1, + 207, 252, -1, 191, 251, -5, -1, 250, -1, 175, 159, -1, 249, 248, -9, + -5, -3, -1, 143, 127, 247, -1, 111, 246, -3, -1, 95, 245, -1, 79, + 244, -71, -7, -3, -1, 63, 243, -1, 47, 242, -5, -1, 241, -1, 31, + 240, -25, -9, -1, 15, -3, -1, 238, 222, -1, 237, 206, -7, -3, -1, + 236, 221, -1, 190, 235, -3, -1, 205, 220, -1, 174, 234, -15, -7, -3, + -1, 189, 219, -1, 204, 158, -3, -1, 233, 173, -1, 218, 188, -7, -3, + -1, 203, 142, -1, 232, 157, -3, -1, 217, 126, -1, 231, 172, 255,-235, +-143, -77, -45, -25, -15, -7, -3, -1, 202, 187, -1, 141, 216, -5, -3, + -1, 14, 224, 13, 230, -5, -3, -1, 110, 156, 201, -1, 94, 186, -9, + -5, -1, 229, -1, 171, 125, -1, 215, 228, -3, -1, 140, 200, -3, -1, + 78, 46, 62, -15, -7, -3, -1, 109, 214, -1, 227, 155, -3, -1, 185, + 170, -1, 226, 30, -7, -3, -1, 225, 93, -1, 213, 124, -3, -1, 199, + 77, -1, 139, 184, -31, -15, -7, -3, -1, 212, 154, -1, 169, 108, -3, + -1, 198, 61, -1, 211, 45, -7, -3, -1, 210, 29, -1, 123, 183, -3, + -1, 209, 92, -1, 197, 138, -17, -7, -3, -1, 168, 153, -1, 76, 196, + -3, -1, 107, 182, -3, -1, 208, 12, 60, -7, -3, -1, 195, 122, -1, + 167, 44, -3, -1, 194, 91, -1, 181, 28, -57, -35, -19, -7, -3, -1, + 137, 152, -1, 193, 75, -5, -3, -1, 192, 11, 59, -3, -1, 176, 10, + 26, -5, -1, 180, -1, 106, 166, -3, -1, 121, 151, -3, -1, 160, 9, + 144, -9, -3, -1, 179, 136, -3, -1, 43, 90, 178, -7, -3, -1, 165, + 27, -1, 177, 105, -1, 150, 164, -17, -9, -5, -3, -1, 74, 120, 135, + -1, 58, 163, -3, -1, 89, 149, -1, 42, 162, -7, -3, -1, 161, 104, + -1, 134, 119, -3, -1, 73, 148, -1, 57, 147, -63, -31, -15, -7, -3, + -1, 88, 133, -1, 41, 103, -3, -1, 118, 146, -1, 25, 145, -7, -3, + -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 40, -17, -7, + -3, -1, 130, 24, -1, 71, 116, -5, -1, 129, -1, 8, 128, -1, 86, + 101, -7, -5, -1, 23, -1, 7, 112, 115, -3, -1, 55, 39, 114, -15, + -7, -3, -1, 70, 100, -1, 85, 113, -3, -1, 54, 99, -1, 69, 84, + -7, -3, -1, 38, 98, -1, 22, 97, -5, -3, -1, 6, 96, 53, -1, + 83, 68, -51, -37, -23, -15, -9, -3, -1, 37, 82, -1, 21, -1, 5, + 80, -1, 81, -1, 52, 67, -3, -1, 36, 66, -1, 51, 20, -9, -5, + -1, 65, -1, 4, 64, -1, 35, 50, -1, 19, 49, -7, -5, -3, -1, + 3, 48, 34, 18, -1, 33, -1, 2, 32, -3, -1, 17, 1, -1, 16, + 0 +}; + +static const short tab_c0[] = +{ + -29, -21, -13, -7, -3, -1, 11, 15, -1, 13, 14, -3, -1, 7, 5, + 9, -3, -1, 6, 3, -1, 10, 12, -3, -1, 2, 1, -1, 4, 8, + 0 +}; + +static const short tab_c1[] = +{ + -15, -7, -3, -1, 15, 14, -1, 13, 12, -3, -1, 11, 10, -1, 9, + 8, -7, -3, -1, 7, 6, -1, 5, 4, -3, -1, 3, 2, -1, 1, + 0 +}; + + + +static const struct newhuff ht[] = +{ + { /* 0 */ 0 , tab0 } , + { /* 2 */ 0 , tab1 } , + { /* 3 */ 0 , tab2 } , + { /* 3 */ 0 , tab3 } , + { /* 0 */ 0 , tab0 } , + { /* 4 */ 0 , tab5 } , + { /* 4 */ 0 , tab6 } , + { /* 6 */ 0 , tab7 } , + { /* 6 */ 0 , tab8 } , + { /* 6 */ 0 , tab9 } , + { /* 8 */ 0 , tab10 } , + { /* 8 */ 0 , tab11 } , + { /* 8 */ 0 , tab12 } , + { /* 16 */ 0 , tab13 } , + { /* 0 */ 0 , tab0 } , + { /* 16 */ 0 , tab15 } , + + { /* 16 */ 1 , tab16 } , + { /* 16 */ 2 , tab16 } , + { /* 16 */ 3 , tab16 } , + { /* 16 */ 4 , tab16 } , + { /* 16 */ 6 , tab16 } , + { /* 16 */ 8 , tab16 } , + { /* 16 */ 10, tab16 } , + { /* 16 */ 13, tab16 } , + { /* 16 */ 4 , tab24 } , + { /* 16 */ 5 , tab24 } , + { /* 16 */ 6 , tab24 } , + { /* 16 */ 7 , tab24 } , + { /* 16 */ 8 , tab24 } , + { /* 16 */ 9 , tab24 } , + { /* 16 */ 11, tab24 } , + { /* 16 */ 13, tab24 } +}; + +static const struct newhuff htc[] = +{ + { /* 1 , 1 , */ 0 , tab_c0 } , + { /* 1 , 1 , */ 0 , tab_c1 } +}; + + /* *INDENT-ON* */ diff --git a/node_modules/lame/deps/lame/mpglib/interface.c b/node_modules/lame/deps/lame/mpglib/interface.c new file mode 100644 index 0000000..e916440 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/interface.c @@ -0,0 +1,711 @@ +/* + * interface.c + * + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +/* $Id: interface.c,v 1.64 2010/03/22 14:30:19 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdlib.h> +#include <stdio.h> + +#include "common.h" +#include "interface.h" +#include "tabinit.h" +#include "layer3.h" +#include "lame.h" +#include "machine.h" +#include "VbrTag.h" +#include "decode_i386.h" + +#include "layer1.h" +#include "layer2.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +extern void lame_report_def(const char* format, va_list args); + +/* #define HIP_DEBUG */ + +int +InitMP3(PMPSTR mp) +{ + hip_init_tables_layer1(); + hip_init_tables_layer2(); + hip_init_tables_layer3(); + + memset(mp, 0, sizeof(MPSTR)); + + mp->framesize = 0; + mp->num_frames = 0; + mp->enc_delay = -1; + mp->enc_padding = -1; + mp->vbr_header = 0; + mp->header_parsed = 0; + mp->side_parsed = 0; + mp->data_parsed = 0; + mp->free_format = 0; + mp->old_free_format = 0; + mp->ssize = 0; + mp->dsize = 0; + mp->fsizeold = -1; + mp->bsize = 0; + mp->head = mp->tail = NULL; + mp->fr.single = -1; + mp->bsnum = 0; + mp->wordpointer = mp->bsspace[mp->bsnum] + 512; + mp->bitindex = 0; + mp->synth_bo = 1; + mp->sync_bitstream = 1; + + mp->report_dbg = &lame_report_def; + mp->report_err = &lame_report_def; + mp->report_msg = &lame_report_def; + + make_decode_tables(32767); + + return 1; +} + +void +ExitMP3(PMPSTR mp) +{ + struct buf *b, *bn; + + b = mp->tail; + while (b) { + free(b->pnt); + bn = b->next; + free(b); + b = bn; + } +} + +static struct buf * +addbuf(PMPSTR mp, unsigned char *buf, int size) +{ + struct buf *nbuf; + + nbuf = (struct buf *) malloc(sizeof(struct buf)); + if (!nbuf) { + lame_report_fnc(mp->report_err, "hip: addbuf() Out of memory!\n"); + return NULL; + } + nbuf->pnt = (unsigned char *) malloc((size_t) size); + if (!nbuf->pnt) { + free(nbuf); + return NULL; + } + nbuf->size = size; + memcpy(nbuf->pnt, buf, (size_t) size); + nbuf->next = NULL; + nbuf->prev = mp->head; + nbuf->pos = 0; + + if (!mp->tail) { + mp->tail = nbuf; + } + else { + mp->head->next = nbuf; + } + + mp->head = nbuf; + mp->bsize += size; + + return nbuf; +} + +void +remove_buf(PMPSTR mp) +{ + struct buf *buf = mp->tail; + + mp->tail = buf->next; + if (mp->tail) + mp->tail->prev = NULL; + else { + mp->tail = mp->head = NULL; + } + + free(buf->pnt); + free(buf); + +} + +static int +read_buf_byte(PMPSTR mp) +{ + unsigned int b; + + int pos; + + + pos = mp->tail->pos; + while (pos >= mp->tail->size) { + remove_buf(mp); + if (!mp->tail) { + lame_report_fnc(mp->report_err, "hip: Fatal error! tried to read past mp buffer\n"); + exit(1); + } + pos = mp->tail->pos; + } + + b = mp->tail->pnt[pos]; + mp->bsize--; + mp->tail->pos++; + + + return b; +} + + + +static void +read_head(PMPSTR mp) +{ + unsigned long head; + + head = read_buf_byte(mp); + head <<= 8; + head |= read_buf_byte(mp); + head <<= 8; + head |= read_buf_byte(mp); + head <<= 8; + head |= read_buf_byte(mp); + + mp->header = head; +} + + + + +static void +copy_mp(PMPSTR mp, int size, unsigned char *ptr) +{ + int len = 0; + + while (len < size && mp->tail) { + int nlen; + int blen = mp->tail->size - mp->tail->pos; + if ((size - len) <= blen) { + nlen = size - len; + } + else { + nlen = blen; + } + memcpy(ptr + len, mp->tail->pnt + mp->tail->pos, (size_t) nlen); + len += nlen; + mp->tail->pos += nlen; + mp->bsize -= nlen; + if (mp->tail->pos == mp->tail->size) { + remove_buf(mp); + } + } +} + +/* number of bytes needed by GetVbrTag to parse header */ +#define XING_HEADER_SIZE 194 + +/* +traverse mp data structure without changing it +(just like sync_buffer) +pull out Xing bytes +call vbr header check code from LAME +if we find a header, parse it and also compute the VBR header size +if no header, do nothing. + +bytes = number of bytes before MPEG header. skip this many bytes +before starting to read +return value: number of bytes in VBR header, including syncword +*/ +static int +check_vbr_header(PMPSTR mp, int bytes) +{ + int i, pos; + struct buf *buf = mp->tail; + unsigned char xing[XING_HEADER_SIZE]; + VBRTAGDATA pTagData; + + pos = buf->pos; + /* skip to valid header */ + for (i = 0; i < bytes; ++i) { + while (pos >= buf->size) { + buf = buf->next; + if (!buf) + return -1; /* fatal error */ + pos = buf->pos; + } + ++pos; + } + /* now read header */ + for (i = 0; i < XING_HEADER_SIZE; ++i) { + while (pos >= buf->size) { + buf = buf->next; + if (!buf) + return -1; /* fatal error */ + pos = buf->pos; + } + xing[i] = buf->pnt[pos]; + ++pos; + } + + /* check first bytes for Xing header */ + mp->vbr_header = GetVbrTag(&pTagData, xing); + if (mp->vbr_header) { + mp->num_frames = pTagData.frames; + mp->enc_delay = pTagData.enc_delay; + mp->enc_padding = pTagData.enc_padding; + + /* lame_report_fnc(mp->report_msg,"hip: delays: %i %i \n",mp->enc_delay,mp->enc_padding); */ + /* lame_report_fnc(mp->report_msg,"hip: Xing VBR header dectected. MP3 file has %i frames\n", pTagData.frames); */ + if (pTagData.headersize < 1) + return 1; + return pTagData.headersize; + } + return 0; +} + + + + + +static int +sync_buffer(PMPSTR mp, int free_match) +{ + /* traverse mp structure without modifying pointers, looking + * for a frame valid header. + * if free_format, valid header must also have the same + * samplerate. + * return number of bytes in mp, before the header + * return -1 if header is not found + */ + unsigned int b[4] = { 0, 0, 0, 0 }; + int i, h, pos; + struct buf *buf = mp->tail; + if (!buf) + return -1; + + pos = buf->pos; + for (i = 0; i < mp->bsize; i++) { + /* get 4 bytes */ + + b[0] = b[1]; + b[1] = b[2]; + b[2] = b[3]; + while (pos >= buf->size) { + buf = buf->next; + pos = buf->pos; + if (!buf) { + return -1; + /* not enough data to read 4 bytes */ + } + } + b[3] = buf->pnt[pos]; + ++pos; + + if (i >= 3) { + struct frame *fr = &mp->fr; + unsigned long head; + + head = b[0]; + head <<= 8; + head |= b[1]; + head <<= 8; + head |= b[2]; + head <<= 8; + head |= b[3]; + h = head_check(head, fr->lay); + + if (h && free_match) { + /* just to be even more thorough, match the sample rate */ + int mode, stereo, sampling_frequency, mpeg25, lsf; + + if (head & (1 << 20)) { + lsf = (head & (1 << 19)) ? 0x0 : 0x1; + mpeg25 = 0; + } + else { + lsf = 1; + mpeg25 = 1; + } + + mode = ((head >> 6) & 0x3); + stereo = (mode == MPG_MD_MONO) ? 1 : 2; + + if (mpeg25) + sampling_frequency = 6 + ((head >> 10) & 0x3); + else + sampling_frequency = ((head >> 10) & 0x3) + (lsf * 3); + h = ((stereo == fr->stereo) && (lsf == fr->lsf) && (mpeg25 == fr->mpeg25) && + (sampling_frequency == fr->sampling_frequency)); + } + + if (h) { + return i - 3; + } + } + } + return -1; +} + + +void +decode_reset(PMPSTR mp) +{ +#if 0 + remove_buf(mp); + /* start looking for next frame */ + /* mp->fsizeold = mp->framesize; */ + mp->fsizeold = -1; + mp->old_free_format = mp->free_format; + mp->framesize = 0; + mp->header_parsed = 0; + mp->side_parsed = 0; + mp->data_parsed = 0; + mp->sync_bitstream = 1; /* TODO check if this is right */ +#else + InitMP3(mp); /* Less error prone to just to reinitialise. */ +#endif +} + +int +audiodata_precedesframes(PMPSTR mp) +{ + if (mp->fr.lay == 3) + return layer3_audiodata_precedesframes(mp); + else + return 0; /* For Layer 1 & 2 the audio data starts at the frame that describes it, so no audio data precedes. */ +} + +static int +decodeMP3_clipchoice(PMPSTR mp, unsigned char *in, int isize, char *out, int *done, + int (*synth_1to1_mono_ptr) (PMPSTR, real *, unsigned char *, int *), + int (*synth_1to1_ptr) (PMPSTR, real *, int, unsigned char *, int *)) +{ + int i, iret, bits, bytes; + + if (in && isize && addbuf(mp, in, isize) == NULL) + return MP3_ERR; + + /* First decode header */ + if (!mp->header_parsed) { + + if (mp->fsizeold == -1 || mp->sync_bitstream) { + int vbrbytes; + mp->sync_bitstream = 0; + + /* This is the very first call. sync with anything */ + /* bytes= number of bytes before header */ + bytes = sync_buffer(mp, 0); + + /* now look for Xing VBR header */ + if (mp->bsize >= bytes + XING_HEADER_SIZE) { + /* vbrbytes = number of bytes in entire vbr header */ + vbrbytes = check_vbr_header(mp, bytes); + } + else { + /* not enough data to look for Xing header */ +#ifdef HIP_DEBUG + lame_report_fnc(mp->report_dbg, "hip: not enough data to look for Xing header\n"); +#endif + return MP3_NEED_MORE; + } + + if (mp->vbr_header) { + /* do we have enough data to parse entire Xing header? */ + if (bytes + vbrbytes > mp->bsize) { + /* lame_report_fnc(mp->report_err,"hip: not enough data to parse entire Xing header\n"); */ + return MP3_NEED_MORE; + } + + /* read in Xing header. Buffer data in case it + * is used by a non zero main_data_begin for the next + * frame, but otherwise dont decode Xing header */ +#ifdef HIP_DEBUG + lame_report_fnc(mp->report_dbg, "hip: found xing header, skipping %i bytes\n", vbrbytes + bytes); +#endif + for (i = 0; i < vbrbytes + bytes; ++i) + read_buf_byte(mp); + /* now we need to find another syncword */ + /* just return and make user send in more data */ + + return MP3_NEED_MORE; + } + } + else { + /* match channels, samplerate, etc, when syncing */ + bytes = sync_buffer(mp, 1); + } + + /* buffer now synchronized */ + if (bytes < 0) { + /* lame_report_fnc(mp->report_err,"hip: need more bytes %d\n", bytes); */ + return MP3_NEED_MORE; + } + if (bytes > 0) { + /* there were some extra bytes in front of header. + * bitstream problem, but we are now resynced + * should try to buffer previous data in case new + * frame has nonzero main_data_begin, but we need + * to make sure we do not overflow buffer + */ + int size; + lame_report_fnc(mp->report_err, "hip: bitstream problem, resyncing skipping %d bytes...\n", bytes); + mp->old_free_format = 0; +#if 1 + /* FIXME: correct ??? */ + mp->sync_bitstream = 1; +#endif + /* skip some bytes, buffer the rest */ + size = (int) (mp->wordpointer - (mp->bsspace[mp->bsnum] + 512)); + + if (size > MAXFRAMESIZE) { + /* wordpointer buffer is trashed. probably cant recover, but try anyway */ + lame_report_fnc(mp->report_err, "hip: wordpointer trashed. size=%i (%i) bytes=%i \n", + size, MAXFRAMESIZE, bytes); + size = 0; + mp->wordpointer = mp->bsspace[mp->bsnum] + 512; + } + + /* buffer contains 'size' data right now + we want to add 'bytes' worth of data, but do not + exceed MAXFRAMESIZE, so we through away 'i' bytes */ + i = (size + bytes) - MAXFRAMESIZE; + for (; i > 0; --i) { + --bytes; + read_buf_byte(mp); + } + + copy_mp(mp, bytes, mp->wordpointer); + mp->fsizeold += bytes; + } + + read_head(mp); + decode_header(mp, &mp->fr, mp->header); + mp->header_parsed = 1; + mp->framesize = mp->fr.framesize; + mp->free_format = (mp->framesize == 0); + + if (mp->fr.lsf) + mp->ssize = (mp->fr.stereo == 1) ? 9 : 17; + else + mp->ssize = (mp->fr.stereo == 1) ? 17 : 32; + if (mp->fr.error_protection) + mp->ssize += 2; + + mp->bsnum = 1 - mp->bsnum; /* toggle buffer */ + mp->wordpointer = mp->bsspace[mp->bsnum] + 512; + mp->bitindex = 0; + + /* for very first header, never parse rest of data */ + if (mp->fsizeold == -1) { +#ifdef HIP_DEBUG + lame_report_fnc(mp->report_dbg, "hip: not parsing the rest of the data of the first header\n"); +#endif + return MP3_NEED_MORE; + } + } /* end of header parsing block */ + + /* now decode side information */ + if (!mp->side_parsed) { + + /* Layer 3 only */ + if (mp->fr.lay == 3) { + if (mp->bsize < mp->ssize) + return MP3_NEED_MORE; + + copy_mp(mp, mp->ssize, mp->wordpointer); + + if (mp->fr.error_protection) + getbits(mp, 16); + bits = decode_layer3_sideinfo(mp); + /* bits = actual number of bits needed to parse this frame */ + /* can be negative, if all bits needed are in the reservoir */ + if (bits < 0) + bits = 0; + + /* read just as many bytes as necessary before decoding */ + mp->dsize = (bits + 7) / 8; + + if (!mp->free_format) { + /* do not read more than framsize data */ + int framesize = mp->fr.framesize - mp->ssize; + if (mp->dsize > framesize) { + lame_report_fnc(mp->report_err, + "hip: error audio data exceeds framesize by %d bytes\n", + mp->dsize - framesize); + mp->dsize = framesize; + } + } +#ifdef HIP_DEBUG + lame_report_fnc(mp->report_dbg, + "hip: %d bits needed to parse layer III frame, number of bytes to read before decoding dsize = %d\n", + bits, mp->dsize); +#endif + + /* this will force mpglib to read entire frame before decoding */ + /* mp->dsize= mp->framesize - mp->ssize; */ + + } + else { + /* Layers 1 and 2 */ + + /* check if there is enough input data */ + if (mp->fr.framesize > mp->bsize) + return MP3_NEED_MORE; + + /* takes care that the right amount of data is copied into wordpointer */ + mp->dsize = mp->fr.framesize; + mp->ssize = 0; + } + + mp->side_parsed = 1; + } + + /* now decode main data */ + iret = MP3_NEED_MORE; + if (!mp->data_parsed) { + if (mp->dsize > mp->bsize) { + return MP3_NEED_MORE; + } + + copy_mp(mp, mp->dsize, mp->wordpointer); + + *done = 0; + + /*do_layer3(&mp->fr,(unsigned char *) out,done); */ + switch (mp->fr.lay) { + case 1: + if (mp->fr.error_protection) + getbits(mp, 16); + + decode_layer1_frame(mp, (unsigned char *) out, done); + break; + + case 2: + if (mp->fr.error_protection) + getbits(mp, 16); + + decode_layer2_frame(mp, (unsigned char *) out, done); + break; + + case 3: + decode_layer3_frame(mp, (unsigned char *) out, done, synth_1to1_mono_ptr, synth_1to1_ptr); + break; + default: + lame_report_fnc(mp->report_err, "hip: invalid layer %d\n", mp->fr.lay); + } + + mp->wordpointer = mp->bsspace[mp->bsnum] + 512 + mp->ssize + mp->dsize; + + mp->data_parsed = 1; + iret = MP3_OK; + } + + + /* remaining bits are ancillary data, or reservoir for next frame + * If free format, scan stream looking for next frame to determine + * mp->framesize */ + if (mp->free_format) { + if (mp->old_free_format) { + /* free format. bitrate must not vary */ + mp->framesize = mp->fsizeold_nopadding + (mp->fr.padding); + } + else { + bytes = sync_buffer(mp, 1); + if (bytes < 0) + return iret; + mp->framesize = bytes + mp->ssize + mp->dsize; + mp->fsizeold_nopadding = mp->framesize - mp->fr.padding; +#if 0 + lame_report_fnc(mp->report_dbg,"hip: freeformat bitstream: estimated bitrate=%ikbs \n", + 8*(4+mp->framesize)*freqs[mp->fr.sampling_frequency]/ + (1000*576*(2-mp->fr.lsf))); +#endif + } + } + + /* buffer the ancillary data and reservoir for next frame */ + bytes = mp->framesize - (mp->ssize + mp->dsize); + if (bytes > mp->bsize) { + return iret; + } + + if (bytes > 0) { + int size; +#if 1 + /* FIXME: while loop OK ??? */ + while (bytes > 512) { + read_buf_byte(mp); + bytes--; + mp->framesize--; + } +#endif + copy_mp(mp, bytes, mp->wordpointer); + mp->wordpointer += bytes; + + size = (int) (mp->wordpointer - (mp->bsspace[mp->bsnum] + 512)); + if (size > MAXFRAMESIZE) { + lame_report_fnc(mp->report_err, "hip: fatal error. MAXFRAMESIZE not large enough.\n"); + } + + } + + /* the above frame is completely parsed. start looking for next frame */ + mp->fsizeold = mp->framesize; + mp->old_free_format = mp->free_format; + mp->framesize = 0; + mp->header_parsed = 0; + mp->side_parsed = 0; + mp->data_parsed = 0; + + return iret; +} + +int +decodeMP3(PMPSTR mp, unsigned char *in, int isize, char *out, int osize, int *done) +{ + if (osize < 4608) { + lame_report_fnc(mp->report_err, "hip: Insufficient memory for decoding buffer %d\n", osize); + return MP3_ERR; + } + + /* passing pointers to the functions which clip the samples */ + return decodeMP3_clipchoice(mp, in, isize, out, done, synth_1to1_mono, synth_1to1); +} + +int +decodeMP3_unclipped(PMPSTR mp, unsigned char *in, int isize, char *out, int osize, int *done) +{ + /* we forbid input with more than 1152 samples per channel for output in unclipped mode */ + if (osize < (int) (1152 * 2 * sizeof(real))) { + lame_report_fnc(mp->report_err, "hip: out space too small for unclipped mode\n"); + return MP3_ERR; + } + + /* passing pointers to the functions which don't clip the samples */ + return decodeMP3_clipchoice(mp, in, isize, out, done, synth_1to1_mono_unclipped, + synth_1to1_unclipped); +} diff --git a/node_modules/lame/deps/lame/mpglib/interface.h b/node_modules/lame/deps/lame/mpglib/interface.h new file mode 100644 index 0000000..f713b46 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/interface.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef INTERFACE_H_INCLUDED +#define INTERFACE_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#include "common.h" + + int InitMP3(PMPSTR mp); + int decodeMP3(PMPSTR mp, unsigned char *inmemory, int inmemsize, char *outmemory, + int outmemsize, int *done); + void ExitMP3(PMPSTR mp); + +/* added decodeMP3_unclipped to support returning raw floating-point values of samples. The representation + of the floating-point numbers is defined in mpg123.h as #define real. It is 64-bit double by default. + No more than 1152 samples per channel are allowed. */ + int decodeMP3_unclipped(PMPSTR mp, unsigned char *inmemory, int inmemsize, char *outmemory, + int outmemsize, int *done); + +/* added remove_buf to support mpglib seeking */ + void remove_buf(PMPSTR mp); + +/* added audiodata_precedesframes to return the number of bitstream frames the audio data will precede the + current frame by for Layer 3 data. Aids seeking. + */ + int audiodata_precedesframes(PMPSTR mp); + +/* Resets decoding. Aids seeking. */ + void decode_reset(PMPSTR mp); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/node_modules/lame/deps/lame/mpglib/l2tables.h b/node_modules/lame/deps/lame/mpglib/l2tables.h new file mode 100644 index 0000000..6a3deac --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/l2tables.h @@ -0,0 +1,183 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Layer 2 Alloc tables .. + * most other tables are calculated on program start (which is (of course) + * not ISO-conform) .. + * Layer-3 huffman table is in huffman.h + */ + +const struct al_table2 alloc_0[] = { + {4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10, + -511}, + {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767}, + {4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10, + -511}, + {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767}, + {4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10, + -511}, + {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767} +}; + +const struct al_table2 alloc_1[] = { + {4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10, + -511}, + {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767}, + {4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10, + -511}, + {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767}, + {4, 0}, {5, 3}, {3, -3}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, {10, + -511}, + {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {3, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767}, + {2, 0}, {5, 3}, {7, 5}, {16, -32767} +}; + +const struct al_table2 alloc_2[] = { + {4, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, + {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, + {4, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, + {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63} +}; + +const struct al_table2 alloc_3[] = { + {4, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, + {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, + {4, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, {9, -255}, + {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, {15, -16383}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63} +}; + +const struct al_table2 alloc_4[] = { + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, + {4, 0}, {5, 3}, {7, 5}, {3, -3}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, {8, -127}, + {9, -255}, {10, -511}, {11, -1023}, {12, -2047}, {13, -4095}, {14, -8191}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {3, 0}, {5, 3}, {7, 5}, {10, 9}, {4, -7}, {5, -15}, {6, -31}, {7, -63}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9}, + {2, 0}, {5, 3}, {7, 5}, {10, 9} +}; diff --git a/node_modules/lame/deps/lame/mpglib/layer1.c b/node_modules/lame/deps/lame/mpglib/layer1.c new file mode 100644 index 0000000..770eec3 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/layer1.c @@ -0,0 +1,221 @@ +/* + * layer1.c: Mpeg Layer-1 audio decoder + * + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* $Id: layer1.c,v 1.30 2010/03/22 14:30:19 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <assert.h> +#include "common.h" +#include "decode_i386.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +#include "layer1.h" + +static int gd_are_hip_tables_layer1_initialized = 0; + +void +hip_init_tables_layer1(void) +{ + if (gd_are_hip_tables_layer1_initialized) { + return; + } + gd_are_hip_tables_layer1_initialized = 1; +} + +typedef struct sideinfo_layer_I_struct +{ + unsigned char allocation[SBLIMIT][2]; + unsigned char scalefactor[SBLIMIT][2]; +} sideinfo_layer_I; + +static void +I_step_one(PMPSTR mp, sideinfo_layer_I* si) +{ + struct frame *fr = &(mp->fr); + int jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext << 2) + 4 : 32; + int i; + memset(si, 0, sizeof(*si)); + assert(fr->stereo == 1 || fr->stereo == 2); + + if (fr->stereo == 2) { + for (i = 0; i < jsbound; i++) { + unsigned char b0 = get_leq_8_bits(mp, 4); /* values 0-15 */ + unsigned char b1 = get_leq_8_bits(mp, 4); /* values 0-15 */ + si->allocation[i][0] = b0; + si->allocation[i][1] = b1; + } + for (i = jsbound; i < SBLIMIT; i++) { + unsigned char b = get_leq_8_bits(mp, 4); /* values 0-15 */ + si->allocation[i][0] = b; + si->allocation[i][1] = b; + } + for (i = 0; i < SBLIMIT; i++) { + unsigned char n0 = si->allocation[i][0]; + unsigned char n1 = si->allocation[i][1]; + unsigned char b0 = n0 ? get_leq_8_bits(mp, 6) : 0; /* values 0-63 */ + unsigned char b1 = n1 ? get_leq_8_bits(mp, 6) : 0; /* values 0-63 */ + si->scalefactor[i][0] = b0; + si->scalefactor[i][1] = b1; + } + } + else { + for (i = 0; i < SBLIMIT; i++) { + unsigned char b0 = get_leq_8_bits(mp, 4); /* values 0-15 */ + si->allocation[i][0] = b0; + } + for (i = 0; i < SBLIMIT; i++) { + unsigned char n0 = si->allocation[i][0]; + unsigned char b0 = n0 ? get_leq_8_bits(mp, 6) : 0; /* values 0-63 */ + si->scalefactor[i][0] = b0; + } + } +} + +static void +I_step_two(PMPSTR mp, sideinfo_layer_I *si, real fraction[2][SBLIMIT]) +{ + double r0, r1; + struct frame *fr = &(mp->fr); + int ds_limit = fr->down_sample_sblimit; + int i; + + assert(fr->stereo == 1 || fr->stereo == 2); + if (fr->stereo == 2) { + int jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext << 2) + 4 : 32; + for (i = 0; i < jsbound; i++) { + unsigned char i0 = si->scalefactor[i][0]; + unsigned char i1 = si->scalefactor[i][1]; + unsigned char n0 = si->allocation[i][0]; + unsigned char n1 = si->allocation[i][1]; + assert( i0 < 64 ); + assert( i1 < 64 ); + assert( n0 < 16 ); + assert( n1 < 16 ); + if (n0 > 0) { + unsigned short v = get_leq_16_bits(mp, n0 + 1); /* 0-65535 */ + r0 = (((-1) << n0) + v + 1) * muls[n0 + 1][i0]; + } + else { + r0 = 0; + } + if (n1 > 0) { + unsigned short v = get_leq_16_bits(mp, n1 + 1); /* 0-65535 */ + r1 = (((-1) << n1) + v + 1) * muls[n1 + 1][i1]; + } + else { + r1 = 0; + } + fraction[0][i] = (real)r0; + fraction[1][i] = (real)r1; + } + for (i = jsbound; i < SBLIMIT; i++) { + unsigned char i0 = si->scalefactor[i][0]; + unsigned char i1 = si->scalefactor[i][1]; + unsigned char n = si->allocation[i][0]; + assert( i0 < 64 ); + assert( i1 < 64 ); + assert( n < 16 ); + if (n > 0) { + unsigned short v = get_leq_16_bits(mp, n + 1); /* 0-65535 */ + unsigned int w = (((-1) << n) + v + 1); + r0 = w * muls[n + 1][i0]; + r1 = w * muls[n + 1][i1]; + } + else { + r0 = r1 = 0; + } + fraction[0][i] = (real)r0; + fraction[1][i] = (real)r1; + } + for (i = ds_limit; i < SBLIMIT; i++) { + fraction[0][i] = 0.0; + fraction[1][i] = 0.0; + } + } + else { + for (i = 0; i < SBLIMIT; i++) { + unsigned char n = si->allocation[i][0]; + unsigned char j = si->scalefactor[i][0]; + assert( j < 64 ); + assert( n < 16 ); + if (n > 0) { + unsigned short v = get_leq_16_bits(mp, n + 1); + r0 = (((-1) << n) + v + 1) * muls[n + 1][j]; + } + else { + r0 = 0; + } + fraction[0][i] = (real)r0; + } + for (i = ds_limit; i < SBLIMIT; i++) { + fraction[0][i] = 0.0; + } + } +} + +int +decode_layer1_sideinfo(PMPSTR mp) +{ + (void) mp; + /* FIXME: extract side information and check values */ + return 0; +} + +int +decode_layer1_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point) +{ + real fraction[2][SBLIMIT]; /* FIXME: change real -> double ? */ + sideinfo_layer_I si; + struct frame *fr = &(mp->fr); + int single = fr->single; + int i, clip = 0; + + I_step_one(mp, &si); + + if (fr->stereo == 1 || single == 3) + single = 0; + + if (single >= 0) { + /* decoding one of possibly two channels */ + for (i = 0; i < SCALE_BLOCK; i++) { + I_step_two(mp, &si, fraction); + clip += synth_1to1_mono(mp, (real *) fraction[single], pcm_sample, pcm_point); + } + } + else { + for (i = 0; i < SCALE_BLOCK; i++) { + int p1 = *pcm_point; + I_step_two(mp, &si, fraction); + clip += synth_1to1(mp, (real *) fraction[0], 0, pcm_sample, &p1); + clip += synth_1to1(mp, (real *) fraction[1], 1, pcm_sample, pcm_point); + } + } + + return clip; +} diff --git a/node_modules/lame/deps/lame/mpglib/layer1.h b/node_modules/lame/deps/lame/mpglib/layer1.h new file mode 100644 index 0000000..308c437 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/layer1.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAYER1_H_INCLUDED +#define LAYER1_H_INCLUDED + +void hip_init_tables_layer1(void); +int decode_layer1_sideinfo(PMPSTR mp); +int decode_layer1_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point); + +#endif diff --git a/node_modules/lame/deps/lame/mpglib/layer2.c b/node_modules/lame/deps/lame/mpglib/layer2.c new file mode 100644 index 0000000..442ccfe --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/layer2.c @@ -0,0 +1,400 @@ +/* + * layer2.c: Mpeg Layer-2 audio decoder + * + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +/* $Id: layer2.c,v 1.32 2011/05/24 20:40:56 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include "common.h" +#include "layer2.h" +#include "l2tables.h" +#include "decode_i386.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif +#include <assert.h> + +static int gd_are_hip_tables_layer2_initialized = 0; + +static unsigned char grp_3tab[32 * 3] = { 0, }; /* used: 27 */ +static unsigned char grp_5tab[128 * 3] = { 0, }; /* used: 125 */ +static unsigned char grp_9tab[1024 * 3] = { 0, }; /* used: 729 */ + + +void +hip_init_tables_layer2(void) +{ + static const double mulmul[27] = { + 0.0, -2.0 / 3.0, 2.0 / 3.0, + 2.0 / 7.0, 2.0 / 15.0, 2.0 / 31.0, 2.0 / 63.0, 2.0 / 127.0, 2.0 / 255.0, + 2.0 / 511.0, 2.0 / 1023.0, 2.0 / 2047.0, 2.0 / 4095.0, 2.0 / 8191.0, + 2.0 / 16383.0, 2.0 / 32767.0, 2.0 / 65535.0, + -4.0 / 5.0, -2.0 / 5.0, 2.0 / 5.0, 4.0 / 5.0, + -8.0 / 9.0, -4.0 / 9.0, -2.0 / 9.0, 2.0 / 9.0, 4.0 / 9.0, 8.0 / 9.0 + }; + static const unsigned char base[3][9] = { + {1, 0, 2,}, + {17, 18, 0, 19, 20,}, + {21, 1, 22, 23, 0, 24, 25, 2, 26} + }; + int i, j, k, l, len; + real *table; + static const int tablen[3] = { 3, 5, 9 }; + static unsigned char *itable, *tables[3] = { grp_3tab, grp_5tab, grp_9tab }; + + if (gd_are_hip_tables_layer2_initialized) { + return; + } + gd_are_hip_tables_layer2_initialized = 1; + + for (i = 0; i < 3; i++) { + itable = tables[i]; + len = tablen[i]; + for (j = 0; j < len; j++) + for (k = 0; k < len; k++) + for (l = 0; l < len; l++) { + *itable++ = base[i][l]; + *itable++ = base[i][k]; + *itable++ = base[i][j]; + } + } + + for (k = 0; k < 27; k++) { + double m = mulmul[k]; + table = muls[k]; + for (j = 3, i = 0; i < 63; i++, j--) + *table++ = (real) (m * pow(2.0, (double) j / 3.0)); + *table++ = 0.0; + } +} + + +static unsigned char* +grp_table_select(short d1, unsigned int idx) +{ + /* RH: it seems to be common, that idx is larger than the table's sizes. + is it OK to return a zero vector in this case? FIXME + /*/ + static unsigned char dummy_table[] = { 0,0,0 }; + unsigned int x; + switch (d1) { + case 3: + x = 3*3*3; + idx = idx < x ? idx : x; + return &grp_3tab[3 * idx]; + case 5: + x = 5*5*5; + idx = idx < x ? idx : x; + return &grp_5tab[3 * idx]; + case 9: + x = 9*9*9; + idx = idx < x ? idx : x; + return &grp_9tab[3 * idx]; + default: + /* fatal error */ + assert(0); + } + return &dummy_table[0]; +} + +typedef struct sideinfo_layer_II_struct +{ + unsigned char allocation[SBLIMIT][2]; + unsigned char scalefactor[SBLIMIT][2][3]; /* subband / channel / block */ +} sideinfo_layer_II; + + + +static void +II_step_one(PMPSTR mp, sideinfo_layer_II *si, struct frame *fr) +{ + int nch = fr->stereo; + int sblimit = fr->II_sblimit; + int jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext << 2) + 4 : fr->II_sblimit; + struct al_table2 const *alloc1 = fr->alloc; + unsigned char scfsi[SBLIMIT][2]; + int i, ch; + + memset(si, 0, sizeof(*si)); + + if (nch == 2) { + for (i = 0; i < jsbound; ++i) { + short step = alloc1->bits; + unsigned char b0 = get_leq_8_bits(mp, step); + unsigned char b1 = get_leq_8_bits(mp, step); + alloc1 += (1 << step); + si->allocation[i][0] = b0; + si->allocation[i][1] = b1; + } + for (i = jsbound; i < sblimit; ++i) { + short step = alloc1->bits; + unsigned char b0 = get_leq_8_bits(mp, step); + alloc1 += (1 << step); + si->allocation[i][0] = b0; + si->allocation[i][1] = b0; + } + for (i = 0; i < sblimit; ++i) { + unsigned char n0 = si->allocation[i][0]; + unsigned char n1 = si->allocation[i][1]; + unsigned char b0 = n0 ? get_leq_8_bits(mp, 2) : 0; + unsigned char b1 = n1 ? get_leq_8_bits(mp, 2) : 0; + scfsi[i][0] = b0; + scfsi[i][1] = b1; + } + } + else { /* mono */ + for (i = 0; i < sblimit; ++i) { + short step = alloc1->bits; + unsigned char b0 = get_leq_8_bits(mp, step); + alloc1 += (1 << step); + si->allocation[i][0] = b0; + } + for (i = 0; i < sblimit; ++i) { + unsigned char n0 = si->allocation[i][0]; + unsigned char b0 = n0 ? get_leq_8_bits(mp, 2) : 0; + scfsi[i][0] = b0; + } + } + for (i = 0; i < sblimit; ++i) { + for (ch = 0; ch < nch; ++ch) { + unsigned char s0 = 0, s1 = 0, s2 = 0; + if (si->allocation[i][ch]) { + switch (scfsi[i][ch]) { + case 0: + s0 = get_leq_8_bits(mp, 6); + s1 = get_leq_8_bits(mp, 6); + s2 = get_leq_8_bits(mp, 6); + break; + case 1: + s0 = get_leq_8_bits(mp, 6); + s1 = s0; + s2 = get_leq_8_bits(mp, 6); + break; + case 2: + s0 = get_leq_8_bits(mp, 6); + s1 = s0; + s2 = s0; + break; + case 3: + s0 = get_leq_8_bits(mp, 6); + s1 = get_leq_8_bits(mp, 6); + s2 = s1; + break; + default: + assert(0); + } + } + si->scalefactor[i][ch][0] = s0; + si->scalefactor[i][ch][1] = s1; + si->scalefactor[i][ch][2] = s2; + } + } +} + +static void +II_step_two(PMPSTR mp, sideinfo_layer_II* si, struct frame *fr, int gr, real fraction[2][4][SBLIMIT]) +{ + struct al_table2 const *alloc1 = fr->alloc; + int sblimit = fr->II_sblimit; + int jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext << 2) + 4 : fr->II_sblimit; + int i, ch, nch = fr->stereo; + double cm, r0, r1, r2; + + for (i = 0; i < jsbound; ++i) { + short step = alloc1->bits; + for (ch = 0; ch < nch; ++ch) { + unsigned char ba = si->allocation[i][ch]; + if (ba) { + unsigned char x1 = si->scalefactor[i][ch][gr]; + struct al_table2 const *alloc2 = alloc1 + ba; + short k = alloc2->bits; + short d1 = alloc2->d; + assert( k <= 16 ); + k = (k <= 16) ? k : 16; + assert( x1 < 64 ); + x1 = (x1 < 64) ? x1 : 63; + if (d1 < 0) { + int v0 = getbits(mp, k); + int v1 = getbits(mp, k); + int v2 = getbits(mp, k); + cm = muls[k][x1]; + r0 = (v0 + d1) * cm; + r1 = (v1 + d1) * cm; + r2 = (v2 + d1) * cm; + } + else { + unsigned int idx = getbits(mp, k); + unsigned char *tab = grp_table_select(d1, idx); + unsigned char k0 = tab[0]; + unsigned char k1 = tab[1]; + unsigned char k2 = tab[2]; + r0 = muls[k0][x1]; + r1 = muls[k1][x1]; + r2 = muls[k2][x1]; + } + fraction[ch][0][i] = (real) r0; + fraction[ch][1][i] = (real) r1; + fraction[ch][2][i] = (real) r2; + } + else { + fraction[ch][0][i] = fraction[ch][1][i] = fraction[ch][2][i] = 0.0; + } + } + alloc1 += (1 << step); + } + + for (i = jsbound; i < sblimit; i++) { + short step = alloc1->bits; + unsigned char ba = si->allocation[i][0]; + if (ba) { + struct al_table2 const *alloc2 = alloc1 + ba; + short k = alloc2->bits; + short d1 = alloc2->d; + assert( k <= 16 ); + k = (k <= 16) ? k : 16; + if (d1 < 0) { + int v0 = getbits(mp, k); + int v1 = getbits(mp, k); + int v2 = getbits(mp, k); + for (ch = 0; ch < nch; ++ch) { + unsigned char x1 = si->scalefactor[i][ch][gr]; + assert( x1 < 64 ); + x1 = (x1 < 64) ? x1 : 63; + cm = muls[k][x1]; + r0 = (v0 + d1) * cm; + r1 = (v1 + d1) * cm; + r2 = (v2 + d1) * cm; + fraction[ch][0][i] = (real) r0; + fraction[ch][1][i] = (real) r1; + fraction[ch][2][i] = (real) r2; + } + } + else { + unsigned int idx = getbits(mp, k); + unsigned char *tab = grp_table_select(d1, idx); + unsigned char k0 = tab[0]; + unsigned char k1 = tab[1]; + unsigned char k2 = tab[2]; + for (ch = 0; ch < nch; ++ch) { + unsigned char x1 = si->scalefactor[i][ch][gr]; + assert( x1 < 64 ); + x1 = (x1 < 64) ? x1 : 63; + r0 = muls[k0][x1]; + r1 = muls[k1][x1]; + r2 = muls[k2][x1]; + fraction[ch][0][i] = (real) r0; + fraction[ch][1][i] = (real) r1; + fraction[ch][2][i] = (real) r2; + } + } + } + else { + fraction[0][0][i] = fraction[0][1][i] = fraction[0][2][i] = 0.0; + fraction[1][0][i] = fraction[1][1][i] = fraction[1][2][i] = 0.0; + } + alloc1 += (1 << step); + } + if (sblimit > fr->down_sample_sblimit) { + sblimit = fr->down_sample_sblimit; + } + for (ch = 0; ch < nch; ++ch) { + for (i = sblimit; i < SBLIMIT; ++i) { + fraction[ch][0][i] = fraction[ch][1][i] = fraction[ch][2][i] = 0.0; + } + } +} + +static void +II_select_table(struct frame *fr) +{ + /* *INDENT-OFF* */ + static const int translate[3][2][16] = + { { { 0,2,2,2,2,2,2,0,0,0,1,1,1,1,1,0 } , + { 0,2,2,0,0,0,1,1,1,1,1,1,1,1,1,0 } } , + { { 0,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0 } , + { 0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0 } } , + { { 0,3,3,3,3,3,3,0,0,0,1,1,1,1,1,0 } , + { 0,3,3,0,0,0,1,1,1,1,1,1,1,1,1,0 } } }; + /* *INDENT-ON* */ + + int table, sblim; + static const struct al_table2 *tables[5] = { alloc_0, alloc_1, alloc_2, alloc_3, alloc_4 }; + static const int sblims[5] = { 27, 30, 8, 12, 30 }; + + if (fr->lsf) + table = 4; + else + table = translate[fr->sampling_frequency][2 - fr->stereo][fr->bitrate_index]; + sblim = sblims[table]; + + fr->alloc = (struct al_table2 const *) tables[table]; + fr->II_sblimit = sblim; +} + + +int +decode_layer2_sideinfo(PMPSTR mp) +{ + (void) mp; + /* FIXME: extract side information and check values */ + return 0; +} + +int +decode_layer2_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point) +{ + real fraction[2][4][SBLIMIT]; /* pick_table clears unused subbands */ + sideinfo_layer_II si; + struct frame *fr = &(mp->fr); + int single = fr->single; + int i, j, clip = 0; + + II_select_table(fr); + II_step_one(mp, &si, fr); + + if (fr->stereo == 1 || single == 3) + single = 0; + + if (single >= 0) { + for (i = 0; i < SCALE_BLOCK; i++) { + II_step_two(mp, &si, fr, i >> 2, fraction); + for (j = 0; j < 3; j++) { + clip += synth_1to1_mono(mp, fraction[single][j], pcm_sample, pcm_point); + } + } + } + else { + for (i = 0; i < SCALE_BLOCK; i++) { + II_step_two(mp, &si, fr, i >> 2, fraction); + for (j = 0; j < 3; j++) { + int p1 = *pcm_point; + clip += synth_1to1(mp, fraction[0][j], 0, pcm_sample, &p1); + clip += synth_1to1(mp, fraction[1][j], 1, pcm_sample, pcm_point); + } + } + } + + return clip; +} diff --git a/node_modules/lame/deps/lame/mpglib/layer2.h b/node_modules/lame/deps/lame/mpglib/layer2.h new file mode 100644 index 0000000..fafc9a7 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/layer2.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#ifndef LAYER2_H_INCLUDED +#define LAYER2_H_INCLUDED + + +struct al_table2 { + short bits; + short d; +}; + + + +void hip_init_tables_layer2(void); +int decode_layer2_sideinfo(PMPSTR mp); +int decode_layer2_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point); + + +#endif diff --git a/node_modules/lame/deps/lame/mpglib/layer3.c b/node_modules/lame/deps/lame/mpglib/layer3.c new file mode 100644 index 0000000..dd7216c --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/layer3.c @@ -0,0 +1,1871 @@ +/* + * layer3.c: Mpeg Layer-3 audio decoder + * + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +/* $Id: layer3.c,v 1.63.2.1 2012/02/11 11:03:20 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdlib.h> +#include "common.h" +#include "huffman.h" +#include "lame.h" +#include "machine.h" +#include "encoder.h" +#include "lame-analysis.h" +#include "decode_i386.h" +#include "layer3.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + + +static int gd_are_hip_tables_layer3_initialized = 0; + +static real ispow[8207]; +static real aa_ca[8], aa_cs[8]; +static real COS1[12][6]; +static real win[4][36]; +static real win1[4][36]; +static real gainpow2[256 + 118 + 4]; +static real COS9[9]; +static real COS6_1, COS6_2; +static real tfcos36[9]; +static real tfcos12[3]; + +struct bandInfoStruct { + short longIdx[23]; + short longDiff[22]; + short shortIdx[14]; + short shortDiff[13]; +}; + +static int longLimit[9][23]; +static int shortLimit[9][14]; + +/* *INDENT-OFF* */ + +static const struct bandInfoStruct bandInfo[9] = { + +/* MPEG 1.0 */ + { {0,4,8,12,16,20,24,30,36,44,52,62,74, 90,110,134,162,196,238,288,342,418,576}, + {4,4,4,4,4,4,6,6,8, 8,10,12,16,20,24,28,34,42,50,54, 76,158}, + {0,4*3,8*3,12*3,16*3,22*3,30*3,40*3,52*3,66*3, 84*3,106*3,136*3,192*3}, + {4,4,4,4,6,8,10,12,14,18,22,30,56} } , + + { {0,4,8,12,16,20,24,30,36,42,50,60,72, 88,106,128,156,190,230,276,330,384,576}, + {4,4,4,4,4,4,6,6,6, 8,10,12,16,18,22,28,34,40,46,54, 54,192}, + {0,4*3,8*3,12*3,16*3,22*3,28*3,38*3,50*3,64*3, 80*3,100*3,126*3,192*3}, + {4,4,4,4,6,6,10,12,14,16,20,26,66} } , + + { {0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576} , + {4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102, 26} , + {0,4*3,8*3,12*3,16*3,22*3,30*3,42*3,58*3,78*3,104*3,138*3,180*3,192*3} , + {4,4,4,4,6,8,12,16,20,26,34,42,12} } , + +/* MPEG 2.0 */ + { {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 } , + {0,4*3,8*3,12*3,18*3,24*3,32*3,42*3,56*3,74*3,100*3,132*3,174*3,192*3} , + {4,4,4,6,6,8,10,14,18,26,32,42,18 } } , + /* docs: 332. mpg123: 330 */ + { {0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576}, + {6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,54,62,70,76,36 } , + {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,136*3,180*3,192*3} , + {4,4,4,6,8,10,12,14,18,24,32,44,12 } } , + + { {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 }, + {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,134*3,174*3,192*3}, + {4,4,4,6,8,10,12,14,18,24,30,40,18 } } , +/* MPEG 2.5 */ + { {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576} , + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54}, + {0,12,24,36,54,78,108,144,186,240,312,402,522,576}, + {4,4,4,6,8,10,12,14,18,24,30,40,18} }, + { {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576} , + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54}, + {0,12,24,36,54,78,108,144,186,240,312,402,522,576}, + {4,4,4,6,8,10,12,14,18,24,30,40,18} }, + { {0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576}, + {12,12,12,12,12,12,16,20,24,28,32,40,48,56,64,76,90,2,2,2,2,2}, + {0, 24, 48, 72,108,156,216,288,372,480,486,492,498,576}, + {8,8,8,12,16,20,24,28,36,2,2,2,26} } , +}; +/* *INDENT-ON* */ + +static int mapbuf0[9][152]; +static int mapbuf1[9][156]; +static int mapbuf2[9][44]; +static int *map[9][3]; +static int *mapend[9][3]; + +static unsigned int n_slen2[512]; /* MPEG 2.0 slen for 'normal' mode */ +static unsigned int i_slen2[256]; /* MPEG 2.0 slen for intensity stereo */ + +static real tan1_1[16], tan2_1[16], tan1_2[16], tan2_2[16]; +static real pow1_1[2][16], pow2_1[2][16], pow1_2[2][16], pow2_2[2][16]; + +static unsigned int +get1bit(PMPSTR mp) +{ + unsigned char rval; + rval = *mp->wordpointer << mp->bitindex; + + mp->bitindex++; + mp->wordpointer += (mp->bitindex >> 3); + mp->bitindex &= 7; + + return rval >> 7; +} + + + + +/* + * init tables for layer-3 + */ +void +hip_init_tables_layer3(void) +{ + int i, j, k; + + if (gd_are_hip_tables_layer3_initialized) { + return; + } + gd_are_hip_tables_layer3_initialized = 1; + + for (i = -256; i < 118 + 4; i++) + gainpow2[i + 256] = pow((double) 2.0, -0.25 * (double) (i + 210)); + + for (i = 0; i < 8207; i++) + ispow[i] = pow((double) i, (double) 4.0 / 3.0); + + for (i = 0; i < 8; i++) { + static const double Ci[8] = { -0.6, -0.535, -0.33, -0.185, -0.095, -0.041, -0.0142, -0.0037 }; + double sq = sqrt(1.0 + Ci[i] * Ci[i]); + aa_cs[i] = 1.0 / sq; + aa_ca[i] = Ci[i] / sq; + } + + for (i = 0; i < 18; i++) { + win[0][i] = win[1][i] = + 0.5 * sin(M_PI / 72.0 * (double) (2 * (i + 0) + 1)) / cos(M_PI * + (double) (2 * (i + 0) + + 19) / 72.0); + win[0][i + 18] = win[3][i + 18] = + 0.5 * sin(M_PI / 72.0 * (double) (2 * (i + 18) + 1)) / cos(M_PI * + (double) (2 * (i + 18) + + 19) / 72.0); + } + for (i = 0; i < 6; i++) { + win[1][i + 18] = 0.5 / cos(M_PI * (double) (2 * (i + 18) + 19) / 72.0); + win[3][i + 12] = 0.5 / cos(M_PI * (double) (2 * (i + 12) + 19) / 72.0); + win[1][i + 24] = + 0.5 * sin(M_PI / 24.0 * (double) (2 * i + 13)) / cos(M_PI * + (double) (2 * (i + 24) + + 19) / 72.0); + win[1][i + 30] = win[3][i] = 0.0; + win[3][i + 6] = + 0.5 * sin(M_PI / 24.0 * (double) (2 * i + 1)) / cos(M_PI * (double) (2 * (i + 6) + 19) / + 72.0); + } + + for (i = 0; i < 9; i++) + COS9[i] = cos(M_PI / 18.0 * (double) i); + + for (i = 0; i < 9; i++) + tfcos36[i] = 0.5 / cos(M_PI * (double) (i * 2 + 1) / 36.0); + for (i = 0; i < 3; i++) + tfcos12[i] = 0.5 / cos(M_PI * (double) (i * 2 + 1) / 12.0); + + COS6_1 = cos(M_PI / 6.0 * (double) 1); + COS6_2 = cos(M_PI / 6.0 * (double) 2); + + for (i = 0; i < 12; i++) { + win[2][i] = + 0.5 * sin(M_PI / 24.0 * (double) (2 * i + 1)) / cos(M_PI * (double) (2 * i + 7) / 24.0); + for (j = 0; j < 6; j++) + COS1[i][j] = cos(M_PI / 24.0 * (double) ((2 * i + 7) * (2 * j + 1))); + } + + for (j = 0; j < 4; j++) { + static int const len[4] = { 36, 36, 12, 36 }; + for (i = 0; i < len[j]; i += 2) + win1[j][i] = +win[j][i]; + for (i = 1; i < len[j]; i += 2) + win1[j][i] = -win[j][i]; + } + + for (i = 0; i < 16; i++) { + double t = tan((double) i * M_PI / 12.0); + tan1_1[i] = t / (1.0 + t); + tan2_1[i] = 1.0 / (1.0 + t); + tan1_2[i] = M_SQRT2 * t / (1.0 + t); + tan2_2[i] = M_SQRT2 / (1.0 + t); + + for (j = 0; j < 2; j++) { + double base = pow(2.0, -0.25 * (j + 1.0)); + double p1 = 1.0, p2 = 1.0; + if (i > 0) { + if (i & 1) + p1 = pow(base, (i + 1.0) * 0.5); + else + p2 = pow(base, i * 0.5); + } + pow1_1[j][i] = p1; + pow2_1[j][i] = p2; + pow1_2[j][i] = M_SQRT2 * p1; + pow2_2[j][i] = M_SQRT2 * p2; + } + } + + for (j = 0; j < 9; j++) { + struct bandInfoStruct const *bi = (struct bandInfoStruct const *) &bandInfo[j]; + int *mp; + int cb, lwin; + short const *bdf; + + mp = map[j][0] = mapbuf0[j]; + bdf = bi->longDiff; + for (i = 0, cb = 0; cb < 8; cb++, i += *bdf++) { + *mp++ = (*bdf) >> 1; + *mp++ = i; + *mp++ = 3; + *mp++ = cb; + } + bdf = bi->shortDiff + 3; + for (cb = 3; cb < 13; cb++) { + int l = (*bdf++) >> 1; + for (lwin = 0; lwin < 3; lwin++) { + *mp++ = l; + *mp++ = i + lwin; + *mp++ = lwin; + *mp++ = cb; + } + i += 6 * l; + } + mapend[j][0] = mp; + + mp = map[j][1] = mapbuf1[j]; + bdf = bi->shortDiff + 0; + for (i = 0, cb = 0; cb < 13; cb++) { + int l = (*bdf++) >> 1; + for (lwin = 0; lwin < 3; lwin++) { + *mp++ = l; + *mp++ = i + lwin; + *mp++ = lwin; + *mp++ = cb; + } + i += 6 * l; + } + mapend[j][1] = mp; + + mp = map[j][2] = mapbuf2[j]; + bdf = bi->longDiff; + for (cb = 0; cb < 22; cb++) { + *mp++ = (*bdf++) >> 1; + *mp++ = cb; + } + mapend[j][2] = mp; + + } + + for (j = 0; j < 9; j++) { + for (i = 0; i < 23; i++) { + longLimit[j][i] = (bandInfo[j].longIdx[i] - 1 + 8) / 18 + 1; + if (longLimit[j][i] > SBLIMIT) + longLimit[j][i] = SBLIMIT; + } + for (i = 0; i < 14; i++) { + shortLimit[j][i] = (bandInfo[j].shortIdx[i] - 1) / 18 + 1; + if (shortLimit[j][i] > SBLIMIT) + shortLimit[j][i] = SBLIMIT; + } + } + + for (i = 0; i < 5; i++) { + for (j = 0; j < 6; j++) { + for (k = 0; k < 6; k++) { + int n = k + j * 6 + i * 36; + i_slen2[n] = i | (j << 3) | (k << 6) | (3 << 12); + } + } + } + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + for (k = 0; k < 4; k++) { + int n = k + j * 4 + i * 16; + i_slen2[n + 180] = i | (j << 3) | (k << 6) | (4 << 12); + } + } + } + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + int n = j + i * 3; + i_slen2[n + 244] = i | (j << 3) | (5 << 12); + n_slen2[n + 500] = i | (j << 3) | (2 << 12) | (1 << 15); + } + } + + for (i = 0; i < 5; i++) { + for (j = 0; j < 5; j++) { + for (k = 0; k < 4; k++) { + int l; + for (l = 0; l < 4; l++) { + int n = l + k * 4 + j * 16 + i * 80; + n_slen2[n] = i | (j << 3) | (k << 6) | (l << 9) | (0 << 12); + } + } + } + } + for (i = 0; i < 5; i++) { + for (j = 0; j < 5; j++) { + for (k = 0; k < 4; k++) { + int n = k + j * 4 + i * 20; + n_slen2[n + 400] = i | (j << 3) | (k << 6) | (1 << 12); + } + } + } +} + +/* + * read additional side information + */ + +static void +III_get_side_info_1(PMPSTR mp, int stereo, + int ms_stereo, long sfreq, int single) +{ + int ch, gr; + int powdiff = (single == 3) ? 4 : 0; + + mp->sideinfo.main_data_begin = getbits(mp, 9); + if (stereo == 1) + mp->sideinfo.private_bits = getbits_fast(mp, 5); + else + mp->sideinfo.private_bits = getbits_fast(mp, 3); + + for (ch = 0; ch < stereo; ch++) { + mp->sideinfo.ch[ch].gr[0].scfsi = -1; + mp->sideinfo.ch[ch].gr[1].scfsi = getbits_fast(mp, 4); + } + + for (gr = 0; gr < 2; gr++) { + for (ch = 0; ch < stereo; ch++) { + struct gr_info_s *gr_infos = &(mp->sideinfo.ch[ch].gr[gr]); + + gr_infos->part2_3_length = getbits(mp, 12); + gr_infos->big_values = getbits_fast(mp, 9); + if (gr_infos->big_values > 288) { + lame_report_fnc(mp->report_err, "big_values too large! %i\n", gr_infos->big_values); + gr_infos->big_values = 288; + } + { + unsigned int qss = getbits_fast(mp, 8); + gr_infos->pow2gain = gainpow2 + 256 - qss + powdiff; + if (mp->pinfo != NULL) { + mp->pinfo->qss[gr][ch] = qss; + } + } + if (ms_stereo) + gr_infos->pow2gain += 2; + gr_infos->scalefac_compress = getbits_fast(mp, 4); +/* window-switching flag == 1 for block_Type != 0 .. and block-type == 0 -> win-sw-flag = 0 */ + if (get1bit(mp)) { + int i; + gr_infos->block_type = getbits_fast(mp, 2); + gr_infos->mixed_block_flag = get1bit(mp); + gr_infos->table_select[0] = getbits_fast(mp, 5); + gr_infos->table_select[1] = getbits_fast(mp, 5); + + + /* + * table_select[2] not needed, because there is no region2, + * but to satisfy some verifications tools we set it either. + */ + gr_infos->table_select[2] = 0; + for (i = 0; i < 3; i++) { + unsigned int sbg = (getbits_fast(mp, 3) << 3); + gr_infos->full_gain[i] = gr_infos->pow2gain + sbg; + if (mp->pinfo != NULL) + mp->pinfo->sub_gain[gr][ch][i] = sbg / 8; + } + + if (gr_infos->block_type == 0) { + lame_report_fnc(mp->report_err, "Blocktype == 0 and window-switching == 1 not allowed.\n"); + /* error seems to be very good recoverable, so don't exit */ + /* exit(1); */ + } + /* region_count/start parameters are implicit in this case. */ + gr_infos->region1start = 36 >> 1; + gr_infos->region2start = 576 >> 1; + } + else { + unsigned int i, r0c, r1c, region0index, region1index; + for (i = 0; i < 3; i++) + gr_infos->table_select[i] = getbits_fast(mp, 5); + r0c = getbits_fast(mp, 4); + r1c = getbits_fast(mp, 3); + region0index = r0c+1; + if (region0index > 22) { + region0index = 22; + lame_report_fnc(mp->report_err, "region0index > 22\n"); + } + region1index = r0c+1 + r1c+1; + if (region1index > 22) { + region1index = 22; + lame_report_fnc(mp->report_err, "region1index > 22\n"); + } + gr_infos->region1start = bandInfo[sfreq].longIdx[region0index] >> 1; + gr_infos->region2start = bandInfo[sfreq].longIdx[region1index] >> 1; + gr_infos->block_type = 0; + gr_infos->mixed_block_flag = 0; + } + gr_infos->preflag = get1bit(mp); + gr_infos->scalefac_scale = get1bit(mp); + gr_infos->count1table_select = get1bit(mp); + } + } +} + +/* + * Side Info for MPEG 2.0 / LSF + */ +static void +III_get_side_info_2(PMPSTR mp, int stereo, int ms_stereo, long sfreq, int single) +{ + int ch; + int powdiff = (single == 3) ? 4 : 0; + + mp->sideinfo.main_data_begin = getbits(mp, 8); + + if (stereo == 1) + mp->sideinfo.private_bits = get1bit(mp); + else + mp->sideinfo.private_bits = getbits_fast(mp, 2); + + for (ch = 0; ch < stereo; ch++) { + struct gr_info_s *gr_infos = &(mp->sideinfo.ch[ch].gr[0]); + unsigned int qss; + + gr_infos->part2_3_length = getbits(mp, 12); + gr_infos->big_values = getbits_fast(mp, 9); + if (gr_infos->big_values > 288) { + lame_report_fnc(mp->report_err, "big_values too large! %i\n", gr_infos->big_values); + gr_infos->big_values = 288; + } + qss = getbits_fast(mp, 8); + gr_infos->pow2gain = gainpow2 + 256 - qss + powdiff; + if (mp->pinfo != NULL) { + mp->pinfo->qss[0][ch] = qss; + } + + + if (ms_stereo) + gr_infos->pow2gain += 2; + gr_infos->scalefac_compress = getbits(mp, 9); +/* window-switching flag == 1 for block_Type != 0 .. and block-type == 0 -> win-sw-flag = 0 */ + if (get1bit(mp)) { + int i; + gr_infos->block_type = getbits_fast(mp, 2); + gr_infos->mixed_block_flag = get1bit(mp); + gr_infos->table_select[0] = getbits_fast(mp, 5); + gr_infos->table_select[1] = getbits_fast(mp, 5); + /* + * table_select[2] not needed, because there is no region2, + * but to satisfy some verifications tools we set it either. + */ + gr_infos->table_select[2] = 0; + for (i = 0; i < 3; i++) { + unsigned int sbg = (getbits_fast(mp, 3) << 3); + gr_infos->full_gain[i] = gr_infos->pow2gain + sbg; + if (mp->pinfo != NULL) + mp->pinfo->sub_gain[0][ch][i] = sbg / 8; + + } + + if (gr_infos->block_type == 0) { + lame_report_fnc(mp->report_err, "Blocktype == 0 and window-switching == 1 not allowed.\n"); + /* error seems to be very good recoverable, so don't exit */ + /* exit(1); */ + } + /* region_count/start parameters are implicit in this case. */ +/* check this again! */ + if (gr_infos->block_type == 2) { + if (sfreq == 8) + gr_infos->region1start = 36; + else + gr_infos->region1start = 36 >> 1; + } + else if (sfreq == 8) +/* check this for 2.5 and sfreq=8 */ + gr_infos->region1start = 108 >> 1; + else + gr_infos->region1start = 54 >> 1; + gr_infos->region2start = 576 >> 1; + } + else { + unsigned int i, r0c, r1c, region0index, region1index; + for (i = 0; i < 3; i++) + gr_infos->table_select[i] = getbits_fast(mp, 5); + r0c = getbits_fast(mp, 4); + r1c = getbits_fast(mp, 3); + region0index = r0c+1; + if (region0index > 22) { + region0index = 22; + lame_report_fnc(mp->report_err, "region0index > 22\n"); + } + region1index = r0c+1 + r1c+1; + if (region1index > 22) { + region1index = 22; + lame_report_fnc(mp->report_err, "region1index > 22\n"); + } + gr_infos->region1start = bandInfo[sfreq].longIdx[region0index] >> 1; + gr_infos->region2start = bandInfo[sfreq].longIdx[region1index] >> 1; + gr_infos->block_type = 0; + gr_infos->mixed_block_flag = 0; + } + gr_infos->scalefac_scale = get1bit(mp); + gr_infos->count1table_select = get1bit(mp); + } +} + +/* + * read scalefactors + */ + +static int +III_get_scale_factors_1(PMPSTR mp, int *scf, struct gr_info_s *gr_infos) +{ + static const unsigned char slen[2][16] = { + {0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4}, + {0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3} + }; + int numbits; + int num0 = slen[0][gr_infos->scalefac_compress]; + int num1 = slen[1][gr_infos->scalefac_compress]; + + if (gr_infos->block_type == 2) { + int i = 18; + numbits = (num0 + num1) * 18; + + if (gr_infos->mixed_block_flag) { + for (i = 8; i; i--) + *scf++ = getbits_fast(mp, num0); + i = 9; + numbits -= num0; /* num0 * 17 + num1 * 18 */ + } + + for (; i; i--) + *scf++ = getbits_fast(mp, num0); + for (i = 18; i; i--) + *scf++ = getbits_fast(mp, num1); + *scf++ = 0; + *scf++ = 0; + *scf++ = 0; /* short[13][0..2] = 0 */ + } + else { + int i; + int scfsi = gr_infos->scfsi; + + if (scfsi < 0) { /* scfsi < 0 => granule == 0 */ + for (i = 11; i; i--) + *scf++ = getbits_fast(mp, num0); + for (i = 10; i; i--) + *scf++ = getbits_fast(mp, num1); + numbits = (num0 + num1) * 10 + num0; + } + else { + numbits = 0; + if (!(scfsi & 0x8)) { + for (i = 6; i; i--) + *scf++ = getbits_fast(mp, num0); + numbits += num0 * 6; + } + else { + scf += 6; + } + + if (!(scfsi & 0x4)) { + for (i = 5; i; i--) + *scf++ = getbits_fast(mp, num0); + numbits += num0 * 5; + } + else { + scf += 5; + } + + if (!(scfsi & 0x2)) { + for (i = 5; i; i--) + *scf++ = getbits_fast(mp, num1); + numbits += num1 * 5; + } + else { + scf += 5; + } + + if (!(scfsi & 0x1)) { + for (i = 5; i; i--) + *scf++ = getbits_fast(mp, num1); + numbits += num1 * 5; + } + else { + scf += 5; + } + } + + *scf++ = 0; /* no l[21] in original sources */ + } + return numbits; +} + + +static int +III_get_scale_factors_2(PMPSTR mp, int *scf, struct gr_info_s *gr_infos, int i_stereo) +{ + unsigned char const *pnt; + int i, j; + unsigned int slen; + int n = 0; + int numbits = 0; + + /* *INDENT-OFF* */ + static const unsigned char stab[3][6][4] = { + { { 6, 5, 5,5 } , { 6, 5, 7,3 } , { 11,10,0,0} , + { 7, 7, 7,0 } , { 6, 6, 6,3 } , { 8, 8,5,0} } , + { { 9, 9, 9,9 } , { 9, 9,12,6 } , { 18,18,0,0} , + {12,12,12,0 } , {12, 9, 9,6 } , { 15,12,9,0} } , + { { 6, 9, 9,9 } , { 6, 9,12,6 } , { 15,18,0,0} , + { 6,15,12,0 } , { 6,12, 9,6 } , { 6,18,9,0} } }; + /* *INDENT-ON* */ + + if (i_stereo) /* i_stereo AND second channel -> do_layer3() checks this */ + slen = i_slen2[gr_infos->scalefac_compress >> 1]; + else + slen = n_slen2[gr_infos->scalefac_compress]; + + gr_infos->preflag = (slen >> 15) & 0x1; + + n = 0; + if (gr_infos->block_type == 2) { + n++; + if (gr_infos->mixed_block_flag) + n++; + } + + pnt = (unsigned char const *) stab[n][(slen >> 12) & 0x7]; + + for (i = 0; i < 4; i++) { + int num = slen & 0x7; + slen >>= 3; + if (num) { + for (j = 0; j < (int) (pnt[i]); j++) + *scf++ = getbits_fast(mp, num); + numbits += pnt[i] * num; + } + else { + for (j = 0; j < (int) (pnt[i]); j++) + *scf++ = 0; + } + } + + n = (n << 1) + 1; + for (i = 0; i < n; i++) + *scf++ = 0; + + return numbits; +} + +/* *INDENT-OFF* */ +static const int pretab1 [22] = {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0}; /* char enough ? */ +static const int pretab2 [22] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +/* *INDENT-ON* */ + +/* + * don't forget to apply the same changes to III_dequantize_sample_ms() !!! + */ +static int +III_dequantize_sample(PMPSTR mp, real xr[SBLIMIT][SSLIMIT], int *scf, + struct gr_info_s *gr_infos, int sfreq, int part2bits) +{ + int shift = 1 + gr_infos->scalefac_scale; + real *xrpnt = (real *) xr; + int l[3], l3; + int part2remain = gr_infos->part2_3_length - part2bits; + int *me; + + /* lame_report_fnc(mp->report_dbg,"part2remain = %d, gr_infos->part2_3_length = %d, part2bits = %d\n", + part2remain, gr_infos->part2_3_length, part2bits); */ + + { + int i; + + for (i = (&xr[SBLIMIT][0] - xrpnt) >> 1; i > 0; i--) { + *xrpnt++ = 0.0; + *xrpnt++ = 0.0; + } + + xrpnt = (real *) xr; + } + + { + int bv = gr_infos->big_values; + int region1 = gr_infos->region1start; + int region2 = gr_infos->region2start; + + l3 = ((576 >> 1) - bv) >> 1; +/* + * we may lose the 'odd' bit here !! + * check this later again + */ + if (bv <= region1) { + l[0] = bv; + l[1] = 0; + l[2] = 0; + } + else { + l[0] = region1; + if (bv <= region2) { + l[1] = bv - l[0]; + l[2] = 0; + } + else { + l[1] = region2 - l[0]; + l[2] = bv - region2; + } + } + } + /* MDH crash fix */ + { + int i; + for (i = 0; i < 3; i++) { + if (l[i] < 0) { + lame_report_fnc(mp->report_err, "hip: Bogus region length (%d)\n", l[i]); + l[i] = 0; + } + } + } + /* end MDH crash fix */ + + if (gr_infos->block_type == 2) { + /* + * decoding with short or mixed mode BandIndex table + */ + int i, max[4]; + int step = 0, lwin = 0, cb = 0; + real v = 0.0; + int *m, mc; + + if (gr_infos->mixed_block_flag) { + max[3] = -1; + max[0] = max[1] = max[2] = 2; + m = map[sfreq][0]; + me = mapend[sfreq][0]; + } + else { + max[0] = max[1] = max[2] = max[3] = -1; + /* max[3] not really needed in this case */ + m = map[sfreq][1]; + me = mapend[sfreq][1]; + } + + mc = 0; + for (i = 0; i < 2; i++) { + int lp = l[i]; + struct newhuff const *h = (struct newhuff const *) (ht + gr_infos->table_select[i]); + for (; lp; lp--, mc--) { + int x, y; + if ((!mc)) { + mc = *m++; + xrpnt = ((real *) xr) + (*m++); + lwin = *m++; + cb = *m++; + if (lwin == 3) { + v = gr_infos->pow2gain[(*scf++) << shift]; + step = 1; + } + else { + v = gr_infos->full_gain[lwin][(*scf++) << shift]; + step = 3; + } + } + { + short const *val = (short const *) h->table; + while ((y = *val++) < 0) { + if (get1bit(mp)) + val -= y; + part2remain--; + } + x = y >> 4; + y &= 0xf; + } + if (x == 15) { + max[lwin] = cb; + part2remain -= h->linbits + 1; + x += getbits(mp, (int) h->linbits); + if (get1bit(mp)) + *xrpnt = -ispow[x] * v; + else + *xrpnt = ispow[x] * v; + } + else if (x) { + max[lwin] = cb; + if (get1bit(mp)) + *xrpnt = -ispow[x] * v; + else + *xrpnt = ispow[x] * v; + part2remain--; + } + else + *xrpnt = 0.0; + xrpnt += step; + if (y == 15) { + max[lwin] = cb; + part2remain -= h->linbits + 1; + y += getbits(mp, (int) h->linbits); + if (get1bit(mp)) + *xrpnt = -ispow[y] * v; + else + *xrpnt = ispow[y] * v; + } + else if (y) { + max[lwin] = cb; + if (get1bit(mp)) + *xrpnt = -ispow[y] * v; + else + *xrpnt = ispow[y] * v; + part2remain--; + } + else + *xrpnt = 0.0; + xrpnt += step; + } + } + for (; l3 && (part2remain > 0); l3--) { + struct newhuff const *h = (struct newhuff const *) (htc + gr_infos->count1table_select); + short const *val = (short const *) h->table; + short a; + + while ((a = *val++) < 0) { + part2remain--; + if (part2remain < 0) { + part2remain++; + a = 0; + break; + } + if (get1bit(mp)) + val -= a; + } + for (i = 0; i < 4; i++) { + if (!(i & 1)) { + if (!mc) { + mc = *m++; + xrpnt = ((real *) xr) + (*m++); + lwin = *m++; + cb = *m++; + if (lwin == 3) { + v = gr_infos->pow2gain[(*scf++) << shift]; + step = 1; + } + else { + v = gr_infos->full_gain[lwin][(*scf++) << shift]; + step = 3; + } + } + mc--; + } + if ((a & (0x8 >> i))) { + max[lwin] = cb; + part2remain--; + if (part2remain < 0) { + part2remain++; + break; + } + if (get1bit(mp)) + *xrpnt = -v; + else + *xrpnt = v; + } + else + *xrpnt = 0.0; + xrpnt += step; + } + } + + while (m < me) { + if (!mc) { + mc = *m++; + xrpnt = ((real *) xr) + *m++; + if ((*m++) == 3) + step = 1; + else + step = 3; + m++; /* cb */ + } + mc--; + *xrpnt = 0.0; + xrpnt += step; + *xrpnt = 0.0; + xrpnt += step; +/* we could add a little opt. here: + * if we finished a band for window 3 or a long band + * further bands could copied in a simple loop without a + * special 'map' decoding + */ + } + + gr_infos->maxband[0] = max[0] + 1; + gr_infos->maxband[1] = max[1] + 1; + gr_infos->maxband[2] = max[2] + 1; + gr_infos->maxbandl = max[3] + 1; + + { + int rmax = max[0] > max[1] ? max[0] : max[1]; + rmax = (rmax > max[2] ? rmax : max[2]) + 1; + gr_infos->maxb = rmax ? shortLimit[sfreq][rmax] : longLimit[sfreq][max[3] + 1]; + } + + } + else { + /* + * decoding with 'long' BandIndex table (block_type != 2) + */ + int const *pretab = (int const *) (gr_infos->preflag ? pretab1 : pretab2); + int i, max = -1; + int cb = 0; + int *m = map[sfreq][2]; + real v = 0.0; + int mc = 0; + + /* + * long hash table values + */ + for (i = 0; i < 3; i++) { + int lp = l[i]; + struct newhuff const *h = (struct newhuff const *) (ht + gr_infos->table_select[i]); + + for (; lp; lp--, mc--) { + int x, y; + + if (!mc) { + mc = *m++; + v = gr_infos->pow2gain[((*scf++) + (*pretab++)) << shift]; + cb = *m++; + } + { + short const *val = (short const *) h->table; + while ((y = *val++) < 0) { + if (get1bit(mp)) + val -= y; + part2remain--; + } + x = y >> 4; + y &= 0xf; + } + if (x == 15) { + max = cb; + part2remain -= h->linbits + 1; + x += getbits(mp, (int) h->linbits); + if (get1bit(mp)) + *xrpnt++ = -ispow[x] * v; + else + *xrpnt++ = ispow[x] * v; + } + else if (x) { + max = cb; + if (get1bit(mp)) + *xrpnt++ = -ispow[x] * v; + else + *xrpnt++ = ispow[x] * v; + part2remain--; + } + else + *xrpnt++ = 0.0; + + if (y == 15) { + max = cb; + part2remain -= h->linbits + 1; + y += getbits(mp, (int) h->linbits); + if (get1bit(mp)) + *xrpnt++ = -ispow[y] * v; + else + *xrpnt++ = ispow[y] * v; + } + else if (y) { + max = cb; + if (get1bit(mp)) + *xrpnt++ = -ispow[y] * v; + else + *xrpnt++ = ispow[y] * v; + part2remain--; + } + else + *xrpnt++ = 0.0; + } + } + + /* + * short (count1table) values + */ + for (; l3 && (part2remain > 0); l3--) { + struct newhuff const *h = (struct newhuff const *) (htc + gr_infos->count1table_select); + short const *val = (short const *) h->table; + short a; + + while ((a = *val++) < 0) { + part2remain--; + if (part2remain < 0) { + part2remain++; + a = 0; + break; + } + if (get1bit(mp)) + val -= a; + } + for (i = 0; i < 4; i++) { + if (!(i & 1)) { + if (!mc) { + mc = *m++; + cb = *m++; + v = gr_infos->pow2gain[((*scf++) + (*pretab++)) << shift]; + } + mc--; + } + if ((a & (0x8 >> i))) { + max = cb; + part2remain--; + if (part2remain < 0) { + part2remain++; + break; + } + if (get1bit(mp)) + *xrpnt++ = -v; + else + *xrpnt++ = v; + } + else + *xrpnt++ = 0.0; + } + } + + /* + * zero part + */ + for (i = (&xr[SBLIMIT][0] - xrpnt) >> 1; i; i--) { + *xrpnt++ = 0.0; + *xrpnt++ = 0.0; + } + + gr_infos->maxbandl = max + 1; + gr_infos->maxb = longLimit[sfreq][gr_infos->maxbandl]; + } + + while (part2remain > 16) { + getbits(mp, 16); /* Dismiss stuffing Bits */ + part2remain -= 16; + } + if (part2remain > 0) + getbits(mp, part2remain); + else if (part2remain < 0) { + lame_report_fnc(mp->report_err, "hip: Can't rewind stream by %d bits!\n", -part2remain); + return 1; /* -> error */ + } + return 0; +} + + +/* + * III_stereo: calculate real channel values for Joint-I-Stereo-mode + */ +static void +III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT], int *scalefac, + struct gr_info_s *gr_infos, int sfreq, int ms_stereo, int lsf) +{ + real(*xr)[SBLIMIT * SSLIMIT] = (real(*)[SBLIMIT * SSLIMIT]) xr_buf; + struct bandInfoStruct const *bi = (struct bandInfoStruct const *) &bandInfo[sfreq]; + real *tabl1, *tabl2; + + if (lsf) { + int p = gr_infos->scalefac_compress & 0x1; + if (ms_stereo) { + tabl1 = pow1_2[p]; + tabl2 = pow2_2[p]; + } + else { + tabl1 = pow1_1[p]; + tabl2 = pow2_1[p]; + } + } + else { + if (ms_stereo) { + tabl1 = tan1_2; + tabl2 = tan2_2; + } + else { + tabl1 = tan1_1; + tabl2 = tan2_1; + } + } + + if (gr_infos->block_type == 2) { + int lwin, do_l = 0; + if (gr_infos->mixed_block_flag) + do_l = 1; + + for (lwin = 0; lwin < 3; lwin++) { /* process each window */ + /* get first band with zero values */ + int is_p, sb, idx, sfb = gr_infos->maxband[lwin]; /* sfb is minimal 3 for mixed mode */ + if (sfb > 3) + do_l = 0; + + for (; sfb < 12; sfb++) { + is_p = scalefac[sfb * 3 + lwin - gr_infos->mixed_block_flag]; /* scale: 0-15 */ + if (is_p != 7) { + real t1, t2; + sb = bi->shortDiff[sfb]; + idx = bi->shortIdx[sfb] + lwin; + t1 = tabl1[is_p]; + t2 = tabl2[is_p]; + for (; sb > 0; sb--, idx += 3) { + real v = xr[0][idx]; + xr[0][idx] = v * t1; + xr[1][idx] = v * t2; + } + } + } + +#if 1 +/* in the original: copy 10 to 11 , here: copy 11 to 12 +maybe still wrong??? (copy 12 to 13?) */ + is_p = scalefac[11 * 3 + lwin - gr_infos->mixed_block_flag]; /* scale: 0-15 */ + sb = bi->shortDiff[12]; + idx = bi->shortIdx[12] + lwin; +#else + is_p = scalefac[10 * 3 + lwin - gr_infos->mixed_block_flag]; /* scale: 0-15 */ + sb = bi->shortDiff[11]; + idx = bi->shortIdx[11] + lwin; +#endif + if (is_p != 7) { + real t1, t2; + t1 = tabl1[is_p]; + t2 = tabl2[is_p]; + for (; sb > 0; sb--, idx += 3) { + real v = xr[0][idx]; + xr[0][idx] = v * t1; + xr[1][idx] = v * t2; + } + } + } /* end for(lwin; .. ; . ) */ + + if (do_l) { +/* also check l-part, if ALL bands in the three windows are 'empty' + * and mode = mixed_mode + */ + int sfb = gr_infos->maxbandl; + int idx = bi->longIdx[sfb]; + + for (; sfb < 8; sfb++) { + int sb = bi->longDiff[sfb]; + int is_p = scalefac[sfb]; /* scale: 0-15 */ + if (is_p != 7) { + real t1, t2; + t1 = tabl1[is_p]; + t2 = tabl2[is_p]; + for (; sb > 0; sb--, idx++) { + real v = xr[0][idx]; + xr[0][idx] = v * t1; + xr[1][idx] = v * t2; + } + } + else + idx += sb; + } + } + } + else { /* ((gr_infos->block_type != 2)) */ + + int sfb = gr_infos->maxbandl; + int is_p, idx = bi->longIdx[sfb]; + for (; sfb < 21; sfb++) { + int sb = bi->longDiff[sfb]; + is_p = scalefac[sfb]; /* scale: 0-15 */ + if (is_p != 7) { + real t1, t2; + t1 = tabl1[is_p]; + t2 = tabl2[is_p]; + for (; sb > 0; sb--, idx++) { + real v = xr[0][idx]; + xr[0][idx] = v * t1; + xr[1][idx] = v * t2; + } + } + else + idx += sb; + } + + is_p = scalefac[20]; /* copy l-band 20 to l-band 21 */ + if (is_p != 7) { + int sb; + real t1 = tabl1[is_p], t2 = tabl2[is_p]; + + for (sb = bi->longDiff[21]; sb > 0; sb--, idx++) { + real v = xr[0][idx]; + xr[0][idx] = v * t1; + xr[1][idx] = v * t2; + } + } + } /* ... */ +} + +static void +III_antialias(real xr[SBLIMIT][SSLIMIT], struct gr_info_s *gr_infos) +{ + int sblim; + + if (gr_infos->block_type == 2) { + if (!gr_infos->mixed_block_flag) + return; + sblim = 1; + } + else { + sblim = gr_infos->maxb - 1; + } + + /* 31 alias-reduction operations between each pair of sub-bands */ + /* with 8 butterflies between each pair */ + + { + int sb; + real *xr1 = (real *) xr[1]; + + for (sb = sblim; sb; sb--, xr1 += 10) { + int ss; + real *cs = aa_cs, *ca = aa_ca; + real *xr2 = xr1; + + for (ss = 7; ss >= 0; ss--) { /* upper and lower butterfly inputs */ + real bu = *--xr2, bd = *xr1; + *xr2 = (bu * (*cs)) - (bd * (*ca)); + *xr1++ = (bd * (*cs++)) + (bu * (*ca++)); + } + } + } +} + + +/* *INDENT-OFF* */ + +/* + DCT insipired by Jeff Tsay's DCT from the maplay package + this is an optimized version with manual unroll. + + References: + [1] S. Winograd: "On Computing the Discrete Fourier Transform", + Mathematics of Computation, Volume 32, Number 141, January 1978, + Pages 175-199 +*/ + +static void dct36(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf) +{ + { + real *in = inbuf; + + in[17]+=in[16]; in[16]+=in[15]; in[15]+=in[14]; + in[14]+=in[13]; in[13]+=in[12]; in[12]+=in[11]; + in[11]+=in[10]; in[10]+=in[9]; in[9] +=in[8]; + in[8] +=in[7]; in[7] +=in[6]; in[6] +=in[5]; + in[5] +=in[4]; in[4] +=in[3]; in[3] +=in[2]; + in[2] +=in[1]; in[1] +=in[0]; + + in[17]+=in[15]; in[15]+=in[13]; in[13]+=in[11]; in[11]+=in[9]; + in[9] +=in[7]; in[7] +=in[5]; in[5] +=in[3]; in[3] +=in[1]; + + { + +#define MACRO0(v) { \ + real tmp; \ + out2[9+(v)] = (tmp = sum0 + sum1) * w[27+(v)]; \ + out2[8-(v)] = tmp * w[26-(v)]; } \ + sum0 -= sum1; \ + ts[SBLIMIT*(8-(v))] = out1[8-(v)] + sum0 * w[8-(v)]; \ + ts[SBLIMIT*(9+(v))] = out1[9+(v)] + sum0 * w[9+(v)]; +#define MACRO1(v) { \ + real sum0,sum1; \ + sum0 = tmp1a + tmp2a; \ + sum1 = (tmp1b + tmp2b) * tfcos36[(v)]; \ + MACRO0(v); } +#define MACRO2(v) { \ + real sum0,sum1; \ + sum0 = tmp2a - tmp1a; \ + sum1 = (tmp2b - tmp1b) * tfcos36[(v)]; \ + MACRO0(v); } + + const real *c = COS9; + real *out2 = o2; + real *w = wintab; + real *out1 = o1; + real *ts = tsbuf; + + real ta33,ta66,tb33,tb66; + + ta33 = in[2*3+0] * c[3]; + ta66 = in[2*6+0] * c[6]; + tb33 = in[2*3+1] * c[3]; + tb66 = in[2*6+1] * c[6]; + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = in[2*1+0] * c[1] + ta33 + in[2*5+0] * c[5] + in[2*7+0] * c[7]; + tmp1b = in[2*1+1] * c[1] + tb33 + in[2*5+1] * c[5] + in[2*7+1] * c[7]; + tmp2a = in[2*0+0] + in[2*2+0] * c[2] + in[2*4+0] * c[4] + ta66 + in[2*8+0] * c[8]; + tmp2b = in[2*0+1] + in[2*2+1] * c[2] + in[2*4+1] * c[4] + tb66 + in[2*8+1] * c[8]; + + MACRO1(0); + MACRO2(8); + } + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = ( in[2*1+0] - in[2*5+0] - in[2*7+0] ) * c[3]; + tmp1b = ( in[2*1+1] - in[2*5+1] - in[2*7+1] ) * c[3]; + tmp2a = ( in[2*2+0] - in[2*4+0] - in[2*8+0] ) * c[6] - in[2*6+0] + in[2*0+0]; + tmp2b = ( in[2*2+1] - in[2*4+1] - in[2*8+1] ) * c[6] - in[2*6+1] + in[2*0+1]; + + MACRO1(1); + MACRO2(7); + } + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = in[2*1+0] * c[5] - ta33 - in[2*5+0] * c[7] + in[2*7+0] * c[1]; + tmp1b = in[2*1+1] * c[5] - tb33 - in[2*5+1] * c[7] + in[2*7+1] * c[1]; + tmp2a = in[2*0+0] - in[2*2+0] * c[8] - in[2*4+0] * c[2] + ta66 + in[2*8+0] * c[4]; + tmp2b = in[2*0+1] - in[2*2+1] * c[8] - in[2*4+1] * c[2] + tb66 + in[2*8+1] * c[4]; + + MACRO1(2); + MACRO2(6); + } + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = in[2*1+0] * c[7] - ta33 + in[2*5+0] * c[1] - in[2*7+0] * c[5]; + tmp1b = in[2*1+1] * c[7] - tb33 + in[2*5+1] * c[1] - in[2*7+1] * c[5]; + tmp2a = in[2*0+0] - in[2*2+0] * c[4] + in[2*4+0] * c[8] + ta66 - in[2*8+0] * c[2]; + tmp2b = in[2*0+1] - in[2*2+1] * c[4] + in[2*4+1] * c[8] + tb66 - in[2*8+1] * c[2]; + + MACRO1(3); + MACRO2(5); + } + + { + real sum0,sum1; + sum0 = in[2*0+0] - in[2*2+0] + in[2*4+0] - in[2*6+0] + in[2*8+0]; + sum1 = (in[2*0+1] - in[2*2+1] + in[2*4+1] - in[2*6+1] + in[2*8+1] ) * tfcos36[4]; + MACRO0(4); + } + } + + } +} + + +/* + * new DCT12 + */ +static void dct12(real *in,real *rawout1,real *rawout2,real *wi,real *ts) +{ +#define DCT12_PART1 \ + in5 = in[5*3]; \ + in5 += (in4 = in[4*3]); \ + in4 += (in3 = in[3*3]); \ + in3 += (in2 = in[2*3]); \ + in2 += (in1 = in[1*3]); \ + in1 += (in0 = in[0*3]); \ + \ + in5 += in3; in3 += in1; \ + \ + in2 *= COS6_1; \ + in3 *= COS6_1; \ + +#define DCT12_PART2 \ + in0 += in4 * COS6_2; \ + \ + in4 = in0 + in2; \ + in0 -= in2; \ + \ + in1 += in5 * COS6_2; \ + \ + in5 = (in1 + in3) * tfcos12[0]; \ + in1 = (in1 - in3) * tfcos12[2]; \ + \ + in3 = in4 + in5; \ + in4 -= in5; \ + \ + in2 = in0 + in1; \ + in0 -= in1; + + + { + real in0,in1,in2,in3,in4,in5; + real *out1 = rawout1; + ts[SBLIMIT*0] = out1[0]; ts[SBLIMIT*1] = out1[1]; ts[SBLIMIT*2] = out1[2]; + ts[SBLIMIT*3] = out1[3]; ts[SBLIMIT*4] = out1[4]; ts[SBLIMIT*5] = out1[5]; + + DCT12_PART1 + + { + real tmp0,tmp1 = (in0 - in4); + { + real tmp2 = (in1 - in5) * tfcos12[1]; + tmp0 = tmp1 + tmp2; + tmp1 -= tmp2; + } + ts[(17-1)*SBLIMIT] = out1[17-1] + tmp0 * wi[11-1]; + ts[(12+1)*SBLIMIT] = out1[12+1] + tmp0 * wi[6+1]; + ts[(6 +1)*SBLIMIT] = out1[6 +1] + tmp1 * wi[1]; + ts[(11-1)*SBLIMIT] = out1[11-1] + tmp1 * wi[5-1]; + } + + DCT12_PART2 + + ts[(17-0)*SBLIMIT] = out1[17-0] + in2 * wi[11-0]; + ts[(12+0)*SBLIMIT] = out1[12+0] + in2 * wi[6+0]; + ts[(12+2)*SBLIMIT] = out1[12+2] + in3 * wi[6+2]; + ts[(17-2)*SBLIMIT] = out1[17-2] + in3 * wi[11-2]; + + ts[(6+0)*SBLIMIT] = out1[6+0] + in0 * wi[0]; + ts[(11-0)*SBLIMIT] = out1[11-0] + in0 * wi[5-0]; + ts[(6+2)*SBLIMIT] = out1[6+2] + in4 * wi[2]; + ts[(11-2)*SBLIMIT] = out1[11-2] + in4 * wi[5-2]; + } + + in++; + + { + real in0,in1,in2,in3,in4,in5; + real *out2 = rawout2; + + DCT12_PART1 + + { + real tmp0,tmp1 = (in0 - in4); + { + real tmp2 = (in1 - in5) * tfcos12[1]; + tmp0 = tmp1 + tmp2; + tmp1 -= tmp2; + } + out2[5-1] = tmp0 * wi[11-1]; + out2[0+1] = tmp0 * wi[6+1]; + ts[(12+1)*SBLIMIT] += tmp1 * wi[1]; + ts[(17-1)*SBLIMIT] += tmp1 * wi[5-1]; + } + + DCT12_PART2 + + out2[5-0] = in2 * wi[11-0]; + out2[0+0] = in2 * wi[6+0]; + out2[0+2] = in3 * wi[6+2]; + out2[5-2] = in3 * wi[11-2]; + + ts[(12+0)*SBLIMIT] += in0 * wi[0]; + ts[(17-0)*SBLIMIT] += in0 * wi[5-0]; + ts[(12+2)*SBLIMIT] += in4 * wi[2]; + ts[(17-2)*SBLIMIT] += in4 * wi[5-2]; + } + + in++; + + { + real in0,in1,in2,in3,in4,in5; + real *out2 = rawout2; + out2[12]=out2[13]=out2[14]=out2[15]=out2[16]=out2[17]=0.0; + + DCT12_PART1 + + { + real tmp0,tmp1 = (in0 - in4); + { + real tmp2 = (in1 - in5) * tfcos12[1]; + tmp0 = tmp1 + tmp2; + tmp1 -= tmp2; + } + out2[11-1] = tmp0 * wi[11-1]; + out2[6 +1] = tmp0 * wi[6+1]; + out2[0+1] += tmp1 * wi[1]; + out2[5-1] += tmp1 * wi[5-1]; + } + + DCT12_PART2 + + out2[11-0] = in2 * wi[11-0]; + out2[6 +0] = in2 * wi[6+0]; + out2[6 +2] = in3 * wi[6+2]; + out2[11-2] = in3 * wi[11-2]; + + out2[0+0] += in0 * wi[0]; + out2[5-0] += in0 * wi[5-0]; + out2[0+2] += in4 * wi[2]; + out2[5-2] += in4 * wi[5-2]; + } +} +/* *INDENT-ON* */ + +/* + * III_hybrid + */ +static void +III_hybrid(PMPSTR mp, real fsIn[SBLIMIT][SSLIMIT], real tsOut[SSLIMIT][SBLIMIT], + int ch, struct gr_info_s *gr_infos) +{ + real *tspnt = (real *) tsOut; + real(*block)[2][SBLIMIT * SSLIMIT] = mp->hybrid_block; + int *blc = mp->hybrid_blc; + real *rawout1, *rawout2; + int bt; + int sb = 0; + + { + int b = blc[ch]; + rawout1 = block[b][ch]; + b = -b + 1; + rawout2 = block[b][ch]; + blc[ch] = b; + } + + + if (gr_infos->mixed_block_flag) { + sb = 2; + dct36(fsIn[0], rawout1, rawout2, win[0], tspnt); + dct36(fsIn[1], rawout1 + 18, rawout2 + 18, win1[0], tspnt + 1); + rawout1 += 36; + rawout2 += 36; + tspnt += 2; + } + + bt = gr_infos->block_type; + if (bt == 2) { + for (; sb < (int) gr_infos->maxb; sb += 2, tspnt += 2, rawout1 += 36, rawout2 += 36) { + dct12(fsIn[sb], rawout1, rawout2, win[2], tspnt); + dct12(fsIn[sb + 1], rawout1 + 18, rawout2 + 18, win1[2], tspnt + 1); + } + } + else { + for (; sb < (int) gr_infos->maxb; sb += 2, tspnt += 2, rawout1 += 36, rawout2 += 36) { + dct36(fsIn[sb], rawout1, rawout2, win[bt], tspnt); + dct36(fsIn[sb + 1], rawout1 + 18, rawout2 + 18, win1[bt], tspnt + 1); + } + } + + for (; sb < SBLIMIT; sb++, tspnt++) { + int i; + for (i = 0; i < SSLIMIT; i++) { + tspnt[i * SBLIMIT] = *rawout1++; + *rawout2++ = 0.0; + } + } +} + +/* + * main layer3 handler + */ + +int +layer3_audiodata_precedesframes(PMPSTR mp) +{ + int audioDataInFrame; + int framesToBacktrack; + + /* specific to Layer 3, since Layer 1 & 2 the audio data starts at the frame that describes it. */ + /* determine how many bytes and therefore bitstream frames the audio data precedes it's matching frame */ + /* lame_report_fnc(mp->report_err, "hip: main_data_begin = %d, mp->bsize %d, mp->fsizeold %d, mp->ssize %d\n", + sideinfo.main_data_begin, mp->bsize, mp->fsizeold, mp->ssize); */ + /* compute the number of frames to backtrack, 4 for the header, ssize already holds the CRC */ + /* TODO Erroneously assumes current frame is same as previous frame. */ + audioDataInFrame = mp->bsize - 4 - mp->ssize; + framesToBacktrack = (mp->sideinfo.main_data_begin + audioDataInFrame - 1) / audioDataInFrame; + /* lame_report_fnc(mp->report_err, "hip: audioDataInFrame %d framesToBacktrack %d\n", audioDataInFrame, framesToBacktrack); */ + return framesToBacktrack; +} + +int +decode_layer3_sideinfo(PMPSTR mp) +{ + struct frame *fr = &mp->fr; + int stereo = fr->stereo; + int single = fr->single; + int ms_stereo; + int sfreq = fr->sampling_frequency; + int granules; + int ch, gr, databits; + + if (stereo == 1) { /* stream is mono */ + single = 0; + } + + if (fr->mode == MPG_MD_JOINT_STEREO) { + ms_stereo = fr->mode_ext & 0x2; + } + else + ms_stereo = 0; + + + if (fr->lsf) { + granules = 1; + III_get_side_info_2(mp, stereo, ms_stereo, sfreq, single); + } + else { + granules = 2; + III_get_side_info_1(mp, stereo, ms_stereo, sfreq, single); + } + + databits = 0; + for (gr = 0; gr < granules; ++gr) { + for (ch = 0; ch < stereo; ++ch) { + struct gr_info_s *gr_infos = &(mp->sideinfo.ch[ch].gr[gr]); + databits += gr_infos->part2_3_length; + } + } + return databits - 8 * mp->sideinfo.main_data_begin; +} + + + +int +decode_layer3_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point, + int (*synth_1to1_mono_ptr) (PMPSTR, real *, unsigned char *, int *), + int (*synth_1to1_ptr) (PMPSTR, real *, int, unsigned char *, int *)) +{ + int gr, ch, ss, clip = 0; + int scalefacs[2][39]; /* max 39 for short[13][3] mode, mixed: 38, long: 22 */ + /* struct III_sideinfo sideinfo; */ + struct frame *fr = &(mp->fr); + int stereo = fr->stereo; + int single = fr->single; + int ms_stereo, i_stereo; + int sfreq = fr->sampling_frequency; + int stereo1, granules; + real hybridIn[2][SBLIMIT][SSLIMIT]; + real hybridOut[2][SSLIMIT][SBLIMIT]; + + if (set_pointer(mp, (int) mp->sideinfo.main_data_begin) == MP3_ERR) + return 0; + + if (stereo == 1) { /* stream is mono */ + stereo1 = 1; + single = 0; + } + else if (single >= 0) /* stream is stereo, but force to mono */ + stereo1 = 1; + else + stereo1 = 2; + + if (fr->mode == MPG_MD_JOINT_STEREO) { + ms_stereo = fr->mode_ext & 0x2; + i_stereo = fr->mode_ext & 0x1; + } + else + ms_stereo = i_stereo = 0; + + + if (fr->lsf) { + granules = 1; + } + else { + granules = 2; + } + + for (gr = 0; gr < granules; gr++) { + + { + struct gr_info_s *gr_infos = &(mp->sideinfo.ch[0].gr[gr]); + long part2bits; + + if (fr->lsf) + part2bits = III_get_scale_factors_2(mp, scalefacs[0], gr_infos, 0); + else { + part2bits = III_get_scale_factors_1(mp, scalefacs[0], gr_infos); + } + + if (mp->pinfo != NULL) { + int i; + mp->pinfo->sfbits[gr][0] = part2bits; + for (i = 0; i < 39; i++) + mp->pinfo->sfb_s[gr][0][i] = scalefacs[0][i]; + } + + /* lame_report_fnc(mp->report_err, "calling III dequantize sample 1 gr_infos->part2_3_length %d\n", gr_infos->part2_3_length); */ + if (III_dequantize_sample(mp, hybridIn[0], scalefacs[0], gr_infos, sfreq, part2bits)) + return clip; + } + if (stereo == 2) { + struct gr_info_s *gr_infos = &(mp->sideinfo.ch[1].gr[gr]); + long part2bits; + if (fr->lsf) + part2bits = III_get_scale_factors_2(mp, scalefacs[1], gr_infos, i_stereo); + else { + part2bits = III_get_scale_factors_1(mp, scalefacs[1], gr_infos); + } + if (mp->pinfo != NULL) { + int i; + mp->pinfo->sfbits[gr][1] = part2bits; + for (i = 0; i < 39; i++) + mp->pinfo->sfb_s[gr][1][i] = scalefacs[1][i]; + } + + /* lame_report_fnc(mp->report_err, "calling III dequantize sample 2 gr_infos->part2_3_length %d\n", gr_infos->part2_3_length); */ + if (III_dequantize_sample(mp, hybridIn[1], scalefacs[1], gr_infos, sfreq, part2bits)) + return clip; + + if (ms_stereo) { + int i; + for (i = 0; i < SBLIMIT * SSLIMIT; i++) { + real tmp0, tmp1; + tmp0 = ((real *) hybridIn[0])[i]; + tmp1 = ((real *) hybridIn[1])[i]; + ((real *) hybridIn[1])[i] = tmp0 - tmp1; + ((real *) hybridIn[0])[i] = tmp0 + tmp1; + } + } + + if (i_stereo) + III_i_stereo(hybridIn, scalefacs[1], gr_infos, sfreq, ms_stereo, fr->lsf); + + if (ms_stereo || i_stereo || (single == 3)) { + if (gr_infos->maxb > mp->sideinfo.ch[0].gr[gr].maxb) + mp->sideinfo.ch[0].gr[gr].maxb = gr_infos->maxb; + else + gr_infos->maxb = mp->sideinfo.ch[0].gr[gr].maxb; + } + + switch (single) { + case 3: + { + int i; + real *in0 = (real *) hybridIn[0], *in1 = (real *) hybridIn[1]; + for (i = 0; i < (int) (SSLIMIT * gr_infos->maxb); i++, in0++) + *in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */ + } + break; + case 1: + { + int i; + real *in0 = (real *) hybridIn[0], *in1 = (real *) hybridIn[1]; + for (i = 0; i < (int) (SSLIMIT * gr_infos->maxb); i++) + *in0++ = *in1++; + } + break; + } + } + + if (mp->pinfo != NULL) { + int i, sb; + float ifqstep; + + mp->pinfo->bitrate = tabsel_123[fr->lsf][fr->lay - 1][fr->bitrate_index]; + mp->pinfo->sampfreq = freqs[sfreq]; + mp->pinfo->emph = fr->emphasis; + mp->pinfo->crc = fr->error_protection; + mp->pinfo->padding = fr->padding; + mp->pinfo->stereo = fr->stereo; + mp->pinfo->js = (fr->mode == MPG_MD_JOINT_STEREO); + mp->pinfo->ms_stereo = ms_stereo; + mp->pinfo->i_stereo = i_stereo; + mp->pinfo->maindata = mp->sideinfo.main_data_begin; + + for (ch = 0; ch < stereo1; ch++) { + struct gr_info_s *gr_infos = &(mp->sideinfo.ch[ch].gr[gr]); + mp->pinfo->big_values[gr][ch] = gr_infos->big_values; + mp->pinfo->scalefac_scale[gr][ch] = gr_infos->scalefac_scale; + mp->pinfo->mixed[gr][ch] = gr_infos->mixed_block_flag; + mp->pinfo->mpg123blocktype[gr][ch] = gr_infos->block_type; + mp->pinfo->mainbits[gr][ch] = gr_infos->part2_3_length; + mp->pinfo->preflag[gr][ch] = gr_infos->preflag; + if (gr == 1) + mp->pinfo->scfsi[ch] = gr_infos->scfsi; + } + + + for (ch = 0; ch < stereo1; ch++) { + struct gr_info_s *gr_infos = &(mp->sideinfo.ch[ch].gr[gr]); + ifqstep = (mp->pinfo->scalefac_scale[gr][ch] == 0) ? .5 : 1.0; + if (2 == gr_infos->block_type) { + for (i = 0; i < 3; i++) { + for (sb = 0; sb < 12; sb++) { + int j = 3 * sb + i; + /* + is_p = scalefac[sfb*3+lwin-gr_infos->mixed_block_flag]; + */ + /* scalefac was copied into pinfo->sfb_s[] above */ + mp->pinfo->sfb_s[gr][ch][j] = + -ifqstep * mp->pinfo->sfb_s[gr][ch][j - gr_infos->mixed_block_flag]; + mp->pinfo->sfb_s[gr][ch][j] -= 2 * (mp->pinfo->sub_gain[gr][ch][i]); + } + mp->pinfo->sfb_s[gr][ch][3 * sb + i] = + -2 * (mp->pinfo->sub_gain[gr][ch][i]); + } + } + else { + for (sb = 0; sb < 21; sb++) { + /* scalefac was copied into pinfo->sfb[] above */ + mp->pinfo->sfb[gr][ch][sb] = mp->pinfo->sfb_s[gr][ch][sb]; + if (gr_infos->preflag) + mp->pinfo->sfb[gr][ch][sb] += pretab1[sb]; + mp->pinfo->sfb[gr][ch][sb] *= -ifqstep; + } + mp->pinfo->sfb[gr][ch][21] = 0; + } + } + + + + for (ch = 0; ch < stereo1; ch++) { + int j = 0; + for (sb = 0; sb < SBLIMIT; sb++) + for (ss = 0; ss < SSLIMIT; ss++, j++) + mp->pinfo->mpg123xr[gr][ch][j] = hybridIn[ch][sb][ss]; + } + } + + + for (ch = 0; ch < stereo1; ch++) { + struct gr_info_s *gr_infos = &(mp->sideinfo.ch[ch].gr[gr]); + III_antialias(hybridIn[ch], gr_infos); + III_hybrid(mp, hybridIn[ch], hybridOut[ch], ch, gr_infos); + } + + for (ss = 0; ss < SSLIMIT; ss++) { + if (single >= 0) { + clip += (*synth_1to1_mono_ptr) (mp, hybridOut[0][ss], pcm_sample, pcm_point); + } + else { + int p1 = *pcm_point; + clip += (*synth_1to1_ptr) (mp, hybridOut[0][ss], 0, pcm_sample, &p1); + clip += (*synth_1to1_ptr) (mp, hybridOut[1][ss], 1, pcm_sample, pcm_point); + } + } + } + + return clip; +} diff --git a/node_modules/lame/deps/lame/mpglib/layer3.h b/node_modules/lame/deps/lame/mpglib/layer3.h new file mode 100644 index 0000000..2e30192 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/layer3.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef LAYER3_H_INCLUDED +#define LAYER3_H_INCLUDED + +void hip_init_tables_layer3(void); +int decode_layer3_sideinfo(PMPSTR mp); +int decode_layer3_frame(PMPSTR mp, unsigned char *pcm_sample, int *pcm_point, + int (*synth_1to1_mono_ptr) (PMPSTR, real *, unsigned char *, int *), + int (*synth_1to1_ptr) (PMPSTR, real *, int, unsigned char *, int *)); +int layer3_audiodata_precedesframes(PMPSTR mp); + +#endif diff --git a/node_modules/lame/deps/lame/mpglib/mpg123.h b/node_modules/lame/deps/lame/mpglib/mpg123.h new file mode 100644 index 0000000..6ac8b67 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/mpg123.h @@ -0,0 +1,152 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef MPG123_H_INCLUDED +#define MPG123_H_INCLUDED + +#include <stdio.h> + +#ifdef STDC_HEADERS +# include <string.h> +#else +# ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex +# endif +char *strchr(), *strrchr(); +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# define memmove(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#include <signal.h> + + +#if defined(__riscos__) && defined(FPA10) +#include "ymath.h" +#else +#include <math.h> +#endif + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif +#ifndef M_SQRT2 +#define M_SQRT2 1.41421356237309504880 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif + +#undef REAL_IS_FLOAT +#define REAL_IS_FLOAT + +#ifdef REAL_IS_FLOAT +# define real float +#elif defined(REAL_IS_LONG_DOUBLE) +# define real long double +#else +# define real double +#endif + +#define FALSE 0 +#define TRUE 1 + +#define SBLIMIT 32 +#define SSLIMIT 18 + +#define MPG_MD_STEREO 0 +#define MPG_MD_JOINT_STEREO 1 +#define MPG_MD_DUAL_CHANNEL 2 +#define MPG_MD_MONO 3 + +#define MAXFRAMESIZE 2880 + +/* AF: ADDED FOR LAYER1/LAYER2 */ +#define SCALE_BLOCK 12 + + +/* Pre Shift fo 16 to 8 bit converter table */ +#define AUSHIFT (3) + +struct frame { + int stereo; + int single; /* single channel (monophonic) */ + int lsf; /* 0 = MPEG-1, 1 = MPEG-2/2.5 */ + int mpeg25; /* 1 = MPEG-2.5, 0 = MPEG-1/2 */ + int header_change; + int lay; /* Layer */ + int error_protection; /* 1 = CRC-16 code following header */ + int bitrate_index; + int sampling_frequency; /* sample rate of decompressed audio in Hz */ + int padding; + int extension; + int mode; + int mode_ext; + int copyright; + int original; + int emphasis; + int framesize; /* computed framesize */ + + /* AF: ADDED FOR LAYER1/LAYER2 */ + int II_sblimit; + struct al_table2 const *alloc; + int down_sample_sblimit; + int down_sample; + + +}; + +struct gr_info_s { + int scfsi; + unsigned part2_3_length; + unsigned big_values; + unsigned scalefac_compress; + unsigned block_type; + unsigned mixed_block_flag; + unsigned table_select[3]; + unsigned subblock_gain[3]; + unsigned maxband[3]; + unsigned maxbandl; + unsigned maxb; + unsigned region1start; + unsigned region2start; + unsigned preflag; + unsigned scalefac_scale; + unsigned count1table_select; + real *full_gain[3]; + real *pow2gain; +}; + +struct III_sideinfo { + unsigned main_data_begin; + unsigned private_bits; + struct { + struct gr_info_s gr[2]; + } ch[2]; +}; + + +#endif diff --git a/node_modules/lame/deps/lame/mpglib/mpglib.h b/node_modules/lame/deps/lame/mpglib/mpglib.h new file mode 100644 index 0000000..7ab4d5f --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/mpglib.h @@ -0,0 +1,96 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef _MPGLIB_H_ +#define _MPGLIB_H_ + +#include "lame.h" + +#ifndef plotting_data_defined +#define plotting_data_defined +struct plotting_data; +typedef struct plotting_data plotting_data; +#endif + + +extern void lame_report_fnc(lame_report_function f, const char *format, ...); + +struct buf { + unsigned char *pnt; + long size; + long pos; + struct buf *next; + struct buf *prev; +}; + +struct framebuf { + struct buf *buf; + long pos; + struct frame *next; + struct frame *prev; +}; + +typedef struct mpstr_tag { + struct buf *head, *tail; /* buffer linked list pointers, tail points to oldest buffer */ + int vbr_header; /* 1 if valid Xing vbr header detected */ + int num_frames; /* set if vbr header present */ + int enc_delay; /* set if vbr header present */ + int enc_padding; /* set if vbr header present */ + /* header_parsed, side_parsed and data_parsed must be all set 1 + before the full frame has been parsed */ + int header_parsed; /* 1 = header of current frame has been parsed */ + int side_parsed; /* 1 = header of sideinfo of current frame has been parsed */ + int data_parsed; + int free_format; /* 1 = free format frame */ + int old_free_format; /* 1 = last frame was free format */ + int bsize; + int framesize; + int ssize; /* number of bytes used for side information, including 2 bytes for CRC-16 if present */ + int dsize; + int fsizeold; /* size of previous frame, -1 for first */ + int fsizeold_nopadding; + struct frame fr; /* holds the parameters decoded from the header */ + struct III_sideinfo sideinfo; + unsigned char bsspace[2][MAXFRAMESIZE + 1024]; /* bit stream space used ???? */ /* MAXFRAMESIZE */ + real hybrid_block[2][2][SBLIMIT * SSLIMIT]; + int hybrid_blc[2]; + unsigned long header; + int bsnum; + real synth_buffs[2][2][0x110]; + int synth_bo; + int sync_bitstream; /* 1 = bitstream is yet to be synchronized */ + + int bitindex; + unsigned char *wordpointer; + plotting_data *pinfo; + + lame_report_function report_msg; + lame_report_function report_dbg; + lame_report_function report_err; +} MPSTR, *PMPSTR; + + +#define MP3_ERR -1 +#define MP3_OK 0 +#define MP3_NEED_MORE 1 + + + +#endif /* _MPGLIB_H_ */ diff --git a/node_modules/lame/deps/lame/mpglib/tabinit.c b/node_modules/lame/deps/lame/mpglib/tabinit.c new file mode 100644 index 0000000..813e4ff --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/tabinit.c @@ -0,0 +1,146 @@ +/* + * tabinit.c + * + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +/* $Id: tabinit.c,v 1.16 2010/03/22 14:30:19 robert Exp $ */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdlib.h> +#include "tabinit.h" +#include "mpg123.h" + +#ifdef WITH_DMALLOC +#include <dmalloc.h> +#endif + +real decwin[512 + 32]; +static real cos64[16], cos32[8], cos16[4], cos8[2], cos4[1]; +real *pnts[] = { cos64, cos32, cos16, cos8, cos4 }; + +/* *INDENT-OFF* */ + +static const double dewin[512] = { + 0.000000000,-0.000015259,-0.000015259,-0.000015259, + -0.000015259,-0.000015259,-0.000015259,-0.000030518, + -0.000030518,-0.000030518,-0.000030518,-0.000045776, + -0.000045776,-0.000061035,-0.000061035,-0.000076294, + -0.000076294,-0.000091553,-0.000106812,-0.000106812, + -0.000122070,-0.000137329,-0.000152588,-0.000167847, + -0.000198364,-0.000213623,-0.000244141,-0.000259399, + -0.000289917,-0.000320435,-0.000366211,-0.000396729, + -0.000442505,-0.000473022,-0.000534058,-0.000579834, + -0.000625610,-0.000686646,-0.000747681,-0.000808716, + -0.000885010,-0.000961304,-0.001037598,-0.001113892, + -0.001205444,-0.001296997,-0.001388550,-0.001480103, + -0.001586914,-0.001693726,-0.001785278,-0.001907349, + -0.002014160,-0.002120972,-0.002243042,-0.002349854, + -0.002456665,-0.002578735,-0.002685547,-0.002792358, + -0.002899170,-0.002990723,-0.003082275,-0.003173828, + -0.003250122,-0.003326416,-0.003387451,-0.003433228, + -0.003463745,-0.003479004,-0.003479004,-0.003463745, + -0.003417969,-0.003372192,-0.003280640,-0.003173828, + -0.003051758,-0.002883911,-0.002700806,-0.002487183, + -0.002227783,-0.001937866,-0.001617432,-0.001266479, + -0.000869751,-0.000442505, 0.000030518, 0.000549316, + 0.001098633, 0.001693726, 0.002334595, 0.003005981, + 0.003723145, 0.004486084, 0.005294800, 0.006118774, + 0.007003784, 0.007919312, 0.008865356, 0.009841919, + 0.010848999, 0.011886597, 0.012939453, 0.014022827, + 0.015121460, 0.016235352, 0.017349243, 0.018463135, + 0.019577026, 0.020690918, 0.021789551, 0.022857666, + 0.023910522, 0.024932861, 0.025909424, 0.026840210, + 0.027725220, 0.028533936, 0.029281616, 0.029937744, + 0.030532837, 0.031005859, 0.031387329, 0.031661987, + 0.031814575, 0.031845093, 0.031738281, 0.031478882, + 0.031082153, 0.030517578, 0.029785156, 0.028884888, + 0.027801514, 0.026535034, 0.025085449, 0.023422241, + 0.021575928, 0.019531250, 0.017257690, 0.014801025, + 0.012115479, 0.009231567, 0.006134033, 0.002822876, + -0.000686646,-0.004394531,-0.008316040,-0.012420654, + -0.016708374,-0.021179199,-0.025817871,-0.030609131, + -0.035552979,-0.040634155,-0.045837402,-0.051132202, + -0.056533813,-0.061996460,-0.067520142,-0.073059082, + -0.078628540,-0.084182739,-0.089706421,-0.095169067, + -0.100540161,-0.105819702,-0.110946655,-0.115921021, + -0.120697021,-0.125259399,-0.129562378,-0.133590698, + -0.137298584,-0.140670776,-0.143676758,-0.146255493, + -0.148422241,-0.150115967,-0.151306152,-0.151962280, + -0.152069092,-0.151596069,-0.150497437,-0.148773193, + -0.146362305,-0.143264771,-0.139450073,-0.134887695, + -0.129577637,-0.123474121,-0.116577148,-0.108856201, + -0.100311279,-0.090927124,-0.080688477,-0.069595337, + -0.057617187,-0.044784546,-0.031082153,-0.016510010, + -0.001068115, 0.015228271, 0.032379150, 0.050354004, + 0.069168091, 0.088775635, 0.109161377, 0.130310059, + 0.152206421, 0.174789429, 0.198059082, 0.221984863, + 0.246505737, 0.271591187, 0.297210693, 0.323318481, + 0.349868774, 0.376800537, 0.404083252, 0.431655884, + 0.459472656, 0.487472534, 0.515609741, 0.543823242, + 0.572036743, 0.600219727, 0.628295898, 0.656219482, + 0.683914185, 0.711318970, 0.738372803, 0.765029907, + 0.791213989, 0.816864014, 0.841949463, 0.866363525, + 0.890090942, 0.913055420, 0.935195923, 0.956481934, + 0.976852417, 0.996246338, 1.014617920, 1.031936646, + 1.048156738, 1.063217163, 1.077117920, 1.089782715, + 1.101211548, 1.111373901, 1.120223999, 1.127746582, + 1.133926392, 1.138763428, 1.142211914, 1.144287109, + 1.144989014 +}; +/* *INDENT-ON* */ + +void +make_decode_tables(long scaleval) +{ + int i, j, k, kr, divv; + real *table, *costab; + + + for (i = 0; i < 5; i++) { + kr = 0x10 >> i; + divv = 0x40 >> i; + costab = pnts[i]; + for (k = 0; k < kr; k++) + costab[k] = (real) (1.0 / (2.0 * cos(M_PI * ((double) k * 2.0 + 1.0) / (double) divv))); + } + + table = decwin; + scaleval = -scaleval; + for (i = 0, j = 0; i < 256; i++, j++, table += 32) { + if (table < decwin + 512 + 16) + table[16] = table[0] = (real) (dewin[j] * scaleval); + if (i % 32 == 31) + table -= 1023; + if (i % 64 == 63) + scaleval = -scaleval; + } + + for ( /* i=256 */ ; i < 512; i++, j--, table += 32) { + if (table < decwin + 512 + 16) + table[16] = table[0] = (real) (dewin[j] * scaleval); + if (i % 32 == 31) + table -= 1023; + if (i % 64 == 63) + scaleval = -scaleval; + } +} diff --git a/node_modules/lame/deps/lame/mpglib/tabinit.h b/node_modules/lame/deps/lame/mpglib/tabinit.h new file mode 100644 index 0000000..76f4c42 --- /dev/null +++ b/node_modules/lame/deps/lame/mpglib/tabinit.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 1999-2010 The L.A.M.E. project + * + * Initially written by Michael Hipp, see also AUTHORS and README. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef MPGLIB_TABINIT_H_INCLUDED +#define MPGLIB_TABINIT_H_INCLUDED + +#include "mpg123.h" + +extern real decwin[512 + 32]; +extern real *pnts[5]; + +void make_decode_tables(long scale); + +#endif diff --git a/node_modules/lame/deps/lame/test.c b/node_modules/lame/deps/lame/test.c new file mode 100644 index 0000000..1fb3dbf --- /dev/null +++ b/node_modules/lame/deps/lame/test.c @@ -0,0 +1,7 @@ +#include <stdio.h> +#include "lame.h" + +int main () { + printf("get_lame_version(): %s\n", get_lame_version()); + return 0; +} diff --git a/node_modules/lame/deps/lame/testcase.mp3 b/node_modules/lame/deps/lame/testcase.mp3 new file mode 100644 index 0000000..8c06214 Binary files /dev/null and b/node_modules/lame/deps/lame/testcase.mp3 differ diff --git a/node_modules/lame/deps/lame/testcase.wav b/node_modules/lame/deps/lame/testcase.wav new file mode 100644 index 0000000..7c835f7 Binary files /dev/null and b/node_modules/lame/deps/lame/testcase.wav differ diff --git a/node_modules/lame/deps/lame/vc_solution/Makefile.am b/node_modules/lame/deps/lame/vc_solution/Makefile.am new file mode 100644 index 0000000..d11cb50 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/Makefile.am @@ -0,0 +1,8 @@ +## $Id: Makefile.am,v 1.2 2010/03/14 17:23:35 robert Exp $ + +include $(top_srcdir)/Makefile.am.global + +EXTRA_DIST = *.sln \ + *.vcproj \ + *.vsprops \ + *.rules diff --git a/node_modules/lame/deps/lame/vc_solution/Makefile.in b/node_modules/lame/deps/lame/vc_solution/Makefile.in new file mode 100644 index 0000000..28e6d8d --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/Makefile.in @@ -0,0 +1,390 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# global section for every Makefile.am +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile.am.global +subdir = vc_solution +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIG_DEFS = @CONFIG_DEFS@ +CONFIG_MATH_LIB = @CONFIG_MATH_LIB@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPUCCODE = @CPUCCODE@ +CPUTYPE = @CPUTYPE@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FRONTEND_CFLAGS = @FRONTEND_CFLAGS@ +FRONTEND_LDADD = @FRONTEND_LDADD@ +FRONTEND_LDFLAGS = @FRONTEND_LDFLAGS@ +GREP = @GREP@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INCLUDES = @INCLUDES@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDADD = @LDADD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIB_MAJOR_VERSION = @LIB_MAJOR_VERSION@ +LIB_MINOR_VERSION = @LIB_MINOR_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBICONV = @LTLIBICONV@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEDEP = @MAKEDEP@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NASM = @NASM@ +NASM_FORMAT = @NASM_FORMAT@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +RM_F = @RM_F@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +U = @U@ +VERSION = @VERSION@ +WITH_FRONTEND = @WITH_FRONTEND@ +WITH_MP3RTP = @WITH_MP3RTP@ +WITH_MP3X = @WITH_MP3X@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = 1.11 foreign $(top_srcdir)/ansi2knr +EXTRA_DIST = *.sln \ + *.vcproj \ + *.vsprops \ + *.rules + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.global $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign vc_solution/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign vc_solution/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# end global section + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/lame/vc_solution/arch_nasm.vsprops b/node_modules/lame/deps/lame/vc_solution/arch_nasm.vsprops new file mode 100644 index 0000000..5429774 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/arch_nasm.vsprops @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="arch_nasm" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="TAKEHIRO_IEEE754_HACK;HAVE_NASM;MMX_choose_table" + /> +</VisualStudioPropertySheet> diff --git a/node_modules/lame/deps/lame/vc_solution/arch_sse2.vsprops b/node_modules/lame/deps/lame/vc_solution/arch_sse2.vsprops new file mode 100644 index 0000000..af6183a --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/arch_sse2.vsprops @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="arch_sse2" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="HAVE_XMMINTRIN_H;MIN_ARCH_SSE" + EnableEnhancedInstructionSet="2" + FloatingPointModel="2" + /> +</VisualStudioPropertySheet> diff --git a/node_modules/lame/deps/lame/vc_solution/arch_x87.vsprops b/node_modules/lame/deps/lame/vc_solution/arch_x87.vsprops new file mode 100644 index 0000000..39ebb09 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/arch_x87.vsprops @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="arch_x87" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="TAKEHIRO_IEEE754_HACK" + /> +</VisualStudioPropertySheet> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame.sln b/node_modules/lame/deps/lame/vc_solution/vc9_lame.sln new file mode 100644 index 0000000..988e044 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame.sln @@ -0,0 +1,91 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "app lame", "vc9_lame_lame.vcproj", "{EEF5B49E-DBD1-4E1B-8B86-C5D64FCBAD38}" + ProjectSection(ProjectDependencies) = postProject + {20536101-3B0E-43EF-94F9-080D595DAC57} = {20536101-3B0E-43EF-94F9-080D595DAC57} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib encoder LAME", "vc9_libmp3lame.vcproj", "{20536101-3B0E-43EF-94F9-080D595DAC57}" + ProjectSection(ProjectDependencies) = postProject + {E2DAB91A-8248-4625-8A85-2C2C2A390DD8} = {E2DAB91A-8248-4625-8A85-2C2C2A390DD8} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll lame", "vc9_libmp3lame_dll.vcproj", "{92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}" + ProjectSection(ProjectDependencies) = postProject + {20536101-3B0E-43EF-94F9-080D595DAC57} = {20536101-3B0E-43EF-94F9-080D595DAC57} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib decoder HIP", "vc9_mpglib.vcproj", "{E2DAB91A-8248-4625-8A85-2C2C2A390DD8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "app mp3rtp", "vc9_lame_mp3rtp.vcproj", "{C04BA4EA-F719-456D-A332-6C3AF92D7BEA}" + ProjectSection(ProjectDependencies) = postProject + {20536101-3B0E-43EF-94F9-080D595DAC57} = {20536101-3B0E-43EF-94F9-080D595DAC57} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "app mp3x", "vc9_lame_mp3x.vcproj", "{E745EB1A-070A-45ED-B8BD-D9F794E23CFA}" + ProjectSection(ProjectDependencies) = postProject + {20536101-3B0E-43EF-94F9-080D595DAC57} = {20536101-3B0E-43EF-94F9-080D595DAC57} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + ReleaseNASM|Win32 = ReleaseNASM|Win32 + ReleaseSSE2|Win32 = ReleaseSSE2|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EEF5B49E-DBD1-4E1B-8B86-C5D64FCBAD38}.Debug|Win32.ActiveCfg = Debug|Win32 + {EEF5B49E-DBD1-4E1B-8B86-C5D64FCBAD38}.Debug|Win32.Build.0 = Debug|Win32 + {EEF5B49E-DBD1-4E1B-8B86-C5D64FCBAD38}.Release|Win32.ActiveCfg = Release|Win32 + {EEF5B49E-DBD1-4E1B-8B86-C5D64FCBAD38}.Release|Win32.Build.0 = Release|Win32 + {EEF5B49E-DBD1-4E1B-8B86-C5D64FCBAD38}.ReleaseNASM|Win32.ActiveCfg = ReleaseNASM|Win32 + {EEF5B49E-DBD1-4E1B-8B86-C5D64FCBAD38}.ReleaseNASM|Win32.Build.0 = ReleaseNASM|Win32 + {EEF5B49E-DBD1-4E1B-8B86-C5D64FCBAD38}.ReleaseSSE2|Win32.ActiveCfg = ReleaseSSE2|Win32 + {EEF5B49E-DBD1-4E1B-8B86-C5D64FCBAD38}.ReleaseSSE2|Win32.Build.0 = ReleaseSSE2|Win32 + {20536101-3B0E-43EF-94F9-080D595DAC57}.Debug|Win32.ActiveCfg = Debug|Win32 + {20536101-3B0E-43EF-94F9-080D595DAC57}.Debug|Win32.Build.0 = Debug|Win32 + {20536101-3B0E-43EF-94F9-080D595DAC57}.Release|Win32.ActiveCfg = Release|Win32 + {20536101-3B0E-43EF-94F9-080D595DAC57}.Release|Win32.Build.0 = Release|Win32 + {20536101-3B0E-43EF-94F9-080D595DAC57}.ReleaseNASM|Win32.ActiveCfg = ReleaseNASM|Win32 + {20536101-3B0E-43EF-94F9-080D595DAC57}.ReleaseNASM|Win32.Build.0 = ReleaseNASM|Win32 + {20536101-3B0E-43EF-94F9-080D595DAC57}.ReleaseSSE2|Win32.ActiveCfg = ReleaseSSE2|Win32 + {20536101-3B0E-43EF-94F9-080D595DAC57}.ReleaseSSE2|Win32.Build.0 = ReleaseSSE2|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.Debug|Win32.ActiveCfg = Debug|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.Debug|Win32.Build.0 = Debug|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.Release|Win32.ActiveCfg = Release|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.Release|Win32.Build.0 = Release|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.ReleaseNASM|Win32.ActiveCfg = ReleaseNASM|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.ReleaseNASM|Win32.Build.0 = ReleaseNASM|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.ReleaseSSE2|Win32.ActiveCfg = ReleaseSSE2|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.ReleaseSSE2|Win32.Build.0 = ReleaseSSE2|Win32 + {E2DAB91A-8248-4625-8A85-2C2C2A390DD8}.Debug|Win32.ActiveCfg = Debug|Win32 + {E2DAB91A-8248-4625-8A85-2C2C2A390DD8}.Debug|Win32.Build.0 = Debug|Win32 + {E2DAB91A-8248-4625-8A85-2C2C2A390DD8}.Release|Win32.ActiveCfg = Release|Win32 + {E2DAB91A-8248-4625-8A85-2C2C2A390DD8}.Release|Win32.Build.0 = Release|Win32 + {E2DAB91A-8248-4625-8A85-2C2C2A390DD8}.ReleaseNASM|Win32.ActiveCfg = ReleaseNASM|Win32 + {E2DAB91A-8248-4625-8A85-2C2C2A390DD8}.ReleaseNASM|Win32.Build.0 = ReleaseNASM|Win32 + {E2DAB91A-8248-4625-8A85-2C2C2A390DD8}.ReleaseSSE2|Win32.ActiveCfg = ReleaseSSE2|Win32 + {E2DAB91A-8248-4625-8A85-2C2C2A390DD8}.ReleaseSSE2|Win32.Build.0 = ReleaseSSE2|Win32 + {C04BA4EA-F719-456D-A332-6C3AF92D7BEA}.Debug|Win32.ActiveCfg = Debug|Win32 + {C04BA4EA-F719-456D-A332-6C3AF92D7BEA}.Debug|Win32.Build.0 = Debug|Win32 + {C04BA4EA-F719-456D-A332-6C3AF92D7BEA}.Release|Win32.ActiveCfg = Release|Win32 + {C04BA4EA-F719-456D-A332-6C3AF92D7BEA}.Release|Win32.Build.0 = Release|Win32 + {C04BA4EA-F719-456D-A332-6C3AF92D7BEA}.ReleaseNASM|Win32.ActiveCfg = ReleaseNASM|Win32 + {C04BA4EA-F719-456D-A332-6C3AF92D7BEA}.ReleaseNASM|Win32.Build.0 = ReleaseNASM|Win32 + {C04BA4EA-F719-456D-A332-6C3AF92D7BEA}.ReleaseSSE2|Win32.ActiveCfg = ReleaseSSE2|Win32 + {C04BA4EA-F719-456D-A332-6C3AF92D7BEA}.ReleaseSSE2|Win32.Build.0 = ReleaseSSE2|Win32 + {E745EB1A-070A-45ED-B8BD-D9F794E23CFA}.Debug|Win32.ActiveCfg = Debug|Win32 + {E745EB1A-070A-45ED-B8BD-D9F794E23CFA}.Debug|Win32.Build.0 = Debug|Win32 + {E745EB1A-070A-45ED-B8BD-D9F794E23CFA}.Release|Win32.ActiveCfg = Release|Win32 + {E745EB1A-070A-45ED-B8BD-D9F794E23CFA}.Release|Win32.Build.0 = Release|Win32 + {E745EB1A-070A-45ED-B8BD-D9F794E23CFA}.ReleaseNASM|Win32.ActiveCfg = ReleaseNASM|Win32 + {E745EB1A-070A-45ED-B8BD-D9F794E23CFA}.ReleaseNASM|Win32.Build.0 = ReleaseNASM|Win32 + {E745EB1A-070A-45ED-B8BD-D9F794E23CFA}.ReleaseSSE2|Win32.ActiveCfg = ReleaseSSE2|Win32 + {E745EB1A-070A-45ED-B8BD-D9F794E23CFA}.ReleaseSSE2|Win32.Build.0 = ReleaseSSE2|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_acm.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_lame_acm.vcproj new file mode 100644 index 0000000..9c4608b --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_acm.vcproj @@ -0,0 +1,433 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="ACM" + ProjectGUID="{FC3D65E7-B7CB-406E-B6C9-0B26E30FE7F4}" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Release|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="NDEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName=".\..\output\Release/lameACM.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + InlineFunctionExpansion="2" + AdditionalIncludeDirectories="../include,../mpglib,../ACM,../ACM/ddk" + PreprocessorDefinitions="NDEBUG;_BLADEDLL;_WINDOWS;WIN32;LAME_ACM" + StringPooling="true" + RuntimeLibrary="2" + StructMemberAlignment="2" + TreatWChar_tAsBuiltInType="false" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + IgnoreImportLibrary="true" + AdditionalDependencies="libmp3lame.lib url.lib winmm.lib" + OutputFile="..\output\Release\lameACM.acm" + LinkIncremental="1" + AdditionalLibraryDirectories="" + IgnoreAllDefaultLibraries="false" + ModuleDefinitionFile="..\ACM\lameACM.def" + SubSystem="2" + ImportLibrary="$(IntDir)/$(TargetName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + Description="ACM config files" + CommandLine="copy ..\ACM\lameacm.inf $(TargetDir)*.* copy ..\ACM\lame_acm.xml $(TargetDir)*.* " + /> + </Configuration> + <Configuration + Name="Debug|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="_DEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName="..\output\Debug\lameACM.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../include,../mpglib,../ACM,../ACM/ddk" + PreprocessorDefinitions="_DEBUG;_BLADEDLL;_WINDOWS;WIN32;LAME_ACM" + StringPooling="true" + RuntimeLibrary="3" + StructMemberAlignment="2" + TreatWChar_tAsBuiltInType="false" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + IgnoreImportLibrary="true" + AdditionalDependencies="libmp3lame.lib url.lib winmm.lib" + OutputFile="..\output\Debug\lameACM.acm" + AdditionalLibraryDirectories="" + IgnoreAllDefaultLibraries="false" + ModuleDefinitionFile="..\ACM\lameACM.def" + GenerateDebugInformation="true" + SubSystem="2" + ImportLibrary="$(IntDir)/$(TargetName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + Description="ACM config files" + CommandLine="copy ..\ACM\lameacm.inf $(TargetDir)*.* copy ..\ACM\lame_acm.xml $(TargetDir)*.* " + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source" + Filter="c;cpp" + > + <File + RelativePath="..\ACM\ACM.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\ACMStream.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\AEncodeProperties.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\DecodeStream.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\lameACM.def" + > + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\main.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Include" + Filter="h" + > + <File + RelativePath="..\ACM\ACM.h" + > + </File> + <File + RelativePath="..\ACM\ACMStream.h" + > + </File> + <File + RelativePath="..\ACM\adebug.h" + > + </File> + <File + RelativePath="..\ACM\AEncodeProperties.h" + > + </File> + <File + RelativePath="..\ACM\DecodeStream.h" + > + </File> + </Filter> + <Filter + Name="Resource" + Filter="rc" + > + <File + RelativePath="..\ACM\acm.rc" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\lame.ico" + > + </File> + </Filter> + <Filter + Name="Install" + Filter="inf;acm" + > + <File + RelativePath="..\ACM\LameACM.inf" + > + </File> + </Filter> + <File + RelativePath="..\ACM\readme.txt" + > + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\TODO" + > + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_acm_adbg.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_lame_acm_adbg.vcproj new file mode 100644 index 0000000..0f6b75c --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_acm_adbg.vcproj @@ -0,0 +1,178 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="ACM ADbg" + ProjectGUID="{0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA}" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" + StringPooling="true" + RuntimeLibrary="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1036" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(IntDir)\$(ProjectName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" + StringPooling="true" + RuntimeLibrary="2" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1036" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(IntDir)\$(ProjectName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Sources" + Filter="cpp" + > + <File + RelativePath="..\ACM\ADbg\ADbg.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Headers" + Filter="h" + > + <File + RelativePath="..\ACM\ADbg\ADbg.h" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_acm_tinyxml.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_lame_acm_tinyxml.vcproj new file mode 100644 index 0000000..3072ddd --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_acm_tinyxml.vcproj @@ -0,0 +1,250 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="ACM tinyxml" + ProjectGUID="{30219289-3B7F-4E02-BC34-C1DBD08CD848}" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Release|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" + StringPooling="true" + RuntimeLibrary="2" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1036" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(IntDir)\$(ProjectName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" + StringPooling="true" + RuntimeLibrary="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1036" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(IntDir)\$(ProjectName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="..\ACM\tinyxml\changes.txt" + > + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\tinyxml\readme.txt" + > + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\tinyxml\tinyxml.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\tinyxml\tinyxml.h" + > + </File> + <File + RelativePath="..\ACM\tinyxml\tinyxmlerror.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\ACM\tinyxml\tinyxmlparser.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_clients.sln b/node_modules/lame/deps/lame/vc_solution/vc9_lame_clients.sln new file mode 100644 index 0000000..4bf6277 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_clients.sln @@ -0,0 +1,103 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACM ADbg", "vc9_lame_acm_adbg.vcproj", "{0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACM tinyxml", "vc9_lame_acm_tinyxml.vcproj", "{30219289-3B7F-4E02-BC34-C1DBD08CD848}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ACM", "vc9_lame_acm.vcproj", "{FC3D65E7-B7CB-406E-B6C9-0B26E30FE7F4}" + ProjectSection(ProjectDependencies) = postProject + {0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA} = {0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA} + {30219289-3B7F-4E02-BC34-C1DBD08CD848} = {30219289-3B7F-4E02-BC34-C1DBD08CD848} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DShow", "vc9_lame_dshow.vcproj", "{6D348A4E-8B40-4FB0-BB57-C982D51FFA01}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lame_enc_dll", "vc9_lame_dll.vcproj", "{0E4820D3-DBE3-477A-910B-7C020D6066D1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lame_enc_dll_example", "vc9_lame_dll_example.vcproj", "{D169F06E-6607-4A9F-A075-2335717B9AB5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lame_test", "vc9_lame_test.vcproj", "{2FE9808B-2B03-48D9-94FC-6C907D39E2AC}" + ProjectSection(ProjectDependencies) = postProject + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2} = {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp3lameDLL", "vc9_libmp3lame_dll.vcproj", "{92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + ReleaseNASM|Win32 = ReleaseNASM|Win32 + ReleaseSSE2|Win32 = ReleaseSSE2|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA}.Debug|Win32.ActiveCfg = Debug|Win32 + {0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA}.Debug|Win32.Build.0 = Debug|Win32 + {0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA}.Release|Win32.ActiveCfg = Release|Win32 + {0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA}.Release|Win32.Build.0 = Release|Win32 + {0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA}.ReleaseNASM|Win32.ActiveCfg = Release|Win32 + {0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA}.ReleaseNASM|Win32.Build.0 = Release|Win32 + {0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA}.ReleaseSSE2|Win32.ActiveCfg = Release|Win32 + {0D7CAB1B-AE57-4BA1-BDBF-D7391AAA81AA}.ReleaseSSE2|Win32.Build.0 = Release|Win32 + {30219289-3B7F-4E02-BC34-C1DBD08CD848}.Debug|Win32.ActiveCfg = Debug|Win32 + {30219289-3B7F-4E02-BC34-C1DBD08CD848}.Debug|Win32.Build.0 = Debug|Win32 + {30219289-3B7F-4E02-BC34-C1DBD08CD848}.Release|Win32.ActiveCfg = Release|Win32 + {30219289-3B7F-4E02-BC34-C1DBD08CD848}.Release|Win32.Build.0 = Release|Win32 + {30219289-3B7F-4E02-BC34-C1DBD08CD848}.ReleaseNASM|Win32.ActiveCfg = Release|Win32 + {30219289-3B7F-4E02-BC34-C1DBD08CD848}.ReleaseNASM|Win32.Build.0 = Release|Win32 + {30219289-3B7F-4E02-BC34-C1DBD08CD848}.ReleaseSSE2|Win32.ActiveCfg = Release|Win32 + {30219289-3B7F-4E02-BC34-C1DBD08CD848}.ReleaseSSE2|Win32.Build.0 = Release|Win32 + {FC3D65E7-B7CB-406E-B6C9-0B26E30FE7F4}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC3D65E7-B7CB-406E-B6C9-0B26E30FE7F4}.Debug|Win32.Build.0 = Debug|Win32 + {FC3D65E7-B7CB-406E-B6C9-0B26E30FE7F4}.Release|Win32.ActiveCfg = Release|Win32 + {FC3D65E7-B7CB-406E-B6C9-0B26E30FE7F4}.Release|Win32.Build.0 = Release|Win32 + {FC3D65E7-B7CB-406E-B6C9-0B26E30FE7F4}.ReleaseNASM|Win32.ActiveCfg = Release|Win32 + {FC3D65E7-B7CB-406E-B6C9-0B26E30FE7F4}.ReleaseNASM|Win32.Build.0 = Release|Win32 + {FC3D65E7-B7CB-406E-B6C9-0B26E30FE7F4}.ReleaseSSE2|Win32.ActiveCfg = Release|Win32 + {FC3D65E7-B7CB-406E-B6C9-0B26E30FE7F4}.ReleaseSSE2|Win32.Build.0 = Release|Win32 + {6D348A4E-8B40-4FB0-BB57-C982D51FFA01}.Debug|Win32.ActiveCfg = Debug|Win32 + {6D348A4E-8B40-4FB0-BB57-C982D51FFA01}.Debug|Win32.Build.0 = Debug|Win32 + {6D348A4E-8B40-4FB0-BB57-C982D51FFA01}.Release|Win32.ActiveCfg = Release|Win32 + {6D348A4E-8B40-4FB0-BB57-C982D51FFA01}.Release|Win32.Build.0 = Release|Win32 + {6D348A4E-8B40-4FB0-BB57-C982D51FFA01}.ReleaseNASM|Win32.ActiveCfg = Release|Win32 + {6D348A4E-8B40-4FB0-BB57-C982D51FFA01}.ReleaseNASM|Win32.Build.0 = Release|Win32 + {6D348A4E-8B40-4FB0-BB57-C982D51FFA01}.ReleaseSSE2|Win32.ActiveCfg = Release|Win32 + {6D348A4E-8B40-4FB0-BB57-C982D51FFA01}.ReleaseSSE2|Win32.Build.0 = Release|Win32 + {0E4820D3-DBE3-477A-910B-7C020D6066D1}.Debug|Win32.ActiveCfg = Debug|Win32 + {0E4820D3-DBE3-477A-910B-7C020D6066D1}.Debug|Win32.Build.0 = Debug|Win32 + {0E4820D3-DBE3-477A-910B-7C020D6066D1}.Release|Win32.ActiveCfg = Release|Win32 + {0E4820D3-DBE3-477A-910B-7C020D6066D1}.Release|Win32.Build.0 = Release|Win32 + {0E4820D3-DBE3-477A-910B-7C020D6066D1}.ReleaseNASM|Win32.ActiveCfg = Release|Win32 + {0E4820D3-DBE3-477A-910B-7C020D6066D1}.ReleaseNASM|Win32.Build.0 = Release|Win32 + {0E4820D3-DBE3-477A-910B-7C020D6066D1}.ReleaseSSE2|Win32.ActiveCfg = Release|Win32 + {0E4820D3-DBE3-477A-910B-7C020D6066D1}.ReleaseSSE2|Win32.Build.0 = Release|Win32 + {D169F06E-6607-4A9F-A075-2335717B9AB5}.Debug|Win32.ActiveCfg = Debug|Win32 + {D169F06E-6607-4A9F-A075-2335717B9AB5}.Debug|Win32.Build.0 = Debug|Win32 + {D169F06E-6607-4A9F-A075-2335717B9AB5}.Release|Win32.ActiveCfg = Release|Win32 + {D169F06E-6607-4A9F-A075-2335717B9AB5}.Release|Win32.Build.0 = Release|Win32 + {D169F06E-6607-4A9F-A075-2335717B9AB5}.ReleaseNASM|Win32.ActiveCfg = Release|Win32 + {D169F06E-6607-4A9F-A075-2335717B9AB5}.ReleaseNASM|Win32.Build.0 = Release|Win32 + {D169F06E-6607-4A9F-A075-2335717B9AB5}.ReleaseSSE2|Win32.ActiveCfg = Release|Win32 + {D169F06E-6607-4A9F-A075-2335717B9AB5}.ReleaseSSE2|Win32.Build.0 = Release|Win32 + {2FE9808B-2B03-48D9-94FC-6C907D39E2AC}.Debug|Win32.ActiveCfg = Debug|Win32 + {2FE9808B-2B03-48D9-94FC-6C907D39E2AC}.Debug|Win32.Build.0 = Debug|Win32 + {2FE9808B-2B03-48D9-94FC-6C907D39E2AC}.Release|Win32.ActiveCfg = Release|Win32 + {2FE9808B-2B03-48D9-94FC-6C907D39E2AC}.Release|Win32.Build.0 = Release|Win32 + {2FE9808B-2B03-48D9-94FC-6C907D39E2AC}.ReleaseNASM|Win32.ActiveCfg = Release|Win32 + {2FE9808B-2B03-48D9-94FC-6C907D39E2AC}.ReleaseNASM|Win32.Build.0 = Release|Win32 + {2FE9808B-2B03-48D9-94FC-6C907D39E2AC}.ReleaseSSE2|Win32.ActiveCfg = Release|Win32 + {2FE9808B-2B03-48D9-94FC-6C907D39E2AC}.ReleaseSSE2|Win32.Build.0 = Release|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.Debug|Win32.ActiveCfg = Debug|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.Debug|Win32.Build.0 = Debug|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.Release|Win32.ActiveCfg = Release|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.Release|Win32.Build.0 = Release|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.ReleaseNASM|Win32.ActiveCfg = ReleaseNASM|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.ReleaseNASM|Win32.Build.0 = ReleaseNASM|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.ReleaseSSE2|Win32.ActiveCfg = ReleaseSSE2|Win32 + {92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}.ReleaseSSE2|Win32.Build.0 = ReleaseSSE2|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_config.vsprops b/node_modules/lame/deps/lame/vc_solution/vc9_lame_config.vsprops new file mode 100644 index 0000000..cbb7dcc --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_config.vsprops @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="vc9_lame_config" + OutputDirectory="$(SolutionDir)..\output\$(ConfigurationName)" + IntermediateDirectory="$(SolutionDir)..\obj\$(ConfigurationName)\$(ProjectName)" + > + <Tool + Name="VCBscMakeTool" + OutputFile="$(IntDir)/$(ProjectName).bsc" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATED" + StringPooling="true" + EnableFunctionLevelLinking="true" + AssemblerListingLocation="$(IntDir)\" + BrowseInformation="1" + WarningLevel="4" + DisableSpecificWarnings="4995;4996" + /> + <Tool + Name="VCLinkerTool" + LinkIncremental="1" + AdditionalLibraryDirectories="$(OutDir)" + ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb" + OptimizeReferences="2" + /> +</VisualStudioPropertySheet> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_dll.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_lame_dll.vcproj new file mode 100644 index 0000000..e7ca678 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_dll.vcproj @@ -0,0 +1,243 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="lame_enc_dll" + ProjectGUID="{0E4820D3-DBE3-477A-910B-7C020D6066D1}" + RootNamespace="lame_enc_dll" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="_DEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName="..\output\Debug/LameDll.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LAMEMP3ENCDLL_EXPORTS" + StringPooling="true" + RuntimeLibrary="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1036" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="libmp3lame.lib odbc32.lib odbccp32.lib" + OutputFile="..\output\Debug\lame_enc.dll" + AdditionalLibraryDirectories="" + GenerateDebugInformation="true" + ImportLibrary="$(OutDir)/lame_enc.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="NDEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName="..\output\Release/LameDll.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + InlineFunctionExpansion="2" + AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LAMEMP3ENCDLL_EXPORTS" + StringPooling="true" + RuntimeLibrary="2" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1036" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="libmp3lame.lib" + OutputFile="..\output\Release\lame_enc.dll" + LinkIncremental="1" + AdditionalLibraryDirectories="" + ImportLibrary="$(OutDir)/lame_enc.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + <File + RelativePath="..\Dll\BladeMP3EncDLL.c" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\Dll\BladeMP3EncDLL.def" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl" + > + <File + RelativePath="..\Dll\BladeMP3EncDLL.h" + > + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" + > + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_dll_example.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_lame_dll_example.vcproj new file mode 100644 index 0000000..9655c4a --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_dll_example.vcproj @@ -0,0 +1,187 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="lame_enc_dll_example" + ProjectGUID="{D169F06E-6607-4A9F-A075-2335717B9AB5}" + RootNamespace="lame_enc_dll_example" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Release|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\obj\Release\LameMp3EncDll/Example.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + InlineFunctionExpansion="2" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + StringPooling="true" + RuntimeLibrary="2" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalLibraryDirectories="" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\obj\Debug\LameMp3EncDll/Example.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + StringPooling="true" + RuntimeLibrary="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalLibraryDirectories="" + GenerateDebugInformation="true" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="..\Dll\Example.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_dshow.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_lame_dshow.vcproj new file mode 100644 index 0000000..9480419 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_dshow.vcproj @@ -0,0 +1,487 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="DShow" + ProjectGUID="{6D348A4E-8B40-4FB0-BB57-C982D51FFA01}" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="_DEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName="..\obj\Debug/dshow.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="..\include,..\DShow" + PreprocessorDefinitions="DEBUG;INC_OLE2;WINVER=0x0400;_X86_=1;STRICT;_WINDOWS;WIN32;STDC_HEADERS" + StringPooling="true" + RuntimeLibrary="3" + DebugInformationFormat="3" + CallingConvention="2" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + IgnoreImportLibrary="true" + AdditionalDependencies="libmp3lame.lib ..\DShow\strmbasD.lib vfw32.lib winmm.lib version.lib Comdlg32.lib comctl32.lib quartz.lib msvcrtd.lib" + OutputFile="..\output\Debug\lame.ax" + AdditionalLibraryDirectories="" + IgnoreAllDefaultLibraries="true" + ModuleDefinitionFile="..\DShow\Mpegac.def" + GenerateDebugInformation="true" + SubSystem="2" + EntryPointSymbol="DllEntryPoint@12" + BaseAddress="0x1c400000" + RandomizedBaseAddress="1" + ImportLibrary="$(IntDir)/$(TargetName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="NDEBUG" + MkTypLibCompatible="true" + TargetEnvironment="1" + TypeLibraryName="..\obj\Release/dshow.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + AdditionalIncludeDirectories="../include,../DShow" + PreprocessorDefinitions="NDEBUG;INC_OLE2;STRICT;WINVER=0x0400;_X86_=1;_WINDOWS;WIN32;STDC_HEADERS" + StringPooling="true" + RuntimeLibrary="2" + CallingConvention="2" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + IgnoreImportLibrary="true" + AdditionalDependencies="libmp3lame.lib ..\DShow\strmbase.lib vfw32.lib winmm.lib version.lib Comdlg32.lib comctl32.lib quartz.lib msvcrt.lib" + OutputFile="..\output\Release\lame.ax" + Version="0.3" + LinkIncremental="1" + AdditionalLibraryDirectories="" + IgnoreAllDefaultLibraries="true" + ModuleDefinitionFile="..\DShow\Mpegac.def" + SubSystem="2" + EntryPointSymbol="DllEntryPoint@12" + BaseAddress="0x1c400000" + RandomizedBaseAddress="1" + ImportLibrary="$(IntDir)/$(TargetName).lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" + > + <File + RelativePath="..\DShow\aboutprp.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\DShow\Encoder.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\DShow\Mpegac.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\DShow\Mpegac.def" + > + </File> + <File + RelativePath="..\DShow\Property.rc" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\DShow\PropPage.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\DShow\PropPage_adv.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\DShow\REG.CPP" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;fi;fd" + > + <File + RelativePath="..\DShow\aboutprp.h" + > + </File> + <File + RelativePath="..\DShow\Encoder.h" + > + </File> + <File + RelativePath="..\DShow\iaudioprops.h" + > + </File> + <File + RelativePath="..\DShow\Mpegac.h" + > + </File> + <File + RelativePath="..\DShow\PropPage.h" + > + </File> + <File + RelativePath="..\DShow\PropPage_adv.h" + > + </File> + <File + RelativePath="..\DShow\reg.h" + > + </File> + <File + RelativePath="..\DShow\resource.h" + > + </File> + <File + RelativePath="..\DShow\uids.h" + > + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" + > + <File + RelativePath="..\DShow\elogo.ico" + > + </File> + </Filter> + <File + RelativePath="..\include\lame.h" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\output\libmp3lame-dynamic.lib" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\DShow\README" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\DShow\STRMBASE.lib" + > + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_lame.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_lame_lame.vcproj new file mode 100644 index 0000000..87a8faa --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_lame.vcproj @@ -0,0 +1,383 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="app lame" + ProjectGUID="{EEF5B49E-DBD1-4E1B-8B86-C5D64FCBAD38}" + RootNamespace="lame" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="ReleaseNASM|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_nasm.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\ReleaseNASM/lame.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="..,../mpglib,../libmp3lame,../include,../" + PreprocessorDefinitions="NDEBUG;WIN32;_WIN32;_CONSOLE;_WINDOWS;HAVE_MPGLIB;HAVE_CONFIG_H;HAVE_NASM;MMX_choose_table" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG;_APP=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\lame.exe" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Debug/lame.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../,../mpglib,../libmp3lame,../include" + PreprocessorDefinitions="_DEBUG;WIN32;_WIN32;_CONSOLE;_WINDOWS;HAVE_MPGLIB;HAVE_CONFIG_H" + RuntimeLibrary="1" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG;_APP=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\lame.exe" + GenerateDebugInformation="true" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Release/lame.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="..,../mpglib,../libmp3lame,../include,../" + PreprocessorDefinitions="NDEBUG;WIN32;_WIN32;_CONSOLE;_WINDOWS;HAVE_MPGLIB;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG;_APP=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\lame.exe" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="ReleaseSSE2|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_sse2.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Release/lame.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="..,../mpglib,../libmp3lame,../include,../" + PreprocessorDefinitions="NDEBUG;WIN32;_WIN32;_CONSOLE;_WINDOWS;HAVE_MPGLIB;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG;_APP=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\lame.exe" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + <File + RelativePath="..\frontend\brhist.c" + > + </File> + <File + RelativePath="..\frontend\console.c" + > + </File> + <File + RelativePath="..\frontend\get_audio.c" + > + </File> + <File + RelativePath="..\frontend\lame_main.c" + > + </File> + <File + RelativePath="..\frontend\lametime.c" + > + </File> + <File + RelativePath="..\frontend\main.c" + > + </File> + <File + RelativePath="..\frontend\parse.c" + > + </File> + <File + RelativePath="..\frontend\timestatus.c" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl" + > + <File + RelativePath="..\frontend\brhist.h" + > + </File> + <File + RelativePath="..\frontend\console.h" + > + </File> + <File + RelativePath="..\frontend\get_audio.h" + > + </File> + <File + RelativePath="..\frontend\lametime.h" + > + </File> + <File + RelativePath="..\frontend\main.h" + > + </File> + <File + RelativePath="..\frontend\parse.h" + > + </File> + <File + RelativePath="..\frontend\timestatus.h" + > + </File> + </Filter> + <File + RelativePath="..\libmp3lame\lame.rc" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_mp3rtp.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_lame_mp3rtp.vcproj new file mode 100644 index 0000000..cb82813 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_mp3rtp.vcproj @@ -0,0 +1,395 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="app mp3rtp" + ProjectGUID="{C04BA4EA-F719-456D-A332-6C3AF92D7BEA}" + RootNamespace="mp3rtp" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="ReleaseNASM|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_nasm.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\ReleaseNASM/mp3rtp.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="..,../mpglib,../libmp3lame,../include,../" + PreprocessorDefinitions="NDEBUG;WIN32;_WIN32;_CONSOLE;_WINDOWS;HAVE_MPGLIB;HAVE_CONFIG_H;HAVE_NASM;MMX_choose_table" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG;_APP=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="wsock32.lib" + OutputFile="$(OutDir)\mp3rtp.exe" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Debug/mp3rtp.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../,../mpglib,../libmp3lame,../include" + PreprocessorDefinitions="_DEBUG;WIN32;_WIN32;_CONSOLE;_WINDOWS;HAVE_MPGLIB;HAVE_CONFIG_H" + RuntimeLibrary="1" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG;_APP=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="wsock32.lib" + OutputFile="$(OutDir)\mp3rtp.exe" + GenerateDebugInformation="true" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Release/mp3rtp.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="..,../mpglib,../libmp3lame,../include,../" + PreprocessorDefinitions="NDEBUG;WIN32;_WIN32;_CONSOLE;_WINDOWS;HAVE_MPGLIB;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG;_APP=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="wsock32.lib" + OutputFile="$(OutDir)\mp3rtp.exe" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="ReleaseSSE2|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_sse2.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Release/mp3rtp.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="..,../mpglib,../libmp3lame,../include,../" + PreprocessorDefinitions="NDEBUG;WIN32;_WIN32;_CONSOLE;_WINDOWS;HAVE_MPGLIB;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG;_APP=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="wsock32.lib" + OutputFile="$(OutDir)\mp3rtp.exe" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + <File + RelativePath="..\frontend\brhist.c" + > + </File> + <File + RelativePath="..\frontend\console.c" + > + </File> + <File + RelativePath="..\frontend\get_audio.c" + > + </File> + <File + RelativePath="..\frontend\lametime.c" + > + </File> + <File + RelativePath="..\frontend\main.c" + > + </File> + <File + RelativePath="..\frontend\mp3rtp.c" + > + </File> + <File + RelativePath="..\frontend\parse.c" + > + </File> + <File + RelativePath="..\frontend\rtp.c" + > + </File> + <File + RelativePath="..\frontend\timestatus.c" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl" + > + <File + RelativePath="..\frontend\brhist.h" + > + </File> + <File + RelativePath="..\frontend\console.h" + > + </File> + <File + RelativePath="..\frontend\get_audio.h" + > + </File> + <File + RelativePath="..\frontend\lametime.h" + > + </File> + <File + RelativePath="..\frontend\main.h" + > + </File> + <File + RelativePath="..\frontend\parse.h" + > + </File> + <File + RelativePath="..\frontend\rtp.h" + > + </File> + <File + RelativePath="..\frontend\timestatus.h" + > + </File> + </Filter> + <File + RelativePath="..\libmp3lame\lame.rc" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_mp3x.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_lame_mp3x.vcproj new file mode 100644 index 0000000..86844ef --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_mp3x.vcproj @@ -0,0 +1,421 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="app mp3x" + ProjectGUID="{E745EB1A-070A-45ED-B8BD-D9F794E23CFA}" + RootNamespace="mp3x" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="ReleaseNASM|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_nasm.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\ReleaseNASM/mp3x.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="./WinGTK/gtk-plus,./WinGTK/glib-1.2,./WinGtk/src/gtk+,./WinGtk/src/glib,./WinGtk/src/gtk+/gdk,../include,../libmp3lame,../mp3x,../frontend,.." + PreprocessorDefinitions="NDEBUG;LAMEPARSE;WIN32;_CONSOLE;HAVE_MPGLIB;LAMESNDFILE;BRHIST;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG;_APP=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="odbc32.lib odbccp32.lib gdk-1.3.lib gtk-1.3.lib glib-1.3.lib" + OutputFile="$(OutDir)\mp3x.exe" + AdditionalLibraryDirectories="./WinGtk/src/gtk+/gtk,./WinGtk/src/gtk+/gdk,./WinGtk/src/glib" + GenerateMapFile="true" + MapFileName="..\obj\ReleaseNASM\frontend/mp3x.map" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Debug/mp3x.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="./WinGtk/src/gtk+,./WinGtk/src/glib,./WinGtk/src/gtk+/gdk,../include,../libmp3lame,../mp3x,../frontend,.." + PreprocessorDefinitions="LAMESNDFILE;BRHIST;_DEBUG;WIN32;_CONSOLE;HAVE_MPGLIB;HAVE_CONFIG_H" + RuntimeLibrary="1" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="odbc32.lib odbccp32.lib gdk-1.3.lib gtk-1.3.lib glib-1.3.lib" + OutputFile="$(OutDir)\mp3x.exe" + AdditionalLibraryDirectories="./WinGtk/src/gtk+/gtk,./WinGtk/src/gtk+/gdk,./WinGtk/src/glib" + GenerateDebugInformation="true" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Release/mp3x.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="./WinGTK/gtk-plus,./WinGTK/glib-1.2,./WinGtk/src/gtk+,./WinGtk/src/glib,./WinGtk/src/gtk+/gdk,../include,../libmp3lame,../mp3x,../frontend,.." + PreprocessorDefinitions="NDEBUG;LAMEPARSE;WIN32;_CONSOLE;HAVE_MPGLIB;LAMESNDFILE;BRHIST;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="odbc32.lib odbccp32.lib gdk-1.3.lib gtk-1.3.lib glib-1.3.lib" + OutputFile="$(OutDir)\mp3x.exe" + AdditionalLibraryDirectories="./WinGtk/src/gtk+/gtk,./WinGtk/src/gtk+/gdk,./WinGtk/src/glib" + GenerateMapFile="true" + MapFileName="..\obj\Release\frontend/mp3x.map" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="ReleaseSSE2|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_sse2.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\ReleaseSSE2/mp3x.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="./WinGTK/gtk-plus,./WinGTK/glib-1.2,./WinGtk/src/gtk+,./WinGtk/src/glib,./WinGtk/src/gtk+/gdk,../include,../libmp3lame,../mp3x,../frontend,.." + PreprocessorDefinitions="NDEBUG;LAMEPARSE;WIN32;_CONSOLE;HAVE_MPGLIB;LAMESNDFILE;BRHIST;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="odbc32.lib odbccp32.lib gdk-1.3.lib gtk-1.3.lib glib-1.3.lib" + OutputFile="$(OutDir)\mp3x.exe" + AdditionalLibraryDirectories="./WinGtk/src/gtk+/gtk,./WinGtk/src/gtk+/gdk,./WinGtk/src/glib" + GenerateMapFile="true" + MapFileName="..\obj\ReleaseSSE2\frontend/mp3x.map" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source" + Filter="c" + > + <File + RelativePath="..\frontend\brhist.c" + > + </File> + <File + RelativePath="..\frontend\console.c" + > + </File> + <File + RelativePath="..\frontend\get_audio.c" + > + </File> + <File + RelativePath="..\frontend\gpkplotting.c" + > + </File> + <File + RelativePath="..\frontend\gtkanal.c" + > + </File> + <File + RelativePath="..\frontend\lametime.c" + > + </File> + <File + RelativePath="..\frontend\main.c" + > + </File> + <File + RelativePath="..\frontend\mp3x.c" + > + </File> + <File + RelativePath="..\frontend\parse.c" + > + </File> + <File + RelativePath="..\frontend\timestatus.c" + > + </File> + </Filter> + <Filter + Name="Include" + Filter="h" + > + <File + RelativePath="..\frontend\brhist.h" + > + </File> + <File + RelativePath="..\frontend\..\configMS.h" + > + </File> + <File + RelativePath="..\frontend\console.h" + > + </File> + <File + RelativePath="..\frontend\get_audio.h" + > + </File> + <File + RelativePath="..\frontend\gpkplotting.h" + > + </File> + <File + RelativePath="..\frontend\lametime.h" + > + </File> + <File + RelativePath="..\frontend\main.h" + > + </File> + <File + RelativePath="..\frontend\parse.h" + > + </File> + <File + RelativePath="..\frontend\timestatus.h" + > + </File> + </Filter> + <File + RelativePath="..\libmp3lame\lame.rc" + > + </File> + <File + RelativePath="..\frontend\..\README.WINGTK" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_lame_test.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_lame_test.vcproj new file mode 100644 index 0000000..df2e6c0 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_lame_test.vcproj @@ -0,0 +1,185 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="lame_test" + ProjectGUID="{2FE9808B-2B03-48D9-94FC-6C907D39E2AC}" + RootNamespace="lame_test" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Release|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + InlineFunctionExpansion="2" + AdditionalIncludeDirectories="..\include" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + StringPooling="true" + RuntimeLibrary="2" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalLibraryDirectories="" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + ConfigurationType="1" + InheritedPropertySheets=".\vc9_lame_config.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="..\include" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + StringPooling="true" + RuntimeLibrary="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalLibraryDirectories="" + GenerateDebugInformation="true" + SubSystem="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="..\test\lame_test.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_libmp3lame.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_libmp3lame.vcproj new file mode 100644 index 0000000..79fd114 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_libmp3lame.vcproj @@ -0,0 +1,1451 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="libmp3lame-static" + ProjectGUID="{20536101-3B0E-43EF-94F9-080D595DAC57}" + RootNamespace="libmp3lame" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + <ToolFile + RelativePath=".\vc9_nasm.rules" + /> + </ToolFiles> + <Configurations> + <Configuration + Name="ReleaseNASM|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_nasm.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="NASM" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="../mpglib,../include,.." + PreprocessorDefinitions="NDEBUG;_WINDOWS;HAVE_MPGLIB;WIN32;HAVE_CONFIG_H;HAVE_NASM;MMX_choose_table;_CRT_SECURE_NO_DEPRECATE" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(OutDir)/libmp3lame-static.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="NASM" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="../mpglib,../include,.." + PreprocessorDefinitions="NDEBUG;_WINDOWS;HAVE_MPGLIB;WIN32;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(OutDir)/libmp3lame-static.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="NASM" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../mpglib,../include,.." + PreprocessorDefinitions="_DEBUG;_WINDOWS;HAVE_MPGLIB;WIN32;HAVE_CONFIG_H" + RuntimeLibrary="1" + ProgramDataBaseFileName="$(OutDir)\$(TargetName).pdb" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(OutDir)/libmp3lame-static.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="ReleaseSSE2|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_sse2.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="NASM" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="../mpglib,../include,.." + PreprocessorDefinitions="NDEBUG;_WINDOWS;HAVE_MPGLIB;WIN32;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(OutDir)/libmp3lame-static.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source" + Filter="c" + > + <File + RelativePath="..\libmp3lame\bitstream.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\encoder.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\fft.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\gain_analysis.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\id3tag.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\lame.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\mpglib_interface.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\newmdct.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\presets.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\psymodel.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\quantize.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\quantize_pvt.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\reservoir.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\set_get.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\tables.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + WarningLevel="1" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + WarningLevel="1" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + WarningLevel="1" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + WarningLevel="1" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\takehiro.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\util.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\vbrquantize.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\VbrTag.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\version.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\.\vector\xmm_quantize_sub.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="../libmp3lame" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="../libmp3lame" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="../libmp3lame" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="../libmp3lame" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Include" + Filter="h" + > + <File + RelativePath="..\libmp3lame\bitstream.h" + > + </File> + <File + RelativePath="..\libmp3lame\..\configMS.h" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCustomBuildTool" + Description="Performing Custom Build Step on $(InputName)" + CommandLine="copy ..\configMS.h ..\config.h " + Outputs="..\config.h" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCustomBuildTool" + Description="Performing Custom Build Step on $(InputName)" + CommandLine="copy ..\configMS.h ..\config.h " + Outputs="..\config.h" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCustomBuildTool" + Description="Performing Custom Build Step on $(InputName)" + CommandLine="copy ..\configMS.h ..\config.h " + Outputs="..\config.h" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCustomBuildTool" + Description="Performing Custom Build Step on $(InputName)" + CommandLine="copy ..\configMS.h ..\config.h " + Outputs="..\config.h" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\encoder.h" + > + </File> + <File + RelativePath="..\libmp3lame\fft.h" + > + </File> + <File + RelativePath="..\libmp3lame\gain_analysis.h" + > + </File> + <File + RelativePath="..\libmp3lame\id3tag.h" + > + </File> + <File + RelativePath="..\libmp3lame\l3side.h" + > + </File> + <File + RelativePath="..\libmp3lame\lame-analysis.h" + > + </File> + <File + RelativePath="..\libmp3lame\lame_global_flags.h" + > + </File> + <File + RelativePath="..\libmp3lame\.\vector\lame_intrin.h" + > + </File> + <File + RelativePath="..\libmp3lame\lameerror.h" + > + </File> + <File + RelativePath="..\libmp3lame\machine.h" + > + </File> + <File + RelativePath="..\libmp3lame\newmdct.h" + > + </File> + <File + RelativePath="..\libmp3lame\psymodel.h" + > + </File> + <File + RelativePath="..\libmp3lame\quantize.h" + > + </File> + <File + RelativePath="..\libmp3lame\quantize_pvt.h" + > + </File> + <File + RelativePath="..\libmp3lame\reservoir.h" + > + </File> + <File + RelativePath="..\libmp3lame\set_get.h" + > + </File> + <File + RelativePath="..\libmp3lame\tables.h" + > + </File> + <File + RelativePath="..\libmp3lame\util.h" + > + </File> + <File + RelativePath="..\libmp3lame\vbrquantize.h" + > + </File> + <File + RelativePath="..\libmp3lame\VbrTag.h" + > + </File> + <File + RelativePath="..\libmp3lame\version.h" + > + </File> + </Filter> + <Filter + Name="Asm" + Filter=".nas" + > + <File + RelativePath="..\libmp3lame\i386\choose_table.nas" + > + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\i386\cpu_feat.nas" + > + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\i386\fft.nas" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\i386\fft3dn.nas" + > + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\i386\fftfpu.nas" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\i386\fftsse.nas" + > + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\i386\ffttbl.nas" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\i386\scalar.nas" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="NASM" + /> + </FileConfiguration> + </File> + </Filter> + <File + RelativePath="..\include\lame.h" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_libmp3lame_dll.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_libmp3lame_dll.vcproj new file mode 100644 index 0000000..66bca67 --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_libmp3lame_dll.vcproj @@ -0,0 +1,374 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="libmp3lame" + ProjectGUID="{92BD50AA-04D6-4FBF-ACE1-468FAF6778F2}" + RootNamespace="libmp3lameDLL" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + <ToolFile + RelativePath=".\vc9_nasm.rules" + /> + </ToolFiles> + <Configurations> + <Configuration + Name="Release|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="NASM" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Release/libmp3lame_dll.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="../libmp3lame,../,../mpglib,../include,.." + PreprocessorDefinitions="NDEBUG;_WINDOWS;HAVE_MPGLIB;WIN32;HAVE_CONFIG_H" + RuntimeLibrary="2" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_VC80_UPGRADE=0x0600;_DLL=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + UseLibraryDependencyInputs="false" + OutputFile="$(OutDir)/libmp3lame.dll" + ModuleDefinitionFile="..\include\lame.def" + ImportLibrary="$(OutDir)/libmp3lame.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="ReleaseNASM|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_nasm.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="NASM" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\ReleaseNASM/libmp3lame_dll.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="../libmp3lame,../,../mpglib,../include,.." + PreprocessorDefinitions="NDEBUG;_WINDOWS;HAVE_MPGLIB;HAVE_CONFIG_H;WIN32;_CRT_SECURE_NO_DEPRECATE" + RuntimeLibrary="2" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_VC80_UPGRADE=0x0600;_DLL=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + UseLibraryDependencyInputs="false" + OutputFile="$(OutDir)/libmp3lame.dll" + ModuleDefinitionFile="..\include\lame.def" + ImportLibrary="$(OutDir)/libmp3lame.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="NASM" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Debug/libmp3lame_dll.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../libmp3lame,../,../mpglib,../include,.." + PreprocessorDefinitions="_DEBUG;_WINDOWS;HAVE_MPGLIB;WIN32;HAVE_CONFIG_H" + RuntimeLibrary="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_VC80_UPGRADE=0x0600;_DLL=$(TargetFileName);_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + UseLibraryDependencyInputs="false" + OutputFile="$(OutDir)/libmp3lame.dll" + ModuleDefinitionFile="..\include\lame.def" + GenerateDebugInformation="true" + ImportLibrary="$(OutDir)/libmp3lame.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="ReleaseSSE2|Win32" + ConfigurationType="2" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_sse2.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="NASM" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName="..\output\Release/libmp3lame_dll.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="../libmp3lame,../,../mpglib,../include,.." + PreprocessorDefinitions="NDEBUG;_WINDOWS;HAVE_MPGLIB;WIN32;HAVE_CONFIG_H" + RuntimeLibrary="2" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_VC80_UPGRADE=0x0600;_DLL=$(TargetFileName)" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)/libmp3lame.dll" + ModuleDefinitionFile="..\include\lame.def" + ImportLibrary="$(OutDir)/libmp3lame.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="..\libmp3lame\..\include\lame.def" + > + <FileConfiguration + Name="Release|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseNASM|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + ExcludedFromBuild="true" + > + <Tool + Name="VCCustomBuildTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\libmp3lame\lame.rc" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_mpglib.vcproj b/node_modules/lame/deps/lame/vc_solution/vc9_mpglib.vcproj new file mode 100644 index 0000000..133d90f --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_mpglib.vcproj @@ -0,0 +1,659 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="libmpghip-static" + ProjectGUID="{E2DAB91A-8248-4625-8A85-2C2C2A390DD8}" + RootNamespace="libmpghip" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="ReleaseNASM|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_nasm.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="../libmp3lame,../include,.." + PreprocessorDefinitions="NDEBUG;HAVE_MPGLIB;_WINDOWS;USE_LAYER_2;WIN32;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(OutDir)/libmpghip-static.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="../libmp3lame,../include,.." + PreprocessorDefinitions="NDEBUG;HAVE_MPGLIB;_WINDOWS;USE_LAYER_2;WIN32;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(OutDir)/libmpghip-static.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_x87.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../libmp3lame,../include,.." + PreprocessorDefinitions="_DEBUG;_WINDOWS;USE_LAYER_2;HAVE_MPGLIB;WIN32;HAVE_CONFIG_H" + RuntimeLibrary="1" + ProgramDataBaseFileName="$(OutDir)\$(TargetName).pdb" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(OutDir)/libmpghip-static.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="ReleaseSSE2|Win32" + ConfigurationType="4" + InheritedPropertySheets=".\vc9_lame_config.vsprops;.\arch_sse2.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="3" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories="../libmp3lame,../include,.." + PreprocessorDefinitions="NDEBUG;HAVE_MPGLIB;_WINDOWS;USE_LAYER_2;WIN32;HAVE_CONFIG_H" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="$(OutDir)/libmpghip-static.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source" + Filter="c" + > + <File + RelativePath="..\mpglib\common.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\mpglib\dct64_i386.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\mpglib\decode_i386.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\mpglib\interface.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\mpglib\layer1.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\mpglib\layer2.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\mpglib\layer3.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\mpglib\tabinit.c" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Include" + Filter="h" + > + <File + RelativePath="..\mpglib\common.h" + > + </File> + <File + RelativePath="..\mpglib\..\configMS.h" + > + <FileConfiguration + Name="ReleaseNASM|Win32" + > + <Tool + Name="VCCustomBuildTool" + Description="Performing Custom Build Step on $(InputName)" + CommandLine="copy ..\configMS.h ..\config.h " + Outputs="..\config.h" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCustomBuildTool" + Description="Performing Custom Build Step on $(InputName)" + CommandLine="copy ..\configMS.h ..\config.h " + Outputs="..\config.h" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCustomBuildTool" + Description="Performing Custom Build Step on $(InputName)" + CommandLine="copy ..\configMS.h ..\config.h " + Outputs="..\config.h" + /> + </FileConfiguration> + <FileConfiguration + Name="ReleaseSSE2|Win32" + > + <Tool + Name="VCCustomBuildTool" + Description="Performing Custom Build Step on $(InputName)" + CommandLine="copy ..\configMS.h ..\config.h " + Outputs="..\config.h" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\mpglib\dct64_i386.h" + > + </File> + <File + RelativePath="..\mpglib\decode_i386.h" + > + </File> + <File + RelativePath="..\mpglib\huffman.h" + > + </File> + <File + RelativePath="..\mpglib\interface.h" + > + </File> + <File + RelativePath="..\mpglib\l2tables.h" + > + </File> + <File + RelativePath="..\mpglib\layer1.h" + > + </File> + <File + RelativePath="..\mpglib\layer2.h" + > + </File> + <File + RelativePath="..\mpglib\layer3.h" + > + </File> + <File + RelativePath="..\mpglib\mpg123.h" + > + </File> + <File + RelativePath="..\mpglib\mpglib.h" + > + </File> + <File + RelativePath="..\mpglib\tabinit.h" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/node_modules/lame/deps/lame/vc_solution/vc9_nasm.rules b/node_modules/lame/deps/lame/vc_solution/vc9_nasm.rules new file mode 100644 index 0000000..8b7f64e --- /dev/null +++ b/node_modules/lame/deps/lame/vc_solution/vc9_nasm.rules @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<VisualStudioToolFile + Name="NASM " + Version="8,00" + > + <Rules> + <CustomBuildRule + Name="NASM" + DisplayName="NASM" + CommandLine="nasmw [BinFormat] [IncludeDir] [Defines] -o [OutFile] $(InputPath)" + Outputs="[OutFile]" + FileExtensions="*.nas" + ExecutionDescription="Assembling $(InputName)..." + ShowOnlyRuleProperties="false" + > + <Properties> + <StringProperty + Name="OutFile" + DisplayName="output file path" + Switch="[value]" + DefaultValue="$(IntDir)\$(InputName).obj" + /> + <StringProperty + Name="BinFormat" + DisplayName="Binary format" + Switch="-f [value]" + DefaultValue="win32" + /> + <StringProperty + Name="IncludeDir" + DisplayName="Additional include directories" + Switch="-i [value]" + DefaultValue="$(InputDir)" + Delimited="true" + /> + <StringProperty + Name="Defines" + DisplayName="Defines" + Switch="-D[value]" + DefaultValue="WIN32" + Delimited="true" + Delimiters=" ;," + /> + </Properties> + </CustomBuildRule> + </Rules> +</VisualStudioToolFile> diff --git a/node_modules/lame/deps/mpg123/AUTHORS b/node_modules/lame/deps/mpg123/AUTHORS new file mode 100644 index 0000000..4e495b7 --- /dev/null +++ b/node_modules/lame/deps/mpg123/AUTHORS @@ -0,0 +1,150 @@ +This is an attempt to give credit to the people who contributed in some way to the mpg123 project. +There are names and email addresses listed. Please use these addresses only to contact contributors with some question about their mpg123 contribution. +You are explicitly not allowed to send them unwanted business offers or to question the quality of their sex life. +-------------------- + +Current maintainers with various sorts of contributions: + Thomas Orgis <thomas@orgis.org> + Patrick Dehne <patrick@steidle.net> + Jonathan Yong <10walls@gmail.com> + +Co-initiator of the revived mpg123 project, but not that involved anymore: + Nicholas J Humfrey <njh@ecs.soton.ac.uk> + +Generic address pointing to the current maintainer (hopefully still works in future in case maintainership will change again): <maintainer@mpg123.org> + +The creator: Michael Hipp (email: hippm@informatik.uni-tuebingen.de - please bother maintainers first) + +Contributions/ideas Thomas Orgis era (includes backports from mhipp trunk): + +Dan McGee <dpmcgee@gmail.com>: various patches (also for test suite) +Jonathan Yong (jon_y) <10walls@gmail.com>: win32 hacking +Malcolm Boczek <MBoczek@terraindustries.com>: Common language runtime wrapper +Elbert Pol (TeLLie) <elbert.pol@gmail.com>: OS/2 port fixup +Jeroen Valkonet <jvalkon@xs4all.nl>: motivate pitch control, suggestive patch for pitch command in generic control interface +Andy Hefner <ahefner@gmail.com>: patch for that second UTF16 issue +Taihei Monma <tmkk@mac.com>: A whole lot of new/improved assembler code, including Altivec! +Christian Weisgerber <naddy@openbsd.org>, Brad Smith: sndio output +Patrick Dehne (P4tr3ck) <patrick@steidle.net>: more MSVC++ porting, patch to handle missing bit reservoirs +Thorsten Glaser <tg@mirbsd.de>: icy2utf8, suggest utf8 locale stuff +Dan Smith <dan@algenta.com>: ABI fixes for ensuring stack alignment (esp. for MinGW-built DLL with MSVC) +Michael Ryzhykh <mclroy@gmail.com>: mpg123.spec.in +Stefan Lenselink <Stefan@lenselink.org>: initial aRts output +Sergej Kvachonok <ravenexp@gmail.com>: win32 audio rewrite +Winston: SunOS-4.1.4/gcc-2.7.0 testing and suggestions for fixes (legacy Makefile, integer type headers) +Mika Tiainen: pointing out the fix for the UTF to ASCII filtering of tags to actually work +Nick Kurshev <nickols_k@mail.ru>: extended 3dnow (from mplayer) +Zuxy Meng <zuxy.meng@gmail.com>: SSE (from mplayer) +Honza <cundrak@quick.cz>: idea and prototype patch for ICY meta data support +Petr Baudis <pasky@ucw.cz>: patches: term sigcont, id3 display unicode fallback and condensed output +Petr Salinger <Petr.Salinger@seznam.cz>: i486 enhancement +mpdavig@users.sourceforge.net: linux-ppc-nas Makefile.legacy entry +Adrian Bacon <adrian.bacon@xs4all.nl>: patched decode_i586_dither (noise shaped float/int rounding) +Cool Feet Audio project <nutcase@dtfm.org>: realtime equalizer control +Steve Grundell <www@grundell.u-net.com>: clean stdout in control mode with stdout decoding +Romain Dolbeau <romain@dolbeau.org>: Altivec support (taken from mplayer) +higway <higway@mednet.md>: MMX Patch +Clemens Ladisch <clemens@ladisch.de>: ALSA 0.9/1.0 support + +Debian Daniel Kobras <kobras@debian.org> era: + +Steve Kemp <skx@debian.org> +Dan Olson <theoddone33@icculus.org> +Syuuhei Kashiyama <squash@mb.kcom.ne.jp> +Rupert Levene <rupert.debian@hotpop.com> +Andreas Dilger <adilger@turbolinux.com> +Erik B. Andersen <andersee@debian.org> +Chris Butler <chrisb@debian.org> +Martin Sjogren <md9ms@mdstud.chalmers.se> +Chet Hosey <chosey@budapress.com> +Roland Rosenfeld <roland@spinnaker.de> + + +Debian Colin Watson <cjwatson@debian.org> era: + +Helge Deller <deller@gmx.de> +Chet Hosey <chosey@budapress.com> +Christopher C. Chimelis <chris@debian.org> +Roland Rosenfeld <roland@spinnaker.de> +Marcelo E. Magallon <mmagallo@debian.org> + + +Initial Debianers: + +Tommi Virtanen <tv@debian.org> +Paul Haggart <phaggart@debian.org> + + +Contributions/ideas Michael Hipp era: + +Mikko Tommila: DCT9 +Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de> +MPEG Software Simulation Group: reference decoder package +Tobias Bading: idea for DCT64 in subband synthesis from maplay package +Jeff Tsay and Mikko Tommila: MDCT36 from maplay package +Philipp Knirsch <phil@mpik-tueb.mpg.de>: DCT36/manual unroll idea +Thomas Woerner: SGI Audio +Damien Clermonte: HP-UX audio fixes +Niclas Lindstrom <nil@wineasy.se>: OS2 port +Stefan Bieschewski <stb@acm.org>: Pentium optimizations, decode_i586.s +Martin Denn <mdenn@unix-ag.uni-kl.de>: NAS port +Niklas Beisert <nbeisert@physik.tu-muenchen.de>: MPEG 2.5 tables +<mycroft@NetBSD.ORG> and <augustss@cs.chalmers.se>: NetBSD Patch(es) +Kevin Brintnall <kbrint@visi.com>: BSD patch +Tony Million: win32 port +Steven Tiger Lang: advanced shuffle +Eric B. Mitchell: esd port +Ryan R. Prosser <prosser@geocities.com>: esd port for Solaris +Andreas Neuhaus: initial generic control interface + +(additionally fetched from changelog:) + +Ralf Hildebrandt <R.Hildebrandt@TU-BS.DE>: audio_alib changes +<sms@moe.2bsd.com>: BSDOS 4.0 with gcc added to Makefile +Bertrand Petit <elrond@phoe.netdev.net>: frontend changes +Erik Mouw <J.A.K.Mouw@its.tudelft.nl>: SGI audio fix for non RAD machines +Daniel O'Connor <darius@guppy.dons.net.au>: freebsd-esd make-entry +D. Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>: enhanced head_check +Wilson, Jeff D <jeff.wilson@wilcom.com>: xterm-title +Robert Bihlmeyer <robbe@orcus.priv.at>: esd changes +Hannu Napari's <Hannu.Napari@hut.fi>: SGI audio patches +<Juergen.Schoew@unix-ag.uni-siegen.de>: native AIX support +<psst@euskalnet.net>: playlist patch +Gilles Zunino <Gilles.Zunino@hei.fupl.asso.fr>: SGI audio patches +Matthew Parslow <roy@alpha.alphalink.com.au>: esdserver patch +<dlux@dlux.sch.bme.hu>: equalizer patch (equalfile setting) +Ducroquet Erwan <ducroque@ufr-info-p7.ibp.fr>: HPUX/ALib support +Shane Wegner <shane@CM.NU>: genrepatch +Samuel Audet <guardia@step.polymtl.ca>: wav-File patch +"J. Dean Brederson" <jdb@cs.utah.edu>: SGI-RAD support +Chou Ye-chi <is84002@cis.nctu.edu.tw>: sajberplay/FreeBSD patch +Fabrice Bellard <bellard@email.enst.fr>: 486 optimizations +A. Hermansen <ahermans@vf.telia.no> and J. Kysela <perex@jcu.cz>: ALSA output +KIMURA Takuhiro <kim@hannah.ipc.miyakyo-u.ac.jp>: K6-3DNow +Petr Stehlik <stehlik@cas3.zlin.vutbr.cz>: MINT +Andy <andy@snoogie.demon.co.uk>: float2int speed up proposal +Brian Foutz <foutz@anise.ee.cornell.edu>: TK3Play +Thomas Niederreiter <tn@tarantel.rz.fh-muenchen.de>: RIFF header fix +Stefan Gybas <cab@studbox.uni-stuttgart.de>: m68k patch +Grant Erickson <eric0139@tc.umn.edu>: Linux PPC patch +Peter Berger <peterb@hoopoe.psc.edu>: BSDi patch +Henrik P Johnson <king@one.se>: HTTP auth +Steven Tiger Lang <tiger@tyger.org>: advanced shuffle +"Brian J. Swetland" <swetland@uiuc.edu>: front-end (remote) patch +<leo@zycad.com> +Tillmann Steinbrecher <tst@gmx.de>: shuffle patch +M.Stekelenburg <m.stekelenburg@student.utwente.nl>: i386-getbits +Antti Andreimann <anttix@cyberix.edu.ee>: outburst patch +Hur TaeSung <saturn@arari.snu.ac.kr>: 'http accept' patch + +(from post-0.59 changes that yet have to go into new trunk:) + +Hans Schwengeler <schweng@astro.unibas.ch>: audio_dec additions +Wojciech Baraski's Mp3Play (check the tools folder): Mp3Play frontend +Daniel Koukola: audio_oss.c patch +Munechika SUMIKAWA <sumikawa@ebina.hitachi.co.jp>: IPv6 +TEMNOTA <temnota@kmv.ru>: HTTP,FTP patch/playlist fix +Peter Surda <shurdeek@panorama.sth.ac.at>: VBR patch +Ben <ben@blaukopf.com>: ARM startup time improvements +Dave MacKenzie <djm@pix.net>: init_output() patch +pasky's <pasky@ju.cz>: close-on-stop patch diff --git a/node_modules/lame/deps/mpg123/COPYING b/node_modules/lame/deps/mpg123/COPYING new file mode 100644 index 0000000..cf361b2 --- /dev/null +++ b/node_modules/lame/deps/mpg123/COPYING @@ -0,0 +1,773 @@ +This is the file that contains the terms of use, copying, etc. for the mpg123 distribution package. + +Main message: + + Code is copyrighted by Michael Hipp, who made it free software under the terms of the LGPL 2.1. + +But that is not all of it. +mpg123 is licensed under the GNU General Lesser Public License, version 2.1, and in parts under the GNU General Public License, version 2. +That means that _all_ of mpg123 is licensed under GPL and the major part also under the LGPL. + +Actually, the "major part" currently is the whole distributed package of mpg123. There are some files (old alsa output, libao output) that you get from our svn repository and that do not fall under LGPL. + +When the copyright marker in a source file says "the mpg123 project" that means that the file contains code copyrighted by contributors to mpg123, the "initially written by" naming the person(s) that created the file and thus may have the largest part of copyrights on it. +I am explaining this here to emphasize that the copyright always actually lies by the individual member (i.e. contributor to) of the mpg123 project who wrote a specific section of code. +Usage of a source code management system like Subversion should provide keeping track of individual copyright traces... + +Please consider that any code that is contributed to the mpg123 project shall be licensed under LGPL 2.1 . +If you want to contribute, but don't agree to that (i.e. you want to have your code GPL only) please say so - then, we either you convince is to include your code under GPL, we convince you to make it LGPL instead or, as a last resort, you'll have to do you own GPLed fork. +But we should try to avoid the last option... + +All files in the distribution that don't carry a license note on their own are licensed under the terms of the LGPL 2.1; all files that do carry either a LGPL or GPL note are licensed respectively under the LGPL or GPL as follows: + + +======================= +1. The LGPL version 2.1 +======================= + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + +==================== +2. The GPL version 2 +==================== + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/node_modules/lame/deps/mpg123/ChangeLog b/node_modules/lame/deps/mpg123/ChangeLog new file mode 100644 index 0000000..e8d40a1 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ChangeLog @@ -0,0 +1,3 @@ +This is a dummy file. If you want to see the change log, use subversion: + + svn log -v svn://orgis.org/mpg123 diff --git a/node_modules/lame/deps/mpg123/INSTALL b/node_modules/lame/deps/mpg123/INSTALL new file mode 100644 index 0000000..c618eff --- /dev/null +++ b/node_modules/lame/deps/mpg123/INSTALL @@ -0,0 +1,111 @@ +mpg123 install hints +-------------------- + +(This file has very long lines - die-hard terminal nostalgists can be satisfied by `fmt -s -w 75 < INSTALL | less`. I think it's better to let the reader's preference rule than to preformat the stuff to some arbitrary width.) + + +0. Prerequesites + +You really need: + +- a C compiler; we try to keep the code ANSI C89/ISO C90 compatible + gcc from 2.95 on should work, others, too - please report any issues + Actually, we have a confirmed working build (svn trunk leading to release 0.67) on SunOS 4.1.4 with gcc-2.7.0 . + +- an (UNIX-like) operating system with standard tools; MinGW32 and Cygwin are working for Microsoft Windows, too. We also have users happily on OS/2. +- For the library only, you may get lucky with MSVC++ using the project files under ports/ +- For other exotic platforms, also see ports/ +- If building from direct SCM checkout, you need GNU autotools installed (see below). + +You want: + +- working assembler (recent GNU binutils) if using certain CPU optimizations +- headers and lib for certain audio output drivers (libasound for alsa, sdl for sdl...) +- libtool's libltdl for runtime output modules (this used to be included, but now we rely on an existing install) + + +1. Build + +There is one main supported way to get your mpg123 installation consisting of + + a) the mpg123 binary file + - with libmpg123 as shared library or statically linked + - with audio output plugins, or one statically linked + b) a man page + +(you may want to copy some of the documentation - README, etc - to /usr/share/doc/mpg123 or the like, too) + +This way is the usual GNU 3-step procedure: + + ./configure + make + make install + +Run + + ./configure --help + +for a list of possible parameters you can specify in the configuration step. The obvious are --prefix and the normal GNU autotool bunch, but others include what audio subsystem to use and what CPU optimizations to build in. +For the optimizations (decoder choice), the default is a build that combines all usable optimizations for the platform and chooses one at runtime (see --cpu, --list-cpu and --test-cpu parameters). + +There are various parameters you can tune, but of course the defaults are what is mainly tested. + +Also, various library features can be left out via --disable options (like output formats, resampling modes). That way, you can strive for a minimal build that only does what you really need. Not every combination of library features is tested regularily, so you might hit some speed bumps, but usually stuff that is easily worked out (at least for the mpg123 team when you report it). + +An example (working on mpg123 trunk r3062): + + CFLAGS="-Os -s" ./configure --with-cpu=generic --disable-id3v2 --disable-lfs-alias --disable-feature-report --with-seektable=0 --disable-16bit --disable-32bit --disable-8bit --disable-messages --disable-feeder --disable-ntom --disable-downsample --disable-icy && make + +That, and further application of `strip --strip-unneeded`, yields a lean 93 KiB shared library for MPEG layer I/II/III decoding to floating point on my x86-64 system (it should be a bit smaller on 32 bit systems). When disabling layers I and II, too, that goes down to 81 KiB. + +The shared library of a full build weighs 170 KiB after stripping. + + +2. Developer build + +This project uses GNU autotools (no specific version, but they should be fairly recent), also libtool. You need to have those installed, as it is usually the case for build environments based on the GNU toolchain. + +One a fresh SCM checkout, or after changing things in configure.ac, you need to run + + autoreconf -iv + +to prepare the configure script. Then you can build as per point 1. + + +3. Library-only build + +If you do not want to build the whole thing, but only the library, run + + ./configure + cd src/libmpg123 + make + +You can then find the library itself under src/libmpg123/.libs (libtool likes to hide things there). + + +4. Exotic platforms + +See the ports/ directory for some help for building at least libmpg123 without the UNIX shell / autotools. The main strategy is to write a config.h to replace what configure would generate and then have a correct listing of all source files involved in that configuration (there are optional files for different decoder choices, for example). + +Then compile objects, link. + + +4a. Preparing Win32 binary packages. + +Caution: You should make sure to use some gcc >= 4.2.0, even if it's still the experimental package for MinGW32. +This helps preventing incompatibilities between generated DLL files and other compilers (it's about stack alignment). + +Get MinGW/MSYS installed, run the MSYS shell. +Enter the mpg123 source directory. +Execute sh ./windows-builds.sh . + +After some time, you should have some relevant files under releases/ (or releases\, for Windows people;-). +You don't just get one build -- there are several variants, corresponding to what usually is to be found under http://mpg123.org/download/win32 . + + +5. Note on large file support + +The libmpg123 API includes the generic off_t type for file offsets and thus is subject to shape-shifting on systems that change off_t depending on build flags. +To deal with the incompatibilities that can cause, the library needs to separate code paths for small and large off_t. +Since version 1.12.0, a large-file-enabled libmpg123 (the default set by configure) provides a dual-mode ABI. Depending on _FILE_OFFSET_BITS, the mpg123.h header file selects different library symbols to use for your app. +In both large-file and normal mode, the library should just work for your app. diff --git a/node_modules/lame/deps/mpg123/Makefile.am b/node_modules/lame/deps/mpg123/Makefile.am new file mode 100644 index 0000000..a837ffa --- /dev/null +++ b/node_modules/lame/deps/mpg123/Makefile.am @@ -0,0 +1,99 @@ +## Makefile.am: produce Makefile.in from this + +## copyright by the mpg123 project - free software under the terms of the LGPL 2.1 +## see COPYING and AUTHORS files in distribution or http://mpg123.org +## initially written by Nicholas J. Humfrey +dist_man_MANS = man1/mpg123.1 + +SUBDIRS = src doc +DIST_SUBDIRS = src doc +ACLOCAL_AMFLAGS = -I m4 + +# pkg-config file for the mpg123 library +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libmpg123.pc + +# mpg123.spec is autogenerated but needs to be present in tarball! +EXTRA_DIST = \ + mpg123.spec \ + makedll.sh \ + windows-builds.sh \ + equalize.dat \ + NEWS.libmpg123 \ + ports/MSVC++/mpg123.h \ + ports/MSVC++/config.h \ + ports/MSVC++/msvc.c \ + ports/MSVC++/examples/scan.c \ + ports/MSVC++/examples/feedseek.c \ + ports/MSVC++/2005/libmpg123/libmpg123.vcproj \ + ports/MSVC++/2008/mpg123.sln \ + ports/MSVC++/2008/feedseek/feedseek.vcproj \ + ports/MSVC++/2008/mpglib/mpglib.vcproj \ + ports/MSVC++/2008/libmpg123/libmpg123.vcproj \ + ports/MSVC++/2008/scan/scan.vcproj \ + ports/MSVC++/2008/dump_seekindex/dump_seekindex.vcproj \ + ports/MSVC++/2008clr/2008clr.sln \ + ports/MSVC++/2008clr/mpg123clr/advanced.cpp \ + ports/MSVC++/2008clr/mpg123clr/advanced.h \ + ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp \ + ports/MSVC++/2008clr/mpg123clr/dllmain.cpp \ + ports/MSVC++/2008clr/mpg123clr/enum.h \ + ports/MSVC++/2008clr/mpg123clr/error.cpp \ + ports/MSVC++/2008clr/mpg123clr/error.h \ + ports/MSVC++/2008clr/mpg123clr/id3v1.cpp \ + ports/MSVC++/2008clr/mpg123clr/id3v1.h \ + ports/MSVC++/2008clr/mpg123clr/id3v2.cpp \ + ports/MSVC++/2008clr/mpg123clr/id3v2.h \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.h \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj \ + ports/MSVC++/2008clr/mpg123clr/ReadMe.txt \ + ports/MSVC++/2008clr/mpg123clr/resource.h \ + ports/MSVC++/2008clr/mpg123clr/stdafx.cpp \ + ports/MSVC++/2008clr/mpg123clr/stdafx.h \ + ports/MSVC++/2008clr/mpg123clr/string.cpp \ + ports/MSVC++/2008clr/mpg123clr/string.h \ + ports/MSVC++/2008clr/mpg123clr/targetver.h \ + ports/MSVC++/2008clr/mpg123clr/text.cpp \ + ports/MSVC++/2008clr/mpg123clr/text.h \ + ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj \ + ports/MSVC++/2008clr/examples/feedseekclr/Program.cs \ + ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj \ + ports/MSVC++/2008clr/examples/scanclr/Program.cs \ + ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2010/mpg123.sln \ + ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj \ + ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj.filters \ + ports/MSVC++/2010/feedseek/feedseek.vcxproj \ + ports/MSVC++/2010/feedseek/feedseek.vcxproj.filters \ + ports/MSVC++/2010/libmpg123/libmpg123.vcxproj \ + ports/MSVC++/2010/scan/scan.vcxproj \ + ports/MSVC++/2010/scan/scan.vcxproj.filters \ + ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj \ + ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE \ + ports/MSVC++/CMP3Stream/README \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP \ + ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H \ + ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H \ + ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H \ + ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H \ + ports/README \ + ports/Sony_PSP/config.h \ + ports/Sony_PSP/README \ + ports/Sony_PSP/Makefile.psp \ + ports/Sony_PSP/readers.c.patch \ + ports/mpg123_.pas \ + ports/Xcode/config.h \ + ports/Xcode/mpg123.h \ + ports/Xcode/mpg123.xcodeproj/project.pbxproj \ + scripts/benchmark-cpu.pl \ + scripts/tag_lyrics.py + diff --git a/node_modules/lame/deps/mpg123/Makefile.in b/node_modules/lame/deps/mpg123/Makefile.in new file mode 100644 index 0000000..83b9797 --- /dev/null +++ b/node_modules/lame/deps/mpg123/Makefile.in @@ -0,0 +1,1043 @@ +# Makefile.in generated by automake 1.12.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/libmpg123.pc.in $(srcdir)/mpg123.spec.in \ + $(top_srcdir)/build/config.guess \ + $(top_srcdir)/build/config.sub $(top_srcdir)/build/install-sh \ + $(top_srcdir)/build/ltmain.sh $(top_srcdir)/build/missing \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + TODO build/config.guess build/config.sub build/install-sh \ + build/ltmain.sh build/missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/addrconfig.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/config.h +CONFIG_CLEAN_FILES = libmpg123.pc mpg123.spec +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" +NROFF = nroff +MANS = $(dist_man_MANS) +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + cscope distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AIX_CFLAGS = @AIX_CFLAGS@ +AIX_LDFLAGS = @AIX_LDFLAGS@ +AIX_LIBS = @AIX_LIBS@ +ALIB_CFLAGS = @ALIB_CFLAGS@ +ALIB_LDFLAGS = @ALIB_LDFLAGS@ +ALIB_LIBS = @ALIB_LIBS@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LDFLAGS = @ALSA_LDFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMTAR = @AMTAR@ +API_VERSION = @API_VERSION@ +AR = @AR@ +ARTS_CFLAGS = @ARTS_CFLAGS@ +ARTS_LDFLAGS = @ARTS_LDFLAGS@ +ARTS_LIBS = @ARTS_LIBS@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COREAUDIO_CFLAGS = @COREAUDIO_CFLAGS@ +COREAUDIO_LDFLAGS = @COREAUDIO_LDFLAGS@ +COREAUDIO_LIBS = @COREAUDIO_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DECODER_LOBJ = @DECODER_LOBJ@ +DECODER_OBJ = @DECODER_OBJ@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMMY_CFLAGS = @DUMMY_CFLAGS@ +DUMMY_LDFLAGS = @DUMMY_LDFLAGS@ +DUMMY_LIBS = @DUMMY_LIBS@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_LDFLAGS = @ESD_LDFLAGS@ +ESD_LIBS = @ESD_LIBS@ +EXEC_LT_LDFLAGS = @EXEC_LT_LDFLAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HP_CFLAGS = @HP_CFLAGS@ +HP_LDFLAGS = @HP_LDFLAGS@ +HP_LIBS = @HP_LIBS@ +INCLUDE_STDIO_H = @INCLUDE_STDIO_H@ +INCLUDE_STDLIB_H = @INCLUDE_STDLIB_H@ +INCLUDE_SYS_TYPE_H = @INCLUDE_SYS_TYPE_H@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBS = @JACK_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LFS_LOBJ = @LFS_LOBJ@ +LIBMPG123_VERSION = @LIBMPG123_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_LDFLAGS = @LT_LDFLAGS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MINT_CFLAGS = @MINT_CFLAGS@ +MINT_LDFLAGS = @MINT_LDFLAGS@ +MINT_LIBS = @MINT_LIBS@ +MKDIR_P = @MKDIR_P@ +MODULE_OBJ = @MODULE_OBJ@ +NAS_CFLAGS = @NAS_CFLAGS@ +NAS_LDFLAGS = @NAS_LDFLAGS@ +NAS_LIBS = @NAS_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENAL_CFLAGS = @OPENAL_CFLAGS@ +OPENAL_LDFLAGS = @OPENAL_LDFLAGS@ +OPENAL_LIBS = @OPENAL_LIBS@ +OS2_CFLAGS = @OS2_CFLAGS@ +OS2_LDFLAGS = @OS2_LDFLAGS@ +OS2_LIBS = @OS2_LIBS@ +OSS_CFLAGS = @OSS_CFLAGS@ +OSS_LDFLAGS = @OSS_LDFLAGS@ +OSS_LIBS = @OSS_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +OUTPUT_CFLAGS = @OUTPUT_CFLAGS@ +OUTPUT_LDFLAGS = @OUTPUT_LDFLAGS@ +OUTPUT_LIBS = @OUTPUT_LIBS@ +OUTPUT_MOD = @OUTPUT_MOD@ +OUTPUT_OBJ = @OUTPUT_OBJ@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PORTAUDIO_CFLAGS = @PORTAUDIO_CFLAGS@ +PORTAUDIO_LDFLAGS = @PORTAUDIO_LDFLAGS@ +PORTAUDIO_LIBS = @PORTAUDIO_LIBS@ +PULSE_CFLAGS = @PULSE_CFLAGS@ +PULSE_LDFLAGS = @PULSE_LDFLAGS@ +PULSE_LIBS = @PULSE_LIBS@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LDFLAGS = @SDL_LDFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SGI_CFLAGS = @SGI_CFLAGS@ +SGI_LDFLAGS = @SGI_LDFLAGS@ +SGI_LIBS = @SGI_LIBS@ +SHELL = @SHELL@ +SNDIO_CFLAGS = @SNDIO_CFLAGS@ +SNDIO_LDFLAGS = @SNDIO_LDFLAGS@ +SNDIO_LIBS = @SNDIO_LIBS@ +STRIP = @STRIP@ +SUN_CFLAGS = @SUN_CFLAGS@ +SUN_LDFLAGS = @SUN_LDFLAGS@ +SUN_LIBS = @SUN_LIBS@ +VERSION = @VERSION@ +WIN32_CFLAGS = @WIN32_CFLAGS@ +WIN32_LDFLAGS = @WIN32_LDFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +dist_man_MANS = man1/mpg123.1 +SUBDIRS = src doc +DIST_SUBDIRS = src doc +ACLOCAL_AMFLAGS = -I m4 + +# pkg-config file for the mpg123 library +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libmpg123.pc + +# mpg123.spec is autogenerated but needs to be present in tarball! +EXTRA_DIST = \ + mpg123.spec \ + makedll.sh \ + windows-builds.sh \ + equalize.dat \ + NEWS.libmpg123 \ + ports/MSVC++/mpg123.h \ + ports/MSVC++/config.h \ + ports/MSVC++/msvc.c \ + ports/MSVC++/examples/scan.c \ + ports/MSVC++/examples/feedseek.c \ + ports/MSVC++/2005/libmpg123/libmpg123.vcproj \ + ports/MSVC++/2008/mpg123.sln \ + ports/MSVC++/2008/feedseek/feedseek.vcproj \ + ports/MSVC++/2008/mpglib/mpglib.vcproj \ + ports/MSVC++/2008/libmpg123/libmpg123.vcproj \ + ports/MSVC++/2008/scan/scan.vcproj \ + ports/MSVC++/2008/dump_seekindex/dump_seekindex.vcproj \ + ports/MSVC++/2008clr/2008clr.sln \ + ports/MSVC++/2008clr/mpg123clr/advanced.cpp \ + ports/MSVC++/2008clr/mpg123clr/advanced.h \ + ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp \ + ports/MSVC++/2008clr/mpg123clr/dllmain.cpp \ + ports/MSVC++/2008clr/mpg123clr/enum.h \ + ports/MSVC++/2008clr/mpg123clr/error.cpp \ + ports/MSVC++/2008clr/mpg123clr/error.h \ + ports/MSVC++/2008clr/mpg123clr/id3v1.cpp \ + ports/MSVC++/2008clr/mpg123clr/id3v1.h \ + ports/MSVC++/2008clr/mpg123clr/id3v2.cpp \ + ports/MSVC++/2008clr/mpg123clr/id3v2.h \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.h \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc \ + ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj \ + ports/MSVC++/2008clr/mpg123clr/ReadMe.txt \ + ports/MSVC++/2008clr/mpg123clr/resource.h \ + ports/MSVC++/2008clr/mpg123clr/stdafx.cpp \ + ports/MSVC++/2008clr/mpg123clr/stdafx.h \ + ports/MSVC++/2008clr/mpg123clr/string.cpp \ + ports/MSVC++/2008clr/mpg123clr/string.h \ + ports/MSVC++/2008clr/mpg123clr/targetver.h \ + ports/MSVC++/2008clr/mpg123clr/text.cpp \ + ports/MSVC++/2008clr/mpg123clr/text.h \ + ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj \ + ports/MSVC++/2008clr/examples/feedseekclr/Program.cs \ + ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs \ + ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj \ + ports/MSVC++/2008clr/examples/scanclr/Program.cs \ + ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs \ + ports/MSVC++/2010/mpg123.sln \ + ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj \ + ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj.filters \ + ports/MSVC++/2010/feedseek/feedseek.vcxproj \ + ports/MSVC++/2010/feedseek/feedseek.vcxproj.filters \ + ports/MSVC++/2010/libmpg123/libmpg123.vcxproj \ + ports/MSVC++/2010/scan/scan.vcxproj \ + ports/MSVC++/2010/scan/scan.vcxproj.filters \ + ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj \ + ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE \ + ports/MSVC++/CMP3Stream/README \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP \ + ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP \ + ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H \ + ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H \ + ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H \ + ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H \ + ports/README \ + ports/Sony_PSP/config.h \ + ports/Sony_PSP/README \ + ports/Sony_PSP/Makefile.psp \ + ports/Sony_PSP/readers.c.patch \ + ports/mpg123_.pas \ + ports/Xcode/config.h \ + ports/Xcode/mpg123.h \ + ports/Xcode/mpg123.xcodeproj/project.pbxproj \ + scripts/benchmark-cpu.pl \ + scripts/tag_lyrics.py + +all: all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): +libmpg123.pc: $(top_builddir)/config.status $(srcdir)/libmpg123.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +mpg123.spec: $(top_builddir)/config.status $(srcdir)/mpg123.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-man1: $(dist_man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) + +clean-cscope: + -rm -f cscope.files + +cscope.files: clean-cscope cscopelist-recursive cscopelist + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + @list='$(MANS)'; if test -n "$$list"; then \ + list=`for p in $$list; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ + if test -n "$$list" && \ + grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ + echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \ + grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ + echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ + echo " typically 'make maintainer-clean' will remove them" >&2; \ + exit 1; \ + else :; fi; \ + else :; fi + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod u+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(MANS) $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-man install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-man uninstall-pkgconfigDATA + +uninstall-man: uninstall-man1 + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-cscope \ + clean-generic clean-libtool cscope cscopelist \ + cscopelist-recursive ctags ctags-recursive dist dist-all \ + dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-pkgconfigDATA \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-man uninstall-man1 \ + uninstall-pkgconfigDATA + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/mpg123/NEWS b/node_modules/lame/deps/mpg123/NEWS new file mode 100644 index 0000000..556885b --- /dev/null +++ b/node_modules/lame/deps/mpg123/NEWS @@ -0,0 +1,1200 @@ +1.14.4 +--- + +Who reworks a parsing and data mangling without really making sure that things still work like before? I hope I won't do so in future. Not again. + +- Fix resync logic to properly work again (used to prematurely end stream on bad headers). A regression again, this sucks, but at least we got a regression test for that now. +- Fix aeon-old regression (since 1.11.0) about short seeks: Bit reservoir was reset also for short seeks that did not break continuity. +- Another damned regression got fixed: Sample-accurate seek for files without full gapless info. + +1.14.3 +--- +- Fix regression from 1.14.1 in parsing of bad free format streams, avoiding apparently endless loops (just very slow reading, in fact). + +1.14.2 +--- +- Fix writing of WAV to stdout. + It is still not the best of ideas to do so, though. At least make sure to fix rate and channels. + +1.14.1 +--- +- Fix subtle bug that could trigger failure to detect a format change on resync when using libmpg123's feeder API. + That bug has been there since ages but was neutralized by other (buggy) behaviour of the parser before the little overhaul. The Law of an Even Number of Bugs. + +1.14.0 +--- +- libmpg123 API version 36 (see NEWS.libmpg123) +- Add --ignore-streamlength. +- But also deal with concatenated (Frankenstein) streams: Not applying gapless cutting once we're over the announced number of frames. +- Also, gapless cutting is only applied if relevant information is present. Previously, at least the decoder delay has been cut. +- Add --lyrics for printout of lyrics (from USLT in ID3v2). +- Added handling of SIGUSR1 and SIGUSER2 to terminal control code, configurable via --ctrlusr1 and --ctrlusr2. +- Some low-level API added (mpg123_framedata(), mpg123_framepos(), buffering and resampling control). +- Added info about input buffer fill to mpg123_getstate(). +- ReplayGain: Try to detect LAME below 3.95 for the different reference level of 83 dB (adding preamp of 6 dB). Version 3.95 itself (not 3.95.1) I cannot detect. User-set gain values are not touched. +- Keep silent about missing bit reservoir when ignoring frames. That is the whole point (mostly;-). +- Add the new/old WRITE_SAMPLE variant from MPlayer that makes the generic decoder faster on older CPUs (x86 at least). Not on x86-64, though (it's not enabled per default there). +- Handle out-of-disk in the file writers (a bit, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=67259) +- Added Xcode project files to build libmpg123 on Mac OS and iOS +- 32 bit output for sndio output (patch by Brad Smith). +- Remote control interface knows LOADLIST command now. +- Now freeing meta data memory after printout. +- Some documentation cleanup, including manpage fixes by quadrispro. +- Re-enabled wildcard expansion on Windows (been broken by unicode file name support). +- Fix MMX tabinit syntax (thanks to Marcel Müller for pointing that out). +- Fix SGI audio output (been broken since change to modules). +- Fix some fringe behaviour (mpg123_getformat() triggering needless reading of next frame, possibly hitting bogus MPG123_NEED_MORE). +- Resync limit now also serves to increase amount of skipped junk on beginning. +- Better separation of stream end and read error (in case there is no stream opened, even). +- Don't always complain about failed free format header search (only with verbosity level 3). + +1.13.8 +--- +- Fix build for ARM Thumb (incompatible assembly in some macros). + +1.13.7 +--- +- Fix endless loop in module loader when starting mpg123 in a directory that does not exist. + +1.13.6 +--- +- Fix output of one random character in -vvv mode for ID3v2.2 frames (no buffer overflow, move along, folks;-). + +1.13.5 +--- +- Fix reading of ReplayGain values from Lame tag (nobody seen this before?!) + (both actual values and the distinction between audiophile / radio). +- Accept application/octet-stream as input from HTTP. +- Update man page with encodings. +- Build fixes. + +1.13.4 +--- +- Fix bogus error on resync with big offsets (hits systems that have bigger off_t than int), bug 3393801. +- Fix windows binary package build script again with plugdir. + +1.13.3 +--- +- Fix an endless loop on bad headers, bug 3267863. +- Prevent compiler warnings about unused variables with gcc 4.6 . +- Fix return value handling of getaddrinfo(), bug 3288333. +- Make decwin size computation work for OPT_ARM and sizeof(long) != 4 (bug 3288360). + +1.13.2 +--- +- Updated .NET wrapper (MPG123_SKIP_ID3V2, encsize and mpg123_strlen functions) by Malcolm Boczek. +- Fix crash when calling mpg123_decoder() before opening a track -- a rare use case since one can choose a decoder with mpg123_new() already. +- Fix format change detection for certain (artificial) concatenated streams (p.ex. MPEG 1 frames following MPEG 2 frames). +- Prevent the nasty of bug 3154889: No change of pitch without a current audio format. No proper solution, but more like earlier behaviour. +- Fix some compiler warnings. +- Fix a memory leak in the module loader, also some in the examples, for being pedantic. +- More use of AC_LANG_SOURCE to silence autoconf. + +1.13.1 +--- +- Fix --float and --8bit (MPG123_FORCE_FLOAT, MPG123_FORCE_8BIT) regression, caused by introduction of 24 bit formats. (bug 3151597). + Btw: The use of specific format choice via `mpg123 -e f32` and friends is encouraged (meaning mpg123_format_none() / mpg123_format() calls in libmpg123 API). +- Loosen the parser restrictions: Allow the private header bit to vary. It is not mpg123's business anyway (finally suggested by Marcel). + +1.13.0 +--- +- libmpg123 API version 29 (see NEWS.libmpg123) +- New optimization: ARM NEON (Cortex A series) -- kudos to Taihei, again! +- Added 24 bit integer output (truncation of 32 bit integer). +- Cleanup of symbols for the static library: Only have global symbols that are actually needed, prefix them with INT123_ to avoid conflicts. +- Added --streamdump to get a copy of the data libmpg123 used. +- Added --icy-interval and tweaked libmpg123 to make playback of ICY stream dumps possible. +- Added possibility to set module file suffix at build -- to be able to avoid .la files for plugins. +- Removed compiler directives for alignment and disable associated tests. + The tests don't work on a wide range of compilers anyway, and newer gccs + do have force_align_arg_pointer to fix bad stacks. +- There is no ChangeLog file anymore... it was autogenerated from subversion log anyway, so look there if interested. + +1.12.5 +--- +- Fix bug with the new meta data printout of the mpg123 app; embedded null bytes in UTF-8 strings in non-UTF-8 environment would trigger buffer overflow. + Thanks to Jakub Bogusz of PLD Linux for the tip. And yes, shame on Thomas for changing working string handling code. At all. + +1.12.4 +--- +- Fix formatting of meta data printout in UTF-8 (string length computing). + As a collorary, ID3v1 data is reduced to ASCII in UTF-8 environment, as we do never know what specific encoding that has. + +1.12.3 +--- +- Fix a long-standing bug that subtly broke http streaming with ICY meta data when reading a bit more quickly, like when using the buffer. + I was a very simple and embarrassing bug, actually ... and it made me wonder how normal streaming still worked rather well, generally:-/ + Thanks to Lint for staying with us and reporting bug 3022850, to finally get a grip on streaming reliability. + +1.12.2 +--- +- Fix for nasty memory corruption on configurations that hand out addresses in the upper half of the memory space (the poiner alignment function broke in that case, bug 2996045). +- Various build and portability fixes (including making some exotic configure switches work (again)). +- Add dump_seekindex example +- Sync mpg123_clr to 1.12 feature set, patch provided by Malcolm Boczek + And actually include it in release tarball! +- Rework mpg123.h logic for large file stuff a bit, clients can control it by defining MPG123_NO_LARGENAME or MPG123_LARGESUFFIX. +- Include dumb wrappers to provide names suffixed with _64 on 64 bit machines and _32 on 32 bit machines, respectively, to help clients that insist on defining _FILE_OFFSET_BITS where it is not needed (or with a non-large value). +- Tuning of the internal buffer code for feeder mode to minimize its performance impact (works in 4K blocks now). +- Workaround for compiler bugs in Open64/PathScale/SunStudio (bug 3004396, suggestion by Doug Gilmore). + Note that Sun Studio is still a tricky fellow, at least when it comes to our preprocessed assembly. + Also, x86-Open64 recently produced another segfault in layer3.c on my box... GNU and intel compilers are what one can use as something stable. +- Make mpg123_getformat() return more error codes (like MPG123_NEED_MORE). +- Fix handle I/O for clients with small file offset (32 bit when libmpg123 has 64 bit). +- Fix 3DNow(Ext) standalone builds. + +1.12.1 +--- + +- Update INSTALL for the dual-mode library. No code changes. + +1.12.0 +--- + +Attention: This reverts the big bad libray name change. People did not like libmpg123_64.so at all ... so Thomas went along with proving that being responsible for a open source library package sucks for your life -- he coded large file dual-mode into libmpg123. One library with both APIs, like glibc. + +- libmpg123 25.0.25: + - The separate libraries are gone again, this one is dual-mode (using ca. 750 lines of not very funny code). + - The library even translates callbacks between large file support modes. + - Introduce handle-based custom I/O in libmpg123. + - The header now defines MPG123_API_VERSION to help compile-time detection of available functions (lib is version 25.0.25 now... MPG123_API_VERSION is 25). +- Make the usage of AI_ADDRCONFIG dependend on a configure check. This flag is not available everywhere. + + +1.11.0 +--- + +Attention: There was a re-release of the source archive, because the initial one missed the actual changes for the library name. +Sorry for the inconvenience:-/ + +- Big bad libray name change for builds with enabled large file support. + That will break libmpg123 binary compatibility on Linux/x86 when upgrading from mpg123>=1.5.0 with enabled large file support. You need to relink with the new library called libmpg123_64. + If you do not enable large file support, or it is implicit on your platform (x86-64), the library keeps the old name of libmpg123 and everything is fine. +- Assembler cleanup: + - no use of compiler-based stack alignment (for SSE), helping portability + - mostly performance neutral, hint at faster decoding for the dynamic build and slower for static, but small change in any case +- Windows networking (access http streams in mingw builds). +- Do not ask for addresses that do not have matching interfaces configured (IPv6 on a IPv4-only host, for example). + That can help with broken DNS servers that choke on IPv6 addresses (T-Online Speedport W502V, for example). +- Fix a potential ICY reading problem were ICY metadata could be read as mp3 data (basically for MPEG frames bigger than the ICY interval). + + +1.10.1 +--- + +- Help multilib setups that boldly assume that headers are invariant by removing the consistency check in mpg123.h and instead just adding a suffix to relevant functions when _FILE_OFFSET_BITS is defined. Invalid setups will now fail at the linking stage instead of the preprocessing stage. + That should cover bug 2934488. +- Fixes for gapless decoding: + - Correctly skip padding larger than one MPEG frame (strange, but occurs). + - Bug 2950218 (proper gapless cuts for seeking near the end). +- Make sure the search for the first header aborts after 64K of one-byte reads, as always intended (bug 2951334). + Certain files (or even random data) were able to fool mpg123 sufficiently enough that it basically reads through the whole file in 1-byte steps in search for MPEG data. + The limit of 64K will very likely be configurable in a future mpg123 version. +- Fix subtle bug with seeking in feeder mode: A seek close to the current position (meaning: the needed data offset is already in mpg123's buffer chain) resulted in skipped bytes. +- Improve the feeder mode for handling large amounts of junk at the beginning, including proper passing of the request for more data when trying to determine free format frame size. This also fixes endless looping as reported in bug 2951334. +- The parser code still needs overhaul. It is not pretty. +- Compile fix for OpenAL. + +1.10.0 +--- + +- Confirmed/fixed on OS/2 platform. + At least a static build works with native audio output and generic decoder. +- Make modules work with libtool-2.2.6b . +- Added pitch command to control interface. +- HTTP header field and MIME type parsing now case-insensitive (fixes bug 2904736). + Also, the MIME-parsing for non-playlist URLs is done the same way as from playlists now. + And, we interpret MIME types only to before a ";" (see bug 2836904). +- There is a build-time option to enable unicode file names on windows now. UNIX (Linux) does not need that, UTF-8 works natively. + An unicode-enabled build of libmpg123 expects file names as UTF-8 strings, opening of non-utf8 strings (by old applications) still works via fallback when the conversion of the string or opening of the file failed. +- Also, on Windows, --realtime now works, along with added granularity of the new --priority parameter. Note that you get the latter functionality through nice/renice on UNIX, no need to add that to mpg123. +- Added experimental framebyframe API. +- Added a new Microsoft common language runtime wrapper (aka .NET wrapper) written by Malcolm Boczek. See ports\MSVC++\2008clr\mpg123clr\ReadMe.txt for further information +- Added Visual Studio 2010 Beta 2 project files for libmpg123 +- Updated autotools machinery, autogen.sh is gone, use `autoreconf -iv`. + +1.9.2 +--- +- Fix logic failure in gapless code: The trailing silence was only cut on the first decode. So, seek-back and decode again never was gapless:-( +- Fix linker flags on MacOS 10.6 . +- Improve portability (mainly for Solaris/x86, possibly others). +- Fix reading from standard input in Windows (use binary mode). + +1.9.1 +--- +- Fix OpenAL output issue (bug 2840085) +- Fix theoretically possible discarding of some audio samples when getting a new format. +- Fix unwanted verboseness (some error messages from library even when MPG123_QUIET was specified). +- Fix back-to-beginning for feed_skip (fixes bug 2859531). +- Fix the CPU creep bug with NtoM decoding. + That one has been nasty on you with large files since bad frame fillup has been introduced. +- Fix regression (since 1.9.0) in ID3 parsing: Now Foobar2000 RVA fields are interpreted again (among others). +- Fix some compiler warnings, minor cleanup. + +1.9.0 +--- + +- Free format support. +- ARM assembly optimizations (yay Taihei again!). +- Dither noise now runtime-generated, thus less bloated binary (thanks Taihei...). + This means that dithered decoding is now included per default. + Please note that work is ongoing to improve the dithering quality, more to come. + For example: Accurate rounding to 16bits is now always used for generic dithered decoder, there are plans to adapt the noise for different sampling frequencies. +- Buffer plays any audio type now. +- New output module: OpenAL +- Bug fixes: + - Broken frame fillup for non-signed 8 bit formats with correct zero (bug 2805665) + - Crash on invalid UTF-16 in ID3 tags fixed (thanks to Andy Hefner) + - Bad detection of separated UTF-16 strings in ID3 tags (bug 2834636). +- Topic ID3 and UTF: Now we are more tolerant with UTF16, even accepting those broken tags that id3v2 produces (multiple conflicing BOMs). +- Build system allows AltiVec on non-Macs now (don't enforce unsupported gcc flags). +- Terminal control mode is more verbose (gives hint about pressing 'h'). +- The library now offers a switch and small API to defer translation of ID3 text data until client app wants to do it (or not). + +1.8.1 +--- +- Include improvements to integer decoder from SVN trunk. + They have been accidentally promised on 1.8.0 release announcements, though they were not there. Here it is: ISO compliant fixed point decoding (speed optimizations are still reserved for next release). +- Fixed build with ./configure --enable-modules (bug in configure script). +- Fix name of binary in help screen when called with path. +- Build fix for old gcc with AltiVec code. +- Update of Sony PSP build files. + +1.8.0 (The Taihei Monmament) +--- + +- New and improved SSE optimizations! For x86-64, too! Also AltiVec! Fast float output! Faster stereo! + Finally, this should put mpg123 into the efficiency-leading position on current hardware! + Thanks go out to Taihei Monma for pushing lots of new assembler code. +- Added proper rounding modes to 16bit integer. + - Use ./configure --enable-int-quality to prefer accuracy over speed. + - Accurate code (generic, SSE, 3dnow -- i586 has always been good) delivers ISO compliant quality with 16bit output. + - Uses fast rounding for IEEE754 floats. + - Mpg123 can do fully ISO compliant MPEG audio decoding to 16bits (of course to 32bit float/int, too). +- subtle performance enhancements via broader data alignment +- Prefer SSE code over 3DNowExt. + - It can be tight, but generally our new SSE code is better on CPUs that can do both. +- Remove HF cutoff (SFB21), has been introduced in 0.59r . +- Fix layer 1 regression (been there since version 1.x). + - Layer 1 ISO compliance test is positive now. +- Fix layer 2 regression (false positives header change). + - Layer 2 ISO compliance test is positive now. +- more sample-accurateness + - Clear frame buffers before seek. + - Decode 4 frames in advance for layer 3 (2 for layer 1 and 2) per default. + - Number of layer 3 frames to decoded in advance (and fill bit reservoir) is runtime tunable (--preframes). +- Do not stop decoding after stray ID3v1 tags in streams (bug 2793677). +- Fix handling of negative RVA2 values in ID3v2 (bug 2792417). +- Discard bitreservoir of previous frames if a resync is needed. +- improve perceived randomness of --random (do not repeat too early) +- Fix special crash case in UTF16 conversion for ID3v2. +- MPG123_MODDIR environment variable for changing module directory at runtime +- arts output fixes (bug 2715128) +- win32 output swallowing less buffers at end (but still some audio is lost, bug 2722991) +- tested mpg123 on OS/2; it works, but not the native audio output (SDL works) +- WAV output announces supported output formats correctly +- fix buffer startup to make sure the first bits of audio are not discarded (bug 2796802) +- re-enable the --gain parameter (the move to modules disabled that), untested +- Libltdl is _not_ included anymore. + - The host system is expected to provide it, otherwise plugins are not used. + - Our copy does not get in the way anymore. +- enhancements of the MSVC++ builds, including optimizations using yasm +- general build system fixes +- Legacy build system is gone. +- code cleanup + - signed/unsigned integer usage, make compilers more happy) + - simplified synth selection code (it is _less_ code now, and does more) +- Fixed behaviour of MPG123_NEW_FORMAT: Now it does not stop you from just continuing decoding without querying the (new) output format, this behaviour regression had been there since somewhen after 1.4.3 . + +1.7.3 +--- + - Fix a regression introduced with the --doublespeed fix. Now seeking should be a lot smoother again. + +1.7.2 +--- + - Fix a possible vulnerability in the ID3 code (negative encoding values). + +1.7.1 +--- + - Just one fix for making the RVA switch in terminal and generic control mode work again (instead of plain silence). + +1.7.0 +--- +- Lots of output format fun! + - now supporting 8, 16, 32 bit signed/unsigned integers, + 32bit float (64bit float can be hacked in quickly) + - optimized decoders use fallback routines for non-optimized + formats transparently + - flexible resampling is automatically chosen when output does + not support standard rates (like a JACK server) + - That meant quite some restructuring in the decoder code... +- Lots of core functionality now optional, enabling small-footprint + builds of libmpg123. + - choosing among the MPEG layer codes + - NtoM resampling + - downsampling + - feeder API (mpg123_open_feed()) + - ID3v2 + - String API + - ICY + - output formats + - error/warning message printouts + - ... a layer3-only shared libmpg123 can be just 107K on x86-64 + or 94K on x86 +- --preload (tune prefill before playback for buffered mode) +- win64 support (one report at least;-), modules working on Windows +- Windows/MSVC++: fixed handling of unicode file names, + mpg123_topen() now actually working there + - You are obliged to use mpg123_tclose() now! +- using "plugins" subdir relative to mpg123 binary + (in addition to ../lib/mpg123) +- switch to libtool 2.2 and automake 1.10 for the build scripts + - though no update to new libtool 2 API, yet +- some portability fixes +- prevent user from creating non-working I/O setups + (replacing timeout reader, ICY with feeding) +- JACK output accepts port names for -a, stereo gets mixed down + when only one port is chosen +- added sndio output, contributed by Christian Weisgerber +- Make --doublespeed paramter work, porting of which has been + forgotten in the 1.x series! + Along with that, a regression in decoding has been fixed + (concerning skipping of frames in general). + +1.6.4 +--- +- Fix for consistent NtoM resampled decoding and broken frames fillup. + +1.6.3 +--- + +- Fix sf.net bug #2413608: Make sure a new format does not slip through after early close. +- Include equalizer example file and a piece of wrapper code for MSVC++ in the distribution. +- Do not claim to support unsigned 16 bit encoding (never been the case). +- Fix default fifo detection, now it actally activates fifo support! + +1.6.2 +--- + +- Fix default IPv6 detection in configure.ac (a typo has been introduced before). + +1.6.1 +--- + +- Fix printing of largefile offsets in remote control interface. +- Some portability fixes (reduced compiler warnings on Solaris, p.ex.). + +1.6.0 +--- +- small things inside that I forgot to mention +- some new commands for remote control interface: + - SCAN + - SAMPLE + - EQFILE + - SHOWEQ +- added --keep-open command line flag (for remote control) +- fixed equalizer file parsing to really handle comment lines as example file suggests +- more elaborate detection of UTF-8 locale, also --utf8 switch to force it +- added --fuzzy to enable inexact seeking (see below) +- added --index-size parameter for tuning accurate frame seek index +- enabling largefile support via configure +- libmpg123 11.0.11: + - added mpg123_geteq(), mpg123_tell_stream() and mpg123_getstate() + - API cleanup (take const char* for mpg123_open()) + - calm down complainling (C++) compilers by completing the mpg123_channels enum + - fixed several possible crashes when user provides NULLs where it isn't appropriate + - workaround for frames that fail decoding (bad frame body, missing bit reservoir): fill up with silence + That also fixes seeking issues related to bad frames since now the fixed relation between frame and sample offsets is restored. + - Finally realized what that the resampling code for integer math (generic_nofpu) was just incomplete! + Now it works, using the defined integer multiplication. + - Detect UTF-8 in ICY conversion (instead of just assuming CP-1252, provided by Torsten Glaser). + - Prevent ugly noise when the bit reservoir is not fully there (p.ex. ignorantly cut mp3 files). + Concerned frames are silenced, but reservoir for following frames is kept. + Thanks to Patrick Dehne for the investigation and patch! + - New option for fuzzy seeking; trading sample accuracy for speed. + With that option, seeks positions are guessed using mean framesize or the Xing VBR TOC is used. + - Feeder streams work with seek index now. + - Seek frame index is runtime tunable. + - more caution with alignment issues for varying library users +- new project files to build/use libmpg123 with MSVC++ 2005 and 2008, provided by Patrick Dehne +- fixed a regression that made the pause/loop mode in terminal control slowly go backwards + +Big note for libmpg123 users: Make sure your application is compiled with the same largefile setting as libmpg123! +If that does not match, you will get unresolved symbols (which is better than weird errors when using a nonmatching off_t in arguments;-). + +1.5.1 +--- + +- fix wav/au/cdr writing to stdout (bug #2044423) +- add more sensible --no-resync to replace --resync (bug #2044404) +- libmpg123 7.0.7 + - fix thread safety of SSE decoder (bug #2053181) + - fix robustness of length handling, added mpg123_set_filesize() (bug #2064322) + +1.5.0 +--- + +- libmpg123 6.0.6 + - Floating point decoding back again, (build time choice for now; --with-cpu=generic_float). + - More robust string handling; extended string API. + - fixed an (so far) unnoticed ID3 bug that may have obscured comment fields + - added mpg123_feed() as shortcut; using const input buffer now + - resync is enabled again for ICY streams (the trouble in the past was due to a reader bug, not the streams) + - decode ICY text data to UTF-8 (thanks, Thorsten) + - preserve file flags for timeout mode +- More elaborate (helpful?) error message for output format problems. +- Reworked HTTP code... and added IPv6 support! +- Fix the --proxy parameter (has been accidentally ignored before). +- Added --ignore-mime to work with web streams with funny playlist MIME types like "audio/megurl". +- Know MIME audio/mpegurl. +- --timeout is now also used for the connection itself (not just reading). +- Now trying to resume ALSA device after suspend. +- subtle build changes (your CFLAGS rule now) + +1.4.3 +--- + +- Fix mpg123_tell() and mpg123_seek() return values with respect to the samples in decoding buffer (bug 1947373). +- Fix (bogus) 3DNow detection on IDT C6 (bug 1947982). +- Fix mono playback of win32 output (bug 1955157). +- Fix ABI compatibility with compilers that don't align the stack like gcc does (fixing SSE crashes on win32). + +1.4.2 +--- + +- Fix build problems (for Cygwin and Win32, perhaps others, too). + +1.4.1 +--- + +- Fix a serious regression of terminal control mode (forgot to remove a term_restore(), bug 1936548). + +1.4.0 +--- + +- Enable runtime check for available and working output modules. + Now mpg123 tries all built modules (or a list specified in mpg123 -o moda,modb,modc) in turn to find a working output. + This minimizes the situation of having to specify a device when default output doesn't work for some reason. + See bug 1910500. +- libmpg123 2.2.2 + - Fixing an endless loop for ICY streams that suddenly end without error (just EOF). + - Further fixes around EOF handling in (buffered/ICY) streams. +- Enable user to interrupt mpg123 when stuck in a loop of failing to open a track (with --loop). +- This time with correct RPM spec (hopefully... sorry, Michael!). + +1.3.1 +--- +- Enable snd_pcm_sw_params_set_xfer_align() for alsa-lib < 1.0.16 (bug 1908603). +- libmpg123 2.1.2 (no-op change) + +1.3.0 +--- + +This is a _major_ fix release for http streaming! +Much more usable than earlier mpg123 1.x versions. + +- libmpg123 libtool-version 2.0.2 + - Fix nasty bug in ICY reader that failed to account for partial reads from slower network. + - Now non-seekable streams can get peek-ahead for MPEG sync, too, triggered by the MPG123_SEEKBUFFER flag. + - Do not try to resync on streams with ICY metadata, that won't work. + Consequently, if there's unreliable network, use --loop -1 to make mpg123 reconnect to the server on errors. + - Applying a few layer 3 decoder fixes from old mhipp CVS (hail to the creator;-) + That includes the fix for bug 1895025. + - Fix ID3v2 parser with very invalid claimed ID3v2 frame sizes (could have triggered DOS before). + - Oh, and fixed a steady memory leak in ID3 handling. Should mention that;-) +- Print ICY-NAME and ICY-URL again, as mpg123-0.6x did. +- Added --smooth option for not flusing buffer between tracks but at program end only. +- Included some contributed ports/bindings of libmpg123 under ports/ . + +1.2.1 +---- + +- libmpg123 libtool-version 1.2.1 (coincidence!) + - Earlier check for free format headers to prevent them from screwing up resync (free format still not supported) + - bug 1889051: more flexible resync, not insisting on the format of the first frame (which could have been bogus) +- Add an output write loop to handle SIGSTOP/CONT operation (bug 1890563). +- Fixed a bug where playback status for some http streams was not shown. + +1.2.0 +---- + +- libmpg123 libtool-version 1.0.1 + - See NEWS.libmpg123 for details. + - This adds --resync-limit parameter to mpg123. +- Some build system work, including: + - It is now possible to build a mpg123 rpm from the source tarball via rpmbuild -tb . + - configure: Accept --with-audio=foo,bar,bla (comma-separated list) in addition to --with-audio="foo bar bla". + - autogen.sh included in distribution. + - Include the forgotten i486 files in the distribution (now that's embarrasing...). + Also a little fix for wrong --list-cpu on i486 build. + - Fix build with MinGW32. +- Fix -v stat output (time display) for MinGW32 build. + +1.1.0 +---- + +- Added arts output. +- More verbosity on lame/xing/info tags (on demand) instead of compile-time debugging switch. +- XMMS2 plugin cleanup (submitted to XMMS2 for inclusion) +- Improved ID3v2 robustness (let bad tags not affect playback of the important part). +- Terminal control: + - Key for going to previous track ([d], because it's left of [f] usually... no config file yet for that). + - Key for printing current playlist, [l]. + - Now possible to switch on verbosity also for mpg123 -q -C + - Key for (re)printing ID3 tag info ([t]). + - Key for (re)printing MPEG frame header info ([m]). +- Soften the -q option: Now you are able to increase verbosity after -q again, like mpg123 -q -v (this fixes cplay's progress display). + +1.0.1 +---- + +- Fix module loader to prevent crash in working paths with more than 49 characters length (bug 1859413). + +1.0.0 +---- + +- Fixed Pulseaudio. +- Cleaned up configure. +- Pushed remote control version to v3. +- Updated documentation. +- Fix VPATH build for generated mpg123.h . + +1.0rc3 +---- + +- Fixed JACK output. +- Disable buffer when statically building CoreAudio in (MacOSX); with CoreAudio module the buffer works, with static output it doesn't. + This is the situation because of fork() discrimination by Apple Inc. . +- Added verbosity to tell about ID3v2 text encodings (level 4). +- minor cleanup + +1.0rc2 +---- + +- Fixed some bugs, the ID3v2 interface of libmpg123 is safer now (there were possibly stale pointers in there). +- Buffer mode got vital improvements (yeah, that is sort of feature creep during release process, but worth it) + The improved communication makes it possible to skip tracks in terminal control mode without the hack to immediately restart playback. + To be able to do seeking in terminal mode with buffer properly, buffered playback stops on seek keys. You restart playback after you are done with seeking. +- Support either portaudio v18 or v19 API (v18 works for me, v19 works according to user report). +- Audio output handling got safer and more clean, a byproduct of implementing the above. I stumbled over some things and had to fix it (yeah, feature creep in parts again, but still: Worth it!;-) + Any audio access is now restricted to either that standalone mpg123 process or the buffer process, the output being opened _after_ the fork(). + There is hope that this fixes buffered output on MacOSX. +- More feature creep, this time because of something like that was already included in the Debian mpg123: + --delay parameter to issue a pause before each track (does not make sense for file writing outputs, though). +- Even more feature creep: remote control can now give ID3v2 data, also in more raw form via new "tag" command. + This sort of qualifies as bugfix, actually, since it's item 1786430 on the tracker;-) +- Make flexible rate computations more safe (especially on 32bit platforms) by switching to the looping code instead of direct multiplication/division (which blows up with integers). A possible effect was premature track ending with a forced rate. +- Flexible rate mode works _at_all_ again with fixed output support detection code (comparison of -1 with a size_t ended a loop all too early). +- check for error in flushing output (this ends mpg123 for a broken pipe, for example) + +1.0rc1 +---- + +- In one word: LOTS! +- Many small things that happened while migrating to the new setup. +- The decoder is now a library (libmpg123) which can be installed also for other programs to use. + This finally provides a heavily improved replacement for the aged mpglib. We have doxygen API doc, example codes. + You can still choose to compile the decoder statically into the mpg123 binary, though. +- We have a plugin system for audio output! This should be relieving to package maintainers for binary distributions, drastically reducing the number of builds they have to provide. + Here, too, you can choose to build one audio output into the binary like before; you can have your old-school one-piece mpg123 or the hip I-am-legion shared-lib-and-plugin flexible mpg123;-) + One exception: For now, you have to compile without modules in MinGW32/MSYS. +- ID3v2 support has been enhanced and, in the case of specific comments (those with a description), fixed. + The ID3 parsing is part of libmpg123, offering support for virtually all textual information in ID3v2.2, ID3v2.3 and ID3v2.4 tags (along with the usual 128 bytes of ID3v1 or ID3v1.1 in a block). + All tag texts are converted to UTF-8, allowing mpg123 to properly display special chars in an Unicode terminal without fuzz (for non-UTF locales, there is still the ASCII reduction). +- Gapless decoding (of layer 3 streams) is now considered to be a standard feature and is enabled per default both at build- and runtime. +- ... + + +0.68 +---- + +- Fix bug 1807964: distorted playback of MPEG 2.5 files + +0.67 +---- + +Thanks go out to the ROM 106.5FM team (http://www.rom.lu/) for supporting this release with a donation on sf.net and a bottle of finest Gewuerztraminer wine from Luxembourg! + +- verified that it builds on SGI IRIX 6.5 for MIPS32 and MIPS64 +- enable flexible rate for stdout decoding, too +- UTF8 filtering to ASCII finally works thanks to Mika Tiainen, see bug 1745847 +- corrected frame offset; -k was off by one + This means now that -k disagrees with mpg123 0.59r on many files because the old version does play a frame of silence when encountering LAME tag instead of dropping it for audio. +- added --timeout <n>: Possibility to end playback on a stream that doesn't give data for <n> seconds. +- added --loop <n>: for ... well... looping playback of a track; motivation was persistent internet streaming with unreliable connection (together with --timeout) +- build fixes +- use movap instruction in SSE assembly when compiler supports the needed alignment (idea from MPlayer) +- show decoder options in their priority order in --list-cpu/--test-cpu +- added Perl script to benchmark each of mpg123's CPU optimizations +- portability enhancements and cleanups along with testing on SunOS 4.1.2 with gcc-2.7.0 +- workaround for ugly flexible rate for MMX/SSE/3DNowExt code: + --with-cpu=mmx also includes i586 code as fallback; similar with the others + +0.66 +---- + +- support for a combined build of x86 optimizations and runtime selection among these + The (supposedly) "highest" CPU-supported optimization is chosen by default, + --cpu, --list-cpu and --test-cpu parameters are there for you to take control. +- default build for x86 systems is combined "x86" with generic, i386, i586, MMX, 3DNow, SSE, 3DNowExt; + "x86_dither" also includes the dithering i586 decoder +- no automatic -march compiler flags anymore; + the --with-cpu configure option selects specific assembler code but special CFLAGS are up to you +- extended 3DNow and SSE optmizations from MPlayer's mp3lib +- x86 assembler optimizations adapted for MacOS X/Intel +- straight support for Windows using MinGW32, reactivated the native WinMM output + Core functionality including assembler optmimizations and WAV writing is there. +- assembler optimizations also for cygwin +- set remote-err automatically when putting audio to stdout +- a bit more general portability in the new build system +- fix file creation mode for -O +- experimental decoding to 32bit float (raw and WAV file): ./configure --with-cpu=generic_float +- generic control interface (-R) can create and read from a named pipe, parameter --fifo <path> +- audio bugfix: playback of mono file on stereo-only hardware, better error reporting there +- ALSA output handling underruns +- MMX, SSE and 3DNowExt fallback to i586 and below or 3Dnow for forced sample rate +- more terminal control: volume, RVA and verbosity controls + +0.65 +---- + + - now allow crc bit to vary over stream (fixes files with bad lame tag and some internet streams) + - do not try to parse id3v2.2 (as opposed to 2.3 and 2.4) + - correct id3v2.3 parsing for not expecting syncsafe integers for framesize, 2.4 introduced that + - omit gcc specific compiler flags when gcc is not there + - initital attempt to support sgi/irix with configure (please test) + +0.64 +---- + + - fixing a potential denial of service problem; broken connection to server could trigger an endless loop + +0.63 +---- + + - build fixes, only relevant to developers and people who had problems building + +0.62 +---- + + - JUMP command in generic frontend accepts offsets/positions in seconds (JUMP 4s vs. JUMP 4) + - initial support for ICY meta data in SHOUTcast streams + - a bit of fixing with rva code, added rva and general volume control to generic frontend + - accepting more MIME types for http streaming (application/pls and audio/x-mpeg) + - ID3v2 info output taking less space per default - more resembling the old ID3v1 view for short tags, full view with always one line per item via extra --long-tag switch + - generally less verbosity (i.e. noise on console) per default + - ID3v2 now having some kind of support for unicode; trying to print what's latin1-compatible and prevent messing up of terminal with unknown bytes + - several bug fixes and small improvements + +0.61 +----- + +- improved AltiVec code from Taihei Monma +- an i486 optimization by Petr Salinger +- improving interactive experience (terminal, frontends) + -> prevent/lessen bad effect after seeking while paused + -> show targeted position while seeking in terminal mode while paused + -> not messing up terminal on unexpected errors +- decoder robustness - better file sync (weird junk at beginning, some vbr frames) +- build system improvements: + -> fixing configure isses on some platforms + -> adding cygwin, kfreebsd +- extended fix for CVE-2006-1655 +- generic code should compiling again... + +0.60 final (The Team!) +----- + +- no functional changes + +0.60-beta6 (Thomas Orgis) +----- + +- more use of ID3v2 tags, mpg123 now displays both (merged) info from ID3v2 and ID3v1; trying to support both ID3v2.3 and ID3v2.4, but ignoring encoding (UTF8 should still work if your terminal supports it, straight unicode should work except for parsing genre numbers and multiline strings) + +0.60-beta5 (Thomas Orgis) +----- + +- more robust playlist support: + -> path/url length not limited to 1023 characters anymore + -> reading in of whole playlist at program start (old operation was not really safe with playlist from http) + -> fixed bug where reading of playlist form stdin caused segfault (introduced with the pls format support) +- smaller cleanups, screen output cosmetics + +0.60-beta4 (Nicholas Humfrey & Thomas Orgis) +----- + +- proper seeking, also for VBR streams +- real two-way seeking in remote control mode at all +- better estimates of remaining frames (on vbr files), exact if Xing header is found +- Removed libao support (as it is GPL and we aren't - and we don't need it with native Alsa) +- Added ALSA 0.9/1.0 support by Clemens Ladisch (old alsa is in audio_alsa05.c but will most likely vanish soon) +- Added PortAudio audio-output support +- Added SDL audio-output support +- Fixed NAS audio-output support +- re-enabled MPEG 2.5, code just seems to work +- improved stream checking; being more willing in general (favor resync instead of bail out) but directly give up if free format stream is obvious +- Whee! Initial Relative Volume Adjustment (buzz) support with reading of ReplayGain values in lame/info tag, the RVA2 frames in ID3v2.4, ID3v2 TXXX tags from foobar2000 (please test, someone!) and custom ID3v2.3 comments entitled RVA / RVA_ALBUM / RVA_AUDIOPHILE / RVA_RADIO / RVA_MIX +- more persistence in trying to get http streams + +0.60-beta3 (Thomas Orgis) +----- + +- fixed bug with segfault in http code on stream from live365.com - bug id 1529266 +- made http request HTTP/1.0 compilant again (tested only without proxy) - bug id 1529319 +- now using http content-type header to check for correct types mpg123 can understand + -> you can now always use -@ for a single http resource (direct stream or playlist) since a stream will be reopened based on MIME type, + though omitting it will save you one http request to the server in the direct stream case... +- now simple parsing of shoutcast pls playlists (how did you people use shoutcast before?) +- playlist mode enhanced with selective playback of one entry in list (--listentry parameter) + + +0.60-beta2 (Thomas Orgis) +----- + +- fixed bug in terminal control mode that caused the f key to quit program isntead of advance to next file (introduced by the first attempt to restore "normal" Ctrl+C behaviour in terminal control mode) + +0.60-beta1 (Thomas Orgis & Nicholas Humfrey) +----- + +On the way to the first new offical realease since years! + +- new license: all LGPL except the old audio_alsa.c +- merge with Nicholas' sourceforge package + - autooled configure/make system + - MacOSX, Jack, libao (alsa 0.9/1.x support through that) +- experimental gapless playback for layer 3 +- merged in MMX and AltiVec optimizations +- security bug fix of GLSA 200607-01 and catching possible crashes found by fuzzing +- fixed many issues here and there +- polished help messages, updated man page... + +UNDERGROUND 0.59r-thor7 (well, I'm going to release a _really_ official mpg123 in future) (Thomas Orgis <thomas@orgis.org>) +----- + +- applied relevant stuff from Debian's 22: + - fix for CVE-2006-1655 (buffer overflow in III_i_stereo()) + - strict aliasing hack in WRITE_SAMPLE of decode_i386.c + - fixed http streaming through proxy by actually using the request url... + - buffer resync on Ctrl-C (cleaning, reducing pauses with multiple files) + - removed unused esdserver variable from mpg123.h + - did NOT apply the Debian Makefile/manpage changes (going to rewrite that stuff anyway) +- made the netbsd-i386 targets visible as netbsd-x86 + +UNOFFICIAL 0.59r-thor6 (Thomas Orgis <thomas@orgis.org>) +----- + +- split nedbsd targets for realtime priority selection code; since one needs -lpthread with it. standard netbsd target doesn't use realtime code -- I won't recommend running mpg123 as root anyway! + +UNOFFICIAL 0.59r-thor5 (Thomas Orgis <thomas@orgis.org>) +----- + +- Separated the the use of char* equalfile as filename from the use as TRUE/FALSE flag by introducing int have_eq_settings. Compilers kept nagging about assigning and integer (TRUE) to char* ... and it feels more right this way. + +- Made control_generic aware of real being possibly different than float (seq command used to raise an FPE on OSF1 when this assumption was not the case. + +- Fixed the command line arg parsing to work properly on Alpha (32 and 64 bit mixup) + +UNOFFICIAL 0.59r-thor4 (Thomas Orgis <thomas@orgis.org>) +----- + +- merged with 0.59r-19 from Debian project (Daniel Kobras <kobras@debian.org>), hopefully fixing all those security vulnerabilities + -> my dirty http_open and open_stream variants now replaced by more proper code + -> still my (rather workloaded) parsing/processing in control_generic, but now including the idea to watch out for \n, \r\n and \r (or \n\r, for that matter;-) + +UNOFFICIAL 0.59r-thor3 (Thomas Orgis <thomas@orgis.org>) +----- + +- hacked additional variants of http_open and open_stream that return errors instead of exit()ing; makes more sense when used by a frontend +- further cleanup (and return to using continue instead of nested if(){}else{if()else{}}) in command processing, better error messages there + +UNOFFICIAL 0.59r-ThOr(remote-err,eq,flushing) (Thomas Orgis <thomas@orgis.org>) +----- +-added audio_flush() calls to various places in control_generic.c to make sure there is nothing left in there that hurts later (not sure if this has effects) +-(re?)enabled (?) code for stream info +-corrected answer of JUMP (now gives actual reached position, +/- 1 frame since I'll still have to figure out what frame 0 really is...) + +UNOFFICIAL 0.59r-realeq-remoteerr: (Thomas Orgis <thomas@orgis.org>) +----- +- applied patch from Cool Feet Audio project (nutcase@dtfm.org, see README.cfa) to use real-time equalizer in remote mode +- applied patch from AMF (amf.sourceforge.net) by Steve Grundell for remote communication not polluting the STDOUT where the audio data is read from (instead using STDERR) ... and faster seeking, maybe + The patches go not cleanly together, but rejects are trivial. Thus, a combined patch with both would makes sense. +- modified (IMHO improved) the control_generic command reading: now always making sure that the full command is read up to a mandatory \n; also reworked the application of the commands afterwards +- added SEQ command: simple eq with only 3 bands +- added SILENCE command: I don't want the playback messages when I don't read them (since my frontend is reading the STDOUT it knows what is going on) +- added SLJ command: SILENCE-LOAD-JUMP... a hack for my hacked mixplayd... maybe one should remove that again. + +0.59r: (MH) +----- +- applied audio_alib changes from Ralf Hildebrandt <R.Hildebrandt@TU-BS.DE> +- some 'paetsches' from DK +- minor optimizations in layer3 (dequantize/huffman) +- BSDOS 4.0 with gcc added to Makefile (<sms@moe.2bsd.com>) +- Solaris-ESD patch from Ryan Prosser <prosser@wam.umd.edu> +- Added Frontend changes from Bertrand Petit <elrond@phoe.netdev.net> +- more DK 'paetsches' (final dk7-clubhaus edition), includes extended term + control +- SGI audio fix for non RAD machines from Erik Mouw <J.A.K.Mouw@its.tudelft.nl> +- fixed ugly bug in layer3 dequant for bt==2 (may cause high frequency clitchs) +- AMD-3DNow optimizations in decode and dct64 +- OS/2 reworked from Samuel Audet (see audio_os2.c for more) +- added freebsd-esd make-entry from Daniel O'Connor (darius@guppy.dons.net.au) +- added enhanced head_check from D. Skarda <0rfelyus@atrey.karlin.mff.cuni.cz> +- applied 'xterm-title-patch' from "Wilson, Jeff D" <jeff.wilson@wilcom.com> +- more esd changes from Robert Bihlmeyer <robbe@orcus.priv.at> +- applied Hannu Napari's <Hannu.Napari@hut.fi> SGI audio patches +- minor changes in httpget.c and mpg123.c +- added native AIX support from Juergen.Schoew@unix-ag.uni-siegen.de +- applied playlist patch from <psst@euskalnet.net> +- more SGI audio patches from Gilles Zunino <Gilles.Zunino@hei.fupl.asso.fr> +- applied esdserver patch from Matthew Parslow <roy@alpha.alphalink.com.au> +- added some fixes for control_generic + +0.59q: (MH) +------ +- ESD fixes +- minor bugfixes (DK patch ;) +- au and cdr 'support' (it's a hack) +- Fixed 'VBR' Bug in get_scale_fac1(). Thanx to <ssonique@hotmail.com> for + this. (Wasn't really a VBR Bug. The new encoders just triggered it.) +- Added equalizer patch from <dlux@dlux.sch.bme.hu> + +0.59p: (MH) +------ +- Added mpglib (see mpglib directory) +- 'make generic' is more generic now +- Added HPUX/ALib support from Ducroquet Erwan (ducroque@ufr-info-p7.ibp.fr) +- Added EsoundD support from <fill it in> +- Added exp. relatime support (compile with -DSET_RT) +- Added linux-sparc patch from <hmm lost email) +- Added genrepatch from Shane Wegner <shane@CM.NU> +- Added wav-File patch Samuel Audet <guardia@cam.org> +- Added SGI-RAD support from "J. Dean Brederson" <jdb@cs.utah.edu> +- Added sajberplay/FreeBSD patch from Chou Ye-chi <is84002@cis.nctu.edu.tw> +- Added 486 optimizations from Fabrice Bellard <bellard@email.enst.fr> +- Added combined output devices on SUN (ie Speaker and headphones together) +- Added audio_alsa.c (under GPL license) for the ALSA sound system from + A. Hermansen <ahermans@vf.telia.no> and J. Kysela <perex@jcu.cz> +- Added K6-3DNow patches from KIMURA Takuhiro <kim@hannah.ipc.miyakyo-u.ac.jp> +- Added MINT patches from Petr Stehlik <stehlik@cas3.zlin.vutbr.cz> +- Fixed minor bug for linux-i486 and mono + +0.59o: (MH) +------ +- fixed Bug with stereo streams on mono audio hardware for OSS +- fixed a bug with mono output and 1:1 (no) rate conversion +- again changes in the probe code +- fix in the buffer code for the case, that audio parameters are changing +- more changes to the flexibel rate converter, should now work when + writing to STDOUT. +- Added Andy's (<andy@snoogie.demon.co.uk>) float2int speed up proposal + (check WRITE_SAMPLE in decode_i386.c) .. Maybe someone wanna take the + idea and put it into the decode_i586.s part? +- Added TK3Play support from Brian Foutz <foutz@anise.ee.cornell.edu> + (compiles but untested) +- RIFF Header fix (according to Thomas Niederreiter's + <tn@tarantel.rz.fh-muenchen.de> patch) +- m68k patch from Stefan Gybas <cab@studbox.uni-stuttgart.de> applied +- minor additional PPC changes applied +- resync and EOF hang fixed +- resync and bitrate correction relaxed +- Slightly change verbose output; added countdown + + +0.59n: (MH) +------ +- fixed shuffle bug +- added memory mapped IO for file reading +- added MPEG 2.5 12kHz and 8kHz table entry +- started flexibel rate conversion .. +- new '-Z' / '--random' option +- minor clean-up +- splitted audio file in audio system dependend smaller parts +- started system stream support (external program: system.c) +- unsigned 8 bit (instead of ulaw) is now default for 8bit operation +- Linux PPC patch from Grant Erickson <eric0139@tc.umn.edu> applied +- added BSDi patch from Peter Berger <peterb@hoopoe.psc.edu>, who reported + a failure when catching signals +- minor bug fix in the control interface for sajber jukebox +- fixed the ugly 'Ctrl-Z in buffer mode' bug .. YES ;) +- added buffer preload when underrun occurs (preload = 1/8 buffer size) +- minor SUN audio clean up + +0.59m: (MH) +------ +- Bug with RIFF header streams fixed. +- HTTP auth option patch from Henrik P Johnson <king@one.se> +- NetBSD patch(s) added from <mycroft@NetBSD.ORG> and <augustss@cs.chalmers.se> +- Added advanced shuffle support from Steven Tiger Lang <tiger@tyger.org> +- fixed bug with too large big_value field +- fixed (hopefully) the bug with the '-a' option +- work-around for some pedantic compilers in fr->synth init +- some changes for the 'generic' version +- applied NAS bug-fix patch +- new (good) MPEG 2.5 tables (from Niklas Beisert) +- added WIN32 support from Tony Million +- added some bug fixes from Niklas Beisert +- fixed another ugly bug in layer3 dequantize (wrote over the border + of the 'xr' field) +- a minor HPUX clean up +- added BSD patch from Kevin Brintnall <kbrint@visi.com> +- added Makefile.win32 +- added NAS big endian fix + + +0.59l: (MH) +------ +- simple equalizer support (to be continued) +- added NAS patch from Martin Denn <mdenn@unix-ag.uni-kl.de> +- real mono support +- added pentium optimized decode_i586 from Stefan Bieschewski <stb@acm.org> +- fixed a bug in MS dequantize function + + +0.59k: (OF) +------ +- fixed "Accept" header in httpget.c +- fixed buffer overflow (causing core dumps) in httpget.c +- fixed display of song length +- fixed -b (buffer) problem on SGI / IRIX -- it definitely works now +- fixed problem when files with different sample rates where played, + it now works with -b (buffer), too +- fixed order of local variables in decode.c to work around a + compiler bug in ultrix +- fixed Makefile for ultrix +- reverted to old getbits.s (the new one could cause coredumps) +- more compact MPEG header display in non-verbose mode +- small fixes in buffer code and elsewhere + + +0.59j: (MH) +------ +- added sajber jukebox control interface (it's currently a big hack) + (see 'JUKEBOX' file for more) +- added simple rewind facility .. (only used by sajber interface at the moment) + + +0.59i: (MH) +----------- +- added front-end (remote) patch from "Brian J. Swetland" <swetland@uiuc.edu> +- added OS2 patches from Niclas Lindstrom <nil@wineasy.se> +- fixed 'rewind bug' +- added patches from Leo Broukhis <leo@zycad.com> +- added shuffle patch from Tillmann Steinbrecher <tst@gmx.de> +- added i386-getbits from M.Stekelenburg <m.stekelenburg@student.utwente.nl> +- added fallback to 8bit if no 16bit samples support (currently linux only) +- added (slightly changed) outburst patch + from Antti Andreimann <anttix@cyberix.edu.ee> +- added 'http accept' patch from Hur TaeSung <saturn@arari.snu.ac.kr> +- fixed buffer mode bug + + +0.59h: (MH) +------ +- added '--8bit' option to force 'ULAW 8 BIT' playing +- pcm buffer type changed to 'unsigned char *' +- plays 2:1 and 4:1 with the real frequency (ie 11025/22050 instead + of 44100) +- program (re)sets (changed) frequency for every frame +- buffer mode is broken + + +0.59g: (MH) +------ +- added support for MPEG 2.5 (it's a HACK!) .. mpg123 understands and plays + 2.5 but it does it wrong. (you will hear this!) +- Fixed wrong values in BandInfo struct for 32kHz mode +- Some performance improvements and minor changes and bug-fixes. +- Tried the new imdct from the maplay1.2+ (version 1.81) package. (but + it was slightly slower on my system, currently disabled) + + +0.59f: (OF) +------ +- HP-UX audio fix (provided by Damien Clermonte) +- Buffering (-b option) hopefully fixed. Please test! + + +0.59e: +------ +- added Audio MPEG 2.0 support (but near untested) (MH) + + +0.59d: (MH) +------ +- minor modifications to dct64_i386.c +- removed duplicated dependency 'dct64.o' in Makefile + + +0.59c: (OF) +------ +Another complete rework of the buffer system (-b option) + (normally uses mmap(), but it can also use SYSV-ShMem because + mmap() is broken on linux). + +0.59: (MH) +----- +extracted dct64() from decode*.c files. +some changes to dct64() and decode*.c to allow auto-increment/decrement +removed bit-counter in getbit-functions. Layer3 part2 now counts it itself. + +0.58: (OF) +----- +Bugfix: not closing the audio device caused a few samples to be lost. +Bugfix: audio_set_rate() was not called (!?!). +Additional command line options "--doublespeed" and "--halfspeed" + (couldn't find better names). See the manpage. +Complete redesign of command line options. See the manpage. +Changed the buffer algorithm (-b). I'm not sure whether it's better + or worse now. +Supports multiple files on the command line. Pressing Ctrl-C will + skip to the next MPEG file, pressing it twice within one second + will abort mpg123 completely. See the "INTERRUPT" section in the + manpage. +Support for http URLs. See also the -p option in the manpage. +Support for list files. See also the -@ option in the manpage. + +0.57: (MH) +----- +Put the downsampling code together with the full + quality decode into one binary. (new options -2to1,-4to1) +Optimizations in the dct12. +Removed the 'int' version. + +0.56: (OF) +----- +Additional command line option "-rs" to try to resync on + "broken" MPEG streams (now called "--resync" or "-y"). +Additional command line option "-b" to use audio output buffering. + See the manpage for additional information. +Changed a few variable names and some other minor fixes, so the + source compiles more cleanly (without warnings) on most + platforms (for example, the FreeBSD port compiles without + warnings using "-Wall -ansi -pedantic"). +Makefile changes: moved "solaris" to "solaris-gcc", new target + "solaris" (using Sun's SparcWorks cc, faster tha gcc!), new + targets "aix" and "generic". + +0.55: +----- +removed some obsolete code from layer3.c (MH) +changed scalefac stoing in layer3 (MH) +decode_4to1.c added again. Renamed decode_lp.c to decode_2to1.c (MH) +(both not optimized .. still expterimental) +Minor cleanups and optimizations in layer3. (MH) +Removed some (probable) minor bugs. (MH) +Changed 2**(...) scaling (and omitted a few muls) (MH) +Changed Makefile (OF) +Changed dequantize to reorder with a mapping table + (you can disable this by undefining MAP in layer3.c) (MH) +removed the 'dummy' scale step for mixed mode (MH) +Changed copy policy (MH) +Modified dequant-reorder-mapping (MH) + +0.54: (MH) +----- +Minor changes in the documents .. +huffman.c: x->len,y->len removed .. always '15' for the important cases +audio.c: some additions to the SOLARIS audio code + +0.53b: (OF) +------ +Makefile: + + Renamed SPARC10 to SUNOS (which is more appropriate). + Tested with SunOS 4.1.4 on a SPARCstation SLC, 20 MHz + (322% CPU, so no realtime decoding). + Added SOLARIS. Tested with Solaris 2.5.1 on an Ultra 1, + 167 MHz (14% CPU), a SPARCstation 5, 110 MHz (47% CPU), + and a SPARCstation 10, 33 MHz (68% CPU). + Added FreeBSD. Tested with 2.1.7 on a Pentium-90 (38% CPU) + and 2.2 on a Pentium-166 (20% CPU). + Added Digital Unix. Tested with DU 3.2 on a DEC 3000/500 + (Alpha AXP 150 MHz, 33% CPU). Does not support DEC's + audio interface ("AudioFile"), decodes to stdout only. + Improved "clean" target to remove core files and editor + backup files. + Added "install" target. + Added "dist" target to create a .tar.gz file of the source + directory. + + In the distributed Makefile, all system sections are + commented out. When you type "make" without uncommenting + one of the sections, an appropriate error message will + be displayed. + +audio.c + + Fixed problem when opening /dev/audio on Solaris: + I had to remove O_NDELAY, because writing to /dev/audio + didn't block until the requested number of samples + could be written, but instead it wrote only as much + samples as it was able too. Sounded funny. Removing + O_NDELAY fixed the problem. I don't think that it + hurts SunOS either, so I didn't make another #ifdef. + +common.c + + Fixed bug by adding function finish_output(): + The decoder writes the audio samples into a buffer, and + each time the buffer is full, it is written to the + audio device (or to stdout). But when the decoding is + done, there are some samples left in the buffer which + aren't written yet -- they were just discarded. + This additional function fixes the problem by writing + the remaining samples from the buffer. It is called + immediately after the main frame loop in mpg123.c. + +decode*.c + + Fixed compiler warning on symbol "div": + Some compilers issue warnings because the symbol div is + already used for something else (see "man div"), so I + changed it to "divv". + +layer*.c + + Functions do_layer*: + Moved the declaration for audio_play_samples into + mpg123.h. Makes the code cleaner. + + I moved the variables pcm_samples and pcm_point to + common.c, so they are shared between all modules. This + was necessary because the finish_output() function + (see common.c above) needs to access them. + + Renamed loop variables "i" and "j" to "k" in order to + fix compiler warnings for duplicate/hidden symbols + (similar to "div" in decode*.c, see above). + + Changed the preprocessor symbol AUDIOBUFSIZE into a + global variable "audiobufsize". This makes it possible + to change it by a command line option. + +layer1.c + + Fixed error in function I_step_one, second parameter: + unsigned int scale_index[2][] --> ...[2][SBLIMIT] + This caused an error with the DU compiler (which is ok, + because [2][] is incorrect according to ANSI). I don't + know whether [2][SBLIMIT] actually works correctly (I + have no layer-1 streams to test it), but at least it + compiles without error, and it appears to be correct + (looking at the rest of the source). Heaven knows why + gcc doesn't issue an error, and what it actually makes + from it. + +mpg123.1 + + A simple manual page. Type "nroff -man mpg123.1 | more" + to view it, or install it in /usr/local/man/man1 (this is + done automatically by "make install"). + +mpg123.c + + New boolean variable "quiet": + If this variable is set to TRUE (command line option + -q), no messages are printed. + +*** + diff --git a/node_modules/lame/deps/mpg123/NEWS.libmpg123 b/node_modules/lame/deps/mpg123/NEWS.libmpg123 new file mode 100644 index 0000000..67ce8cd --- /dev/null +++ b/node_modules/lame/deps/mpg123/NEWS.libmpg123 @@ -0,0 +1,133 @@ +Changes in libmpg123 libtool interface versions... + +36.0.36 + - Extended MPG123_RESYNC_LIMIT to initial header search. + - Not cutting decoder delay unconditionally anymore (only in combination with known encoder delay / padding). + +35.0.35 + - Added mpg123_meta_free(). + +34.0.34 + - Added flag MPG123_AUTO_RESAMPLE. + - Changed (improved;-) outbuffer behaviour. + +33.0.33 + - Added MPG123_BUFFERFILL. + +32.0.32 + - Added mpg123_framepos() + +31.0.31 + - Added mpg123_framedata() and MPG123_IGNORE_INFOFRAME. + +30.0.30 + - Added MPG123_FEEDPOOL and MPG123_FEEDBUFFER. + +29.0.29 + - New decoder: ARM neon. + - Added support for 24 bit output (dumb byte-chopping of 32 bit output). + +28.0.28 + - Add mpg123_strlen(). + +27.0.27 + - Implictly disable seeking on streams when client enforced ICY parsing. + This helps debugging dumps of http streams. + +26.0.26 + - Added mpg123_encsize(). + - Added flag MPG123_SKIP_ID3V2. + +25.0.25 + - Version increase to mark the point where the split between normal and large-file-enabled library vanishes again. The world did not like it. + Now Thomas lost some days of recreation and sleep to give it a dual-mode libmpg123 on large-file-sensitive systems. + +24.0.24 + - Introduce mpg123_replace_reader_handle() and mpg123_open_handle() + ... this is also in preparation for the next version which will drop the separated large-file library again, due to public display of dismay. + - Add the experimental mpg123_framebyframe_decode to the off_t-sensitive functions. + +23.0.23 + - Version increase to mark the point where the explicit split between normal and large-file-enabled library has been introduced. + +22.0.22 + - Experimental framebyframe API added. + +21.0.21 + - Added support of unicode file names under windows via UTF-8 argument to mpg123_open. + - Added mpg123_feature(), for example to test for the above behaviour. + +20.0.20 + - New flag: MPG123_PLAIN_ID3TEXT + - Corresponding text encoding handling API added: + mpg123_enc_from_id3, mpg123_store_utf8 + +19.0.19 + - Hm, what was it exactly now... there are candidates: + - runtime dithering + - free format + - ARM optimizations + +18.0.18 + - new parameter: MPG123_PREFRAMES is now tunable (the number of frames to decode and skip before a seek point), also default value increased + +17.0.17 + - introduction optimized stereo synths + +16.0.16 + - introducing floating point x86-64 SSE synth + +15.0.15 + - first addition of x86-64 SSE optimizations + +14.0.14 + - the first libmpg123 with actually working MPG123_UPSPEED + - also important regression fix concerning skipping of frames + +13.0.13 + - The whole set of output formats is generally available (8, 16 and 32 bit integer, signed/unsigned, float) + - Many features can be absent from libary as build decision (minimize binary size). + +12.0.12 + - added mpg123_current_decoder + - fixed value of MPG123_ENC_FLOAT + - float output now is a real runtime option + +11.0.11 + - added mpg123_getstate + - run-time tunable frame index + - officially configured with largefile support where available + +10.0.10 + - new flag MPG123_FUZZY (along with the fuzzy seek functionality) + +9.0.9 + - added mpg123_tell_stream + +8.0.8 + - added mpg123_get_eq + +7.0.7 + - added mpg123_set_filesize + +6.0.6 + - added mpg123_icy2utf8 + +5.0.5 + - added mpg123_feed + - input buffers now const + +4.0.4 + - extended mpg123_string api (mpg123_add_substring, mpg123_grow_string) + +3.0.3 + - Initial floating point support as compile-time option. + +2.0.2 + - New flag MPG123_SEEKBUFFER. + +1.0.1 + - Added MPG123_RESYNC_LIMIT parameter. + - Added MPG123_OUT_OF_SYNC and MPG123_RESYNC_FAIL error codes. + - Fix for uninitialized framesize value in handle. + diff --git a/node_modules/lame/deps/mpg123/README b/node_modules/lame/deps/mpg123/README new file mode 100644 index 0000000..830b0ab --- /dev/null +++ b/node_modules/lame/deps/mpg123/README @@ -0,0 +1,203 @@ +* * * * * * * * * * * * * * * * * * * * * * * * * * * * +* mpg123 - MPEG 1.0/2.0/2.5 audio player * +* README for version 1.x.y, dated at 14.06.2009 * +* * +* ...still the fastest MPEG audio player for UNIX ;) * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * +(This file has very long lines - die-hard terminal nostalgists can be satisfied by `fmt -s -w 75 < README | less`. I think it's better to let the reader's preference rule than to preformat the stuff to some arbitrary width.) + + +0. Stuff + +For building/installation info see INSTALL. + +The mpg123 project was started by Michel Hipp and is now being maintained by Thomas Orgis and Nicholas J. Humfrey, who initiated the Sourceforge project. +The source code contains contributions from quite a few people - see AUTHORS for more info. +It is Open Source software licensed mostly under the LGPL with some parts restricted to GPL. See COPYING for details. +As for every mp3 player, some of mpg123's functionality may be covered by patents in a country where these are valid. See PATENTS for details. + +Project's official website URL is + + http://mpg123.org +(or http://mpg123.orgis.org as fallback address if there is a problem with the DNS forwarding) + +for the traditional home page and + + http://sourceforge.net/projects/mpg123 + +for sourceforge.net based services like download mirrors, mailing lists and bug/feature trackers. +Please use the sourceforge download mirrors when possible to minimize load on the mpg123.org server. + + +1. Introduction + +This is a console based decoder/player for mono/stereo mpeg audio files, probably more familiar as MP3 or MP2 files. +It's focus is speed. We still need some low-end benchmarks for the current version, but playback should be possible even on i486 CPUs. There is hand-optimized assembly code for i586, MMX, 3DNow, SEE and 3DNowExt instructions, while generic code runs on a variety of different platforms and CPUs. +It can play MPEG1.0/2.0/2.5 layer I, II, II (1, 2, 3;-) files (VBR files are fine, too) and produce output on a number of different ways: raw data to stdout and different sound systems depending on your platform (see INSTALL). +Most tested are Linux on x86 and Alpha/AXP and MacOSX on ppc as the environments the current developers work in. +We are always thankful for user reports on success (and failure) on any platform! + + +2. Contact + +short: + + mpg123-devel@lists.sourceforge.net + mpg123-users@lists.sourceforge.net +or + maintainer@mpg123.org + +long: see doc/CONTACT + + +3. Interface/Usage + +Please consult the manpage mpg123(1). Some starter info follows. + +3.1 Simple Console Usage + +Mpg123 is a console program - normally it just plays a list of files you specify on command line and that's it. See the included manpage or + + mpg123 --help + +or, for the full story, + + mpg123 --longhelp + +on command line syntax/options. I encourage you to check out the --gapless and --rva-album/--rva-mix options:-) + +In the simple "mpg123 file1.mp3 file2.mp3" mode, the only thing you can do to interact is to press Ctrl+C to skip to next track or end the whole playback if pressing it twice. + +Note that this Ctrl+C behaviour is special to this mode; when any of the following is activated, Ctrl+C will just kill the program like you would expect normally (this changed from earlier versions). + +3.2 Advanced Console Usage + +You can specify the option -C to enable a terminal control interface enabling to influence playback on current title/playlist by pressing some key: + + -= terminal control keys =- +[s] or [ ] interrupt/restart playback (i.e. 'pause') +[f] next track +[d] previous track +[b] back to beginning of track +[p] pause while looping current sound chunk +[.] forward +[,] rewind +[:] fast forward +[;] fast rewind +[>] fine forward +[<] fine rewind +[+] volume up +[-] volume down +[r] RVA switch +[v] verbose switch +[l] list current playlist, indicating current track there +[t] display tag info (again) +[m] print MPEG header info (again) +[h] this help +[q] quit + +You can change these bindings to key to your liking by modifying term.h . + +Note: This interface needs not to be available on _every_ platform/build. + +Another note: The volume up and down is performed by changing the scale factor (like the -f parameter) ... so the audio is scaled digitally in the given range of the output format (usually 16bits). That means the lowering the volume will decrease the dynamic range and possibly lessen the quality while increasing volume can in fact increase the dynamic range and thus make it better, if you deal with a silent source and no clipping is necessary. +It is a good idea to use RVA values stored in the file for adjusting low volume files, though - mpg123 handles that in addition to your volume setting. + +3.3 Control Interface for Frontends + +There used to be several interfaces for frontends left over from that past, but only one of them remains for the present and future: + + The Generic Control Interface + +It contains of communication of textual messages via standard input to mpg123 and responses to standard output unless the -s switch for output of audio data on stdout is used - then the responses come via stderr. + +See doc/README.remote for usage. + + +4. Speed + +mpg123 is fast. Any faster software player is probably based on some hacked mpg123;-) +MPlayer included mpg123 source code in it's mp3lib and we have to be thankful for the MPlayer folks adding SSE, 3DNowExt and AltiVec optimizations over the years, which we were able to backport. + +mpg123 includes the AltiVec optimization since version 0.61 and the SSE and 3DNowExt optimizations since 0.66 . +Also, version 0.66 adds the merged x86 optimization build, which includes every applicable optimization for x86 cpus except the one for i486, wich is a bit special. + +Now mpg123 catched up with MPlayer's mp3lib concerning decoding speed on my Pentium M (which supports SSE): +Decoding a certain album (Queensryche's Rage for Order) to /dev/null took 22.4s user time with mpg123-0.66 compared to 24.7s with MPlayer-1.0rc1 . + +Also, beginning with mpg123 1.8.0, there are fresh x86-64 SSE optimizations (provided by Taihei Monma) which make mpg123 the fastest MPEG audio decoder in my knowledge also on current 64bit x86 systems. + +5. Accuracy + +The mpg123 engine is able to decode in full compliance to ISO/IEC 11172-3, for all three layers, using floating point or integer math (the latter since 1.8.1). +Accuracy of 16bit output depends on specific optimization in use and compile-time choice about the rounding mode (which is performance relevant). + +The ISO test suite is incorporated in the mpg123 subversion repository under svn://orgis.org/mpg123/test, nightly tests of a build (with high-quality 16bit rounding) are published on the mpg123 website. + +Dithered 16bit output is available as an option (the --cpu choices ending with _dither). See + + http://dither123.dyndns.org + +on the whereabouts. + +6. History + +A looooong time ago (mid-90s), Michael Hipp wrote some initial mpg123 and made it _the_ Unix console mp3 player in the following years. +The exact date of birth is fuzzy in human memory, but according to the master himself (Michael) mpg123 started in 1994 as an MP2 player which a year later, 1995, gained MP3 ability. +The core decoder files have mostly 1995 as their birth year listed, so one can say that mpg123 as the layer1,2,3 player was born in 1995. +In any case, that is a looooong time ago for a media player - especially for one that is still alive! + +This is the historic description: + + This isn't a new player. It's a fully rewritten version originally based + on the mpegaudio (FHG-version) package. The DCT algorithm in the + synthesis filter is a rewritten version of the DCT first seen in the maplay + package, which was written by Tobias Bading (bading@cs.tu-berlin.de). The + rewrite was necessary, because the GPL may not allow this copyright mix. + The mpegaudio package was written by various people from the MPEG/audio + software simulation group. The maplay is under GPL .. You can find the + original source code and the mpegaudio package on: ftp.tnt.uni-hannover.de. + + Especially layer3.c common.c and mpg123.h is based on the dist10 package. + The code is fully rewritten but I'm using sometimes the + same variable names or similar function names as in the + original package. + + In the current layer3.c I'm using a DCT36 first seen in Jeff Tsay's + (ctsay@pasteur.eecs.berkeley.edu) maplay 1.2+ package. His code is + under GPL .. I also tried the enhancement from Mikko Tommila. His + code is also in layer3.c (but it's disabled at the moment, because + it was slightly slower than the unrolled 9 point DCT (at least on + _my_ system)). Theoretically it should be faster. You may try it on + your system. + +Well, that's how it started... +Official development ceased due to the typical lack-of-time syndrome around 2002 and the free-floating patches began to seize the day. + +But before that, Michael wrote or rewrote the essential code; others contributed their bits. +The main message is: + +Code is copyrighted by Michael Hipp, who made it free software under the terms of the LGPL 2.1. + +Please see doc/ROAD_TO_LGPL, COPYING and AUTHORS for details on that. Note that the only notable legacy non-LGPL file was the old alsa output that didn't work with alsa 0.9/1.0 anymore. +Also, there has been a libao output in the betas 0.60 for a short period. Libao being generally problematic for us because of its GPL license, this output is not distributed anymore in the release packages. There is now a new, LGPLed alsa output that made both the old alsa and libao obsolete for our purposes. +So, the distributed mpg123 releases actually only contain LGPL code, but you get the other files from our subversion repository if you checkout the trunk / version tags. + +There has been quite some confusion about the licensing and "freeness" of mpg123 in the past. +The initial "free for private use, ask me when you want to do something commercial" license caused some people to avoid mpg123 and even to write a replacement mimicking the interface but using a different decoding engine - what was not actively developed for too long but entered the "free" software sections. + +The Debian (non-free section) and Gentoo distributions cared about the last stable and the last development release of mpg123 over the years with mainly applying security fixes. Thanks go to the distribution maintainers for not letting it alone to bitrot over the years. + +Thomas Orgis started to hack on mpg123 in 2004 while working on his personal audio experience with mixplayd and later DerMixD, utilizing the generic control interface. In Feb 2005, he crammed control interface improvements together with Debian's r19 fixes and released the personal fork/patch named mpg123-thor. +Little later that year, Nicholas J. Humphrey independently created the sourceforge project and released an autotooled 0.59r under official GPL flag with Debian and MacOSX fixes. +In the beginning of 2006, Thomas finally decided that he could work "officially" on mpg123 and contacted Michael Hipp for taking over maintainership. +Michael was all-positive about letting mpg123 really live again (and perhaps see version 1.0 some time;-) and also pointed at the sourceforge project that didn't see much activity since the initial release. +A lot of emails and some weeks later there was the two-developer team of Nicholas and Thomas working on merging their mpg123 variants as well as adding some features and fixes to let it shine again. + +And there we are now... + +7. End + +Have fun! +____________ +Thomas Orgis diff --git a/node_modules/lame/deps/mpg123/TODO b/node_modules/lame/deps/mpg123/TODO new file mode 100644 index 0000000..ec4de61 --- /dev/null +++ b/node_modules/lame/deps/mpg123/TODO @@ -0,0 +1,38 @@ +Things that need to be done... + +... as always, mostly outdated. + +0. Fix that ugly crash that happens sometimes when Ctrl+C-ing with jack output active: + +Program terminated with signal 11, Segmentation fault. +[New process 6293] +[New process 6291] +[New process 6292] +[New process 6284] +#0 0x00002aced607695b in memcpy () from /lib/libc.so.6 +(gdb) bt +#0 0x00002aced607695b in memcpy () from /lib/libc.so.6 +#1 0x00002aced5b4f092 in jack_ringbuffer_read () from /usr/lib/libjack.so.0 +#2 0x00000000004151dd in process_callback () +#3 0x00002aced5b4bf40 in Jack::JackClient::Execute () from /usr/lib/libjack.so.0 +#4 0x00002aced5b5f8da in Jack::JackPosixThread::ThreadHandler () from /usr/lib/libjack.so.0 +#5 0x00002aced6354fa7 in start_thread () from /lib/libpthread.so.0 +#6 0x00002aced60c802d in clone () from /lib/libc.so.6 + + +1. mpg123 could pick up new sample rates suggested by the output modules (like a jack server fixed to 96kHz) and adapt to that. + +Though the practical rates for MPEG audio are up to 48kHz ... but one could easily upsample. +Currently, we detect standard rates and resample when needed... but not new ones. + +4. Prevent ID3v2 tags from being parsed multiple times after seek. + +I need to carry a list of ID3v2 frame addresses that already have been parsed into the data structures. +Currently, this is a possible memory leak when the seek index is disabled (tag data at file beginning) or id3 data is just somewhere in the stream. +That being said, in the "normal" case, there is no leak. + +5. What's about SINGLE_MIX? +Check what is _really_ happening there, make some test file... + +6. Ensure proper operation of free format with the feeder. +MPG123_NEED_MORE needs to be propagated from the freeformat framesize guesser. diff --git a/node_modules/lame/deps/mpg123/aclocal.m4 b/node_modules/lame/deps/mpg123/aclocal.m4 new file mode 100644 index 0000000..713f790 --- /dev/null +++ b/node_modules/lame/deps/mpg123/aclocal.m4 @@ -0,0 +1,1168 @@ +# generated automatically by aclocal 1.12.2 -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.12' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.12.2], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.12.2])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Figure out how to run the assembler. -*- Autoconf -*- + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_PROG_AS +# ---------- +AC_DEFUN([AM_PROG_AS], +[# By default we simply use the C compiler to build assembly code. +AC_REQUIRE([AC_PROG_CC]) +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS +AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) +AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 17 + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 19 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], +[$0: two- and three-arguments forms are deprecated. For more info, see: +http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +dnl Support for Objective C++ was only introduced in Autoconf 2.65, +dnl but we still cater to Autoconf 2.62. +m4_ifdef([AC_PROG_OBJCXX], +[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of '-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar <conftest.tar]) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/addrconfig.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff --git a/node_modules/lame/deps/mpg123/config/freebsd/x64/config.h b/node_modules/lame/deps/mpg123/config/freebsd/x64/config.h new file mode 100644 index 0000000..0d291d3 --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/freebsd/x64/config.h @@ -0,0 +1,460 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +/* #undef ABI_ALIGN_FUN */ + +/* Define to use proper rounding. */ +/* #undef ACCURATE_ROUNDING */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if .balign is present. */ +#define ASMALIGN_BALIGN 1 + +/* Define if .align just takes byte count. */ +/* #undef ASMALIGN_BYTE */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +/* #undef ASMALIGN_EXP */ + +/* Define if __attribute__((aligned(16))) shall be used */ +#define CCALIGN 1 + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "oss" + +/* Define if building with dynamcally linked libmpg123 */ +#define DYNAMIC_BUILD 1 + +/* Use EFBIG as substitude for EOVERFLOW, mingw.org may lack the latter */ +/* #undef EOVERFLOW */ + +/* Define if FIFO support is enabled. */ +#define FIFO 1 + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the <alc.h> header file. */ +/* #undef HAVE_ALC_H */ + +/* Define to 1 if you have the <Alib.h> header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the <AL/alc.h> header file. */ +/* #undef HAVE_AL_ALC_H */ + +/* Define to 1 if you have the <AL/al.h> header file. */ +/* #undef HAVE_AL_AL_H */ + +/* Define to 1 if you have the <al.h> header file. */ +/* #undef HAVE_AL_H */ + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <asm/audioio.h> header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the <audios.h> header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */ +/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + +/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */ +/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + +/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have the <CUlib.h> header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */ +#define HAVE_GAI_ADDRCONFIG 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <langinfo.h> header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +/* #undef HAVE_LIBMX */ + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the <linux/soundcard.h> header file. */ +/* #undef HAVE_LINUX_SOUNDCARD_H */ + +/* Define to 1 if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if libltdl is available */ +/* #undef HAVE_LTDL */ + +/* Define to 1 if you have the <machine/soundcard.h> header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the <OpenAL/alc.h> header file. */ +/* #undef HAVE_OPENAL_ALC_H */ + +/* Define to 1 if you have the <OpenAL/al.h> header file. */ +/* #undef HAVE_OPENAL_AL_H */ + +/* Define to 1 if you have the <os2me.h> header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the <os2.h> header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the <sched.h> header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#define HAVE_SCHED_SETSCHEDULER 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#define HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the `setuid' function. */ +#define HAVE_SETUID 1 + +/* Define to 1 if you have the <signal.h> header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the <sndio.h> header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sun/audioio.h> header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audioio.h> header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audio.h> header file. */ +/* #undef HAVE_SYS_AUDIO_H */ + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the <sys/signal.h> header file. */ +#define HAVE_SYS_SIGNAL_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/soundcard.h> header file. */ +#define HAVE_SYS_SOUNDCARD_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define this if you have the POSIX termios library */ +#define HAVE_TERMIOS 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the <windows.h> header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the <ws2tcpip.h> header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to indicate that float storage follows IEEE754. */ +#define IEEE_FLOAT 1 + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define this to the size of native offset type in bits, used for LFS alias + functions. */ +#define LFS_ALIAS_BITS 64 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* The suffix for module files. */ +#define MODULE_FILE_SUFFIX ".la" + +/* Define if network support is enabled. */ +#define NETWORK 1 + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit and 24 bit integer output. */ +/* #undef NO_32BIT */ + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +/* #undef NO_REAL */ + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define for post-processed 32 bit formats. */ +/* #undef NO_SYNTH32 */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.22.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.22.2" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if modules are enabled */ +/* #undef USE_MODULES */ + +/* Define for new Huffman decoding scheme. */ +#define USE_NEW_HUFFTABLE 1 + +/* Define to use yasm for assemble AVX sources. */ +/* #undef USE_YASM_FOR_AVX */ + +/* Version number of package */ +#define VERSION "1.22.2" + +/* Define to use Win32 named pipes */ +/* #undef WANT_WIN32_FIFO */ + +/* Define to use Win32 sockets */ +/* #undef WANT_WIN32_SOCKETS */ + +/* Define to use Unicode for Windows */ +/* #undef WANT_WIN32_UNICODE */ + +/* WinXP and above for ipv6 */ +/* #undef WINVER */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* WinXP and above for ipv6 */ +/* #undef _WIN32_WINNT */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if <sys/types.h> does not define. */ +/* #undef int16_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef int32_t */ + +/* Define to `long long' if <sys/types.h> does not define. */ +/* #undef int64_t */ + +/* Define to the native offset type (long or actually off_t). */ +#define lfs_alias_t off_t + +/* Define to `long int' if <sys/types.h> does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef size_t */ + +/* Define to `long' if <sys/types.h> does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if <sys/types.h> does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* #undef uint32_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef uintptr_t */ diff --git a/node_modules/lame/deps/mpg123/config/freebsd/x64/mpg123.h b/node_modules/lame/deps/mpg123/config/freebsd/x64/mpg123.h new file mode 100644 index 0000000..25e2b62 --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/freebsd/x64/mpg123.h @@ -0,0 +1,1202 @@ +/* + libmpg123: MPEG Audio Decoder library (version 1.22.2) + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#ifndef MPG123_LIB_H +#define MPG123_LIB_H + +/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ + +/* A macro to check at compile time which set of API functions to expect. + This should be incremented at least each time a new symbol is added to the header. */ +#define MPG123_API_VERSION 41 + +/* These aren't actually in use... seems to work without using libtool. */ +#ifdef BUILD_MPG123_DLL +/* The dll exports. */ +#define MPG123_EXPORT __declspec(dllexport) +#else +#ifdef LINK_MPG123_DLL +/* The exe imports. */ +#define MPG123_EXPORT __declspec(dllimport) +#else +/* Nothing on normal/UNIX builds */ +#define MPG123_EXPORT +#endif +#endif + +#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */ +#include <stdlib.h> +#include <sys/types.h> + +/* Simplified large file handling. + I used to have a check here that prevents building for a library with conflicting large file setup + (application that uses 32 bit offsets with library that uses 64 bits). + While that was perfectly fine in an environment where there is one incarnation of the library, + it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the + correct header matching the 32 bit library (where large files need explicit support) or + the 64 bit library (where there is no distinction). + + New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support, + and thus functions with added suffix (mpg123_open_64). + Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when + building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now. + Link failure is not the expected outcome of any half-sane usage anymore. + + More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names. +*/ + +/* + Now, the renaming of large file aware functions. + By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +*/ +#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) + +/* Need some trickery to concatenate the value(s) of the given macro(s). */ +#define MPG123_MACROCAT_REALLY(a, b) a ## b +#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b) +#ifndef MPG123_LARGESUFFIX +#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS) +#endif +#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX) + +#define mpg123_open MPG123_LARGENAME(mpg123_open) +#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd) +#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle) +#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode) +#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame) +#define mpg123_tell MPG123_LARGENAME(mpg123_tell) +#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe) +#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream) +#define mpg123_seek MPG123_LARGENAME(mpg123_seek) +#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek) +#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame) +#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe) +#define mpg123_index MPG123_LARGENAME(mpg123_index) +#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) +#define mpg123_position MPG123_LARGENAME(mpg123_position) +#define mpg123_length MPG123_LARGENAME(mpg123_length) +#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) +#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) +#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) +#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos) + +#endif /* largefile hackery */ + +#endif /* MPG123_NO_CONFIGURE */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \defgroup mpg123_init mpg123 library and handle setup + * + * Functions to initialise and shutdown the mpg123 library and handles. + * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) + * Tip: Use a RVA setting... + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder handle. */ +struct mpg123_handle_struct; + +/** Opaque structure for the libmpg123 decoder handle. + * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner. + */ +typedef struct mpg123_handle_struct mpg123_handle; + +/** Function to initialise the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + * + * \return MPG123_OK if successful, otherwise an error number. + */ +MPG123_EXPORT int mpg123_init(void); + +/** Function to close down the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */ +MPG123_EXPORT void mpg123_exit(void); + +/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()). + * and optional retrieval of an error code to feed to mpg123_plain_strerror(). + * Optional means: Any of or both the parameters may be NULL. + * + * \return Non-NULL pointer when successful. + */ +MPG123_EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error); + +/** Delete handle, mh is either a valid mpg123 handle or NULL. */ +MPG123_EXPORT void mpg123_delete(mpg123_handle *mh); + +/** Enumeration of the parameters types that it is possible to set/get. */ +enum mpg123_parms +{ + MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ + MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ + MPG123_ADD_FLAGS, /**< add some flags (integer) */ + MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */ + MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */ + MPG123_RVA, /**< one of the RVA choices above (integer) */ + MPG123_DOWNSPEED, /**< play a frame N times (integer) */ + MPG123_UPSPEED, /**< play every Nth frame (integer) */ + MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */ + MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */ + MPG123_ICY_INTERVAL, /**< stream contains ICY metadata with this interval (integer) */ + MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ + MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */ + MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ + MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */ + MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */ + ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/ + ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */ + ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */ +}; + +/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */ +enum mpg123_param_flags +{ + MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ + ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */ + ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */ + ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */ + ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */ + ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */ + ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */ + ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ + ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */ + ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ + ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */ + ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */ + ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */ + ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */ + ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */ + ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */ + ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */ + ,MPG123_PICTURE = 0x10000 /**< 17th bit: Enable storage of pictures from tags (ID3v2 APIC). */ +}; + +/** choices for MPG123_RVA */ +enum mpg123_param_rva +{ + MPG123_RVA_OFF = 0 /**< RVA disabled (default). */ + ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */ + ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */ + ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */ +}; + +/* TODO: Assess the possibilities and troubles of changing parameters during playback. */ + +/** Set a specific parameter, for a specific mpg123_handle, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_handle. + * See the mpg123_parms enumeration for a list of available parameters. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval); + +/** Feature set available for query with mpg123_feature. */ +enum mpg123_feature_set +{ + MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */ + ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */ + ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */ + ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */ + ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */ + ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */ + ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */ + ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */ + ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */ + ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */ + ,MPG123_FEATURE_PARSE_ICY /**< ICY support */ + ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */ +}; + +/** Query libmpg123 feature, 1 for success, 0 for unimplemented functions. */ +MPG123_EXPORT int mpg123_feature(const enum mpg123_feature_set key); + +/* @} */ + + +/** \defgroup mpg123_error mpg123 error handling + * + * Functions to get text version of the error numbers and an enumeration + * of the error codes returned by libmpg123. + * + * Most functions operating on a mpg123_handle simply return MPG123_OK (0) + * on success and MPG123_ERR (-1) on failure, setting the internal error + * variable of the handle to the specific error code. If there was not a valid + * (non-NULL) handle provided to a function operating on one, MPG123_BAD_HANDLE + * may be returned if this can not be confused with a valid positive return + * value. + * Meaning: A function expected to return positive integers on success will + * always indicate error or a special condition by returning a negative one. + * + * Decoding/seek functions may also return message codes MPG123_DONE, + * MPG123_NEW_FORMAT and MPG123_NEED_MORE (all negative, see below on how to + * react). Note that calls to those can be nested, so generally watch out + * for these codes after initial handle setup. + * Especially any function that needs information about the current stream + * to work will try to at least parse the beginning if that did not happen + * yet. + * + * On a function that is supposed to return MPG123_OK on success and + * MPG123_ERR on failure, make sure you check for != MPG123_OK, not + * == MPG123_ERR, as the error code could get more specific in future, + * or there is just a special message from a decoding routine as indicated + * above. + * + * @{ + */ + +/** Enumeration of the message and error codes and returned by libmpg123 functions. */ +enum mpg123_errors +{ + MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */ + MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */ + MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */ + MPG123_ERR=-1, /**< Generic Error */ + MPG123_OK=0, /**< Success */ + MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */ + MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */ + MPG123_BAD_RATE, /**< Invalid sample rate specified. */ + MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */ + MPG123_BAD_PARAM, /**< Bad parameter id! */ + MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */ + MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */ + MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */ + MPG123_BAD_DECODER, /**< Invalid decoder choice. */ + MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */ + MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */ + MPG123_BAD_RVA, /**< Invalid RVA mode. */ + MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */ + MPG123_NO_SPACE, /**< Not enough buffer space. */ + MPG123_BAD_TYPES, /**< Incompatible numeric data types. */ + MPG123_BAD_BAND, /**< Bad equalizer band. */ + MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */ + MPG123_ERR_READER, /**< Error reading the stream. */ + MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */ + MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/ + MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */ + MPG123_BAD_FILE, /**< File access error. */ + MPG123_NO_SEEK, /**< Seek not supported by stream. */ + MPG123_NO_READER, /**< No stream opened. */ + MPG123_BAD_PARS, /**< Bad parameter handle. */ + MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */ + MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */ + MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */ + MPG123_NO_8BIT, /**< No 8bit encoding possible. */ + MPG123_BAD_ALIGN, /**< Stack aligmnent error */ + MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */ + MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */ + MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */ + MPG123_BAD_KEY, /**< Bad key value given. */ + MPG123_NO_INDEX, /**< No frame index in this build. */ + MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */ + MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */ + MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */ + ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */ + ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */ + ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */ + ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */ + ,MPG123_INT_OVERFLOW /**< Some integer overflow. */ +}; + +/** Return a string describing that error errcode means. */ +MPG123_EXPORT const char* mpg123_plain_strerror(int errcode); + +/** Give string describing what error has occured in the context of handle mh. + * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via + * char *errmsg = mpg123_strerror(mh) + * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. */ +MPG123_EXPORT const char* mpg123_strerror(mpg123_handle *mh); + +/** Return the plain errcode intead of a string. + * \return error code recorded in handle or MPG123_BAD_HANDLE + */ +MPG123_EXPORT int mpg123_errcode(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_decoder mpg123 decoder selection + * + * Functions to list and select the available decoders. + * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). + * + * @{ + */ + +/** Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). */ +MPG123_EXPORT const char **mpg123_decoders(void); + +/** Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). */ +MPG123_EXPORT const char **mpg123_supported_decoders(void); + +/** Set the chosen decoder to 'decoder_name' + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name); + +/** Get the currently active decoder engine name. + The active decoder engine can vary depening on output constraints, + mostly non-resampling, integer output is accelerated via 3DNow & Co. but for other modes a fallback engine kicks in. + Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. + \return The decoder name or NULL on error. */ +MPG123_EXPORT const char* mpg123_current_decoder(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_output mpg123 output audio format + * + * Functions to get and select the format of the decoded audio. + * + * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance. + * + * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including ptimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again). + * + * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness. + * + * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation. + * + * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format. + * + * @{ + */ + +/** An enum over all sample types possibly known to mpg123. + * The values are designed as bit flags to allow bitmasking for encoding families. + * + * Note that (your build of) libmpg123 does not necessarily support all these. + * Usually, you can expect the 8bit encodings and signed 16 bit. + * Also 32bit float will be usual beginning with mpg123-1.7.0 . + * What you should bear in mind is that (SSE, etc) optimized routines may be absent + * for some formats. We do have SSE for 16, 32 bit and float, though. + * 24 bit integer is done via postprocessing of 32 bit output -- just cutting + * the last byte, no rounding, even. If you want better, do it yourself. + * + * All formats are in native byte order. If you need different endinaness, you + * can simply postprocess the output buffers (libmpg123 wouldn't do anything else). + * mpg123_encsize() can be helpful there. + */ +enum mpg123_enc_enum +{ + MPG123_ENC_8 = 0x00f /**< 0000 0000 1111 Some 8 bit integer encoding. */ + ,MPG123_ENC_16 = 0x040 /**< 0000 0100 0000 Some 16 bit integer encoding. */ + ,MPG123_ENC_24 = 0x4000 /**< 0100 0000 0000 0000 Some 24 bit integer encoding. */ + ,MPG123_ENC_32 = 0x100 /**< 0001 0000 0000 Some 32 bit integer encoding. */ + ,MPG123_ENC_SIGNED = 0x080 /**< 0000 1000 0000 Some signed integer encoding. */ + ,MPG123_ENC_FLOAT = 0xe00 /**< 1110 0000 0000 Some float encoding. */ + ,MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) /**< 1101 0000 signed 16 bit */ + ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) /**< 0110 0000 unsigned 16 bit */ + ,MPG123_ENC_UNSIGNED_8 = 0x01 /**< 0000 0001 unsigned 8 bit */ + ,MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) /**< 1000 0010 signed 8 bit */ + ,MPG123_ENC_ULAW_8 = 0x04 /**< 0000 0100 ulaw 8 bit */ + ,MPG123_ENC_ALAW_8 = 0x08 /**< 0000 1000 alaw 8 bit */ + ,MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 /**< 0001 0001 1000 0000 signed 32 bit */ + ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 /**< 0010 0001 0000 0000 unsigned 32 bit */ + ,MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 /**< 0101 0000 1000 0000 signed 24 bit */ + ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 /**< 0110 0000 0000 0000 unsigned 24 bit */ + ,MPG123_ENC_FLOAT_32 = 0x200 /**< 0010 0000 0000 32bit float */ + ,MPG123_ENC_FLOAT_64 = 0x400 /**< 0100 0000 0000 64bit float */ + ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 + | MPG123_ENC_SIGNED_8 | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8 + | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32 + | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24 + | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 ) /**< Any encoding on the list. */ +}; + +/** They can be combined into one number (3) to indicate mono and stereo... */ +enum mpg123_channelcount +{ + MPG123_MONO = 1 + ,MPG123_STEREO = 2 +}; + +/** An array of supported standard sample rates + * These are possible native sample rates of MPEG audio files. + * You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. + * \param list Store a pointer to the sample rates array there. + * \param number Store the number of sample rates there. */ +MPG123_EXPORT void mpg123_rates(const long **list, size_t *number); + +/** An array of supported audio encodings. + * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED). + * \param list Store a pointer to the encodings array there. + * \param number Store the number of encodings there. */ +MPG123_EXPORT void mpg123_encodings(const int **list, size_t *number); + +/** Return the size (in bytes) of one mono sample of the named encoding. + * \param encoding The encoding value to analyze. + * \return positive size of encoding in bytes, 0 on invalid encoding. */ +MPG123_EXPORT int mpg123_encsize(int encoding); + +/** Configure a mpg123 handle to accept no output format at all, + * use before specifying supported formats with mpg123_format + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_format_none(mpg123_handle *mh); + +/** Configure mpg123 handle to accept all formats + * (also any custom rate you may set) -- this is default. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_format_all(mpg123_handle *mh); + +/** Set the audio format support of a mpg123_handle in detail: + * \param mh audio decoder handle + * \param rate The sample rate value (in Hertz). + * \param channels A combination of MPG123_STEREO and MPG123_MONO. + * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here. + * \return MPG123_OK on success, MPG123_ERR if there was an error. */ +MPG123_EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings); + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_handle. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +MPG123_EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding); + +/** Get the current output format written to the addresses given. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding); + +/*@}*/ + + +/** \defgroup mpg123_input mpg123 file input and decoding + * + * Functions for input bitstream and decoding operations. + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * @{ + */ + +/* reading samples / triggering decoding, possible return values: */ +/** Enumeration of the error codes returned by libmpg123 functions. */ + +/** Open and prepare to decode the specified file by filesystem path. + * This does not open HTTP urls; libmpg123 contains no networking code. + * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed(). + * \param path filesystem path + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path); + +/** Use an already opened file descriptor as the bitstream input + * mpg123_close() will _not_ close the file descriptor. + */ +MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_replace_reader_handle()! + * mpg123_close() will call the cleanup callback for your handle (if you gave one). + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); + +/** Open a new bitstream and prepare for direct feeding + * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open_feed(mpg123_handle *mh); + +/** Closes the source, if libmpg123 opened it. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_close(mpg123_handle *mh); + +/** Read from stream and decode up to outmemsize bytes. + * \param outmemory address of output buffer to write to + * \param outmemsize maximum number of bytes to write + * \param done address to store the number of actually decoded bytes to + * \return MPG123_OK or error/message code + */ +MPG123_EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Feed data for a stream that has been opened with mpg123_open_feed(). + * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples. + * \param in input buffer + * \param size number of input bytes + * \return MPG123_OK or error/message code. + */ +MPG123_EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size); + +/** Decode MPEG Audio from inmemory to outmemory. + * This is very close to a drop-in replacement for old mpglib. + * When you give zero-sized output buffer the input will be parsed until + * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) + * without taking decoded data. + * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-). + * You can actually always decide if you want those specialized functions in separate steps or one call this one here. + * \param inmemory input buffer + * \param inmemsize number of input bytes + * \param outmemory output buffer + * \param outmemsize maximum number of output bytes + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out especially for MPG123_NEED_MORE) + */ +MPG123_EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Decode next MPEG frame to internal buffer + * or read a frame and return after setting a new format. + * \param num current frame offset gets stored there + * \param audio This pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + * \return MPG123_OK or error/message code + */ +MPG123_EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Decode current MPEG frame to internal buffer. + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + * \param num last frame offset gets stored there + * \param audio this pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + * \return MPG123_OK or error/message code + */ +MPG123_EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Find, read and parse the next mp3 frame + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + * \return MPG123_OK or error/message code + */ +MPG123_EXPORT int mpg123_framebyframe_next(mpg123_handle *mh); + +/** Get access to the raw input data for the last parsed frame. + * This gives you a direct look (and write access) to the frame body data. + * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()). + * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present. + * You can provide NULL for a parameter pointer when you are not interested in the value. + * + * \param header the 4-byte MPEG header + * \param bodydata pointer to the frame body stored in the handle (without the header) + * \param bodybytes size of frame body in bytes (without the header) + * \return MPG123_OK if there was a yet un-decoded frame to get the + * data from, MPG123_BAD_HANDLE or MPG123_ERR otherwise (without further + * explanation, the error state of the mpg123_handle is not modified by + * this function). + */ +MPG123_EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes); + +/** Get the input position (byte offset in stream) of the last parsed frame. + * This can be used for external seek index building, for example. + * It just returns the internally stored offset, regardless of validity -- you ensure that a valid frame has been parsed before! */ +MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_seek mpg123 position and seeking + * + * Functions querying and manipulating position in the decoded audio bitstream. + * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. + * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) + * The general usage is modelled after stdlib's ftell() and fseek(). + * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: + * - SEEK_SET: set position to (or near to) specified offset + * - SEEK_CUR: change position by offset from now + * - SEEK_END: set position to offset from end + * + * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. + * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! + * Short: When you care about the sample position, don't mess with those parameters;-) + * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). + * And yet another caveat: If the stream is concatenated out of differing pieces (Frankenstein stream), seeking may suffer, too. + * + * @{ + */ + +/** Returns the current position in samples. + * On the next successful read, you'd get that sample. + * \return sample offset or MPG123_ERR (null handle) + */ +MPG123_EXPORT off_t mpg123_tell(mpg123_handle *mh); + +/** Returns the frame number that the next read will give you data from. + * \return frame offset or MPG123_ERR (null handle) + */ +MPG123_EXPORT off_t mpg123_tellframe(mpg123_handle *mh); + +/** Returns the current byte offset in the input stream. + * \return byte offset or MPG123_ERR (null handle) + */ +MPG123_EXPORT off_t mpg123_tell_stream(mpg123_handle *mh); + +/** Seek to a desired sample offset. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +MPG123_EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); + +/** Seek to a desired sample offset in data feeding mode. + * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. + * \param input_offset The position it expects to be at the + * next time data is fed to mpg123_decode(). + * \return The resulting offset >= 0 or error/message code */ +MPG123_EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); + +/** Seek to a desired MPEG frame index. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +MPG123_EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); + +/** Return a MPEG frame offset corresponding to an offset in seconds. + * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. + * \return frame offset >= 0 or error/message code */ +MPG123_EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec); + +/** Give access to the frame index table that is managed for seeking. + * You are asked not to modify the values... Use mpg123_set_index to set the + * seek index + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill); + +/** Set the frame index table + * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets + * to NULL and fill to 0 will clear the index and free the allocated memory used by the index. + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); + +/** Get information about current and remaining frames/seconds. + * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + * You provide an offset (in frames) from now and a number of output bytes + * served by libmpg123 but not yet played. You get the projected current frame + * and seconds, as well as the remaining frames/seconds. This does _not_ care + * about skipped samples due to gapless playback. */ +MPG123_EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); + +/*@}*/ + + +/** \defgroup mpg123_voleq mpg123 volume and equalizer + * + * @{ + */ + +enum mpg123_channels +{ + MPG123_LEFT=0x1 /**< The Left Channel. */ + ,MPG123_RIGHT=0x2 /**< The Right Channel. */ + ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */ +}; + +/** Set the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. + * \param band The equaliser band to change (from 0 to 31) + * \param val The (linear) adjustment factor. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val); + +/** Get the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. + * \param band The equaliser band to change (from 0 to 31) + * \return The (linear) adjustment factor (zero for pad parameters) */ +MPG123_EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band); + +/** Reset the 32 Band Audio Equalizer settings to flat + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_reset_eq(mpg123_handle *mh); + +/** Set the absolute output volume including the RVA setting, + * vol<0 just applies (a possibly changed) RVA setting. */ +MPG123_EXPORT int mpg123_volume(mpg123_handle *mh, double vol); + +/** Adjust output volume including the RVA setting by chosen amount */ +MPG123_EXPORT int mpg123_volume_change(mpg123_handle *mh, double change); + +/** Return current volume setting, the actual value due to RVA, and the RVA + * adjustment itself. It's all as double float value to abstract the sample + * format. The volume values are linear factors / amplitudes (not percent) + * and the RVA value is in decibels. */ +MPG123_EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db); + +/* TODO: Set some preamp in addition / to replace internal RVA handling? */ + +/*@}*/ + + +/** \defgroup mpg123_status mpg123 status and information + * + * @{ + */ + +/** Enumeration of the mode types of Variable Bitrate */ +enum mpg123_vbr { + MPG123_CBR=0, /**< Constant Bitrate Mode (default) */ + MPG123_VBR, /**< Variable Bitrate Mode */ + MPG123_ABR /**< Average Bitrate Mode */ +}; + +/** Enumeration of the MPEG Versions */ +enum mpg123_version { + MPG123_1_0=0, /**< MPEG Version 1.0 */ + MPG123_2_0, /**< MPEG Version 2.0 */ + MPG123_2_5 /**< MPEG Version 2.5 */ +}; + + +/** Enumeration of the MPEG Audio mode. + * Only the mono mode has 1 channel, the others have 2 channels. */ +enum mpg123_mode { + MPG123_M_STEREO=0, /**< Standard Stereo. */ + MPG123_M_JOINT, /**< Joint Stereo. */ + MPG123_M_DUAL, /**< Dual Channel. */ + MPG123_M_MONO /**< Single Channel. */ +}; + + +/** Enumeration of the MPEG Audio flag bits */ +enum mpg123_flags { + MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */ + MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */ + MPG123_PRIVATE=0x4, /**< The private bit has been set. */ + MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */ +}; + +/** Data structure for storing information about a frame of MPEG Audio */ +struct mpg123_frameinfo +{ + enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */ + int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */ + long rate; /**< The sampling rate in Hz. */ + enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */ + int mode_ext; /**< The mode extension bit flag. */ + int framesize; /**< The size of the frame (in bytes, including header). */ + enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */ + int emphasis; /**< The emphasis type. */ + int bitrate; /**< Bitrate of the frame (kbps). */ + int abr_rate; /**< The target average bitrate. */ + enum mpg123_vbr vbr; /**< The VBR mode. */ +}; + +/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); + +/** Get the safe output buffer size for all cases (when you want to replace the internal buffer) */ +MPG123_EXPORT size_t mpg123_safe_buffer(void); + +/** Make a full parsing scan of each frame in the file. ID3 tags are found. An accurate length + * value is stored. Seek index will be filled. A seek back to current position + * is performed. At all, this function refuses work when stream is + * not seekable. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_scan(mpg123_handle *mh); + +/** Return, if possible, the full (expected) length of current track in samples. + * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ +MPG123_EXPORT off_t mpg123_length(mpg123_handle *mh); + +/** Override the value for file size in bytes. + * Useful for getting sensible track length values in feed mode or for HTTP streams. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size); + +/** Returns the time (seconds) per frame; <0 is error. */ +MPG123_EXPORT double mpg123_tpf(mpg123_handle *mh); + +/** Returns the samples per frame for the most recently parsed frame; <0 is error. */ +MPG123_EXPORT int mpg123_spf(mpg123_handle *mh); + +/** Get and reset the clip count. */ +MPG123_EXPORT long mpg123_clip(mpg123_handle *mh); + + +/** The key values for state information from mpg123_getstate(). */ +enum mpg123_state +{ + MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true). */ + ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */ + ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files. Seeking may yield unexpected results (also with MPG123_ACCURATE, it may be confused). */ + ,MPG123_FRESH_DECODER /**< Decoder structure has been updated, possibly indicating changed stream (integer value, 0 if false, 1 if true). Flag is cleared after retrieval. */ +}; + +/** Get various current decoder/stream state information. + * \param key the key to identify the information to give. + * \param val the address to return (long) integer values to + * \param fval the address to return floating point values to + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval); + +/*@}*/ + + +/** \defgroup mpg123_metadata mpg123 metadata handling + * + * Functions to retrieve the metadata from MPEG Audio files and streams. + * Also includes string handling functions. + * + * @{ + */ + +/** Data structure for storing strings in a safer way than a standard C-String. + * Can also hold a number of null-terminated strings. */ +typedef struct +{ + char* p; /**< pointer to the string data */ + size_t size; /**< raw number of bytes allocated */ + size_t fill; /**< number of used bytes (including closing zero byte) */ +} mpg123_string; + +/** Create and allocate memory for a new mpg123_string */ +MPG123_EXPORT void mpg123_init_string(mpg123_string* sb); + +/** Free-up mempory for an existing mpg123_string */ +MPG123_EXPORT void mpg123_free_string(mpg123_string* sb); + +/** Change the size of a mpg123_string + * \return 0 on error, 1 on success */ +MPG123_EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news); + +/** Increase size of a mpg123_string if necessary (it may stay larger). + * Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). + * That way, you can preallocate memory and safely work afterwards with pieces. + * \return 0 on error, 1 on success */ +MPG123_EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news); + +/** Copy the contents of one mpg123_string string to another. + * \return 0 on error, 1 on success */ +MPG123_EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to); + +/** Append a C-String to an mpg123_string + * \return 0 on error, 1 on success */ +MPG123_EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff); + +/** Append a C-substring to an mpg123 string + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +MPG123_EXPORT int mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Set the conents of a mpg123_string to a C-string + * \return 0 on error, 1 on success */ +MPG123_EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff); + +/** Set the contents of a mpg123_string to a C-substring + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +MPG123_EXPORT int mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters). + * \return character count + * \param sb the string + * \param utf8 a flag to tell if the string is in utf8 encoding + * Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. +*/ +MPG123_EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8); + +/** Remove trailing \r and \n, if present. + * \return 0 on error, 1 on success + * \param sb the string + */ +MPG123_EXPORT int mpg123_chomp_string(mpg123_string *sb); + +/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */ +enum mpg123_text_encoding +{ + mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */ + ,mpg123_text_utf8 = 1 /**< UTF-8 */ + ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */ + ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */ + ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */ + ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. + * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when + * you don't mess with the reserved code points. If you want to decode little endian data + * without BOM you need to prepend 0xff 0xfe yourself. */ + ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */ + ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, + * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 + * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 + * types (we expect a BOM before real data there), not so for utf16be!*/ + ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */ +}; + +/** The encoding byte values from ID3v2. */ +enum mpg123_id3_enc +{ + mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */ + ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */ + ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */ + ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */ + ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */ +}; + +/** Convert ID3 encoding byte to mpg123 encoding index. */ +MPG123_EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte); + +/** Store text data in string, after converting to UTF-8 from indicated encoding + * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb) + * \param sb target string + * \param enc mpg123 text encoding value + * \param source source buffer with plain unsigned bytes (you might need to cast from char *) + * \param source_size number of bytes in the source buffer + * + * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). + * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). + */ +MPG123_EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size); + +/** Sub data structure for ID3v2, for storing various text fields (including comments). + * This is for ID3v2 COMM, TXXX and all the other text fields. + * Only COMM and TXXX have a description, only COMM and USLT have a language. + * You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */ +typedef struct +{ + char lang[3]; /**< Three-letter language code (not terminated). */ + char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */ + mpg123_string description; /**< Empty for the generic comment... */ + mpg123_string text; /**< ... */ +} mpg123_text; + +/** The picture type values from ID3v2. */ +enum mpg123_id3_pic_type +{ + mpg123_id3_pic_other = 0 + ,mpg123_id3_pic_icon = 1 + ,mpg123_id3_pic_other_icon = 2 + ,mpg123_id3_pic_front_cover = 3 + ,mpg123_id3_pic_back_cover = 4 + ,mpg123_id3_pic_leaflet = 5 + ,mpg123_id3_pic_media = 6 + ,mpg123_id3_pic_lead = 7 + ,mpg123_id3_pic_artist = 8 + ,mpg123_id3_pic_conductor = 9 + ,mpg123_id3_pic_orchestra = 10 + ,mpg123_id3_pic_composer = 11 + ,mpg123_id3_pic_lyricist = 12 + ,mpg123_id3_pic_location = 13 + ,mpg123_id3_pic_recording = 14 + ,mpg123_id3_pic_performance = 15 + ,mpg123_id3_pic_video = 16 + ,mpg123_id3_pic_fish = 17 + ,mpg123_id3_pic_illustration = 18 + ,mpg123_id3_pic_artist_logo = 19 + ,mpg123_id3_pic_publisher_logo = 20 +}; + +/** Sub data structure for ID3v2, for storing picture data including comment. + * This is for the ID3v2 APIC field. You should consult the ID3v2 specification + * for the use of the APIC field ("frames" in ID3v2 documentation, I use "fields" + * here to separate from MPEG frames). */ +typedef struct +{ + char type; + mpg123_string description; + mpg123_string mime_type; + size_t size; + unsigned char* data; +} mpg123_picture; + +/** Data structure for storing IDV3v2 tags. + * This structure is not a direct binary mapping with the file contents. + * The ID3v2 text frames are allowed to contain multiple strings. + * So check for null bytes until you reach the mpg123_string fill. + * All text is encoded in UTF-8. */ +typedef struct +{ + unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */ + mpg123_string *title; /**< Title string (pointer into text_list). */ + mpg123_string *artist; /**< Artist string (pointer into text_list). */ + mpg123_string *album; /**< Album string (pointer into text_list). */ + mpg123_string *year; /**< The year as a string (pointer into text_list). */ + mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */ + mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */ + /* Encountered ID3v2 fields are appended to these lists. + There can be multiple occurences, the pointers above always point to the last encountered data. */ + mpg123_text *comment_list; /**< Array of comments. */ + size_t comments; /**< Number of comments. */ + mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */ + size_t texts; /**< Numer of text fields. */ + mpg123_text *extra; /**< The array of extra (TXXX) fields. */ + size_t extras; /**< Number of extra text (TXXX) fields. */ + mpg123_picture *picture; /**< Array of ID3v2 pictures fields (APIC). */ + size_t pictures; /**< Number of picture (APIC) fields. */ +} mpg123_id3v2; + +/** Data structure for ID3v1 tags (the last 128 bytes of a file). + * Don't take anything for granted (like string termination)! + * Also note the change ID3v1.1 did: comment[28] = 0; comment[29] = track_number + * It is your task to support ID3v1 only or ID3v1.1 ...*/ +typedef struct +{ + char tag[3]; /**< Always the string "TAG", the classic intro. */ + char title[30]; /**< Title string. */ + char artist[30]; /**< Artist string. */ + char album[30]; /**< Album string. */ + char year[4]; /**< Year string. */ + char comment[30]; /**< Comment string. */ + unsigned char genre; /**< Genre index. */ +} mpg123_id3v1; + +#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ +#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ +#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ +#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ + +/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future). + The check function returns a combination of flags. */ +MPG123_EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */ + +/** Clean up meta data storage (ID3v2 and ICY), freeing memory. */ +MPG123_EXPORT void mpg123_meta_free(mpg123_handle *mh); + +/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call. + * v1 and/or v2 can be set to NULL when there is no corresponding data. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2); + +/** Point icy_meta to existing data structure wich may change on any next read/decode function call. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */ + +/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. + * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) . + * \param icy_text The input data in ICY encoding + * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */ +MPG123_EXPORT char* mpg123_icy2utf8(const char* icy_text); + + +/* @} */ + + +/** \defgroup mpg123_advpar mpg123 advanced parameter API + * + * Direct access to a parameter set without full handle around it. + * Possible uses: + * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). + * - Use one set of parameters for multiple handles. + * + * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() + * family) directly return a fully qualified mpg123 error code, the ones + * operating on full handles normally MPG123_OK or MPG123_ERR, storing the + * specific error code itseld inside the handle. + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder parameters. */ +struct mpg123_pars_struct; + +/** Opaque structure for the libmpg123 decoder parameters. */ +typedef struct mpg123_pars_struct mpg123_pars; + +/** Create a handle with preset parameters. */ +MPG123_EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error); + +/** Allocate memory for and return a pointer to a new mpg123_pars */ +MPG123_EXPORT mpg123_pars *mpg123_new_pars(int *error); + +/** Delete and free up memory used by a mpg123_pars data structure */ +MPG123_EXPORT void mpg123_delete_pars(mpg123_pars* mp); + +/** Configure mpg123 parameters to accept no output format at all, + * use before specifying supported formats with mpg123_format + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_fmt_none(mpg123_pars *mp); + +/** Configure mpg123 parameters to accept all formats + * (also any custom rate you may set) -- this is default. + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_fmt_all(mpg123_pars *mp); + +/** Set the audio format support of a mpg123_pars in detail: + \param rate The sample rate value (in Hertz). + \param channels A combination of MPG123_STEREO and MPG123_MONO. + \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no support). + \return MPG123_OK on success +*/ +MPG123_EXPORT int mpg123_fmt(mpg123_pars *mp, long rate, int channels, int encodings); /* 0 is good, -1 is error */ + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_pars. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +MPG123_EXPORT int mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding); + +/** Set a specific parameter, for a specific mpg123_pars, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +MPG123_EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_pars. + * See the mpg123_parms enumeration for a list of available parameters. */ +MPG123_EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval); + +/* @} */ + + +/** \defgroup mpg123_lowio mpg123 low level I/O + * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... + * + * @{ */ + +/** Replace default internal buffer with user-supplied buffer. + * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. + * Note that the required buffer size could be bigger than expected from output + * encoding if libmpg123 has to convert from primary decoder output (p.ex. 32 bit + * storage for 24 bit output. + * \param data pointer to user buffer + * \param size of buffer in bytes + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size); + +/** The max size of one frame's decoded output with current settings. + * Use that to determine an appropriate minimum buffer size for decoding one frame. */ +MPG123_EXPORT size_t mpg123_outblock(mpg123_handle *mh); + +/** Replace low-level stream access functions; read and lseek as known in POSIX. + * You can use this to make any fancy file opening/closing yourself, + * using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a "real" file descriptor...). + * Setting a function to NULL means that the default internal read is + * used (active from next mpg123_open call on). + * Note: As it would be troublesome to mess with this while having a file open, + * this implies mpg123_close(). */ +MPG123_EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int)); + +/** Replace I/O functions with your own ones operating on some kind of handle instead of integer descriptors. + * The handle is a void pointer, so you can pass any data you want... + * mpg123_open_handle() is the call you make to use the I/O defined here. + * There is no fallback to internal read/seek here. + * Note: As it would be troublesome to mess with this while having a file open, + * this mpg123_close() is implied here. + * \param r_read The callback for reading (behaviour like posix read). + * \param r_lseek The callback for seeking (like posix lseek). + * \param cleanup A callback to clean up an I/O handle on mpg123_close, can be NULL for none (you take care of cleaning your handles). */ +MPG123_EXPORT int mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*)); + +/* @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/config/linux/arm/config.h b/node_modules/lame/deps/mpg123/config/linux/arm/config.h new file mode 100644 index 0000000..cb6b816 --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/linux/arm/config.h @@ -0,0 +1,437 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +/* #undef ABI_ALIGN_FUN */ + +/* Define to use proper rounding. */ +/* #undef ACCURATE_ROUNDING */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +#define ASMALIGN_EXP 1 + +/* Define if __attribute__((aligned(16))) shall be used */ +/* #undef CCALIGN */ + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "oss" + +/* Define if building with dynamcally linked libmpg123 */ +/* #undef DYNAMIC_BUILD */ + +/* Define if FIFO support is enabled. */ +#define FIFO 1 + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the <alc.h> header file. */ +/* #undef HAVE_ALC_H */ + +/* Define to 1 if you have the <Alib.h> header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the <AL/alc.h> header file. */ +/* #undef HAVE_AL_ALC_H */ + +/* Define to 1 if you have the <AL/al.h> header file. */ +/* #undef HAVE_AL_AL_H */ + +/* Define to 1 if you have the <al.h> header file. */ +/* #undef HAVE_AL_H */ + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <asm/audioio.h> header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the <audios.h> header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */ +/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + +/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */ +/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + +/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have the <CUlib.h> header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */ +#define HAVE_GAI_ADDRCONFIG 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <langinfo.h> header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +/* #undef HAVE_LIBMX */ + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the <linux/soundcard.h> header file. */ +#define HAVE_LINUX_SOUNDCARD_H 1 + +/* Define to 1 if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if libltdl is available */ +/* #undef HAVE_LTDL */ + +/* Define to 1 if you have the <machine/soundcard.h> header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the <OpenAL/alc.h> header file. */ +/* #undef HAVE_OPENAL_ALC_H */ + +/* Define to 1 if you have the <OpenAL/al.h> header file. */ +/* #undef HAVE_OPENAL_AL_H */ + +/* Define to 1 if you have the <os2me.h> header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the <os2.h> header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the <sched.h> header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#define HAVE_SCHED_SETSCHEDULER 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#define HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the `setuid' function. */ +#define HAVE_SETUID 1 + +/* Define to 1 if you have the <signal.h> header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the <sndio.h> header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sun/audioio.h> header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audioio.h> header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audio.h> header file. */ +/* #undef HAVE_SYS_AUDIO_H */ + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the <sys/signal.h> header file. */ +#define HAVE_SYS_SIGNAL_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/soundcard.h> header file. */ +#define HAVE_SYS_SOUNDCARD_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define this if you have the POSIX termios library */ +#define HAVE_TERMIOS 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the <windows.h> header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the <ws2tcpip.h> header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to indicate that float storage follows IEEE754. */ +/* #undef IEEE_FLOAT */ + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define this to the size of long type in bits, used for LFS small/native + alias functions. */ +#define LFS_ALIAS_BITS 32 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* The suffix for module files. */ +#define MODULE_FILE_SUFFIX ".la" + +/* Define if network support is enabled. */ +/* #undef NETWORK */ + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit and 24 bit integer output. */ +#define NO_32BIT 1 + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +#define NO_REAL 1 + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.14.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.14.4" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if modules are enabled */ +/* #undef USE_MODULES */ + +/* Version number of package */ +#define VERSION "1.14.4" + +/* Define to use Win32 named pipes */ +/* #undef WANT_WIN32_FIFO */ + +/* Define to use Win32 sockets */ +/* #undef WANT_WIN32_SOCKETS */ + +/* Define to use Unicode for Windows */ +/* #undef WANT_WIN32_UNICODE */ + +/* WinXP and above for ipv6 */ +/* #undef WINVER */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#define _FILE_OFFSET_BITS 64 + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* WinXP and above for ipv6 */ +/* #undef _WIN32_WINNT */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if <sys/types.h> does not define. */ +/* #undef int16_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef int32_t */ + +/* Define to `long int' if <sys/types.h> does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef size_t */ + +/* Define to `long' if <sys/types.h> does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if <sys/types.h> does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* #undef uint32_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef uintptr_t */ diff --git a/node_modules/lame/deps/mpg123/config/linux/arm/mpg123.h b/node_modules/lame/deps/mpg123/config/linux/arm/mpg123.h new file mode 100644 index 0000000..421288a --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/linux/arm/mpg123.h @@ -0,0 +1,1075 @@ +/* + libmpg123: MPEG Audio Decoder library (version 1.14.4) + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#ifndef MPG123_LIB_H +#define MPG123_LIB_H + +/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ + +/* A macro to check at compile time which set of API functions to expect. + This should be incremented at least each time a new symbol is added to the header. */ +#define MPG123_API_VERSION 36 + +/* These aren't actually in use... seems to work without using libtool. */ +#ifdef BUILD_MPG123_DLL +/* The dll exports. */ +#define EXPORT __declspec(dllexport) +#else +#ifdef LINK_MPG123_DLL +/* The exe imports. */ +#define EXPORT __declspec(dllimport) +#else +/* Nothing on normal/UNIX builds */ +#define EXPORT +#endif +#endif + +#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */ +#include <stdlib.h> +#include <sys/types.h> + +/* Simplified large file handling. + I used to have a check here that prevents building for a library with conflicting large file setup + (application that uses 32 bit offsets with library that uses 64 bits). + While that was perfectly fine in an environment where there is one incarnation of the library, + it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the + correct header matching the 32 bit library (where large files need explicit support) or + the 64 bit library (where there is no distinction). + + New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support, + and thus functions with added suffix (mpg123_open_64). + Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when + building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now. + Link failure is not the expected outcome of any half-sane usage anymore. + + More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names. +*/ + +/* + Now, the renaming of large file aware functions. + By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +*/ +#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) + +/* Need some trickery to concatenate the value(s) of the given macro(s). */ +#define MPG123_MACROCAT_REALLY(a, b) a ## b +#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b) +#ifndef MPG123_LARGESUFFIX +#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS) +#endif +#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX) + +#define mpg123_open MPG123_LARGENAME(mpg123_open) +#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd) +#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle) +#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode) +#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame) +#define mpg123_tell MPG123_LARGENAME(mpg123_tell) +#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe) +#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream) +#define mpg123_seek MPG123_LARGENAME(mpg123_seek) +#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek) +#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame) +#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe) +#define mpg123_index MPG123_LARGENAME(mpg123_index) +#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) +#define mpg123_position MPG123_LARGENAME(mpg123_position) +#define mpg123_length MPG123_LARGENAME(mpg123_length) +#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) +#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) +#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) +#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos) + +#endif /* largefile hackery */ + +#endif /* MPG123_NO_CONFIGURE */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \defgroup mpg123_init mpg123 library and handle setup + * + * Functions to initialise and shutdown the mpg123 library and handles. + * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) + * Tip: Use a RVA setting... + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder handle. */ +struct mpg123_handle_struct; + +/** Opaque structure for the libmpg123 decoder handle. + * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner. + */ +typedef struct mpg123_handle_struct mpg123_handle; + +/** Function to initialise the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + * + * \return MPG123_OK if successful, otherwise an error number. + */ +EXPORT int mpg123_init(void); + +/** Function to close down the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */ +EXPORT void mpg123_exit(void); + +/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()). + * and optional retrieval of an error code to feed to mpg123_plain_strerror(). + * Optional means: Any of or both the parameters may be NULL. + * + * \return Non-NULL pointer when successful. + */ +EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error); + +/** Delete handle, mh is either a valid mpg123 handle or NULL. */ +EXPORT void mpg123_delete(mpg123_handle *mh); + +/** Enumeration of the parameters types that it is possible to set/get. */ +enum mpg123_parms +{ + MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ + MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ + MPG123_ADD_FLAGS, /**< add some flags (integer) */ + MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */ + MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */ + MPG123_RVA, /**< one of the RVA choices above (integer) */ + MPG123_DOWNSPEED, /**< play a frame N times (integer) */ + MPG123_UPSPEED, /**< play every Nth frame (integer) */ + MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */ + MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */ + MPG123_ICY_INTERVAL, /**< stream contains ICY metadata with this interval (integer) */ + MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ + MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */ + MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ + MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */ + MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */ + ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/ + ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */ + ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */ +}; + +/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */ +enum mpg123_param_flags +{ + MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ + ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */ + ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */ + ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */ + ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */ + ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */ + ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */ + ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ + ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */ + ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ + ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */ + ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */ + ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */ + ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */ + ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */ + ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */ + ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */ +}; + +/** choices for MPG123_RVA */ +enum mpg123_param_rva +{ + MPG123_RVA_OFF = 0 /**< RVA disabled (default). */ + ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */ + ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */ + ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */ +}; + +/* TODO: Assess the possibilities and troubles of changing parameters during playback. */ + +/** Set a specific parameter, for a specific mpg123_handle, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_handle. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval); + +/** Feature set available for query with mpg123_feature. */ +enum mpg123_feature_set +{ + MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */ + ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */ + ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */ + ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */ + ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */ + ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */ + ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */ + ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */ + ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */ + ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */ + ,MPG123_FEATURE_PARSE_ICY /**< ICY support */ + ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */ +}; + +/** Query libmpg123 feature, 1 for success, 0 for unimplemented functions. */ +EXPORT int mpg123_feature(const enum mpg123_feature_set key); + +/* @} */ + + +/** \defgroup mpg123_error mpg123 error handling + * + * Functions to get text version of the error numbers and an enumeration + * of the error codes returned by libmpg123. + * + * Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * The positive range of return values is used for "useful" values when appropriate. + * + * @{ + */ + +/** Enumeration of the message and error codes and returned by libmpg123 functions. */ +enum mpg123_errors +{ + MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */ + MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */ + MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */ + MPG123_ERR=-1, /**< Generic Error */ + MPG123_OK=0, /**< Success */ + MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */ + MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */ + MPG123_BAD_RATE, /**< Invalid sample rate specified. */ + MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */ + MPG123_BAD_PARAM, /**< Bad parameter id! */ + MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */ + MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */ + MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */ + MPG123_BAD_DECODER, /**< Invalid decoder choice. */ + MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */ + MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */ + MPG123_BAD_RVA, /**< Invalid RVA mode. */ + MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */ + MPG123_NO_SPACE, /**< Not enough buffer space. */ + MPG123_BAD_TYPES, /**< Incompatible numeric data types. */ + MPG123_BAD_BAND, /**< Bad equalizer band. */ + MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */ + MPG123_ERR_READER, /**< Error reading the stream. */ + MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */ + MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/ + MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */ + MPG123_BAD_FILE, /**< File access error. */ + MPG123_NO_SEEK, /**< Seek not supported by stream. */ + MPG123_NO_READER, /**< No stream opened. */ + MPG123_BAD_PARS, /**< Bad parameter handle. */ + MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */ + MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */ + MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */ + MPG123_NO_8BIT, /**< No 8bit encoding possible. */ + MPG123_BAD_ALIGN, /**< Stack aligmnent error */ + MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */ + MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */ + MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */ + MPG123_BAD_KEY, /**< Bad key value given. */ + MPG123_NO_INDEX, /**< No frame index in this build. */ + MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */ + MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */ + MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */ + ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */ + ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */ + ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */ + ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */ + ,MPG123_INT_OVERFLOW /**< Some integer overflow. */ +}; + +/** Return a string describing that error errcode means. */ +EXPORT const char* mpg123_plain_strerror(int errcode); + +/** Give string describing what error has occured in the context of handle mh. + * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via + * char *errmsg = mpg123_strerror(mh) + * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. */ +EXPORT const char* mpg123_strerror(mpg123_handle *mh); + +/** Return the plain errcode intead of a string. */ +EXPORT int mpg123_errcode(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_decoder mpg123 decoder selection + * + * Functions to list and select the available decoders. + * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). + * + * @{ + */ + +/** Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). */ +EXPORT const char **mpg123_decoders(void); + +/** Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). */ +EXPORT const char **mpg123_supported_decoders(void); + +/** Set the chosen decoder to 'decoder_name' */ +EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name); + +/** Get the currently active decoder engine name. + The active decoder engine can vary depening on output constraints, + mostly non-resampling, integer output is accelerated via 3DNow & Co. but for other modes a fallback engine kicks in. + Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. + \return The decoder name or NULL on error. */ +EXPORT const char* mpg123_current_decoder(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_output mpg123 output audio format + * + * Functions to get and select the format of the decoded audio. + * + * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance. + * + * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including ptimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again). + * + * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness. + * + * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation. + * + * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format. + * + * @{ + */ + +/** An enum over all sample types possibly known to mpg123. + * The values are designed as bit flags to allow bitmasking for encoding families. + * + * Note that (your build of) libmpg123 does not necessarily support all these. + * Usually, you can expect the 8bit encodings and signed 16 bit. + * Also 32bit float will be usual beginning with mpg123-1.7.0 . + * What you should bear in mind is that (SSE, etc) optimized routines may be absent + * for some formats. We do have SSE for 16, 32 bit and float, though. + * 24 bit integer is done via postprocessing of 32 bit output -- just cutting + * the last byte, no rounding, even. If you want better, do it yourself. + * + * All formats are in native byte order. If you need different endinaness, you + * can simply postprocess the output buffers (libmpg123 wouldn't do anything else). + * mpg123_encsize() can be helpful there. + */ +enum mpg123_enc_enum +{ + MPG123_ENC_8 = 0x00f /**< 0000 0000 1111 Some 8 bit integer encoding. */ + ,MPG123_ENC_16 = 0x040 /**< 0000 0100 0000 Some 16 bit integer encoding. */ + ,MPG123_ENC_24 = 0x4000 /**< 0100 0000 0000 0000 Some 24 bit integer encoding. */ + ,MPG123_ENC_32 = 0x100 /**< 0001 0000 0000 Some 32 bit integer encoding. */ + ,MPG123_ENC_SIGNED = 0x080 /**< 0000 1000 0000 Some signed integer encoding. */ + ,MPG123_ENC_FLOAT = 0xe00 /**< 1110 0000 0000 Some float encoding. */ + ,MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) /**< 1101 0000 signed 16 bit */ + ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) /**< 0110 0000 unsigned 16 bit */ + ,MPG123_ENC_UNSIGNED_8 = 0x01 /**< 0000 0001 unsigned 8 bit */ + ,MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) /**< 1000 0010 signed 8 bit */ + ,MPG123_ENC_ULAW_8 = 0x04 /**< 0000 0100 ulaw 8 bit */ + ,MPG123_ENC_ALAW_8 = 0x08 /**< 0000 1000 alaw 8 bit */ + ,MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 /**< 0001 0001 1000 0000 signed 32 bit */ + ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 /**< 0010 0001 0000 0000 unsigned 32 bit */ + ,MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 /**< 0101 0000 1000 0000 signed 24 bit */ + ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 /**< 0110 0000 0000 0000 unsigned 24 bit */ + ,MPG123_ENC_FLOAT_32 = 0x200 /**< 0010 0000 0000 32bit float */ + ,MPG123_ENC_FLOAT_64 = 0x400 /**< 0100 0000 0000 64bit float */ + ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 + | MPG123_ENC_SIGNED_8 | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8 + | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32 + | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24 + | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 ) /**< Any encoding on the list. */ +}; + +/** They can be combined into one number (3) to indicate mono and stereo... */ +enum mpg123_channelcount +{ + MPG123_MONO = 1 + ,MPG123_STEREO = 2 +}; + +/** An array of supported standard sample rates + * These are possible native sample rates of MPEG audio files. + * You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. + * \param list Store a pointer to the sample rates array there. + * \param number Store the number of sample rates there. */ +EXPORT void mpg123_rates(const long **list, size_t *number); + +/** An array of supported audio encodings. + * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED). + * \param list Store a pointer to the encodings array there. + * \param number Store the number of encodings there. */ +EXPORT void mpg123_encodings(const int **list, size_t *number); + +/** Return the size (in bytes) of one mono sample of the named encoding. + * \param encoding The encoding value to analyze. + * \return positive size of encoding in bytes, 0 on invalid encoding. */ +EXPORT int mpg123_encsize(int encoding); + +/** Configure a mpg123 handle to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_format_none(mpg123_handle *mh); + +/** Configure mpg123 handle to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_format_all(mpg123_handle *mh); + +/** Set the audio format support of a mpg123_handle in detail: + * \param mh audio decoder handle + * \param rate The sample rate value (in Hertz). + * \param channels A combination of MPG123_STEREO and MPG123_MONO. + * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here. + * \return MPG123_OK on success, MPG123_ERR if there was an error. */ +EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings); + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_handle. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding); + +/** Get the current output format written to the addresses givenr. */ +EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding); + +/*@}*/ + + +/** \defgroup mpg123_input mpg123 file input and decoding + * + * Functions for input bitstream and decoding operations. + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * @{ + */ + +/* reading samples / triggering decoding, possible return values: */ +/** Enumeration of the error codes returned by libmpg123 functions. */ + +/** Open and prepare to decode the specified file by filesystem path. + * This does not open HTTP urls; libmpg123 contains no networking code. + * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed(). + */ +EXPORT int mpg123_open(mpg123_handle *mh, const char *path); + +/** Use an already opened file descriptor as the bitstream input + * mpg123_close() will _not_ close the file descriptor. + */ +EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_replace_reader_handle()! + * mpg123_close() will call the cleanup callback for your handle (if you gave one). + */ +EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); + +/** Open a new bitstream and prepare for direct feeding + * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. + */ +EXPORT int mpg123_open_feed(mpg123_handle *mh); + +/** Closes the source, if libmpg123 opened it. */ +EXPORT int mpg123_close(mpg123_handle *mh); + +/** Read from stream and decode up to outmemsize bytes. + * \param outmemory address of output buffer to write to + * \param outmemsize maximum number of bytes to write + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out for MPG123_DONE and friends!) */ +EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Feed data for a stream that has been opened with mpg123_open_feed(). + * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples. + * \param in input buffer + * \param size number of input bytes + * \return error/message code. */ +EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size); + +/** Decode MPEG Audio from inmemory to outmemory. + * This is very close to a drop-in replacement for old mpglib. + * When you give zero-sized output buffer the input will be parsed until + * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) + * without taking decoded data. + * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-). + * You can actually always decide if you want those specialized functions in separate steps or one call this one here. + * \param inmemory input buffer + * \param inmemsize number of input bytes + * \param outmemory output buffer + * \param outmemsize maximum number of output bytes + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out especially for MPG123_NEED_MORE) + */ +EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Decode next MPEG frame to internal buffer + * or read a frame and return after setting a new format. + * \param num current frame offset gets stored there + * \param audio This pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Decode current MPEG frame to internal buffer. + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + * \param num last frame offset gets stored there + * \param audio this pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Find, read and parse the next mp3 frame + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + */ +EXPORT int mpg123_framebyframe_next(mpg123_handle *mh); + +/** Get access to the raw input data for the last parsed frame. + * This gives you a direct look (and write access) to the frame body data. + * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()). + * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present. + * You can provide NULL for a parameter pointer when you are not interested in the value. + * + * \param header the 4-byte MPEG header + * \param bodydata pointer to the frame body stored in the handle (without the header) + * \param bodybytes size of frame body in bytes (without the header) + * \return MPG123_OK if there was a yet un-decoded frame to get the data from, MPG123_ERR otherwise (without further explanation, the error state of the mpg123_handle is not modified by this function). + */ +EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes); + +/** Get the input position (byte offset in stream) of the last parsed frame. + * This can be used for external seek index building, for example. + * It just returns the internally stored offset, regardless of validity -- you ensure that a valid frame has been parsed before! */ +EXPORT off_t mpg123_framepos(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_seek mpg123 position and seeking + * + * Functions querying and manipulating position in the decoded audio bitstream. + * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. + * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) + * The general usage is modelled after stdlib's ftell() and fseek(). + * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: + * - SEEK_SET: set position to (or near to) specified offset + * - SEEK_CUR: change position by offset from now + * - SEEK_END: set position to offset from end + * + * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. + * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! + * Short: When you care about the sample position, don't mess with those parameters;-) + * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). + * + * @{ + */ + +/** Returns the current position in samples. + * On the next read, you'd get that sample. */ +EXPORT off_t mpg123_tell(mpg123_handle *mh); + +/** Returns the frame number that the next read will give you data from. */ +EXPORT off_t mpg123_tellframe(mpg123_handle *mh); + +/** Returns the current byte offset in the input stream. */ +EXPORT off_t mpg123_tell_stream(mpg123_handle *mh); + +/** Seek to a desired sample offset. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); + +/** Seek to a desired sample offset in data feeding mode. + * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. + * \param input_offset The position it expects to be at the + * next time data is fed to mpg123_decode(). + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); + +/** Seek to a desired MPEG frame index. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); + +/** Return a MPEG frame offset corresponding to an offset in seconds. + * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. + * \return frame offset >= 0 or error/message code */ +EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec); + +/** Give access to the frame index table that is managed for seeking. + * You are asked not to modify the values... Use mpg123_set_index to set the + * seek index + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill); + +/** Set the frame index table + * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets + * to NULL and fill to 0 will clear the index and free the allocated memory used by the index. + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); + +/** Get information about current and remaining frames/seconds. + * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + * You provide an offset (in frames) from now and a number of output bytes + * served by libmpg123 but not yet played. You get the projected current frame + * and seconds, as well as the remaining frames/seconds. This does _not_ care + * about skipped samples due to gapless playback. */ +EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); + +/*@}*/ + + +/** \defgroup mpg123_voleq mpg123 volume and equalizer + * + * @{ + */ + +enum mpg123_channels +{ + MPG123_LEFT=0x1 /**< The Left Channel. */ + ,MPG123_RIGHT=0x2 /**< The Right Channel. */ + ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */ +}; + +/** Set the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. + * \param band The equaliser band to change (from 0 to 31) + * \param val The (linear) adjustment factor. */ +EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val); + +/** Get the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. + * \param band The equaliser band to change (from 0 to 31) + * \return The (linear) adjustment factor. */ +EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band); + +/** Reset the 32 Band Audio Equalizer settings to flat */ +EXPORT int mpg123_reset_eq(mpg123_handle *mh); + +/** Set the absolute output volume including the RVA setting, + * vol<0 just applies (a possibly changed) RVA setting. */ +EXPORT int mpg123_volume(mpg123_handle *mh, double vol); + +/** Adjust output volume including the RVA setting by chosen amount */ +EXPORT int mpg123_volume_change(mpg123_handle *mh, double change); + +/** Return current volume setting, the actual value due to RVA, and the RVA + * adjustment itself. It's all as double float value to abstract the sample + * format. The volume values are linear factors / amplitudes (not percent) + * and the RVA value is in decibels. */ +EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db); + +/* TODO: Set some preamp in addition / to replace internal RVA handling? */ + +/*@}*/ + + +/** \defgroup mpg123_status mpg123 status and information + * + * @{ + */ + +/** Enumeration of the mode types of Variable Bitrate */ +enum mpg123_vbr { + MPG123_CBR=0, /**< Constant Bitrate Mode (default) */ + MPG123_VBR, /**< Variable Bitrate Mode */ + MPG123_ABR /**< Average Bitrate Mode */ +}; + +/** Enumeration of the MPEG Versions */ +enum mpg123_version { + MPG123_1_0=0, /**< MPEG Version 1.0 */ + MPG123_2_0, /**< MPEG Version 2.0 */ + MPG123_2_5 /**< MPEG Version 2.5 */ +}; + + +/** Enumeration of the MPEG Audio mode. + * Only the mono mode has 1 channel, the others have 2 channels. */ +enum mpg123_mode { + MPG123_M_STEREO=0, /**< Standard Stereo. */ + MPG123_M_JOINT, /**< Joint Stereo. */ + MPG123_M_DUAL, /**< Dual Channel. */ + MPG123_M_MONO /**< Single Channel. */ +}; + + +/** Enumeration of the MPEG Audio flag bits */ +enum mpg123_flags { + MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */ + MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */ + MPG123_PRIVATE=0x4, /**< The private bit has been set. */ + MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */ +}; + +/** Data structure for storing information about a frame of MPEG Audio */ +struct mpg123_frameinfo +{ + enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */ + int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */ + long rate; /**< The sampling rate in Hz. */ + enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */ + int mode_ext; /**< The mode extension bit flag. */ + int framesize; /**< The size of the frame (in bytes, including header). */ + enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */ + int emphasis; /**< The emphasis type. */ + int bitrate; /**< Bitrate of the frame (kbps). */ + int abr_rate; /**< The target average bitrate. */ + enum mpg123_vbr vbr; /**< The VBR mode. */ +}; + +/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. */ +EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); + +/** Get the safe output buffer size for all cases (when you want to replace the internal buffer) */ +EXPORT size_t mpg123_safe_buffer(void); + +/** Make a full parsing scan of each frame in the file. ID3 tags are found. An accurate length + * value is stored. Seek index will be filled. A seek back to current position + * is performed. At all, this function refuses work when stream is + * not seekable. + * \return MPG123_OK or MPG123_ERR. + */ +EXPORT int mpg123_scan(mpg123_handle *mh); + +/** Return, if possible, the full (expected) length of current track in samples. + * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ +EXPORT off_t mpg123_length(mpg123_handle *mh); + +/** Override the value for file size in bytes. + * Useful for getting sensible track length values in feed mode or for HTTP streams. + * \return MPG123_OK or MPG123_ERR */ +EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size); + +/** Returns the time (seconds) per frame; <0 is error. */ +EXPORT double mpg123_tpf(mpg123_handle *mh); + +/** Returns the samples per frame for the most recently parsed frame; <0 is error. */ +EXPORT int mpg123_spf(mpg123_handle *mh); + +/** Get and reset the clip count. */ +EXPORT long mpg123_clip(mpg123_handle *mh); + + +/** The key values for state information from mpg123_getstate(). */ +enum mpg123_state +{ + MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true) */ + ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */ + ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files (the leading one featuring gapless info). */ +}; + +/** Get various current decoder/stream state information. + * \param key the key to identify the information to give. + * \param val the address to return (long) integer values to + * \param fval the address to return floating point values to + * \return MPG123_OK or MPG123_ERR for success + */ +EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval); + +/*@}*/ + + +/** \defgroup mpg123_metadata mpg123 metadata handling + * + * Functions to retrieve the metadata from MPEG Audio files and streams. + * Also includes string handling functions. + * + * @{ + */ + +/** Data structure for storing strings in a safer way than a standard C-String. + * Can also hold a number of null-terminated strings. */ +typedef struct +{ + char* p; /**< pointer to the string data */ + size_t size; /**< raw number of bytes allocated */ + size_t fill; /**< number of used bytes (including closing zero byte) */ +} mpg123_string; + +/** Create and allocate memory for a new mpg123_string */ +EXPORT void mpg123_init_string(mpg123_string* sb); + +/** Free-up mempory for an existing mpg123_string */ +EXPORT void mpg123_free_string(mpg123_string* sb); + +/** Change the size of a mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news); + +/** Increase size of a mpg123_string if necessary (it may stay larger). + * Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). + * That way, you can preallocate memory and safely work afterwards with pieces. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news); + +/** Copy the contents of one mpg123_string string to another. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to); + +/** Append a C-String to an mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff); + +/** Append a C-substring to an mpg123 string + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Set the conents of a mpg123_string to a C-string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff); + +/** Set the contents of a mpg123_string to a C-substring + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters). + * \return character count + * \param sb the string + * \param utf8 a flag to tell if the string is in utf8 encoding + * Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. +*/ +EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8); + +/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */ +enum mpg123_text_encoding +{ + mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */ + ,mpg123_text_utf8 = 1 /**< UTF-8 */ + ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */ + ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */ + ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */ + ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. + * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when + * you don't mess with the reserved code points. If you want to decode little endian data + * without BOM you need to prepend 0xff 0xfe yourself. */ + ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */ + ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, + * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 + * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 + * types (we expect a BOM before real data there), not so for utf16be!*/ + ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */ +}; + +/** The encoding byte values from ID3v2. */ +enum mpg123_id3_enc +{ + mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */ + ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */ + ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */ + ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */ + ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */ +}; + +/** Convert ID3 encoding byte to mpg123 encoding index. */ +EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte); + +/** Store text data in string, after converting to UTF-8 from indicated encoding + * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb) + * \param sb target string + * \param enc mpg123 text encoding value + * \param source source buffer with plain unsigned bytes (you might need to cast from char *) + * \param source_size number of bytes in the source buffer + * + * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). + * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). + */ +EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size); + +/** Sub data structure for ID3v2, for storing various text fields (including comments). + * This is for ID3v2 COMM, TXXX and all the other text fields. + * Only COMM and TXXX have a description, only COMM and USLT have a language. + * You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */ +typedef struct +{ + char lang[3]; /**< Three-letter language code (not terminated). */ + char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */ + mpg123_string description; /**< Empty for the generic comment... */ + mpg123_string text; /**< ... */ +} mpg123_text; + +/** Data structure for storing IDV3v2 tags. + * This structure is not a direct binary mapping with the file contents. + * The ID3v2 text frames are allowed to contain multiple strings. + * So check for null bytes until you reach the mpg123_string fill. + * All text is encoded in UTF-8. */ +typedef struct +{ + unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */ + mpg123_string *title; /**< Title string (pointer into text_list). */ + mpg123_string *artist; /**< Artist string (pointer into text_list). */ + mpg123_string *album; /**< Album string (pointer into text_list). */ + mpg123_string *year; /**< The year as a string (pointer into text_list). */ + mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */ + mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */ + /* Encountered ID3v2 fields are appended to these lists. + There can be multiple occurences, the pointers above always point to the last encountered data. */ + mpg123_text *comment_list; /**< Array of comments. */ + size_t comments; /**< Number of comments. */ + mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */ + size_t texts; /**< Numer of text fields. */ + mpg123_text *extra; /**< The array of extra (TXXX) fields. */ + size_t extras; /**< Number of extra text (TXXX) fields. */ +} mpg123_id3v2; + +/** Data structure for ID3v1 tags (the last 128 bytes of a file). + * Don't take anything for granted (like string termination)! + * Also note the change ID3v1.1 did: comment[28] = 0; comment[19] = track_number + * It is your task to support ID3v1 only or ID3v1.1 ...*/ +typedef struct +{ + char tag[3]; /**< Always the string "TAG", the classic intro. */ + char title[30]; /**< Title string. */ + char artist[30]; /**< Artist string. */ + char album[30]; /**< Album string. */ + char year[4]; /**< Year string. */ + char comment[30]; /**< Comment string. */ + unsigned char genre; /**< Genre index. */ +} mpg123_id3v1; + +#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ +#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ +#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ +#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ + +/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future). + The check function returns a combination of flags. */ +EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */ + +/** Clean up meta data storage (ID3v2 and ICY), freeing memory. */ +EXPORT void mpg123_meta_free(mpg123_handle *mh); + +/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call. + * v1 and/or v2 can be set to NULL when there is no corresponding data. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2); + +/** Point icy_meta to existing data structure wich may change on any next read/decode function call. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */ + +/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. + * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) . + * \param icy_text The input data in ICY encoding + * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */ +EXPORT char* mpg123_icy2utf8(const char* icy_text); + + +/* @} */ + + +/** \defgroup mpg123_advpar mpg123 advanced parameter API + * + * Direct access to a parameter set without full handle around it. + * Possible uses: + * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). + * - Use one set of parameters for multiple handles. + * + * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() + * family) directly return a fully qualified mpg123 error code, the ones + * operating on full handles normally MPG123_OK or MPG123_ERR, storing the + * specific error code itseld inside the handle. + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder parameters. */ +struct mpg123_pars_struct; + +/** Opaque structure for the libmpg123 decoder parameters. */ +typedef struct mpg123_pars_struct mpg123_pars; + +/** Create a handle with preset parameters. */ +EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error); + +/** Allocate memory for and return a pointer to a new mpg123_pars */ +EXPORT mpg123_pars *mpg123_new_pars(int *error); + +/** Delete and free up memory used by a mpg123_pars data structure */ +EXPORT void mpg123_delete_pars(mpg123_pars* mp); + +/** Configure mpg123 parameters to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_fmt_none(mpg123_pars *mp); + +/** Configure mpg123 parameters to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_fmt_all(mpg123_pars *mp); + +/** Set the audio format support of a mpg123_pars in detail: + \param rate The sample rate value (in Hertz). + \param channels A combination of MPG123_STEREO and MPG123_MONO. + \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no support). + \return 0 on success, -1 if there was an error. / +*/ +EXPORT int mpg123_fmt(mpg123_pars *mh, long rate, int channels, int encodings); /* 0 is good, -1 is error */ + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_pars. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_fmt_support(mpg123_pars *mh, long rate, int encoding); + +/** Set a specific parameter, for a specific mpg123_pars, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_pars. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval); + +/* @} */ + + +/** \defgroup mpg123_lowio mpg123 low level I/O + * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... + * + * @{ */ + +/** Replace default internal buffer with user-supplied buffer. + * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. */ +EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size); + +/** The max size of one frame's decoded output with current settings. + * Use that to determine an appropriate minimum buffer size for decoding one frame. */ +EXPORT size_t mpg123_outblock(mpg123_handle *mh); + +/** Replace low-level stream access functions; read and lseek as known in POSIX. + * You can use this to make any fancy file opening/closing yourself, + * using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a "real" file descriptor...). + * Setting a function to NULL means that the default internal read is + * used (active from next mpg123_open call on). + * Note: As it would be troublesome to mess with this while having a file open, + * this implies mpg123_close(). */ +EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int)); + +/** Replace I/O functions with your own ones operating on some kind of handle instead of integer descriptors. + * The handle is a void pointer, so you can pass any data you want... + * mpg123_open_handle() is the call you make to use the I/O defined here. + * There is no fallback to internal read/seek here. + * Note: As it would be troublesome to mess with this while having a file open, + * this mpg123_close() is implied here. + * \param r_read The callback for reading (behaviour like posix read). + * \param r_lseek The callback for seeking (like posix lseek). + * \param cleanup A callback to clean up an I/O handle on mpg123_close, can be NULL for none (you take care of cleaning your handles). */ +EXPORT int mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*)); + +/* @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/config/linux/ia32/config.h b/node_modules/lame/deps/mpg123/config/linux/ia32/config.h new file mode 100644 index 0000000..7732b08 --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/linux/ia32/config.h @@ -0,0 +1,429 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +#define ABI_ALIGN_FUN 1 + +/* Define to use proper rounding. */ +/* #undef ACCURATE_ROUNDING */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +/* #undef ASMALIGN_EXP */ + +/* Define if __attribute__((aligned(16))) shall be used */ +#define CCALIGN 1 + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "oss" + +/* Define if building with dynamcally linked libmpg123 */ +/* #undef DYNAMIC_BUILD */ + +/* Define if FIFO support is enabled. */ +#define FIFO 1 + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the <alc.h> header file. */ +/* #undef HAVE_ALC_H */ + +/* Define to 1 if you have the <Alib.h> header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the <AL/alc.h> header file. */ +/* #undef HAVE_AL_ALC_H */ + +/* Define to 1 if you have the <AL/al.h> header file. */ +/* #undef HAVE_AL_AL_H */ + +/* Define to 1 if you have the <al.h> header file. */ +/* #undef HAVE_AL_H */ + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <asm/audioio.h> header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the <audios.h> header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */ +/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + +/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */ +/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + +/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have the <CUlib.h> header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <langinfo.h> header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +/* #undef HAVE_LIBMX */ + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the <linux/soundcard.h> header file. */ +#define HAVE_LINUX_SOUNDCARD_H 1 + +/* Define to 1 if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if libltdl is available */ +/* #undef HAVE_LTDL */ + +/* Define to 1 if you have the <machine/soundcard.h> header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the <OpenAL/alc.h> header file. */ +/* #undef HAVE_OPENAL_ALC_H */ + +/* Define to 1 if you have the <OpenAL/al.h> header file. */ +/* #undef HAVE_OPENAL_AL_H */ + +/* Define to 1 if you have the <os2me.h> header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the <os2.h> header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the <sched.h> header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#define HAVE_SCHED_SETSCHEDULER 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#define HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the `setuid' function. */ +#define HAVE_SETUID 1 + +/* Define to 1 if you have the <signal.h> header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the <sndio.h> header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sun/audioio.h> header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audioio.h> header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audio.h> header file. */ +/* #undef HAVE_SYS_AUDIO_H */ + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the <sys/signal.h> header file. */ +#define HAVE_SYS_SIGNAL_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/soundcard.h> header file. */ +#define HAVE_SYS_SOUNDCARD_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define this if you have the POSIX termios library */ +#define HAVE_TERMIOS 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the <windows.h> header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the <ws2tcpip.h> header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to indicate that float storage follows IEEE754. */ +#define IEEE_FLOAT 1 + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define this to the size of long type in bits, used for LFS small/native + alias functions. */ +#define LFS_ALIAS_BITS 32 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* The suffix for module files. */ +#define MODULE_FILE_SUFFIX ".la" + +/* Define if network support is enabled. */ +#define NETWORK 1 + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit and 24 bit integer output. */ +/* #undef NO_32BIT */ + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +/* #undef NO_REAL */ + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.14.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.14.4" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if modules are enabled */ +/* #undef USE_MODULES */ + +/* Version number of package */ +#define VERSION "1.14.4" + +/* Define to use Win32 named pipes */ +/* #undef WANT_WIN32_FIFO */ + +/* Define to use Win32 sockets */ +/* #undef WANT_WIN32_SOCKETS */ + +/* Define to use Unicode for Windows */ +/* #undef WANT_WIN32_UNICODE */ + +/* WinXP and above for ipv6 */ +/* #undef WINVER */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#define _FILE_OFFSET_BITS 64 + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* WinXP and above for ipv6 */ +/* #undef _WIN32_WINNT */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if <sys/types.h> does not define. */ +/* #undef int16_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef int32_t */ + +/* Define to `long int' if <sys/types.h> does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef size_t */ + +/* Define to `long' if <sys/types.h> does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if <sys/types.h> does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* #undef uint32_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef uintptr_t */ diff --git a/node_modules/lame/deps/mpg123/config/linux/ia32/mpg123.h b/node_modules/lame/deps/mpg123/config/linux/ia32/mpg123.h new file mode 100644 index 0000000..421288a --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/linux/ia32/mpg123.h @@ -0,0 +1,1075 @@ +/* + libmpg123: MPEG Audio Decoder library (version 1.14.4) + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#ifndef MPG123_LIB_H +#define MPG123_LIB_H + +/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ + +/* A macro to check at compile time which set of API functions to expect. + This should be incremented at least each time a new symbol is added to the header. */ +#define MPG123_API_VERSION 36 + +/* These aren't actually in use... seems to work without using libtool. */ +#ifdef BUILD_MPG123_DLL +/* The dll exports. */ +#define EXPORT __declspec(dllexport) +#else +#ifdef LINK_MPG123_DLL +/* The exe imports. */ +#define EXPORT __declspec(dllimport) +#else +/* Nothing on normal/UNIX builds */ +#define EXPORT +#endif +#endif + +#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */ +#include <stdlib.h> +#include <sys/types.h> + +/* Simplified large file handling. + I used to have a check here that prevents building for a library with conflicting large file setup + (application that uses 32 bit offsets with library that uses 64 bits). + While that was perfectly fine in an environment where there is one incarnation of the library, + it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the + correct header matching the 32 bit library (where large files need explicit support) or + the 64 bit library (where there is no distinction). + + New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support, + and thus functions with added suffix (mpg123_open_64). + Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when + building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now. + Link failure is not the expected outcome of any half-sane usage anymore. + + More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names. +*/ + +/* + Now, the renaming of large file aware functions. + By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +*/ +#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) + +/* Need some trickery to concatenate the value(s) of the given macro(s). */ +#define MPG123_MACROCAT_REALLY(a, b) a ## b +#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b) +#ifndef MPG123_LARGESUFFIX +#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS) +#endif +#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX) + +#define mpg123_open MPG123_LARGENAME(mpg123_open) +#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd) +#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle) +#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode) +#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame) +#define mpg123_tell MPG123_LARGENAME(mpg123_tell) +#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe) +#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream) +#define mpg123_seek MPG123_LARGENAME(mpg123_seek) +#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek) +#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame) +#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe) +#define mpg123_index MPG123_LARGENAME(mpg123_index) +#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) +#define mpg123_position MPG123_LARGENAME(mpg123_position) +#define mpg123_length MPG123_LARGENAME(mpg123_length) +#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) +#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) +#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) +#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos) + +#endif /* largefile hackery */ + +#endif /* MPG123_NO_CONFIGURE */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \defgroup mpg123_init mpg123 library and handle setup + * + * Functions to initialise and shutdown the mpg123 library and handles. + * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) + * Tip: Use a RVA setting... + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder handle. */ +struct mpg123_handle_struct; + +/** Opaque structure for the libmpg123 decoder handle. + * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner. + */ +typedef struct mpg123_handle_struct mpg123_handle; + +/** Function to initialise the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + * + * \return MPG123_OK if successful, otherwise an error number. + */ +EXPORT int mpg123_init(void); + +/** Function to close down the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */ +EXPORT void mpg123_exit(void); + +/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()). + * and optional retrieval of an error code to feed to mpg123_plain_strerror(). + * Optional means: Any of or both the parameters may be NULL. + * + * \return Non-NULL pointer when successful. + */ +EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error); + +/** Delete handle, mh is either a valid mpg123 handle or NULL. */ +EXPORT void mpg123_delete(mpg123_handle *mh); + +/** Enumeration of the parameters types that it is possible to set/get. */ +enum mpg123_parms +{ + MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ + MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ + MPG123_ADD_FLAGS, /**< add some flags (integer) */ + MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */ + MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */ + MPG123_RVA, /**< one of the RVA choices above (integer) */ + MPG123_DOWNSPEED, /**< play a frame N times (integer) */ + MPG123_UPSPEED, /**< play every Nth frame (integer) */ + MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */ + MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */ + MPG123_ICY_INTERVAL, /**< stream contains ICY metadata with this interval (integer) */ + MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ + MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */ + MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ + MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */ + MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */ + ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/ + ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */ + ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */ +}; + +/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */ +enum mpg123_param_flags +{ + MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ + ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */ + ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */ + ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */ + ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */ + ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */ + ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */ + ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ + ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */ + ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ + ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */ + ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */ + ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */ + ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */ + ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */ + ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */ + ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */ +}; + +/** choices for MPG123_RVA */ +enum mpg123_param_rva +{ + MPG123_RVA_OFF = 0 /**< RVA disabled (default). */ + ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */ + ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */ + ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */ +}; + +/* TODO: Assess the possibilities and troubles of changing parameters during playback. */ + +/** Set a specific parameter, for a specific mpg123_handle, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_handle. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval); + +/** Feature set available for query with mpg123_feature. */ +enum mpg123_feature_set +{ + MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */ + ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */ + ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */ + ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */ + ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */ + ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */ + ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */ + ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */ + ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */ + ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */ + ,MPG123_FEATURE_PARSE_ICY /**< ICY support */ + ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */ +}; + +/** Query libmpg123 feature, 1 for success, 0 for unimplemented functions. */ +EXPORT int mpg123_feature(const enum mpg123_feature_set key); + +/* @} */ + + +/** \defgroup mpg123_error mpg123 error handling + * + * Functions to get text version of the error numbers and an enumeration + * of the error codes returned by libmpg123. + * + * Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * The positive range of return values is used for "useful" values when appropriate. + * + * @{ + */ + +/** Enumeration of the message and error codes and returned by libmpg123 functions. */ +enum mpg123_errors +{ + MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */ + MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */ + MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */ + MPG123_ERR=-1, /**< Generic Error */ + MPG123_OK=0, /**< Success */ + MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */ + MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */ + MPG123_BAD_RATE, /**< Invalid sample rate specified. */ + MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */ + MPG123_BAD_PARAM, /**< Bad parameter id! */ + MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */ + MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */ + MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */ + MPG123_BAD_DECODER, /**< Invalid decoder choice. */ + MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */ + MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */ + MPG123_BAD_RVA, /**< Invalid RVA mode. */ + MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */ + MPG123_NO_SPACE, /**< Not enough buffer space. */ + MPG123_BAD_TYPES, /**< Incompatible numeric data types. */ + MPG123_BAD_BAND, /**< Bad equalizer band. */ + MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */ + MPG123_ERR_READER, /**< Error reading the stream. */ + MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */ + MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/ + MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */ + MPG123_BAD_FILE, /**< File access error. */ + MPG123_NO_SEEK, /**< Seek not supported by stream. */ + MPG123_NO_READER, /**< No stream opened. */ + MPG123_BAD_PARS, /**< Bad parameter handle. */ + MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */ + MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */ + MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */ + MPG123_NO_8BIT, /**< No 8bit encoding possible. */ + MPG123_BAD_ALIGN, /**< Stack aligmnent error */ + MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */ + MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */ + MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */ + MPG123_BAD_KEY, /**< Bad key value given. */ + MPG123_NO_INDEX, /**< No frame index in this build. */ + MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */ + MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */ + MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */ + ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */ + ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */ + ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */ + ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */ + ,MPG123_INT_OVERFLOW /**< Some integer overflow. */ +}; + +/** Return a string describing that error errcode means. */ +EXPORT const char* mpg123_plain_strerror(int errcode); + +/** Give string describing what error has occured in the context of handle mh. + * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via + * char *errmsg = mpg123_strerror(mh) + * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. */ +EXPORT const char* mpg123_strerror(mpg123_handle *mh); + +/** Return the plain errcode intead of a string. */ +EXPORT int mpg123_errcode(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_decoder mpg123 decoder selection + * + * Functions to list and select the available decoders. + * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). + * + * @{ + */ + +/** Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). */ +EXPORT const char **mpg123_decoders(void); + +/** Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). */ +EXPORT const char **mpg123_supported_decoders(void); + +/** Set the chosen decoder to 'decoder_name' */ +EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name); + +/** Get the currently active decoder engine name. + The active decoder engine can vary depening on output constraints, + mostly non-resampling, integer output is accelerated via 3DNow & Co. but for other modes a fallback engine kicks in. + Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. + \return The decoder name or NULL on error. */ +EXPORT const char* mpg123_current_decoder(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_output mpg123 output audio format + * + * Functions to get and select the format of the decoded audio. + * + * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance. + * + * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including ptimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again). + * + * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness. + * + * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation. + * + * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format. + * + * @{ + */ + +/** An enum over all sample types possibly known to mpg123. + * The values are designed as bit flags to allow bitmasking for encoding families. + * + * Note that (your build of) libmpg123 does not necessarily support all these. + * Usually, you can expect the 8bit encodings and signed 16 bit. + * Also 32bit float will be usual beginning with mpg123-1.7.0 . + * What you should bear in mind is that (SSE, etc) optimized routines may be absent + * for some formats. We do have SSE for 16, 32 bit and float, though. + * 24 bit integer is done via postprocessing of 32 bit output -- just cutting + * the last byte, no rounding, even. If you want better, do it yourself. + * + * All formats are in native byte order. If you need different endinaness, you + * can simply postprocess the output buffers (libmpg123 wouldn't do anything else). + * mpg123_encsize() can be helpful there. + */ +enum mpg123_enc_enum +{ + MPG123_ENC_8 = 0x00f /**< 0000 0000 1111 Some 8 bit integer encoding. */ + ,MPG123_ENC_16 = 0x040 /**< 0000 0100 0000 Some 16 bit integer encoding. */ + ,MPG123_ENC_24 = 0x4000 /**< 0100 0000 0000 0000 Some 24 bit integer encoding. */ + ,MPG123_ENC_32 = 0x100 /**< 0001 0000 0000 Some 32 bit integer encoding. */ + ,MPG123_ENC_SIGNED = 0x080 /**< 0000 1000 0000 Some signed integer encoding. */ + ,MPG123_ENC_FLOAT = 0xe00 /**< 1110 0000 0000 Some float encoding. */ + ,MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) /**< 1101 0000 signed 16 bit */ + ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) /**< 0110 0000 unsigned 16 bit */ + ,MPG123_ENC_UNSIGNED_8 = 0x01 /**< 0000 0001 unsigned 8 bit */ + ,MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) /**< 1000 0010 signed 8 bit */ + ,MPG123_ENC_ULAW_8 = 0x04 /**< 0000 0100 ulaw 8 bit */ + ,MPG123_ENC_ALAW_8 = 0x08 /**< 0000 1000 alaw 8 bit */ + ,MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 /**< 0001 0001 1000 0000 signed 32 bit */ + ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 /**< 0010 0001 0000 0000 unsigned 32 bit */ + ,MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 /**< 0101 0000 1000 0000 signed 24 bit */ + ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 /**< 0110 0000 0000 0000 unsigned 24 bit */ + ,MPG123_ENC_FLOAT_32 = 0x200 /**< 0010 0000 0000 32bit float */ + ,MPG123_ENC_FLOAT_64 = 0x400 /**< 0100 0000 0000 64bit float */ + ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 + | MPG123_ENC_SIGNED_8 | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8 + | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32 + | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24 + | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 ) /**< Any encoding on the list. */ +}; + +/** They can be combined into one number (3) to indicate mono and stereo... */ +enum mpg123_channelcount +{ + MPG123_MONO = 1 + ,MPG123_STEREO = 2 +}; + +/** An array of supported standard sample rates + * These are possible native sample rates of MPEG audio files. + * You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. + * \param list Store a pointer to the sample rates array there. + * \param number Store the number of sample rates there. */ +EXPORT void mpg123_rates(const long **list, size_t *number); + +/** An array of supported audio encodings. + * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED). + * \param list Store a pointer to the encodings array there. + * \param number Store the number of encodings there. */ +EXPORT void mpg123_encodings(const int **list, size_t *number); + +/** Return the size (in bytes) of one mono sample of the named encoding. + * \param encoding The encoding value to analyze. + * \return positive size of encoding in bytes, 0 on invalid encoding. */ +EXPORT int mpg123_encsize(int encoding); + +/** Configure a mpg123 handle to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_format_none(mpg123_handle *mh); + +/** Configure mpg123 handle to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_format_all(mpg123_handle *mh); + +/** Set the audio format support of a mpg123_handle in detail: + * \param mh audio decoder handle + * \param rate The sample rate value (in Hertz). + * \param channels A combination of MPG123_STEREO and MPG123_MONO. + * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here. + * \return MPG123_OK on success, MPG123_ERR if there was an error. */ +EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings); + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_handle. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding); + +/** Get the current output format written to the addresses givenr. */ +EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding); + +/*@}*/ + + +/** \defgroup mpg123_input mpg123 file input and decoding + * + * Functions for input bitstream and decoding operations. + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * @{ + */ + +/* reading samples / triggering decoding, possible return values: */ +/** Enumeration of the error codes returned by libmpg123 functions. */ + +/** Open and prepare to decode the specified file by filesystem path. + * This does not open HTTP urls; libmpg123 contains no networking code. + * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed(). + */ +EXPORT int mpg123_open(mpg123_handle *mh, const char *path); + +/** Use an already opened file descriptor as the bitstream input + * mpg123_close() will _not_ close the file descriptor. + */ +EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_replace_reader_handle()! + * mpg123_close() will call the cleanup callback for your handle (if you gave one). + */ +EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); + +/** Open a new bitstream and prepare for direct feeding + * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. + */ +EXPORT int mpg123_open_feed(mpg123_handle *mh); + +/** Closes the source, if libmpg123 opened it. */ +EXPORT int mpg123_close(mpg123_handle *mh); + +/** Read from stream and decode up to outmemsize bytes. + * \param outmemory address of output buffer to write to + * \param outmemsize maximum number of bytes to write + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out for MPG123_DONE and friends!) */ +EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Feed data for a stream that has been opened with mpg123_open_feed(). + * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples. + * \param in input buffer + * \param size number of input bytes + * \return error/message code. */ +EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size); + +/** Decode MPEG Audio from inmemory to outmemory. + * This is very close to a drop-in replacement for old mpglib. + * When you give zero-sized output buffer the input will be parsed until + * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) + * without taking decoded data. + * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-). + * You can actually always decide if you want those specialized functions in separate steps or one call this one here. + * \param inmemory input buffer + * \param inmemsize number of input bytes + * \param outmemory output buffer + * \param outmemsize maximum number of output bytes + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out especially for MPG123_NEED_MORE) + */ +EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Decode next MPEG frame to internal buffer + * or read a frame and return after setting a new format. + * \param num current frame offset gets stored there + * \param audio This pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Decode current MPEG frame to internal buffer. + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + * \param num last frame offset gets stored there + * \param audio this pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Find, read and parse the next mp3 frame + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + */ +EXPORT int mpg123_framebyframe_next(mpg123_handle *mh); + +/** Get access to the raw input data for the last parsed frame. + * This gives you a direct look (and write access) to the frame body data. + * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()). + * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present. + * You can provide NULL for a parameter pointer when you are not interested in the value. + * + * \param header the 4-byte MPEG header + * \param bodydata pointer to the frame body stored in the handle (without the header) + * \param bodybytes size of frame body in bytes (without the header) + * \return MPG123_OK if there was a yet un-decoded frame to get the data from, MPG123_ERR otherwise (without further explanation, the error state of the mpg123_handle is not modified by this function). + */ +EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes); + +/** Get the input position (byte offset in stream) of the last parsed frame. + * This can be used for external seek index building, for example. + * It just returns the internally stored offset, regardless of validity -- you ensure that a valid frame has been parsed before! */ +EXPORT off_t mpg123_framepos(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_seek mpg123 position and seeking + * + * Functions querying and manipulating position in the decoded audio bitstream. + * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. + * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) + * The general usage is modelled after stdlib's ftell() and fseek(). + * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: + * - SEEK_SET: set position to (or near to) specified offset + * - SEEK_CUR: change position by offset from now + * - SEEK_END: set position to offset from end + * + * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. + * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! + * Short: When you care about the sample position, don't mess with those parameters;-) + * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). + * + * @{ + */ + +/** Returns the current position in samples. + * On the next read, you'd get that sample. */ +EXPORT off_t mpg123_tell(mpg123_handle *mh); + +/** Returns the frame number that the next read will give you data from. */ +EXPORT off_t mpg123_tellframe(mpg123_handle *mh); + +/** Returns the current byte offset in the input stream. */ +EXPORT off_t mpg123_tell_stream(mpg123_handle *mh); + +/** Seek to a desired sample offset. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); + +/** Seek to a desired sample offset in data feeding mode. + * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. + * \param input_offset The position it expects to be at the + * next time data is fed to mpg123_decode(). + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); + +/** Seek to a desired MPEG frame index. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); + +/** Return a MPEG frame offset corresponding to an offset in seconds. + * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. + * \return frame offset >= 0 or error/message code */ +EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec); + +/** Give access to the frame index table that is managed for seeking. + * You are asked not to modify the values... Use mpg123_set_index to set the + * seek index + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill); + +/** Set the frame index table + * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets + * to NULL and fill to 0 will clear the index and free the allocated memory used by the index. + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); + +/** Get information about current and remaining frames/seconds. + * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + * You provide an offset (in frames) from now and a number of output bytes + * served by libmpg123 but not yet played. You get the projected current frame + * and seconds, as well as the remaining frames/seconds. This does _not_ care + * about skipped samples due to gapless playback. */ +EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); + +/*@}*/ + + +/** \defgroup mpg123_voleq mpg123 volume and equalizer + * + * @{ + */ + +enum mpg123_channels +{ + MPG123_LEFT=0x1 /**< The Left Channel. */ + ,MPG123_RIGHT=0x2 /**< The Right Channel. */ + ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */ +}; + +/** Set the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. + * \param band The equaliser band to change (from 0 to 31) + * \param val The (linear) adjustment factor. */ +EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val); + +/** Get the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. + * \param band The equaliser band to change (from 0 to 31) + * \return The (linear) adjustment factor. */ +EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band); + +/** Reset the 32 Band Audio Equalizer settings to flat */ +EXPORT int mpg123_reset_eq(mpg123_handle *mh); + +/** Set the absolute output volume including the RVA setting, + * vol<0 just applies (a possibly changed) RVA setting. */ +EXPORT int mpg123_volume(mpg123_handle *mh, double vol); + +/** Adjust output volume including the RVA setting by chosen amount */ +EXPORT int mpg123_volume_change(mpg123_handle *mh, double change); + +/** Return current volume setting, the actual value due to RVA, and the RVA + * adjustment itself. It's all as double float value to abstract the sample + * format. The volume values are linear factors / amplitudes (not percent) + * and the RVA value is in decibels. */ +EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db); + +/* TODO: Set some preamp in addition / to replace internal RVA handling? */ + +/*@}*/ + + +/** \defgroup mpg123_status mpg123 status and information + * + * @{ + */ + +/** Enumeration of the mode types of Variable Bitrate */ +enum mpg123_vbr { + MPG123_CBR=0, /**< Constant Bitrate Mode (default) */ + MPG123_VBR, /**< Variable Bitrate Mode */ + MPG123_ABR /**< Average Bitrate Mode */ +}; + +/** Enumeration of the MPEG Versions */ +enum mpg123_version { + MPG123_1_0=0, /**< MPEG Version 1.0 */ + MPG123_2_0, /**< MPEG Version 2.0 */ + MPG123_2_5 /**< MPEG Version 2.5 */ +}; + + +/** Enumeration of the MPEG Audio mode. + * Only the mono mode has 1 channel, the others have 2 channels. */ +enum mpg123_mode { + MPG123_M_STEREO=0, /**< Standard Stereo. */ + MPG123_M_JOINT, /**< Joint Stereo. */ + MPG123_M_DUAL, /**< Dual Channel. */ + MPG123_M_MONO /**< Single Channel. */ +}; + + +/** Enumeration of the MPEG Audio flag bits */ +enum mpg123_flags { + MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */ + MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */ + MPG123_PRIVATE=0x4, /**< The private bit has been set. */ + MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */ +}; + +/** Data structure for storing information about a frame of MPEG Audio */ +struct mpg123_frameinfo +{ + enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */ + int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */ + long rate; /**< The sampling rate in Hz. */ + enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */ + int mode_ext; /**< The mode extension bit flag. */ + int framesize; /**< The size of the frame (in bytes, including header). */ + enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */ + int emphasis; /**< The emphasis type. */ + int bitrate; /**< Bitrate of the frame (kbps). */ + int abr_rate; /**< The target average bitrate. */ + enum mpg123_vbr vbr; /**< The VBR mode. */ +}; + +/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. */ +EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); + +/** Get the safe output buffer size for all cases (when you want to replace the internal buffer) */ +EXPORT size_t mpg123_safe_buffer(void); + +/** Make a full parsing scan of each frame in the file. ID3 tags are found. An accurate length + * value is stored. Seek index will be filled. A seek back to current position + * is performed. At all, this function refuses work when stream is + * not seekable. + * \return MPG123_OK or MPG123_ERR. + */ +EXPORT int mpg123_scan(mpg123_handle *mh); + +/** Return, if possible, the full (expected) length of current track in samples. + * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ +EXPORT off_t mpg123_length(mpg123_handle *mh); + +/** Override the value for file size in bytes. + * Useful for getting sensible track length values in feed mode or for HTTP streams. + * \return MPG123_OK or MPG123_ERR */ +EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size); + +/** Returns the time (seconds) per frame; <0 is error. */ +EXPORT double mpg123_tpf(mpg123_handle *mh); + +/** Returns the samples per frame for the most recently parsed frame; <0 is error. */ +EXPORT int mpg123_spf(mpg123_handle *mh); + +/** Get and reset the clip count. */ +EXPORT long mpg123_clip(mpg123_handle *mh); + + +/** The key values for state information from mpg123_getstate(). */ +enum mpg123_state +{ + MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true) */ + ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */ + ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files (the leading one featuring gapless info). */ +}; + +/** Get various current decoder/stream state information. + * \param key the key to identify the information to give. + * \param val the address to return (long) integer values to + * \param fval the address to return floating point values to + * \return MPG123_OK or MPG123_ERR for success + */ +EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval); + +/*@}*/ + + +/** \defgroup mpg123_metadata mpg123 metadata handling + * + * Functions to retrieve the metadata from MPEG Audio files and streams. + * Also includes string handling functions. + * + * @{ + */ + +/** Data structure for storing strings in a safer way than a standard C-String. + * Can also hold a number of null-terminated strings. */ +typedef struct +{ + char* p; /**< pointer to the string data */ + size_t size; /**< raw number of bytes allocated */ + size_t fill; /**< number of used bytes (including closing zero byte) */ +} mpg123_string; + +/** Create and allocate memory for a new mpg123_string */ +EXPORT void mpg123_init_string(mpg123_string* sb); + +/** Free-up mempory for an existing mpg123_string */ +EXPORT void mpg123_free_string(mpg123_string* sb); + +/** Change the size of a mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news); + +/** Increase size of a mpg123_string if necessary (it may stay larger). + * Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). + * That way, you can preallocate memory and safely work afterwards with pieces. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news); + +/** Copy the contents of one mpg123_string string to another. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to); + +/** Append a C-String to an mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff); + +/** Append a C-substring to an mpg123 string + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Set the conents of a mpg123_string to a C-string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff); + +/** Set the contents of a mpg123_string to a C-substring + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters). + * \return character count + * \param sb the string + * \param utf8 a flag to tell if the string is in utf8 encoding + * Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. +*/ +EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8); + +/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */ +enum mpg123_text_encoding +{ + mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */ + ,mpg123_text_utf8 = 1 /**< UTF-8 */ + ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */ + ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */ + ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */ + ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. + * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when + * you don't mess with the reserved code points. If you want to decode little endian data + * without BOM you need to prepend 0xff 0xfe yourself. */ + ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */ + ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, + * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 + * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 + * types (we expect a BOM before real data there), not so for utf16be!*/ + ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */ +}; + +/** The encoding byte values from ID3v2. */ +enum mpg123_id3_enc +{ + mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */ + ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */ + ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */ + ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */ + ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */ +}; + +/** Convert ID3 encoding byte to mpg123 encoding index. */ +EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte); + +/** Store text data in string, after converting to UTF-8 from indicated encoding + * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb) + * \param sb target string + * \param enc mpg123 text encoding value + * \param source source buffer with plain unsigned bytes (you might need to cast from char *) + * \param source_size number of bytes in the source buffer + * + * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). + * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). + */ +EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size); + +/** Sub data structure for ID3v2, for storing various text fields (including comments). + * This is for ID3v2 COMM, TXXX and all the other text fields. + * Only COMM and TXXX have a description, only COMM and USLT have a language. + * You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */ +typedef struct +{ + char lang[3]; /**< Three-letter language code (not terminated). */ + char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */ + mpg123_string description; /**< Empty for the generic comment... */ + mpg123_string text; /**< ... */ +} mpg123_text; + +/** Data structure for storing IDV3v2 tags. + * This structure is not a direct binary mapping with the file contents. + * The ID3v2 text frames are allowed to contain multiple strings. + * So check for null bytes until you reach the mpg123_string fill. + * All text is encoded in UTF-8. */ +typedef struct +{ + unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */ + mpg123_string *title; /**< Title string (pointer into text_list). */ + mpg123_string *artist; /**< Artist string (pointer into text_list). */ + mpg123_string *album; /**< Album string (pointer into text_list). */ + mpg123_string *year; /**< The year as a string (pointer into text_list). */ + mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */ + mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */ + /* Encountered ID3v2 fields are appended to these lists. + There can be multiple occurences, the pointers above always point to the last encountered data. */ + mpg123_text *comment_list; /**< Array of comments. */ + size_t comments; /**< Number of comments. */ + mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */ + size_t texts; /**< Numer of text fields. */ + mpg123_text *extra; /**< The array of extra (TXXX) fields. */ + size_t extras; /**< Number of extra text (TXXX) fields. */ +} mpg123_id3v2; + +/** Data structure for ID3v1 tags (the last 128 bytes of a file). + * Don't take anything for granted (like string termination)! + * Also note the change ID3v1.1 did: comment[28] = 0; comment[19] = track_number + * It is your task to support ID3v1 only or ID3v1.1 ...*/ +typedef struct +{ + char tag[3]; /**< Always the string "TAG", the classic intro. */ + char title[30]; /**< Title string. */ + char artist[30]; /**< Artist string. */ + char album[30]; /**< Album string. */ + char year[4]; /**< Year string. */ + char comment[30]; /**< Comment string. */ + unsigned char genre; /**< Genre index. */ +} mpg123_id3v1; + +#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ +#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ +#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ +#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ + +/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future). + The check function returns a combination of flags. */ +EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */ + +/** Clean up meta data storage (ID3v2 and ICY), freeing memory. */ +EXPORT void mpg123_meta_free(mpg123_handle *mh); + +/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call. + * v1 and/or v2 can be set to NULL when there is no corresponding data. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2); + +/** Point icy_meta to existing data structure wich may change on any next read/decode function call. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */ + +/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. + * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) . + * \param icy_text The input data in ICY encoding + * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */ +EXPORT char* mpg123_icy2utf8(const char* icy_text); + + +/* @} */ + + +/** \defgroup mpg123_advpar mpg123 advanced parameter API + * + * Direct access to a parameter set without full handle around it. + * Possible uses: + * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). + * - Use one set of parameters for multiple handles. + * + * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() + * family) directly return a fully qualified mpg123 error code, the ones + * operating on full handles normally MPG123_OK or MPG123_ERR, storing the + * specific error code itseld inside the handle. + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder parameters. */ +struct mpg123_pars_struct; + +/** Opaque structure for the libmpg123 decoder parameters. */ +typedef struct mpg123_pars_struct mpg123_pars; + +/** Create a handle with preset parameters. */ +EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error); + +/** Allocate memory for and return a pointer to a new mpg123_pars */ +EXPORT mpg123_pars *mpg123_new_pars(int *error); + +/** Delete and free up memory used by a mpg123_pars data structure */ +EXPORT void mpg123_delete_pars(mpg123_pars* mp); + +/** Configure mpg123 parameters to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_fmt_none(mpg123_pars *mp); + +/** Configure mpg123 parameters to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_fmt_all(mpg123_pars *mp); + +/** Set the audio format support of a mpg123_pars in detail: + \param rate The sample rate value (in Hertz). + \param channels A combination of MPG123_STEREO and MPG123_MONO. + \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no support). + \return 0 on success, -1 if there was an error. / +*/ +EXPORT int mpg123_fmt(mpg123_pars *mh, long rate, int channels, int encodings); /* 0 is good, -1 is error */ + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_pars. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_fmt_support(mpg123_pars *mh, long rate, int encoding); + +/** Set a specific parameter, for a specific mpg123_pars, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_pars. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval); + +/* @} */ + + +/** \defgroup mpg123_lowio mpg123 low level I/O + * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... + * + * @{ */ + +/** Replace default internal buffer with user-supplied buffer. + * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. */ +EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size); + +/** The max size of one frame's decoded output with current settings. + * Use that to determine an appropriate minimum buffer size for decoding one frame. */ +EXPORT size_t mpg123_outblock(mpg123_handle *mh); + +/** Replace low-level stream access functions; read and lseek as known in POSIX. + * You can use this to make any fancy file opening/closing yourself, + * using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a "real" file descriptor...). + * Setting a function to NULL means that the default internal read is + * used (active from next mpg123_open call on). + * Note: As it would be troublesome to mess with this while having a file open, + * this implies mpg123_close(). */ +EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int)); + +/** Replace I/O functions with your own ones operating on some kind of handle instead of integer descriptors. + * The handle is a void pointer, so you can pass any data you want... + * mpg123_open_handle() is the call you make to use the I/O defined here. + * There is no fallback to internal read/seek here. + * Note: As it would be troublesome to mess with this while having a file open, + * this mpg123_close() is implied here. + * \param r_read The callback for reading (behaviour like posix read). + * \param r_lseek The callback for seeking (like posix lseek). + * \param cleanup A callback to clean up an I/O handle on mpg123_close, can be NULL for none (you take care of cleaning your handles). */ +EXPORT int mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*)); + +/* @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/config/linux/x64/config.h b/node_modules/lame/deps/mpg123/config/linux/x64/config.h new file mode 100644 index 0000000..95878c4 --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/linux/x64/config.h @@ -0,0 +1,429 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +/* #undef ABI_ALIGN_FUN */ + +/* Define to use proper rounding. */ +/* #undef ACCURATE_ROUNDING */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +/* #undef ASMALIGN_EXP */ + +/* Define if __attribute__((aligned(16))) shall be used */ +#define CCALIGN 1 + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "oss" + +/* Define if building with dynamcally linked libmpg123 */ +/* #undef DYNAMIC_BUILD */ + +/* Define if FIFO support is enabled. */ +/* #undef FIFO */ + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the <alc.h> header file. */ +/* #undef HAVE_ALC_H */ + +/* Define to 1 if you have the <Alib.h> header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the <AL/alc.h> header file. */ +/* #undef HAVE_AL_ALC_H */ + +/* Define to 1 if you have the <AL/al.h> header file. */ +/* #undef HAVE_AL_AL_H */ + +/* Define to 1 if you have the <al.h> header file. */ +/* #undef HAVE_AL_H */ + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <asm/audioio.h> header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the <audios.h> header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */ +/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + +/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */ +/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + +/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have the <CUlib.h> header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <langinfo.h> header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +/* #undef HAVE_LIBMX */ + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the <linux/soundcard.h> header file. */ +#define HAVE_LINUX_SOUNDCARD_H 1 + +/* Define to 1 if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if libltdl is available */ +/* #undef HAVE_LTDL */ + +/* Define to 1 if you have the <machine/soundcard.h> header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the <OpenAL/alc.h> header file. */ +/* #undef HAVE_OPENAL_ALC_H */ + +/* Define to 1 if you have the <OpenAL/al.h> header file. */ +/* #undef HAVE_OPENAL_AL_H */ + +/* Define to 1 if you have the <os2me.h> header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the <os2.h> header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the <sched.h> header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#define HAVE_SCHED_SETSCHEDULER 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#define HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the `setuid' function. */ +#define HAVE_SETUID 1 + +/* Define to 1 if you have the <signal.h> header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the <sndio.h> header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sun/audioio.h> header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audioio.h> header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audio.h> header file. */ +/* #undef HAVE_SYS_AUDIO_H */ + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the <sys/signal.h> header file. */ +#define HAVE_SYS_SIGNAL_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/soundcard.h> header file. */ +#define HAVE_SYS_SOUNDCARD_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define this if you have the POSIX termios library */ +#define HAVE_TERMIOS 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the <windows.h> header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the <ws2tcpip.h> header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to indicate that float storage follows IEEE754. */ +#define IEEE_FLOAT 1 + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define this to the size of long type in bits, used for LFS small/native + alias functions. */ +#define LFS_ALIAS_BITS 64 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* The suffix for module files. */ +#define MODULE_FILE_SUFFIX ".la" + +/* Define if network support is enabled. */ +#define NETWORK 1 + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit and 24 bit integer output. */ +/* #undef NO_32BIT */ + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +/* #undef NO_REAL */ + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.14.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.14.4" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if modules are enabled */ +/* #undef USE_MODULES */ + +/* Version number of package */ +#define VERSION "1.14.4" + +/* Define to use Win32 named pipes */ +/* #undef WANT_WIN32_FIFO */ + +/* Define to use Win32 sockets */ +/* #undef WANT_WIN32_SOCKETS */ + +/* Define to use Unicode for Windows */ +/* #undef WANT_WIN32_UNICODE */ + +/* WinXP and above for ipv6 */ +/* #undef WINVER */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* WinXP and above for ipv6 */ +/* #undef _WIN32_WINNT */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if <sys/types.h> does not define. */ +/* #undef int16_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef int32_t */ + +/* Define to `long int' if <sys/types.h> does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef size_t */ + +/* Define to `long' if <sys/types.h> does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if <sys/types.h> does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* #undef uint32_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef uintptr_t */ diff --git a/node_modules/lame/deps/mpg123/config/linux/x64/mpg123.h b/node_modules/lame/deps/mpg123/config/linux/x64/mpg123.h new file mode 100644 index 0000000..421288a --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/linux/x64/mpg123.h @@ -0,0 +1,1075 @@ +/* + libmpg123: MPEG Audio Decoder library (version 1.14.4) + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#ifndef MPG123_LIB_H +#define MPG123_LIB_H + +/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ + +/* A macro to check at compile time which set of API functions to expect. + This should be incremented at least each time a new symbol is added to the header. */ +#define MPG123_API_VERSION 36 + +/* These aren't actually in use... seems to work without using libtool. */ +#ifdef BUILD_MPG123_DLL +/* The dll exports. */ +#define EXPORT __declspec(dllexport) +#else +#ifdef LINK_MPG123_DLL +/* The exe imports. */ +#define EXPORT __declspec(dllimport) +#else +/* Nothing on normal/UNIX builds */ +#define EXPORT +#endif +#endif + +#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */ +#include <stdlib.h> +#include <sys/types.h> + +/* Simplified large file handling. + I used to have a check here that prevents building for a library with conflicting large file setup + (application that uses 32 bit offsets with library that uses 64 bits). + While that was perfectly fine in an environment where there is one incarnation of the library, + it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the + correct header matching the 32 bit library (where large files need explicit support) or + the 64 bit library (where there is no distinction). + + New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support, + and thus functions with added suffix (mpg123_open_64). + Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when + building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now. + Link failure is not the expected outcome of any half-sane usage anymore. + + More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names. +*/ + +/* + Now, the renaming of large file aware functions. + By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +*/ +#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) + +/* Need some trickery to concatenate the value(s) of the given macro(s). */ +#define MPG123_MACROCAT_REALLY(a, b) a ## b +#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b) +#ifndef MPG123_LARGESUFFIX +#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS) +#endif +#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX) + +#define mpg123_open MPG123_LARGENAME(mpg123_open) +#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd) +#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle) +#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode) +#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame) +#define mpg123_tell MPG123_LARGENAME(mpg123_tell) +#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe) +#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream) +#define mpg123_seek MPG123_LARGENAME(mpg123_seek) +#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek) +#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame) +#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe) +#define mpg123_index MPG123_LARGENAME(mpg123_index) +#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) +#define mpg123_position MPG123_LARGENAME(mpg123_position) +#define mpg123_length MPG123_LARGENAME(mpg123_length) +#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) +#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) +#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) +#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos) + +#endif /* largefile hackery */ + +#endif /* MPG123_NO_CONFIGURE */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \defgroup mpg123_init mpg123 library and handle setup + * + * Functions to initialise and shutdown the mpg123 library and handles. + * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) + * Tip: Use a RVA setting... + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder handle. */ +struct mpg123_handle_struct; + +/** Opaque structure for the libmpg123 decoder handle. + * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner. + */ +typedef struct mpg123_handle_struct mpg123_handle; + +/** Function to initialise the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + * + * \return MPG123_OK if successful, otherwise an error number. + */ +EXPORT int mpg123_init(void); + +/** Function to close down the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */ +EXPORT void mpg123_exit(void); + +/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()). + * and optional retrieval of an error code to feed to mpg123_plain_strerror(). + * Optional means: Any of or both the parameters may be NULL. + * + * \return Non-NULL pointer when successful. + */ +EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error); + +/** Delete handle, mh is either a valid mpg123 handle or NULL. */ +EXPORT void mpg123_delete(mpg123_handle *mh); + +/** Enumeration of the parameters types that it is possible to set/get. */ +enum mpg123_parms +{ + MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ + MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ + MPG123_ADD_FLAGS, /**< add some flags (integer) */ + MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */ + MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */ + MPG123_RVA, /**< one of the RVA choices above (integer) */ + MPG123_DOWNSPEED, /**< play a frame N times (integer) */ + MPG123_UPSPEED, /**< play every Nth frame (integer) */ + MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */ + MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */ + MPG123_ICY_INTERVAL, /**< stream contains ICY metadata with this interval (integer) */ + MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ + MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */ + MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ + MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */ + MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */ + ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/ + ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */ + ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */ +}; + +/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */ +enum mpg123_param_flags +{ + MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ + ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */ + ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */ + ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */ + ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */ + ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */ + ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */ + ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ + ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */ + ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ + ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */ + ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */ + ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */ + ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */ + ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */ + ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */ + ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */ +}; + +/** choices for MPG123_RVA */ +enum mpg123_param_rva +{ + MPG123_RVA_OFF = 0 /**< RVA disabled (default). */ + ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */ + ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */ + ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */ +}; + +/* TODO: Assess the possibilities and troubles of changing parameters during playback. */ + +/** Set a specific parameter, for a specific mpg123_handle, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_handle. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval); + +/** Feature set available for query with mpg123_feature. */ +enum mpg123_feature_set +{ + MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */ + ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */ + ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */ + ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */ + ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */ + ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */ + ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */ + ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */ + ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */ + ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */ + ,MPG123_FEATURE_PARSE_ICY /**< ICY support */ + ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */ +}; + +/** Query libmpg123 feature, 1 for success, 0 for unimplemented functions. */ +EXPORT int mpg123_feature(const enum mpg123_feature_set key); + +/* @} */ + + +/** \defgroup mpg123_error mpg123 error handling + * + * Functions to get text version of the error numbers and an enumeration + * of the error codes returned by libmpg123. + * + * Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * The positive range of return values is used for "useful" values when appropriate. + * + * @{ + */ + +/** Enumeration of the message and error codes and returned by libmpg123 functions. */ +enum mpg123_errors +{ + MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */ + MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */ + MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */ + MPG123_ERR=-1, /**< Generic Error */ + MPG123_OK=0, /**< Success */ + MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */ + MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */ + MPG123_BAD_RATE, /**< Invalid sample rate specified. */ + MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */ + MPG123_BAD_PARAM, /**< Bad parameter id! */ + MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */ + MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */ + MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */ + MPG123_BAD_DECODER, /**< Invalid decoder choice. */ + MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */ + MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */ + MPG123_BAD_RVA, /**< Invalid RVA mode. */ + MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */ + MPG123_NO_SPACE, /**< Not enough buffer space. */ + MPG123_BAD_TYPES, /**< Incompatible numeric data types. */ + MPG123_BAD_BAND, /**< Bad equalizer band. */ + MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */ + MPG123_ERR_READER, /**< Error reading the stream. */ + MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */ + MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/ + MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */ + MPG123_BAD_FILE, /**< File access error. */ + MPG123_NO_SEEK, /**< Seek not supported by stream. */ + MPG123_NO_READER, /**< No stream opened. */ + MPG123_BAD_PARS, /**< Bad parameter handle. */ + MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */ + MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */ + MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */ + MPG123_NO_8BIT, /**< No 8bit encoding possible. */ + MPG123_BAD_ALIGN, /**< Stack aligmnent error */ + MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */ + MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */ + MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */ + MPG123_BAD_KEY, /**< Bad key value given. */ + MPG123_NO_INDEX, /**< No frame index in this build. */ + MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */ + MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */ + MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */ + ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */ + ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */ + ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */ + ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */ + ,MPG123_INT_OVERFLOW /**< Some integer overflow. */ +}; + +/** Return a string describing that error errcode means. */ +EXPORT const char* mpg123_plain_strerror(int errcode); + +/** Give string describing what error has occured in the context of handle mh. + * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via + * char *errmsg = mpg123_strerror(mh) + * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. */ +EXPORT const char* mpg123_strerror(mpg123_handle *mh); + +/** Return the plain errcode intead of a string. */ +EXPORT int mpg123_errcode(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_decoder mpg123 decoder selection + * + * Functions to list and select the available decoders. + * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). + * + * @{ + */ + +/** Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). */ +EXPORT const char **mpg123_decoders(void); + +/** Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). */ +EXPORT const char **mpg123_supported_decoders(void); + +/** Set the chosen decoder to 'decoder_name' */ +EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name); + +/** Get the currently active decoder engine name. + The active decoder engine can vary depening on output constraints, + mostly non-resampling, integer output is accelerated via 3DNow & Co. but for other modes a fallback engine kicks in. + Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. + \return The decoder name or NULL on error. */ +EXPORT const char* mpg123_current_decoder(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_output mpg123 output audio format + * + * Functions to get and select the format of the decoded audio. + * + * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance. + * + * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including ptimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again). + * + * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness. + * + * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation. + * + * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format. + * + * @{ + */ + +/** An enum over all sample types possibly known to mpg123. + * The values are designed as bit flags to allow bitmasking for encoding families. + * + * Note that (your build of) libmpg123 does not necessarily support all these. + * Usually, you can expect the 8bit encodings and signed 16 bit. + * Also 32bit float will be usual beginning with mpg123-1.7.0 . + * What you should bear in mind is that (SSE, etc) optimized routines may be absent + * for some formats. We do have SSE for 16, 32 bit and float, though. + * 24 bit integer is done via postprocessing of 32 bit output -- just cutting + * the last byte, no rounding, even. If you want better, do it yourself. + * + * All formats are in native byte order. If you need different endinaness, you + * can simply postprocess the output buffers (libmpg123 wouldn't do anything else). + * mpg123_encsize() can be helpful there. + */ +enum mpg123_enc_enum +{ + MPG123_ENC_8 = 0x00f /**< 0000 0000 1111 Some 8 bit integer encoding. */ + ,MPG123_ENC_16 = 0x040 /**< 0000 0100 0000 Some 16 bit integer encoding. */ + ,MPG123_ENC_24 = 0x4000 /**< 0100 0000 0000 0000 Some 24 bit integer encoding. */ + ,MPG123_ENC_32 = 0x100 /**< 0001 0000 0000 Some 32 bit integer encoding. */ + ,MPG123_ENC_SIGNED = 0x080 /**< 0000 1000 0000 Some signed integer encoding. */ + ,MPG123_ENC_FLOAT = 0xe00 /**< 1110 0000 0000 Some float encoding. */ + ,MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) /**< 1101 0000 signed 16 bit */ + ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) /**< 0110 0000 unsigned 16 bit */ + ,MPG123_ENC_UNSIGNED_8 = 0x01 /**< 0000 0001 unsigned 8 bit */ + ,MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) /**< 1000 0010 signed 8 bit */ + ,MPG123_ENC_ULAW_8 = 0x04 /**< 0000 0100 ulaw 8 bit */ + ,MPG123_ENC_ALAW_8 = 0x08 /**< 0000 1000 alaw 8 bit */ + ,MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 /**< 0001 0001 1000 0000 signed 32 bit */ + ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 /**< 0010 0001 0000 0000 unsigned 32 bit */ + ,MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 /**< 0101 0000 1000 0000 signed 24 bit */ + ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 /**< 0110 0000 0000 0000 unsigned 24 bit */ + ,MPG123_ENC_FLOAT_32 = 0x200 /**< 0010 0000 0000 32bit float */ + ,MPG123_ENC_FLOAT_64 = 0x400 /**< 0100 0000 0000 64bit float */ + ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 + | MPG123_ENC_SIGNED_8 | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8 + | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32 + | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24 + | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 ) /**< Any encoding on the list. */ +}; + +/** They can be combined into one number (3) to indicate mono and stereo... */ +enum mpg123_channelcount +{ + MPG123_MONO = 1 + ,MPG123_STEREO = 2 +}; + +/** An array of supported standard sample rates + * These are possible native sample rates of MPEG audio files. + * You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. + * \param list Store a pointer to the sample rates array there. + * \param number Store the number of sample rates there. */ +EXPORT void mpg123_rates(const long **list, size_t *number); + +/** An array of supported audio encodings. + * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED). + * \param list Store a pointer to the encodings array there. + * \param number Store the number of encodings there. */ +EXPORT void mpg123_encodings(const int **list, size_t *number); + +/** Return the size (in bytes) of one mono sample of the named encoding. + * \param encoding The encoding value to analyze. + * \return positive size of encoding in bytes, 0 on invalid encoding. */ +EXPORT int mpg123_encsize(int encoding); + +/** Configure a mpg123 handle to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_format_none(mpg123_handle *mh); + +/** Configure mpg123 handle to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_format_all(mpg123_handle *mh); + +/** Set the audio format support of a mpg123_handle in detail: + * \param mh audio decoder handle + * \param rate The sample rate value (in Hertz). + * \param channels A combination of MPG123_STEREO and MPG123_MONO. + * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here. + * \return MPG123_OK on success, MPG123_ERR if there was an error. */ +EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings); + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_handle. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding); + +/** Get the current output format written to the addresses givenr. */ +EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding); + +/*@}*/ + + +/** \defgroup mpg123_input mpg123 file input and decoding + * + * Functions for input bitstream and decoding operations. + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * @{ + */ + +/* reading samples / triggering decoding, possible return values: */ +/** Enumeration of the error codes returned by libmpg123 functions. */ + +/** Open and prepare to decode the specified file by filesystem path. + * This does not open HTTP urls; libmpg123 contains no networking code. + * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed(). + */ +EXPORT int mpg123_open(mpg123_handle *mh, const char *path); + +/** Use an already opened file descriptor as the bitstream input + * mpg123_close() will _not_ close the file descriptor. + */ +EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_replace_reader_handle()! + * mpg123_close() will call the cleanup callback for your handle (if you gave one). + */ +EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); + +/** Open a new bitstream and prepare for direct feeding + * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. + */ +EXPORT int mpg123_open_feed(mpg123_handle *mh); + +/** Closes the source, if libmpg123 opened it. */ +EXPORT int mpg123_close(mpg123_handle *mh); + +/** Read from stream and decode up to outmemsize bytes. + * \param outmemory address of output buffer to write to + * \param outmemsize maximum number of bytes to write + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out for MPG123_DONE and friends!) */ +EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Feed data for a stream that has been opened with mpg123_open_feed(). + * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples. + * \param in input buffer + * \param size number of input bytes + * \return error/message code. */ +EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size); + +/** Decode MPEG Audio from inmemory to outmemory. + * This is very close to a drop-in replacement for old mpglib. + * When you give zero-sized output buffer the input will be parsed until + * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) + * without taking decoded data. + * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-). + * You can actually always decide if you want those specialized functions in separate steps or one call this one here. + * \param inmemory input buffer + * \param inmemsize number of input bytes + * \param outmemory output buffer + * \param outmemsize maximum number of output bytes + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out especially for MPG123_NEED_MORE) + */ +EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Decode next MPEG frame to internal buffer + * or read a frame and return after setting a new format. + * \param num current frame offset gets stored there + * \param audio This pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Decode current MPEG frame to internal buffer. + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + * \param num last frame offset gets stored there + * \param audio this pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Find, read and parse the next mp3 frame + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + */ +EXPORT int mpg123_framebyframe_next(mpg123_handle *mh); + +/** Get access to the raw input data for the last parsed frame. + * This gives you a direct look (and write access) to the frame body data. + * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()). + * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present. + * You can provide NULL for a parameter pointer when you are not interested in the value. + * + * \param header the 4-byte MPEG header + * \param bodydata pointer to the frame body stored in the handle (without the header) + * \param bodybytes size of frame body in bytes (without the header) + * \return MPG123_OK if there was a yet un-decoded frame to get the data from, MPG123_ERR otherwise (without further explanation, the error state of the mpg123_handle is not modified by this function). + */ +EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes); + +/** Get the input position (byte offset in stream) of the last parsed frame. + * This can be used for external seek index building, for example. + * It just returns the internally stored offset, regardless of validity -- you ensure that a valid frame has been parsed before! */ +EXPORT off_t mpg123_framepos(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_seek mpg123 position and seeking + * + * Functions querying and manipulating position in the decoded audio bitstream. + * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. + * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) + * The general usage is modelled after stdlib's ftell() and fseek(). + * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: + * - SEEK_SET: set position to (or near to) specified offset + * - SEEK_CUR: change position by offset from now + * - SEEK_END: set position to offset from end + * + * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. + * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! + * Short: When you care about the sample position, don't mess with those parameters;-) + * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). + * + * @{ + */ + +/** Returns the current position in samples. + * On the next read, you'd get that sample. */ +EXPORT off_t mpg123_tell(mpg123_handle *mh); + +/** Returns the frame number that the next read will give you data from. */ +EXPORT off_t mpg123_tellframe(mpg123_handle *mh); + +/** Returns the current byte offset in the input stream. */ +EXPORT off_t mpg123_tell_stream(mpg123_handle *mh); + +/** Seek to a desired sample offset. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); + +/** Seek to a desired sample offset in data feeding mode. + * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. + * \param input_offset The position it expects to be at the + * next time data is fed to mpg123_decode(). + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); + +/** Seek to a desired MPEG frame index. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); + +/** Return a MPEG frame offset corresponding to an offset in seconds. + * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. + * \return frame offset >= 0 or error/message code */ +EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec); + +/** Give access to the frame index table that is managed for seeking. + * You are asked not to modify the values... Use mpg123_set_index to set the + * seek index + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill); + +/** Set the frame index table + * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets + * to NULL and fill to 0 will clear the index and free the allocated memory used by the index. + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); + +/** Get information about current and remaining frames/seconds. + * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + * You provide an offset (in frames) from now and a number of output bytes + * served by libmpg123 but not yet played. You get the projected current frame + * and seconds, as well as the remaining frames/seconds. This does _not_ care + * about skipped samples due to gapless playback. */ +EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); + +/*@}*/ + + +/** \defgroup mpg123_voleq mpg123 volume and equalizer + * + * @{ + */ + +enum mpg123_channels +{ + MPG123_LEFT=0x1 /**< The Left Channel. */ + ,MPG123_RIGHT=0x2 /**< The Right Channel. */ + ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */ +}; + +/** Set the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. + * \param band The equaliser band to change (from 0 to 31) + * \param val The (linear) adjustment factor. */ +EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val); + +/** Get the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. + * \param band The equaliser band to change (from 0 to 31) + * \return The (linear) adjustment factor. */ +EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band); + +/** Reset the 32 Band Audio Equalizer settings to flat */ +EXPORT int mpg123_reset_eq(mpg123_handle *mh); + +/** Set the absolute output volume including the RVA setting, + * vol<0 just applies (a possibly changed) RVA setting. */ +EXPORT int mpg123_volume(mpg123_handle *mh, double vol); + +/** Adjust output volume including the RVA setting by chosen amount */ +EXPORT int mpg123_volume_change(mpg123_handle *mh, double change); + +/** Return current volume setting, the actual value due to RVA, and the RVA + * adjustment itself. It's all as double float value to abstract the sample + * format. The volume values are linear factors / amplitudes (not percent) + * and the RVA value is in decibels. */ +EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db); + +/* TODO: Set some preamp in addition / to replace internal RVA handling? */ + +/*@}*/ + + +/** \defgroup mpg123_status mpg123 status and information + * + * @{ + */ + +/** Enumeration of the mode types of Variable Bitrate */ +enum mpg123_vbr { + MPG123_CBR=0, /**< Constant Bitrate Mode (default) */ + MPG123_VBR, /**< Variable Bitrate Mode */ + MPG123_ABR /**< Average Bitrate Mode */ +}; + +/** Enumeration of the MPEG Versions */ +enum mpg123_version { + MPG123_1_0=0, /**< MPEG Version 1.0 */ + MPG123_2_0, /**< MPEG Version 2.0 */ + MPG123_2_5 /**< MPEG Version 2.5 */ +}; + + +/** Enumeration of the MPEG Audio mode. + * Only the mono mode has 1 channel, the others have 2 channels. */ +enum mpg123_mode { + MPG123_M_STEREO=0, /**< Standard Stereo. */ + MPG123_M_JOINT, /**< Joint Stereo. */ + MPG123_M_DUAL, /**< Dual Channel. */ + MPG123_M_MONO /**< Single Channel. */ +}; + + +/** Enumeration of the MPEG Audio flag bits */ +enum mpg123_flags { + MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */ + MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */ + MPG123_PRIVATE=0x4, /**< The private bit has been set. */ + MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */ +}; + +/** Data structure for storing information about a frame of MPEG Audio */ +struct mpg123_frameinfo +{ + enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */ + int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */ + long rate; /**< The sampling rate in Hz. */ + enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */ + int mode_ext; /**< The mode extension bit flag. */ + int framesize; /**< The size of the frame (in bytes, including header). */ + enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */ + int emphasis; /**< The emphasis type. */ + int bitrate; /**< Bitrate of the frame (kbps). */ + int abr_rate; /**< The target average bitrate. */ + enum mpg123_vbr vbr; /**< The VBR mode. */ +}; + +/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. */ +EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); + +/** Get the safe output buffer size for all cases (when you want to replace the internal buffer) */ +EXPORT size_t mpg123_safe_buffer(void); + +/** Make a full parsing scan of each frame in the file. ID3 tags are found. An accurate length + * value is stored. Seek index will be filled. A seek back to current position + * is performed. At all, this function refuses work when stream is + * not seekable. + * \return MPG123_OK or MPG123_ERR. + */ +EXPORT int mpg123_scan(mpg123_handle *mh); + +/** Return, if possible, the full (expected) length of current track in samples. + * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ +EXPORT off_t mpg123_length(mpg123_handle *mh); + +/** Override the value for file size in bytes. + * Useful for getting sensible track length values in feed mode or for HTTP streams. + * \return MPG123_OK or MPG123_ERR */ +EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size); + +/** Returns the time (seconds) per frame; <0 is error. */ +EXPORT double mpg123_tpf(mpg123_handle *mh); + +/** Returns the samples per frame for the most recently parsed frame; <0 is error. */ +EXPORT int mpg123_spf(mpg123_handle *mh); + +/** Get and reset the clip count. */ +EXPORT long mpg123_clip(mpg123_handle *mh); + + +/** The key values for state information from mpg123_getstate(). */ +enum mpg123_state +{ + MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true) */ + ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */ + ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files (the leading one featuring gapless info). */ +}; + +/** Get various current decoder/stream state information. + * \param key the key to identify the information to give. + * \param val the address to return (long) integer values to + * \param fval the address to return floating point values to + * \return MPG123_OK or MPG123_ERR for success + */ +EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval); + +/*@}*/ + + +/** \defgroup mpg123_metadata mpg123 metadata handling + * + * Functions to retrieve the metadata from MPEG Audio files and streams. + * Also includes string handling functions. + * + * @{ + */ + +/** Data structure for storing strings in a safer way than a standard C-String. + * Can also hold a number of null-terminated strings. */ +typedef struct +{ + char* p; /**< pointer to the string data */ + size_t size; /**< raw number of bytes allocated */ + size_t fill; /**< number of used bytes (including closing zero byte) */ +} mpg123_string; + +/** Create and allocate memory for a new mpg123_string */ +EXPORT void mpg123_init_string(mpg123_string* sb); + +/** Free-up mempory for an existing mpg123_string */ +EXPORT void mpg123_free_string(mpg123_string* sb); + +/** Change the size of a mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news); + +/** Increase size of a mpg123_string if necessary (it may stay larger). + * Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). + * That way, you can preallocate memory and safely work afterwards with pieces. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news); + +/** Copy the contents of one mpg123_string string to another. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to); + +/** Append a C-String to an mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff); + +/** Append a C-substring to an mpg123 string + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Set the conents of a mpg123_string to a C-string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff); + +/** Set the contents of a mpg123_string to a C-substring + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters). + * \return character count + * \param sb the string + * \param utf8 a flag to tell if the string is in utf8 encoding + * Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. +*/ +EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8); + +/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */ +enum mpg123_text_encoding +{ + mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */ + ,mpg123_text_utf8 = 1 /**< UTF-8 */ + ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */ + ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */ + ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */ + ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. + * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when + * you don't mess with the reserved code points. If you want to decode little endian data + * without BOM you need to prepend 0xff 0xfe yourself. */ + ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */ + ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, + * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 + * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 + * types (we expect a BOM before real data there), not so for utf16be!*/ + ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */ +}; + +/** The encoding byte values from ID3v2. */ +enum mpg123_id3_enc +{ + mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */ + ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */ + ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */ + ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */ + ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */ +}; + +/** Convert ID3 encoding byte to mpg123 encoding index. */ +EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte); + +/** Store text data in string, after converting to UTF-8 from indicated encoding + * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb) + * \param sb target string + * \param enc mpg123 text encoding value + * \param source source buffer with plain unsigned bytes (you might need to cast from char *) + * \param source_size number of bytes in the source buffer + * + * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). + * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). + */ +EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size); + +/** Sub data structure for ID3v2, for storing various text fields (including comments). + * This is for ID3v2 COMM, TXXX and all the other text fields. + * Only COMM and TXXX have a description, only COMM and USLT have a language. + * You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */ +typedef struct +{ + char lang[3]; /**< Three-letter language code (not terminated). */ + char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */ + mpg123_string description; /**< Empty for the generic comment... */ + mpg123_string text; /**< ... */ +} mpg123_text; + +/** Data structure for storing IDV3v2 tags. + * This structure is not a direct binary mapping with the file contents. + * The ID3v2 text frames are allowed to contain multiple strings. + * So check for null bytes until you reach the mpg123_string fill. + * All text is encoded in UTF-8. */ +typedef struct +{ + unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */ + mpg123_string *title; /**< Title string (pointer into text_list). */ + mpg123_string *artist; /**< Artist string (pointer into text_list). */ + mpg123_string *album; /**< Album string (pointer into text_list). */ + mpg123_string *year; /**< The year as a string (pointer into text_list). */ + mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */ + mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */ + /* Encountered ID3v2 fields are appended to these lists. + There can be multiple occurences, the pointers above always point to the last encountered data. */ + mpg123_text *comment_list; /**< Array of comments. */ + size_t comments; /**< Number of comments. */ + mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */ + size_t texts; /**< Numer of text fields. */ + mpg123_text *extra; /**< The array of extra (TXXX) fields. */ + size_t extras; /**< Number of extra text (TXXX) fields. */ +} mpg123_id3v2; + +/** Data structure for ID3v1 tags (the last 128 bytes of a file). + * Don't take anything for granted (like string termination)! + * Also note the change ID3v1.1 did: comment[28] = 0; comment[19] = track_number + * It is your task to support ID3v1 only or ID3v1.1 ...*/ +typedef struct +{ + char tag[3]; /**< Always the string "TAG", the classic intro. */ + char title[30]; /**< Title string. */ + char artist[30]; /**< Artist string. */ + char album[30]; /**< Album string. */ + char year[4]; /**< Year string. */ + char comment[30]; /**< Comment string. */ + unsigned char genre; /**< Genre index. */ +} mpg123_id3v1; + +#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ +#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ +#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ +#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ + +/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future). + The check function returns a combination of flags. */ +EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */ + +/** Clean up meta data storage (ID3v2 and ICY), freeing memory. */ +EXPORT void mpg123_meta_free(mpg123_handle *mh); + +/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call. + * v1 and/or v2 can be set to NULL when there is no corresponding data. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2); + +/** Point icy_meta to existing data structure wich may change on any next read/decode function call. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */ + +/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. + * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) . + * \param icy_text The input data in ICY encoding + * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */ +EXPORT char* mpg123_icy2utf8(const char* icy_text); + + +/* @} */ + + +/** \defgroup mpg123_advpar mpg123 advanced parameter API + * + * Direct access to a parameter set without full handle around it. + * Possible uses: + * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). + * - Use one set of parameters for multiple handles. + * + * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() + * family) directly return a fully qualified mpg123 error code, the ones + * operating on full handles normally MPG123_OK or MPG123_ERR, storing the + * specific error code itseld inside the handle. + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder parameters. */ +struct mpg123_pars_struct; + +/** Opaque structure for the libmpg123 decoder parameters. */ +typedef struct mpg123_pars_struct mpg123_pars; + +/** Create a handle with preset parameters. */ +EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error); + +/** Allocate memory for and return a pointer to a new mpg123_pars */ +EXPORT mpg123_pars *mpg123_new_pars(int *error); + +/** Delete and free up memory used by a mpg123_pars data structure */ +EXPORT void mpg123_delete_pars(mpg123_pars* mp); + +/** Configure mpg123 parameters to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_fmt_none(mpg123_pars *mp); + +/** Configure mpg123 parameters to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_fmt_all(mpg123_pars *mp); + +/** Set the audio format support of a mpg123_pars in detail: + \param rate The sample rate value (in Hertz). + \param channels A combination of MPG123_STEREO and MPG123_MONO. + \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no support). + \return 0 on success, -1 if there was an error. / +*/ +EXPORT int mpg123_fmt(mpg123_pars *mh, long rate, int channels, int encodings); /* 0 is good, -1 is error */ + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_pars. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_fmt_support(mpg123_pars *mh, long rate, int encoding); + +/** Set a specific parameter, for a specific mpg123_pars, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_pars. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval); + +/* @} */ + + +/** \defgroup mpg123_lowio mpg123 low level I/O + * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... + * + * @{ */ + +/** Replace default internal buffer with user-supplied buffer. + * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. */ +EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size); + +/** The max size of one frame's decoded output with current settings. + * Use that to determine an appropriate minimum buffer size for decoding one frame. */ +EXPORT size_t mpg123_outblock(mpg123_handle *mh); + +/** Replace low-level stream access functions; read and lseek as known in POSIX. + * You can use this to make any fancy file opening/closing yourself, + * using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a "real" file descriptor...). + * Setting a function to NULL means that the default internal read is + * used (active from next mpg123_open call on). + * Note: As it would be troublesome to mess with this while having a file open, + * this implies mpg123_close(). */ +EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int)); + +/** Replace I/O functions with your own ones operating on some kind of handle instead of integer descriptors. + * The handle is a void pointer, so you can pass any data you want... + * mpg123_open_handle() is the call you make to use the I/O defined here. + * There is no fallback to internal read/seek here. + * Note: As it would be troublesome to mess with this while having a file open, + * this mpg123_close() is implied here. + * \param r_read The callback for reading (behaviour like posix read). + * \param r_lseek The callback for seeking (like posix lseek). + * \param cleanup A callback to clean up an I/O handle on mpg123_close, can be NULL for none (you take care of cleaning your handles). */ +EXPORT int mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*)); + +/* @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/config/mac/ia32/config.h b/node_modules/lame/deps/mpg123/config/mac/ia32/config.h new file mode 100644 index 0000000..cd563fc --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/mac/ia32/config.h @@ -0,0 +1,437 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +#define ABI_ALIGN_FUN 1 + +/* Define to use proper rounding. */ +/* #undef ACCURATE_ROUNDING */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +#define ASMALIGN_EXP 1 + +/* Define if __attribute__((aligned(16))) shall be used */ +#define CCALIGN 1 + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "coreaudio" + +/* Define if building with dynamcally linked libmpg123 */ +/* #undef DYNAMIC_BUILD */ + +/* Define if FIFO support is enabled. */ +/* #undef FIFO */ + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the <alc.h> header file. */ +/* #undef HAVE_ALC_H */ + +/* Define to 1 if you have the <Alib.h> header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the <AL/alc.h> header file. */ +/* #undef HAVE_AL_ALC_H */ + +/* Define to 1 if you have the <AL/al.h> header file. */ +/* #undef HAVE_AL_AL_H */ + +/* Define to 1 if you have the <al.h> header file. */ +/* #undef HAVE_AL_H */ + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <asm/audioio.h> header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the <audios.h> header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */ +#define HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H 1 + +/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */ +#define HAVE_AUDIOUNIT_AUDIOUNIT_H 1 + +/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */ +#define HAVE_CORESERVICES_CORESERVICES_H 1 + +/* Define to 1 if you have the <CUlib.h> header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */ +#define HAVE_GAI_ADDRCONFIG 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <langinfo.h> header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +#define HAVE_LIBMX 1 + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the <linux/soundcard.h> header file. */ +/* #undef HAVE_LINUX_SOUNDCARD_H */ + +/* Define to 1 if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if libltdl is available */ +/* #undef HAVE_LTDL */ + +/* Define to 1 if you have the <machine/soundcard.h> header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the <OpenAL/alc.h> header file. */ +#define HAVE_OPENAL_ALC_H 1 + +/* Define to 1 if you have the <OpenAL/al.h> header file. */ +#define HAVE_OPENAL_AL_H 1 + +/* Define to 1 if you have the <os2me.h> header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the <os2.h> header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the <sched.h> header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +/* #undef HAVE_SCHED_SETSCHEDULER */ + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#define HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the `setuid' function. */ +#define HAVE_SETUID 1 + +/* Define to 1 if you have the <signal.h> header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the <sndio.h> header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sun/audioio.h> header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audioio.h> header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audio.h> header file. */ +/* #undef HAVE_SYS_AUDIO_H */ + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the <sys/signal.h> header file. */ +#define HAVE_SYS_SIGNAL_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/soundcard.h> header file. */ +/* #undef HAVE_SYS_SOUNDCARD_H */ + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define this if you have the POSIX termios library */ +#define HAVE_TERMIOS 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the <windows.h> header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the <ws2tcpip.h> header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to indicate that float storage follows IEEE754. */ +#define IEEE_FLOAT 1 + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define this to the size of long type in bits, used for LFS small/native + alias functions. */ +#define LFS_ALIAS_BITS 64 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* The suffix for module files. */ +#define MODULE_FILE_SUFFIX ".la" + +/* Define if network support is enabled. */ +#define NETWORK 1 + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit and 24 bit integer output. */ +/* #undef NO_32BIT */ + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +/* #undef NO_REAL */ + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.14.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.14.4" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if modules are enabled */ +/* #undef USE_MODULES */ + +/* Version number of package */ +#define VERSION "1.14.4" + +/* Define to use Win32 named pipes */ +/* #undef WANT_WIN32_FIFO */ + +/* Define to use Win32 sockets */ +/* #undef WANT_WIN32_SOCKETS */ + +/* Define to use Unicode for Windows */ +/* #undef WANT_WIN32_UNICODE */ + +/* WinXP and above for ipv6 */ +/* #undef WINVER */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* WinXP and above for ipv6 */ +/* #undef _WIN32_WINNT */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if <sys/types.h> does not define. */ +/* #undef int16_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef int32_t */ + +/* Define to `long int' if <sys/types.h> does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef size_t */ + +/* Define to `long' if <sys/types.h> does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if <sys/types.h> does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* #undef uint32_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef uintptr_t */ diff --git a/node_modules/lame/deps/mpg123/config/mac/ia32/mpg123.h b/node_modules/lame/deps/mpg123/config/mac/ia32/mpg123.h new file mode 100644 index 0000000..421288a --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/mac/ia32/mpg123.h @@ -0,0 +1,1075 @@ +/* + libmpg123: MPEG Audio Decoder library (version 1.14.4) + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#ifndef MPG123_LIB_H +#define MPG123_LIB_H + +/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ + +/* A macro to check at compile time which set of API functions to expect. + This should be incremented at least each time a new symbol is added to the header. */ +#define MPG123_API_VERSION 36 + +/* These aren't actually in use... seems to work without using libtool. */ +#ifdef BUILD_MPG123_DLL +/* The dll exports. */ +#define EXPORT __declspec(dllexport) +#else +#ifdef LINK_MPG123_DLL +/* The exe imports. */ +#define EXPORT __declspec(dllimport) +#else +/* Nothing on normal/UNIX builds */ +#define EXPORT +#endif +#endif + +#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */ +#include <stdlib.h> +#include <sys/types.h> + +/* Simplified large file handling. + I used to have a check here that prevents building for a library with conflicting large file setup + (application that uses 32 bit offsets with library that uses 64 bits). + While that was perfectly fine in an environment where there is one incarnation of the library, + it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the + correct header matching the 32 bit library (where large files need explicit support) or + the 64 bit library (where there is no distinction). + + New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support, + and thus functions with added suffix (mpg123_open_64). + Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when + building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now. + Link failure is not the expected outcome of any half-sane usage anymore. + + More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names. +*/ + +/* + Now, the renaming of large file aware functions. + By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +*/ +#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) + +/* Need some trickery to concatenate the value(s) of the given macro(s). */ +#define MPG123_MACROCAT_REALLY(a, b) a ## b +#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b) +#ifndef MPG123_LARGESUFFIX +#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS) +#endif +#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX) + +#define mpg123_open MPG123_LARGENAME(mpg123_open) +#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd) +#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle) +#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode) +#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame) +#define mpg123_tell MPG123_LARGENAME(mpg123_tell) +#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe) +#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream) +#define mpg123_seek MPG123_LARGENAME(mpg123_seek) +#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek) +#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame) +#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe) +#define mpg123_index MPG123_LARGENAME(mpg123_index) +#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) +#define mpg123_position MPG123_LARGENAME(mpg123_position) +#define mpg123_length MPG123_LARGENAME(mpg123_length) +#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) +#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) +#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) +#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos) + +#endif /* largefile hackery */ + +#endif /* MPG123_NO_CONFIGURE */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \defgroup mpg123_init mpg123 library and handle setup + * + * Functions to initialise and shutdown the mpg123 library and handles. + * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) + * Tip: Use a RVA setting... + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder handle. */ +struct mpg123_handle_struct; + +/** Opaque structure for the libmpg123 decoder handle. + * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner. + */ +typedef struct mpg123_handle_struct mpg123_handle; + +/** Function to initialise the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + * + * \return MPG123_OK if successful, otherwise an error number. + */ +EXPORT int mpg123_init(void); + +/** Function to close down the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */ +EXPORT void mpg123_exit(void); + +/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()). + * and optional retrieval of an error code to feed to mpg123_plain_strerror(). + * Optional means: Any of or both the parameters may be NULL. + * + * \return Non-NULL pointer when successful. + */ +EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error); + +/** Delete handle, mh is either a valid mpg123 handle or NULL. */ +EXPORT void mpg123_delete(mpg123_handle *mh); + +/** Enumeration of the parameters types that it is possible to set/get. */ +enum mpg123_parms +{ + MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ + MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ + MPG123_ADD_FLAGS, /**< add some flags (integer) */ + MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */ + MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */ + MPG123_RVA, /**< one of the RVA choices above (integer) */ + MPG123_DOWNSPEED, /**< play a frame N times (integer) */ + MPG123_UPSPEED, /**< play every Nth frame (integer) */ + MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */ + MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */ + MPG123_ICY_INTERVAL, /**< stream contains ICY metadata with this interval (integer) */ + MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ + MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */ + MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ + MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */ + MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */ + ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/ + ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */ + ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */ +}; + +/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */ +enum mpg123_param_flags +{ + MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ + ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */ + ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */ + ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */ + ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */ + ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */ + ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */ + ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ + ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */ + ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ + ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */ + ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */ + ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */ + ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */ + ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */ + ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */ + ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */ +}; + +/** choices for MPG123_RVA */ +enum mpg123_param_rva +{ + MPG123_RVA_OFF = 0 /**< RVA disabled (default). */ + ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */ + ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */ + ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */ +}; + +/* TODO: Assess the possibilities and troubles of changing parameters during playback. */ + +/** Set a specific parameter, for a specific mpg123_handle, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_handle. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval); + +/** Feature set available for query with mpg123_feature. */ +enum mpg123_feature_set +{ + MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */ + ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */ + ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */ + ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */ + ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */ + ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */ + ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */ + ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */ + ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */ + ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */ + ,MPG123_FEATURE_PARSE_ICY /**< ICY support */ + ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */ +}; + +/** Query libmpg123 feature, 1 for success, 0 for unimplemented functions. */ +EXPORT int mpg123_feature(const enum mpg123_feature_set key); + +/* @} */ + + +/** \defgroup mpg123_error mpg123 error handling + * + * Functions to get text version of the error numbers and an enumeration + * of the error codes returned by libmpg123. + * + * Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * The positive range of return values is used for "useful" values when appropriate. + * + * @{ + */ + +/** Enumeration of the message and error codes and returned by libmpg123 functions. */ +enum mpg123_errors +{ + MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */ + MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */ + MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */ + MPG123_ERR=-1, /**< Generic Error */ + MPG123_OK=0, /**< Success */ + MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */ + MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */ + MPG123_BAD_RATE, /**< Invalid sample rate specified. */ + MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */ + MPG123_BAD_PARAM, /**< Bad parameter id! */ + MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */ + MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */ + MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */ + MPG123_BAD_DECODER, /**< Invalid decoder choice. */ + MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */ + MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */ + MPG123_BAD_RVA, /**< Invalid RVA mode. */ + MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */ + MPG123_NO_SPACE, /**< Not enough buffer space. */ + MPG123_BAD_TYPES, /**< Incompatible numeric data types. */ + MPG123_BAD_BAND, /**< Bad equalizer band. */ + MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */ + MPG123_ERR_READER, /**< Error reading the stream. */ + MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */ + MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/ + MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */ + MPG123_BAD_FILE, /**< File access error. */ + MPG123_NO_SEEK, /**< Seek not supported by stream. */ + MPG123_NO_READER, /**< No stream opened. */ + MPG123_BAD_PARS, /**< Bad parameter handle. */ + MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */ + MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */ + MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */ + MPG123_NO_8BIT, /**< No 8bit encoding possible. */ + MPG123_BAD_ALIGN, /**< Stack aligmnent error */ + MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */ + MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */ + MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */ + MPG123_BAD_KEY, /**< Bad key value given. */ + MPG123_NO_INDEX, /**< No frame index in this build. */ + MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */ + MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */ + MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */ + ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */ + ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */ + ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */ + ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */ + ,MPG123_INT_OVERFLOW /**< Some integer overflow. */ +}; + +/** Return a string describing that error errcode means. */ +EXPORT const char* mpg123_plain_strerror(int errcode); + +/** Give string describing what error has occured in the context of handle mh. + * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via + * char *errmsg = mpg123_strerror(mh) + * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. */ +EXPORT const char* mpg123_strerror(mpg123_handle *mh); + +/** Return the plain errcode intead of a string. */ +EXPORT int mpg123_errcode(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_decoder mpg123 decoder selection + * + * Functions to list and select the available decoders. + * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). + * + * @{ + */ + +/** Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). */ +EXPORT const char **mpg123_decoders(void); + +/** Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). */ +EXPORT const char **mpg123_supported_decoders(void); + +/** Set the chosen decoder to 'decoder_name' */ +EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name); + +/** Get the currently active decoder engine name. + The active decoder engine can vary depening on output constraints, + mostly non-resampling, integer output is accelerated via 3DNow & Co. but for other modes a fallback engine kicks in. + Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. + \return The decoder name or NULL on error. */ +EXPORT const char* mpg123_current_decoder(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_output mpg123 output audio format + * + * Functions to get and select the format of the decoded audio. + * + * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance. + * + * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including ptimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again). + * + * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness. + * + * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation. + * + * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format. + * + * @{ + */ + +/** An enum over all sample types possibly known to mpg123. + * The values are designed as bit flags to allow bitmasking for encoding families. + * + * Note that (your build of) libmpg123 does not necessarily support all these. + * Usually, you can expect the 8bit encodings and signed 16 bit. + * Also 32bit float will be usual beginning with mpg123-1.7.0 . + * What you should bear in mind is that (SSE, etc) optimized routines may be absent + * for some formats. We do have SSE for 16, 32 bit and float, though. + * 24 bit integer is done via postprocessing of 32 bit output -- just cutting + * the last byte, no rounding, even. If you want better, do it yourself. + * + * All formats are in native byte order. If you need different endinaness, you + * can simply postprocess the output buffers (libmpg123 wouldn't do anything else). + * mpg123_encsize() can be helpful there. + */ +enum mpg123_enc_enum +{ + MPG123_ENC_8 = 0x00f /**< 0000 0000 1111 Some 8 bit integer encoding. */ + ,MPG123_ENC_16 = 0x040 /**< 0000 0100 0000 Some 16 bit integer encoding. */ + ,MPG123_ENC_24 = 0x4000 /**< 0100 0000 0000 0000 Some 24 bit integer encoding. */ + ,MPG123_ENC_32 = 0x100 /**< 0001 0000 0000 Some 32 bit integer encoding. */ + ,MPG123_ENC_SIGNED = 0x080 /**< 0000 1000 0000 Some signed integer encoding. */ + ,MPG123_ENC_FLOAT = 0xe00 /**< 1110 0000 0000 Some float encoding. */ + ,MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) /**< 1101 0000 signed 16 bit */ + ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) /**< 0110 0000 unsigned 16 bit */ + ,MPG123_ENC_UNSIGNED_8 = 0x01 /**< 0000 0001 unsigned 8 bit */ + ,MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) /**< 1000 0010 signed 8 bit */ + ,MPG123_ENC_ULAW_8 = 0x04 /**< 0000 0100 ulaw 8 bit */ + ,MPG123_ENC_ALAW_8 = 0x08 /**< 0000 1000 alaw 8 bit */ + ,MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 /**< 0001 0001 1000 0000 signed 32 bit */ + ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 /**< 0010 0001 0000 0000 unsigned 32 bit */ + ,MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 /**< 0101 0000 1000 0000 signed 24 bit */ + ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 /**< 0110 0000 0000 0000 unsigned 24 bit */ + ,MPG123_ENC_FLOAT_32 = 0x200 /**< 0010 0000 0000 32bit float */ + ,MPG123_ENC_FLOAT_64 = 0x400 /**< 0100 0000 0000 64bit float */ + ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 + | MPG123_ENC_SIGNED_8 | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8 + | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32 + | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24 + | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 ) /**< Any encoding on the list. */ +}; + +/** They can be combined into one number (3) to indicate mono and stereo... */ +enum mpg123_channelcount +{ + MPG123_MONO = 1 + ,MPG123_STEREO = 2 +}; + +/** An array of supported standard sample rates + * These are possible native sample rates of MPEG audio files. + * You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. + * \param list Store a pointer to the sample rates array there. + * \param number Store the number of sample rates there. */ +EXPORT void mpg123_rates(const long **list, size_t *number); + +/** An array of supported audio encodings. + * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED). + * \param list Store a pointer to the encodings array there. + * \param number Store the number of encodings there. */ +EXPORT void mpg123_encodings(const int **list, size_t *number); + +/** Return the size (in bytes) of one mono sample of the named encoding. + * \param encoding The encoding value to analyze. + * \return positive size of encoding in bytes, 0 on invalid encoding. */ +EXPORT int mpg123_encsize(int encoding); + +/** Configure a mpg123 handle to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_format_none(mpg123_handle *mh); + +/** Configure mpg123 handle to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_format_all(mpg123_handle *mh); + +/** Set the audio format support of a mpg123_handle in detail: + * \param mh audio decoder handle + * \param rate The sample rate value (in Hertz). + * \param channels A combination of MPG123_STEREO and MPG123_MONO. + * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here. + * \return MPG123_OK on success, MPG123_ERR if there was an error. */ +EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings); + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_handle. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding); + +/** Get the current output format written to the addresses givenr. */ +EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding); + +/*@}*/ + + +/** \defgroup mpg123_input mpg123 file input and decoding + * + * Functions for input bitstream and decoding operations. + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * @{ + */ + +/* reading samples / triggering decoding, possible return values: */ +/** Enumeration of the error codes returned by libmpg123 functions. */ + +/** Open and prepare to decode the specified file by filesystem path. + * This does not open HTTP urls; libmpg123 contains no networking code. + * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed(). + */ +EXPORT int mpg123_open(mpg123_handle *mh, const char *path); + +/** Use an already opened file descriptor as the bitstream input + * mpg123_close() will _not_ close the file descriptor. + */ +EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_replace_reader_handle()! + * mpg123_close() will call the cleanup callback for your handle (if you gave one). + */ +EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); + +/** Open a new bitstream and prepare for direct feeding + * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. + */ +EXPORT int mpg123_open_feed(mpg123_handle *mh); + +/** Closes the source, if libmpg123 opened it. */ +EXPORT int mpg123_close(mpg123_handle *mh); + +/** Read from stream and decode up to outmemsize bytes. + * \param outmemory address of output buffer to write to + * \param outmemsize maximum number of bytes to write + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out for MPG123_DONE and friends!) */ +EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Feed data for a stream that has been opened with mpg123_open_feed(). + * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples. + * \param in input buffer + * \param size number of input bytes + * \return error/message code. */ +EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size); + +/** Decode MPEG Audio from inmemory to outmemory. + * This is very close to a drop-in replacement for old mpglib. + * When you give zero-sized output buffer the input will be parsed until + * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) + * without taking decoded data. + * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-). + * You can actually always decide if you want those specialized functions in separate steps or one call this one here. + * \param inmemory input buffer + * \param inmemsize number of input bytes + * \param outmemory output buffer + * \param outmemsize maximum number of output bytes + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out especially for MPG123_NEED_MORE) + */ +EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Decode next MPEG frame to internal buffer + * or read a frame and return after setting a new format. + * \param num current frame offset gets stored there + * \param audio This pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Decode current MPEG frame to internal buffer. + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + * \param num last frame offset gets stored there + * \param audio this pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Find, read and parse the next mp3 frame + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + */ +EXPORT int mpg123_framebyframe_next(mpg123_handle *mh); + +/** Get access to the raw input data for the last parsed frame. + * This gives you a direct look (and write access) to the frame body data. + * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()). + * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present. + * You can provide NULL for a parameter pointer when you are not interested in the value. + * + * \param header the 4-byte MPEG header + * \param bodydata pointer to the frame body stored in the handle (without the header) + * \param bodybytes size of frame body in bytes (without the header) + * \return MPG123_OK if there was a yet un-decoded frame to get the data from, MPG123_ERR otherwise (without further explanation, the error state of the mpg123_handle is not modified by this function). + */ +EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes); + +/** Get the input position (byte offset in stream) of the last parsed frame. + * This can be used for external seek index building, for example. + * It just returns the internally stored offset, regardless of validity -- you ensure that a valid frame has been parsed before! */ +EXPORT off_t mpg123_framepos(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_seek mpg123 position and seeking + * + * Functions querying and manipulating position in the decoded audio bitstream. + * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. + * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) + * The general usage is modelled after stdlib's ftell() and fseek(). + * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: + * - SEEK_SET: set position to (or near to) specified offset + * - SEEK_CUR: change position by offset from now + * - SEEK_END: set position to offset from end + * + * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. + * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! + * Short: When you care about the sample position, don't mess with those parameters;-) + * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). + * + * @{ + */ + +/** Returns the current position in samples. + * On the next read, you'd get that sample. */ +EXPORT off_t mpg123_tell(mpg123_handle *mh); + +/** Returns the frame number that the next read will give you data from. */ +EXPORT off_t mpg123_tellframe(mpg123_handle *mh); + +/** Returns the current byte offset in the input stream. */ +EXPORT off_t mpg123_tell_stream(mpg123_handle *mh); + +/** Seek to a desired sample offset. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); + +/** Seek to a desired sample offset in data feeding mode. + * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. + * \param input_offset The position it expects to be at the + * next time data is fed to mpg123_decode(). + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); + +/** Seek to a desired MPEG frame index. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); + +/** Return a MPEG frame offset corresponding to an offset in seconds. + * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. + * \return frame offset >= 0 or error/message code */ +EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec); + +/** Give access to the frame index table that is managed for seeking. + * You are asked not to modify the values... Use mpg123_set_index to set the + * seek index + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill); + +/** Set the frame index table + * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets + * to NULL and fill to 0 will clear the index and free the allocated memory used by the index. + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); + +/** Get information about current and remaining frames/seconds. + * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + * You provide an offset (in frames) from now and a number of output bytes + * served by libmpg123 but not yet played. You get the projected current frame + * and seconds, as well as the remaining frames/seconds. This does _not_ care + * about skipped samples due to gapless playback. */ +EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); + +/*@}*/ + + +/** \defgroup mpg123_voleq mpg123 volume and equalizer + * + * @{ + */ + +enum mpg123_channels +{ + MPG123_LEFT=0x1 /**< The Left Channel. */ + ,MPG123_RIGHT=0x2 /**< The Right Channel. */ + ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */ +}; + +/** Set the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. + * \param band The equaliser band to change (from 0 to 31) + * \param val The (linear) adjustment factor. */ +EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val); + +/** Get the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. + * \param band The equaliser band to change (from 0 to 31) + * \return The (linear) adjustment factor. */ +EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band); + +/** Reset the 32 Band Audio Equalizer settings to flat */ +EXPORT int mpg123_reset_eq(mpg123_handle *mh); + +/** Set the absolute output volume including the RVA setting, + * vol<0 just applies (a possibly changed) RVA setting. */ +EXPORT int mpg123_volume(mpg123_handle *mh, double vol); + +/** Adjust output volume including the RVA setting by chosen amount */ +EXPORT int mpg123_volume_change(mpg123_handle *mh, double change); + +/** Return current volume setting, the actual value due to RVA, and the RVA + * adjustment itself. It's all as double float value to abstract the sample + * format. The volume values are linear factors / amplitudes (not percent) + * and the RVA value is in decibels. */ +EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db); + +/* TODO: Set some preamp in addition / to replace internal RVA handling? */ + +/*@}*/ + + +/** \defgroup mpg123_status mpg123 status and information + * + * @{ + */ + +/** Enumeration of the mode types of Variable Bitrate */ +enum mpg123_vbr { + MPG123_CBR=0, /**< Constant Bitrate Mode (default) */ + MPG123_VBR, /**< Variable Bitrate Mode */ + MPG123_ABR /**< Average Bitrate Mode */ +}; + +/** Enumeration of the MPEG Versions */ +enum mpg123_version { + MPG123_1_0=0, /**< MPEG Version 1.0 */ + MPG123_2_0, /**< MPEG Version 2.0 */ + MPG123_2_5 /**< MPEG Version 2.5 */ +}; + + +/** Enumeration of the MPEG Audio mode. + * Only the mono mode has 1 channel, the others have 2 channels. */ +enum mpg123_mode { + MPG123_M_STEREO=0, /**< Standard Stereo. */ + MPG123_M_JOINT, /**< Joint Stereo. */ + MPG123_M_DUAL, /**< Dual Channel. */ + MPG123_M_MONO /**< Single Channel. */ +}; + + +/** Enumeration of the MPEG Audio flag bits */ +enum mpg123_flags { + MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */ + MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */ + MPG123_PRIVATE=0x4, /**< The private bit has been set. */ + MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */ +}; + +/** Data structure for storing information about a frame of MPEG Audio */ +struct mpg123_frameinfo +{ + enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */ + int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */ + long rate; /**< The sampling rate in Hz. */ + enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */ + int mode_ext; /**< The mode extension bit flag. */ + int framesize; /**< The size of the frame (in bytes, including header). */ + enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */ + int emphasis; /**< The emphasis type. */ + int bitrate; /**< Bitrate of the frame (kbps). */ + int abr_rate; /**< The target average bitrate. */ + enum mpg123_vbr vbr; /**< The VBR mode. */ +}; + +/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. */ +EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); + +/** Get the safe output buffer size for all cases (when you want to replace the internal buffer) */ +EXPORT size_t mpg123_safe_buffer(void); + +/** Make a full parsing scan of each frame in the file. ID3 tags are found. An accurate length + * value is stored. Seek index will be filled. A seek back to current position + * is performed. At all, this function refuses work when stream is + * not seekable. + * \return MPG123_OK or MPG123_ERR. + */ +EXPORT int mpg123_scan(mpg123_handle *mh); + +/** Return, if possible, the full (expected) length of current track in samples. + * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ +EXPORT off_t mpg123_length(mpg123_handle *mh); + +/** Override the value for file size in bytes. + * Useful for getting sensible track length values in feed mode or for HTTP streams. + * \return MPG123_OK or MPG123_ERR */ +EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size); + +/** Returns the time (seconds) per frame; <0 is error. */ +EXPORT double mpg123_tpf(mpg123_handle *mh); + +/** Returns the samples per frame for the most recently parsed frame; <0 is error. */ +EXPORT int mpg123_spf(mpg123_handle *mh); + +/** Get and reset the clip count. */ +EXPORT long mpg123_clip(mpg123_handle *mh); + + +/** The key values for state information from mpg123_getstate(). */ +enum mpg123_state +{ + MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true) */ + ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */ + ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files (the leading one featuring gapless info). */ +}; + +/** Get various current decoder/stream state information. + * \param key the key to identify the information to give. + * \param val the address to return (long) integer values to + * \param fval the address to return floating point values to + * \return MPG123_OK or MPG123_ERR for success + */ +EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval); + +/*@}*/ + + +/** \defgroup mpg123_metadata mpg123 metadata handling + * + * Functions to retrieve the metadata from MPEG Audio files and streams. + * Also includes string handling functions. + * + * @{ + */ + +/** Data structure for storing strings in a safer way than a standard C-String. + * Can also hold a number of null-terminated strings. */ +typedef struct +{ + char* p; /**< pointer to the string data */ + size_t size; /**< raw number of bytes allocated */ + size_t fill; /**< number of used bytes (including closing zero byte) */ +} mpg123_string; + +/** Create and allocate memory for a new mpg123_string */ +EXPORT void mpg123_init_string(mpg123_string* sb); + +/** Free-up mempory for an existing mpg123_string */ +EXPORT void mpg123_free_string(mpg123_string* sb); + +/** Change the size of a mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news); + +/** Increase size of a mpg123_string if necessary (it may stay larger). + * Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). + * That way, you can preallocate memory and safely work afterwards with pieces. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news); + +/** Copy the contents of one mpg123_string string to another. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to); + +/** Append a C-String to an mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff); + +/** Append a C-substring to an mpg123 string + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Set the conents of a mpg123_string to a C-string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff); + +/** Set the contents of a mpg123_string to a C-substring + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters). + * \return character count + * \param sb the string + * \param utf8 a flag to tell if the string is in utf8 encoding + * Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. +*/ +EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8); + +/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */ +enum mpg123_text_encoding +{ + mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */ + ,mpg123_text_utf8 = 1 /**< UTF-8 */ + ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */ + ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */ + ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */ + ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. + * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when + * you don't mess with the reserved code points. If you want to decode little endian data + * without BOM you need to prepend 0xff 0xfe yourself. */ + ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */ + ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, + * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 + * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 + * types (we expect a BOM before real data there), not so for utf16be!*/ + ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */ +}; + +/** The encoding byte values from ID3v2. */ +enum mpg123_id3_enc +{ + mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */ + ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */ + ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */ + ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */ + ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */ +}; + +/** Convert ID3 encoding byte to mpg123 encoding index. */ +EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte); + +/** Store text data in string, after converting to UTF-8 from indicated encoding + * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb) + * \param sb target string + * \param enc mpg123 text encoding value + * \param source source buffer with plain unsigned bytes (you might need to cast from char *) + * \param source_size number of bytes in the source buffer + * + * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). + * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). + */ +EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size); + +/** Sub data structure for ID3v2, for storing various text fields (including comments). + * This is for ID3v2 COMM, TXXX and all the other text fields. + * Only COMM and TXXX have a description, only COMM and USLT have a language. + * You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */ +typedef struct +{ + char lang[3]; /**< Three-letter language code (not terminated). */ + char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */ + mpg123_string description; /**< Empty for the generic comment... */ + mpg123_string text; /**< ... */ +} mpg123_text; + +/** Data structure for storing IDV3v2 tags. + * This structure is not a direct binary mapping with the file contents. + * The ID3v2 text frames are allowed to contain multiple strings. + * So check for null bytes until you reach the mpg123_string fill. + * All text is encoded in UTF-8. */ +typedef struct +{ + unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */ + mpg123_string *title; /**< Title string (pointer into text_list). */ + mpg123_string *artist; /**< Artist string (pointer into text_list). */ + mpg123_string *album; /**< Album string (pointer into text_list). */ + mpg123_string *year; /**< The year as a string (pointer into text_list). */ + mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */ + mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */ + /* Encountered ID3v2 fields are appended to these lists. + There can be multiple occurences, the pointers above always point to the last encountered data. */ + mpg123_text *comment_list; /**< Array of comments. */ + size_t comments; /**< Number of comments. */ + mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */ + size_t texts; /**< Numer of text fields. */ + mpg123_text *extra; /**< The array of extra (TXXX) fields. */ + size_t extras; /**< Number of extra text (TXXX) fields. */ +} mpg123_id3v2; + +/** Data structure for ID3v1 tags (the last 128 bytes of a file). + * Don't take anything for granted (like string termination)! + * Also note the change ID3v1.1 did: comment[28] = 0; comment[19] = track_number + * It is your task to support ID3v1 only or ID3v1.1 ...*/ +typedef struct +{ + char tag[3]; /**< Always the string "TAG", the classic intro. */ + char title[30]; /**< Title string. */ + char artist[30]; /**< Artist string. */ + char album[30]; /**< Album string. */ + char year[4]; /**< Year string. */ + char comment[30]; /**< Comment string. */ + unsigned char genre; /**< Genre index. */ +} mpg123_id3v1; + +#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ +#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ +#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ +#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ + +/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future). + The check function returns a combination of flags. */ +EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */ + +/** Clean up meta data storage (ID3v2 and ICY), freeing memory. */ +EXPORT void mpg123_meta_free(mpg123_handle *mh); + +/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call. + * v1 and/or v2 can be set to NULL when there is no corresponding data. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2); + +/** Point icy_meta to existing data structure wich may change on any next read/decode function call. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */ + +/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. + * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) . + * \param icy_text The input data in ICY encoding + * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */ +EXPORT char* mpg123_icy2utf8(const char* icy_text); + + +/* @} */ + + +/** \defgroup mpg123_advpar mpg123 advanced parameter API + * + * Direct access to a parameter set without full handle around it. + * Possible uses: + * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). + * - Use one set of parameters for multiple handles. + * + * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() + * family) directly return a fully qualified mpg123 error code, the ones + * operating on full handles normally MPG123_OK or MPG123_ERR, storing the + * specific error code itseld inside the handle. + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder parameters. */ +struct mpg123_pars_struct; + +/** Opaque structure for the libmpg123 decoder parameters. */ +typedef struct mpg123_pars_struct mpg123_pars; + +/** Create a handle with preset parameters. */ +EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error); + +/** Allocate memory for and return a pointer to a new mpg123_pars */ +EXPORT mpg123_pars *mpg123_new_pars(int *error); + +/** Delete and free up memory used by a mpg123_pars data structure */ +EXPORT void mpg123_delete_pars(mpg123_pars* mp); + +/** Configure mpg123 parameters to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_fmt_none(mpg123_pars *mp); + +/** Configure mpg123 parameters to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_fmt_all(mpg123_pars *mp); + +/** Set the audio format support of a mpg123_pars in detail: + \param rate The sample rate value (in Hertz). + \param channels A combination of MPG123_STEREO and MPG123_MONO. + \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no support). + \return 0 on success, -1 if there was an error. / +*/ +EXPORT int mpg123_fmt(mpg123_pars *mh, long rate, int channels, int encodings); /* 0 is good, -1 is error */ + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_pars. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_fmt_support(mpg123_pars *mh, long rate, int encoding); + +/** Set a specific parameter, for a specific mpg123_pars, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_pars. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval); + +/* @} */ + + +/** \defgroup mpg123_lowio mpg123 low level I/O + * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... + * + * @{ */ + +/** Replace default internal buffer with user-supplied buffer. + * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. */ +EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size); + +/** The max size of one frame's decoded output with current settings. + * Use that to determine an appropriate minimum buffer size for decoding one frame. */ +EXPORT size_t mpg123_outblock(mpg123_handle *mh); + +/** Replace low-level stream access functions; read and lseek as known in POSIX. + * You can use this to make any fancy file opening/closing yourself, + * using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a "real" file descriptor...). + * Setting a function to NULL means that the default internal read is + * used (active from next mpg123_open call on). + * Note: As it would be troublesome to mess with this while having a file open, + * this implies mpg123_close(). */ +EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int)); + +/** Replace I/O functions with your own ones operating on some kind of handle instead of integer descriptors. + * The handle is a void pointer, so you can pass any data you want... + * mpg123_open_handle() is the call you make to use the I/O defined here. + * There is no fallback to internal read/seek here. + * Note: As it would be troublesome to mess with this while having a file open, + * this mpg123_close() is implied here. + * \param r_read The callback for reading (behaviour like posix read). + * \param r_lseek The callback for seeking (like posix lseek). + * \param cleanup A callback to clean up an I/O handle on mpg123_close, can be NULL for none (you take care of cleaning your handles). */ +EXPORT int mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*)); + +/* @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/config/mac/x64/config.h b/node_modules/lame/deps/mpg123/config/mac/x64/config.h new file mode 100644 index 0000000..053818c --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/mac/x64/config.h @@ -0,0 +1,437 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +/* #undef ABI_ALIGN_FUN */ + +/* Define to use proper rounding. */ +/* #undef ACCURATE_ROUNDING */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +#define ASMALIGN_EXP 1 + +/* Define if __attribute__((aligned(16))) shall be used */ +#define CCALIGN 1 + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "coreaudio" + +/* Define if building with dynamcally linked libmpg123 */ +/* #undef DYNAMIC_BUILD */ + +/* Define if FIFO support is enabled. */ +/* #undef FIFO */ + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the <alc.h> header file. */ +/* #undef HAVE_ALC_H */ + +/* Define to 1 if you have the <Alib.h> header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the <AL/alc.h> header file. */ +/* #undef HAVE_AL_ALC_H */ + +/* Define to 1 if you have the <AL/al.h> header file. */ +/* #undef HAVE_AL_AL_H */ + +/* Define to 1 if you have the <al.h> header file. */ +/* #undef HAVE_AL_H */ + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <asm/audioio.h> header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the <audios.h> header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */ +#define HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H 1 + +/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */ +#define HAVE_AUDIOUNIT_AUDIOUNIT_H 1 + +/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */ +#define HAVE_CORESERVICES_CORESERVICES_H 1 + +/* Define to 1 if you have the <CUlib.h> header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */ +#define HAVE_GAI_ADDRCONFIG 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <langinfo.h> header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +#define HAVE_LIBMX 1 + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the <linux/soundcard.h> header file. */ +/* #undef HAVE_LINUX_SOUNDCARD_H */ + +/* Define to 1 if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if libltdl is available */ +/* #undef HAVE_LTDL */ + +/* Define to 1 if you have the <machine/soundcard.h> header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the <OpenAL/alc.h> header file. */ +#define HAVE_OPENAL_ALC_H 1 + +/* Define to 1 if you have the <OpenAL/al.h> header file. */ +#define HAVE_OPENAL_AL_H 1 + +/* Define to 1 if you have the <os2me.h> header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the <os2.h> header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the <sched.h> header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +/* #undef HAVE_SCHED_SETSCHEDULER */ + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#define HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the `setuid' function. */ +#define HAVE_SETUID 1 + +/* Define to 1 if you have the <signal.h> header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the <sndio.h> header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sun/audioio.h> header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audioio.h> header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audio.h> header file. */ +/* #undef HAVE_SYS_AUDIO_H */ + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the <sys/signal.h> header file. */ +#define HAVE_SYS_SIGNAL_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/soundcard.h> header file. */ +/* #undef HAVE_SYS_SOUNDCARD_H */ + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define this if you have the POSIX termios library */ +#define HAVE_TERMIOS 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the <windows.h> header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the <ws2tcpip.h> header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to indicate that float storage follows IEEE754. */ +#define IEEE_FLOAT 1 + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define this to the size of long type in bits, used for LFS small/native + alias functions. */ +#define LFS_ALIAS_BITS 64 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* The suffix for module files. */ +#define MODULE_FILE_SUFFIX ".la" + +/* Define if network support is enabled. */ +#define NETWORK 1 + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit and 24 bit integer output. */ +/* #undef NO_32BIT */ + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +/* #undef NO_REAL */ + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.14.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.14.4" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if modules are enabled */ +/* #undef USE_MODULES */ + +/* Version number of package */ +#define VERSION "1.14.4" + +/* Define to use Win32 named pipes */ +/* #undef WANT_WIN32_FIFO */ + +/* Define to use Win32 sockets */ +/* #undef WANT_WIN32_SOCKETS */ + +/* Define to use Unicode for Windows */ +/* #undef WANT_WIN32_UNICODE */ + +/* WinXP and above for ipv6 */ +/* #undef WINVER */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* WinXP and above for ipv6 */ +/* #undef _WIN32_WINNT */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if <sys/types.h> does not define. */ +/* #undef int16_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef int32_t */ + +/* Define to `long int' if <sys/types.h> does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef size_t */ + +/* Define to `long' if <sys/types.h> does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if <sys/types.h> does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* #undef uint32_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef uintptr_t */ diff --git a/node_modules/lame/deps/mpg123/config/mac/x64/mpg123.h b/node_modules/lame/deps/mpg123/config/mac/x64/mpg123.h new file mode 100644 index 0000000..421288a --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/mac/x64/mpg123.h @@ -0,0 +1,1075 @@ +/* + libmpg123: MPEG Audio Decoder library (version 1.14.4) + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#ifndef MPG123_LIB_H +#define MPG123_LIB_H + +/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ + +/* A macro to check at compile time which set of API functions to expect. + This should be incremented at least each time a new symbol is added to the header. */ +#define MPG123_API_VERSION 36 + +/* These aren't actually in use... seems to work without using libtool. */ +#ifdef BUILD_MPG123_DLL +/* The dll exports. */ +#define EXPORT __declspec(dllexport) +#else +#ifdef LINK_MPG123_DLL +/* The exe imports. */ +#define EXPORT __declspec(dllimport) +#else +/* Nothing on normal/UNIX builds */ +#define EXPORT +#endif +#endif + +#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */ +#include <stdlib.h> +#include <sys/types.h> + +/* Simplified large file handling. + I used to have a check here that prevents building for a library with conflicting large file setup + (application that uses 32 bit offsets with library that uses 64 bits). + While that was perfectly fine in an environment where there is one incarnation of the library, + it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the + correct header matching the 32 bit library (where large files need explicit support) or + the 64 bit library (where there is no distinction). + + New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support, + and thus functions with added suffix (mpg123_open_64). + Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when + building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now. + Link failure is not the expected outcome of any half-sane usage anymore. + + More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names. +*/ + +/* + Now, the renaming of large file aware functions. + By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +*/ +#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) + +/* Need some trickery to concatenate the value(s) of the given macro(s). */ +#define MPG123_MACROCAT_REALLY(a, b) a ## b +#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b) +#ifndef MPG123_LARGESUFFIX +#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS) +#endif +#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX) + +#define mpg123_open MPG123_LARGENAME(mpg123_open) +#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd) +#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle) +#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode) +#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame) +#define mpg123_tell MPG123_LARGENAME(mpg123_tell) +#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe) +#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream) +#define mpg123_seek MPG123_LARGENAME(mpg123_seek) +#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek) +#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame) +#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe) +#define mpg123_index MPG123_LARGENAME(mpg123_index) +#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) +#define mpg123_position MPG123_LARGENAME(mpg123_position) +#define mpg123_length MPG123_LARGENAME(mpg123_length) +#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) +#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) +#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) +#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos) + +#endif /* largefile hackery */ + +#endif /* MPG123_NO_CONFIGURE */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \defgroup mpg123_init mpg123 library and handle setup + * + * Functions to initialise and shutdown the mpg123 library and handles. + * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) + * Tip: Use a RVA setting... + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder handle. */ +struct mpg123_handle_struct; + +/** Opaque structure for the libmpg123 decoder handle. + * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner. + */ +typedef struct mpg123_handle_struct mpg123_handle; + +/** Function to initialise the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + * + * \return MPG123_OK if successful, otherwise an error number. + */ +EXPORT int mpg123_init(void); + +/** Function to close down the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */ +EXPORT void mpg123_exit(void); + +/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()). + * and optional retrieval of an error code to feed to mpg123_plain_strerror(). + * Optional means: Any of or both the parameters may be NULL. + * + * \return Non-NULL pointer when successful. + */ +EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error); + +/** Delete handle, mh is either a valid mpg123 handle or NULL. */ +EXPORT void mpg123_delete(mpg123_handle *mh); + +/** Enumeration of the parameters types that it is possible to set/get. */ +enum mpg123_parms +{ + MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ + MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ + MPG123_ADD_FLAGS, /**< add some flags (integer) */ + MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */ + MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */ + MPG123_RVA, /**< one of the RVA choices above (integer) */ + MPG123_DOWNSPEED, /**< play a frame N times (integer) */ + MPG123_UPSPEED, /**< play every Nth frame (integer) */ + MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */ + MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */ + MPG123_ICY_INTERVAL, /**< stream contains ICY metadata with this interval (integer) */ + MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ + MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */ + MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ + MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */ + MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */ + ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/ + ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */ + ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */ +}; + +/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */ +enum mpg123_param_flags +{ + MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ + ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */ + ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */ + ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */ + ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */ + ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */ + ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */ + ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ + ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */ + ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ + ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */ + ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */ + ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */ + ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */ + ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */ + ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */ + ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */ +}; + +/** choices for MPG123_RVA */ +enum mpg123_param_rva +{ + MPG123_RVA_OFF = 0 /**< RVA disabled (default). */ + ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */ + ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */ + ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */ +}; + +/* TODO: Assess the possibilities and troubles of changing parameters during playback. */ + +/** Set a specific parameter, for a specific mpg123_handle, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_handle. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval); + +/** Feature set available for query with mpg123_feature. */ +enum mpg123_feature_set +{ + MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */ + ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */ + ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */ + ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */ + ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */ + ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */ + ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */ + ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */ + ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */ + ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */ + ,MPG123_FEATURE_PARSE_ICY /**< ICY support */ + ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */ +}; + +/** Query libmpg123 feature, 1 for success, 0 for unimplemented functions. */ +EXPORT int mpg123_feature(const enum mpg123_feature_set key); + +/* @} */ + + +/** \defgroup mpg123_error mpg123 error handling + * + * Functions to get text version of the error numbers and an enumeration + * of the error codes returned by libmpg123. + * + * Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * The positive range of return values is used for "useful" values when appropriate. + * + * @{ + */ + +/** Enumeration of the message and error codes and returned by libmpg123 functions. */ +enum mpg123_errors +{ + MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */ + MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */ + MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */ + MPG123_ERR=-1, /**< Generic Error */ + MPG123_OK=0, /**< Success */ + MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */ + MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */ + MPG123_BAD_RATE, /**< Invalid sample rate specified. */ + MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */ + MPG123_BAD_PARAM, /**< Bad parameter id! */ + MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */ + MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */ + MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */ + MPG123_BAD_DECODER, /**< Invalid decoder choice. */ + MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */ + MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */ + MPG123_BAD_RVA, /**< Invalid RVA mode. */ + MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */ + MPG123_NO_SPACE, /**< Not enough buffer space. */ + MPG123_BAD_TYPES, /**< Incompatible numeric data types. */ + MPG123_BAD_BAND, /**< Bad equalizer band. */ + MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */ + MPG123_ERR_READER, /**< Error reading the stream. */ + MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */ + MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/ + MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */ + MPG123_BAD_FILE, /**< File access error. */ + MPG123_NO_SEEK, /**< Seek not supported by stream. */ + MPG123_NO_READER, /**< No stream opened. */ + MPG123_BAD_PARS, /**< Bad parameter handle. */ + MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */ + MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */ + MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */ + MPG123_NO_8BIT, /**< No 8bit encoding possible. */ + MPG123_BAD_ALIGN, /**< Stack aligmnent error */ + MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */ + MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */ + MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */ + MPG123_BAD_KEY, /**< Bad key value given. */ + MPG123_NO_INDEX, /**< No frame index in this build. */ + MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */ + MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */ + MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */ + ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */ + ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */ + ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */ + ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */ + ,MPG123_INT_OVERFLOW /**< Some integer overflow. */ +}; + +/** Return a string describing that error errcode means. */ +EXPORT const char* mpg123_plain_strerror(int errcode); + +/** Give string describing what error has occured in the context of handle mh. + * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via + * char *errmsg = mpg123_strerror(mh) + * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. */ +EXPORT const char* mpg123_strerror(mpg123_handle *mh); + +/** Return the plain errcode intead of a string. */ +EXPORT int mpg123_errcode(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_decoder mpg123 decoder selection + * + * Functions to list and select the available decoders. + * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). + * + * @{ + */ + +/** Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). */ +EXPORT const char **mpg123_decoders(void); + +/** Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). */ +EXPORT const char **mpg123_supported_decoders(void); + +/** Set the chosen decoder to 'decoder_name' */ +EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name); + +/** Get the currently active decoder engine name. + The active decoder engine can vary depening on output constraints, + mostly non-resampling, integer output is accelerated via 3DNow & Co. but for other modes a fallback engine kicks in. + Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. + \return The decoder name or NULL on error. */ +EXPORT const char* mpg123_current_decoder(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_output mpg123 output audio format + * + * Functions to get and select the format of the decoded audio. + * + * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance. + * + * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including ptimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again). + * + * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness. + * + * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation. + * + * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format. + * + * @{ + */ + +/** An enum over all sample types possibly known to mpg123. + * The values are designed as bit flags to allow bitmasking for encoding families. + * + * Note that (your build of) libmpg123 does not necessarily support all these. + * Usually, you can expect the 8bit encodings and signed 16 bit. + * Also 32bit float will be usual beginning with mpg123-1.7.0 . + * What you should bear in mind is that (SSE, etc) optimized routines may be absent + * for some formats. We do have SSE for 16, 32 bit and float, though. + * 24 bit integer is done via postprocessing of 32 bit output -- just cutting + * the last byte, no rounding, even. If you want better, do it yourself. + * + * All formats are in native byte order. If you need different endinaness, you + * can simply postprocess the output buffers (libmpg123 wouldn't do anything else). + * mpg123_encsize() can be helpful there. + */ +enum mpg123_enc_enum +{ + MPG123_ENC_8 = 0x00f /**< 0000 0000 1111 Some 8 bit integer encoding. */ + ,MPG123_ENC_16 = 0x040 /**< 0000 0100 0000 Some 16 bit integer encoding. */ + ,MPG123_ENC_24 = 0x4000 /**< 0100 0000 0000 0000 Some 24 bit integer encoding. */ + ,MPG123_ENC_32 = 0x100 /**< 0001 0000 0000 Some 32 bit integer encoding. */ + ,MPG123_ENC_SIGNED = 0x080 /**< 0000 1000 0000 Some signed integer encoding. */ + ,MPG123_ENC_FLOAT = 0xe00 /**< 1110 0000 0000 Some float encoding. */ + ,MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) /**< 1101 0000 signed 16 bit */ + ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) /**< 0110 0000 unsigned 16 bit */ + ,MPG123_ENC_UNSIGNED_8 = 0x01 /**< 0000 0001 unsigned 8 bit */ + ,MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) /**< 1000 0010 signed 8 bit */ + ,MPG123_ENC_ULAW_8 = 0x04 /**< 0000 0100 ulaw 8 bit */ + ,MPG123_ENC_ALAW_8 = 0x08 /**< 0000 1000 alaw 8 bit */ + ,MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 /**< 0001 0001 1000 0000 signed 32 bit */ + ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 /**< 0010 0001 0000 0000 unsigned 32 bit */ + ,MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 /**< 0101 0000 1000 0000 signed 24 bit */ + ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 /**< 0110 0000 0000 0000 unsigned 24 bit */ + ,MPG123_ENC_FLOAT_32 = 0x200 /**< 0010 0000 0000 32bit float */ + ,MPG123_ENC_FLOAT_64 = 0x400 /**< 0100 0000 0000 64bit float */ + ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 + | MPG123_ENC_SIGNED_8 | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8 + | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32 + | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24 + | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 ) /**< Any encoding on the list. */ +}; + +/** They can be combined into one number (3) to indicate mono and stereo... */ +enum mpg123_channelcount +{ + MPG123_MONO = 1 + ,MPG123_STEREO = 2 +}; + +/** An array of supported standard sample rates + * These are possible native sample rates of MPEG audio files. + * You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. + * \param list Store a pointer to the sample rates array there. + * \param number Store the number of sample rates there. */ +EXPORT void mpg123_rates(const long **list, size_t *number); + +/** An array of supported audio encodings. + * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED). + * \param list Store a pointer to the encodings array there. + * \param number Store the number of encodings there. */ +EXPORT void mpg123_encodings(const int **list, size_t *number); + +/** Return the size (in bytes) of one mono sample of the named encoding. + * \param encoding The encoding value to analyze. + * \return positive size of encoding in bytes, 0 on invalid encoding. */ +EXPORT int mpg123_encsize(int encoding); + +/** Configure a mpg123 handle to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_format_none(mpg123_handle *mh); + +/** Configure mpg123 handle to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_format_all(mpg123_handle *mh); + +/** Set the audio format support of a mpg123_handle in detail: + * \param mh audio decoder handle + * \param rate The sample rate value (in Hertz). + * \param channels A combination of MPG123_STEREO and MPG123_MONO. + * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here. + * \return MPG123_OK on success, MPG123_ERR if there was an error. */ +EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings); + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_handle. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding); + +/** Get the current output format written to the addresses givenr. */ +EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding); + +/*@}*/ + + +/** \defgroup mpg123_input mpg123 file input and decoding + * + * Functions for input bitstream and decoding operations. + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * @{ + */ + +/* reading samples / triggering decoding, possible return values: */ +/** Enumeration of the error codes returned by libmpg123 functions. */ + +/** Open and prepare to decode the specified file by filesystem path. + * This does not open HTTP urls; libmpg123 contains no networking code. + * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed(). + */ +EXPORT int mpg123_open(mpg123_handle *mh, const char *path); + +/** Use an already opened file descriptor as the bitstream input + * mpg123_close() will _not_ close the file descriptor. + */ +EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_replace_reader_handle()! + * mpg123_close() will call the cleanup callback for your handle (if you gave one). + */ +EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); + +/** Open a new bitstream and prepare for direct feeding + * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. + */ +EXPORT int mpg123_open_feed(mpg123_handle *mh); + +/** Closes the source, if libmpg123 opened it. */ +EXPORT int mpg123_close(mpg123_handle *mh); + +/** Read from stream and decode up to outmemsize bytes. + * \param outmemory address of output buffer to write to + * \param outmemsize maximum number of bytes to write + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out for MPG123_DONE and friends!) */ +EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Feed data for a stream that has been opened with mpg123_open_feed(). + * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples. + * \param in input buffer + * \param size number of input bytes + * \return error/message code. */ +EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size); + +/** Decode MPEG Audio from inmemory to outmemory. + * This is very close to a drop-in replacement for old mpglib. + * When you give zero-sized output buffer the input will be parsed until + * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) + * without taking decoded data. + * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-). + * You can actually always decide if you want those specialized functions in separate steps or one call this one here. + * \param inmemory input buffer + * \param inmemsize number of input bytes + * \param outmemory output buffer + * \param outmemsize maximum number of output bytes + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out especially for MPG123_NEED_MORE) + */ +EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Decode next MPEG frame to internal buffer + * or read a frame and return after setting a new format. + * \param num current frame offset gets stored there + * \param audio This pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Decode current MPEG frame to internal buffer. + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + * \param num last frame offset gets stored there + * \param audio this pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Find, read and parse the next mp3 frame + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + */ +EXPORT int mpg123_framebyframe_next(mpg123_handle *mh); + +/** Get access to the raw input data for the last parsed frame. + * This gives you a direct look (and write access) to the frame body data. + * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()). + * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present. + * You can provide NULL for a parameter pointer when you are not interested in the value. + * + * \param header the 4-byte MPEG header + * \param bodydata pointer to the frame body stored in the handle (without the header) + * \param bodybytes size of frame body in bytes (without the header) + * \return MPG123_OK if there was a yet un-decoded frame to get the data from, MPG123_ERR otherwise (without further explanation, the error state of the mpg123_handle is not modified by this function). + */ +EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes); + +/** Get the input position (byte offset in stream) of the last parsed frame. + * This can be used for external seek index building, for example. + * It just returns the internally stored offset, regardless of validity -- you ensure that a valid frame has been parsed before! */ +EXPORT off_t mpg123_framepos(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_seek mpg123 position and seeking + * + * Functions querying and manipulating position in the decoded audio bitstream. + * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. + * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) + * The general usage is modelled after stdlib's ftell() and fseek(). + * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: + * - SEEK_SET: set position to (or near to) specified offset + * - SEEK_CUR: change position by offset from now + * - SEEK_END: set position to offset from end + * + * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. + * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! + * Short: When you care about the sample position, don't mess with those parameters;-) + * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). + * + * @{ + */ + +/** Returns the current position in samples. + * On the next read, you'd get that sample. */ +EXPORT off_t mpg123_tell(mpg123_handle *mh); + +/** Returns the frame number that the next read will give you data from. */ +EXPORT off_t mpg123_tellframe(mpg123_handle *mh); + +/** Returns the current byte offset in the input stream. */ +EXPORT off_t mpg123_tell_stream(mpg123_handle *mh); + +/** Seek to a desired sample offset. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); + +/** Seek to a desired sample offset in data feeding mode. + * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. + * \param input_offset The position it expects to be at the + * next time data is fed to mpg123_decode(). + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); + +/** Seek to a desired MPEG frame index. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); + +/** Return a MPEG frame offset corresponding to an offset in seconds. + * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. + * \return frame offset >= 0 or error/message code */ +EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec); + +/** Give access to the frame index table that is managed for seeking. + * You are asked not to modify the values... Use mpg123_set_index to set the + * seek index + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill); + +/** Set the frame index table + * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets + * to NULL and fill to 0 will clear the index and free the allocated memory used by the index. + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); + +/** Get information about current and remaining frames/seconds. + * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + * You provide an offset (in frames) from now and a number of output bytes + * served by libmpg123 but not yet played. You get the projected current frame + * and seconds, as well as the remaining frames/seconds. This does _not_ care + * about skipped samples due to gapless playback. */ +EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); + +/*@}*/ + + +/** \defgroup mpg123_voleq mpg123 volume and equalizer + * + * @{ + */ + +enum mpg123_channels +{ + MPG123_LEFT=0x1 /**< The Left Channel. */ + ,MPG123_RIGHT=0x2 /**< The Right Channel. */ + ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */ +}; + +/** Set the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. + * \param band The equaliser band to change (from 0 to 31) + * \param val The (linear) adjustment factor. */ +EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val); + +/** Get the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. + * \param band The equaliser band to change (from 0 to 31) + * \return The (linear) adjustment factor. */ +EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band); + +/** Reset the 32 Band Audio Equalizer settings to flat */ +EXPORT int mpg123_reset_eq(mpg123_handle *mh); + +/** Set the absolute output volume including the RVA setting, + * vol<0 just applies (a possibly changed) RVA setting. */ +EXPORT int mpg123_volume(mpg123_handle *mh, double vol); + +/** Adjust output volume including the RVA setting by chosen amount */ +EXPORT int mpg123_volume_change(mpg123_handle *mh, double change); + +/** Return current volume setting, the actual value due to RVA, and the RVA + * adjustment itself. It's all as double float value to abstract the sample + * format. The volume values are linear factors / amplitudes (not percent) + * and the RVA value is in decibels. */ +EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db); + +/* TODO: Set some preamp in addition / to replace internal RVA handling? */ + +/*@}*/ + + +/** \defgroup mpg123_status mpg123 status and information + * + * @{ + */ + +/** Enumeration of the mode types of Variable Bitrate */ +enum mpg123_vbr { + MPG123_CBR=0, /**< Constant Bitrate Mode (default) */ + MPG123_VBR, /**< Variable Bitrate Mode */ + MPG123_ABR /**< Average Bitrate Mode */ +}; + +/** Enumeration of the MPEG Versions */ +enum mpg123_version { + MPG123_1_0=0, /**< MPEG Version 1.0 */ + MPG123_2_0, /**< MPEG Version 2.0 */ + MPG123_2_5 /**< MPEG Version 2.5 */ +}; + + +/** Enumeration of the MPEG Audio mode. + * Only the mono mode has 1 channel, the others have 2 channels. */ +enum mpg123_mode { + MPG123_M_STEREO=0, /**< Standard Stereo. */ + MPG123_M_JOINT, /**< Joint Stereo. */ + MPG123_M_DUAL, /**< Dual Channel. */ + MPG123_M_MONO /**< Single Channel. */ +}; + + +/** Enumeration of the MPEG Audio flag bits */ +enum mpg123_flags { + MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */ + MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */ + MPG123_PRIVATE=0x4, /**< The private bit has been set. */ + MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */ +}; + +/** Data structure for storing information about a frame of MPEG Audio */ +struct mpg123_frameinfo +{ + enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */ + int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */ + long rate; /**< The sampling rate in Hz. */ + enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */ + int mode_ext; /**< The mode extension bit flag. */ + int framesize; /**< The size of the frame (in bytes, including header). */ + enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */ + int emphasis; /**< The emphasis type. */ + int bitrate; /**< Bitrate of the frame (kbps). */ + int abr_rate; /**< The target average bitrate. */ + enum mpg123_vbr vbr; /**< The VBR mode. */ +}; + +/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. */ +EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); + +/** Get the safe output buffer size for all cases (when you want to replace the internal buffer) */ +EXPORT size_t mpg123_safe_buffer(void); + +/** Make a full parsing scan of each frame in the file. ID3 tags are found. An accurate length + * value is stored. Seek index will be filled. A seek back to current position + * is performed. At all, this function refuses work when stream is + * not seekable. + * \return MPG123_OK or MPG123_ERR. + */ +EXPORT int mpg123_scan(mpg123_handle *mh); + +/** Return, if possible, the full (expected) length of current track in samples. + * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ +EXPORT off_t mpg123_length(mpg123_handle *mh); + +/** Override the value for file size in bytes. + * Useful for getting sensible track length values in feed mode or for HTTP streams. + * \return MPG123_OK or MPG123_ERR */ +EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size); + +/** Returns the time (seconds) per frame; <0 is error. */ +EXPORT double mpg123_tpf(mpg123_handle *mh); + +/** Returns the samples per frame for the most recently parsed frame; <0 is error. */ +EXPORT int mpg123_spf(mpg123_handle *mh); + +/** Get and reset the clip count. */ +EXPORT long mpg123_clip(mpg123_handle *mh); + + +/** The key values for state information from mpg123_getstate(). */ +enum mpg123_state +{ + MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true) */ + ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */ + ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files (the leading one featuring gapless info). */ +}; + +/** Get various current decoder/stream state information. + * \param key the key to identify the information to give. + * \param val the address to return (long) integer values to + * \param fval the address to return floating point values to + * \return MPG123_OK or MPG123_ERR for success + */ +EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval); + +/*@}*/ + + +/** \defgroup mpg123_metadata mpg123 metadata handling + * + * Functions to retrieve the metadata from MPEG Audio files and streams. + * Also includes string handling functions. + * + * @{ + */ + +/** Data structure for storing strings in a safer way than a standard C-String. + * Can also hold a number of null-terminated strings. */ +typedef struct +{ + char* p; /**< pointer to the string data */ + size_t size; /**< raw number of bytes allocated */ + size_t fill; /**< number of used bytes (including closing zero byte) */ +} mpg123_string; + +/** Create and allocate memory for a new mpg123_string */ +EXPORT void mpg123_init_string(mpg123_string* sb); + +/** Free-up mempory for an existing mpg123_string */ +EXPORT void mpg123_free_string(mpg123_string* sb); + +/** Change the size of a mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news); + +/** Increase size of a mpg123_string if necessary (it may stay larger). + * Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). + * That way, you can preallocate memory and safely work afterwards with pieces. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news); + +/** Copy the contents of one mpg123_string string to another. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to); + +/** Append a C-String to an mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff); + +/** Append a C-substring to an mpg123 string + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Set the conents of a mpg123_string to a C-string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff); + +/** Set the contents of a mpg123_string to a C-substring + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters). + * \return character count + * \param sb the string + * \param utf8 a flag to tell if the string is in utf8 encoding + * Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. +*/ +EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8); + +/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */ +enum mpg123_text_encoding +{ + mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */ + ,mpg123_text_utf8 = 1 /**< UTF-8 */ + ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */ + ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */ + ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */ + ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. + * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when + * you don't mess with the reserved code points. If you want to decode little endian data + * without BOM you need to prepend 0xff 0xfe yourself. */ + ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */ + ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, + * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 + * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 + * types (we expect a BOM before real data there), not so for utf16be!*/ + ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */ +}; + +/** The encoding byte values from ID3v2. */ +enum mpg123_id3_enc +{ + mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */ + ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */ + ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */ + ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */ + ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */ +}; + +/** Convert ID3 encoding byte to mpg123 encoding index. */ +EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte); + +/** Store text data in string, after converting to UTF-8 from indicated encoding + * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb) + * \param sb target string + * \param enc mpg123 text encoding value + * \param source source buffer with plain unsigned bytes (you might need to cast from char *) + * \param source_size number of bytes in the source buffer + * + * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). + * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). + */ +EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size); + +/** Sub data structure for ID3v2, for storing various text fields (including comments). + * This is for ID3v2 COMM, TXXX and all the other text fields. + * Only COMM and TXXX have a description, only COMM and USLT have a language. + * You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */ +typedef struct +{ + char lang[3]; /**< Three-letter language code (not terminated). */ + char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */ + mpg123_string description; /**< Empty for the generic comment... */ + mpg123_string text; /**< ... */ +} mpg123_text; + +/** Data structure for storing IDV3v2 tags. + * This structure is not a direct binary mapping with the file contents. + * The ID3v2 text frames are allowed to contain multiple strings. + * So check for null bytes until you reach the mpg123_string fill. + * All text is encoded in UTF-8. */ +typedef struct +{ + unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */ + mpg123_string *title; /**< Title string (pointer into text_list). */ + mpg123_string *artist; /**< Artist string (pointer into text_list). */ + mpg123_string *album; /**< Album string (pointer into text_list). */ + mpg123_string *year; /**< The year as a string (pointer into text_list). */ + mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */ + mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */ + /* Encountered ID3v2 fields are appended to these lists. + There can be multiple occurences, the pointers above always point to the last encountered data. */ + mpg123_text *comment_list; /**< Array of comments. */ + size_t comments; /**< Number of comments. */ + mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */ + size_t texts; /**< Numer of text fields. */ + mpg123_text *extra; /**< The array of extra (TXXX) fields. */ + size_t extras; /**< Number of extra text (TXXX) fields. */ +} mpg123_id3v2; + +/** Data structure for ID3v1 tags (the last 128 bytes of a file). + * Don't take anything for granted (like string termination)! + * Also note the change ID3v1.1 did: comment[28] = 0; comment[19] = track_number + * It is your task to support ID3v1 only or ID3v1.1 ...*/ +typedef struct +{ + char tag[3]; /**< Always the string "TAG", the classic intro. */ + char title[30]; /**< Title string. */ + char artist[30]; /**< Artist string. */ + char album[30]; /**< Album string. */ + char year[4]; /**< Year string. */ + char comment[30]; /**< Comment string. */ + unsigned char genre; /**< Genre index. */ +} mpg123_id3v1; + +#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ +#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ +#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ +#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ + +/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future). + The check function returns a combination of flags. */ +EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */ + +/** Clean up meta data storage (ID3v2 and ICY), freeing memory. */ +EXPORT void mpg123_meta_free(mpg123_handle *mh); + +/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call. + * v1 and/or v2 can be set to NULL when there is no corresponding data. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2); + +/** Point icy_meta to existing data structure wich may change on any next read/decode function call. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */ + +/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. + * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) . + * \param icy_text The input data in ICY encoding + * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */ +EXPORT char* mpg123_icy2utf8(const char* icy_text); + + +/* @} */ + + +/** \defgroup mpg123_advpar mpg123 advanced parameter API + * + * Direct access to a parameter set without full handle around it. + * Possible uses: + * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). + * - Use one set of parameters for multiple handles. + * + * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() + * family) directly return a fully qualified mpg123 error code, the ones + * operating on full handles normally MPG123_OK or MPG123_ERR, storing the + * specific error code itseld inside the handle. + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder parameters. */ +struct mpg123_pars_struct; + +/** Opaque structure for the libmpg123 decoder parameters. */ +typedef struct mpg123_pars_struct mpg123_pars; + +/** Create a handle with preset parameters. */ +EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error); + +/** Allocate memory for and return a pointer to a new mpg123_pars */ +EXPORT mpg123_pars *mpg123_new_pars(int *error); + +/** Delete and free up memory used by a mpg123_pars data structure */ +EXPORT void mpg123_delete_pars(mpg123_pars* mp); + +/** Configure mpg123 parameters to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_fmt_none(mpg123_pars *mp); + +/** Configure mpg123 parameters to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_fmt_all(mpg123_pars *mp); + +/** Set the audio format support of a mpg123_pars in detail: + \param rate The sample rate value (in Hertz). + \param channels A combination of MPG123_STEREO and MPG123_MONO. + \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no support). + \return 0 on success, -1 if there was an error. / +*/ +EXPORT int mpg123_fmt(mpg123_pars *mh, long rate, int channels, int encodings); /* 0 is good, -1 is error */ + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_pars. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_fmt_support(mpg123_pars *mh, long rate, int encoding); + +/** Set a specific parameter, for a specific mpg123_pars, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_pars. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval); + +/* @} */ + + +/** \defgroup mpg123_lowio mpg123 low level I/O + * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... + * + * @{ */ + +/** Replace default internal buffer with user-supplied buffer. + * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. */ +EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size); + +/** The max size of one frame's decoded output with current settings. + * Use that to determine an appropriate minimum buffer size for decoding one frame. */ +EXPORT size_t mpg123_outblock(mpg123_handle *mh); + +/** Replace low-level stream access functions; read and lseek as known in POSIX. + * You can use this to make any fancy file opening/closing yourself, + * using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a "real" file descriptor...). + * Setting a function to NULL means that the default internal read is + * used (active from next mpg123_open call on). + * Note: As it would be troublesome to mess with this while having a file open, + * this implies mpg123_close(). */ +EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int)); + +/** Replace I/O functions with your own ones operating on some kind of handle instead of integer descriptors. + * The handle is a void pointer, so you can pass any data you want... + * mpg123_open_handle() is the call you make to use the I/O defined here. + * There is no fallback to internal read/seek here. + * Note: As it would be troublesome to mess with this while having a file open, + * this mpg123_close() is implied here. + * \param r_read The callback for reading (behaviour like posix read). + * \param r_lseek The callback for seeking (like posix lseek). + * \param cleanup A callback to clean up an I/O handle on mpg123_close, can be NULL for none (you take care of cleaning your handles). */ +EXPORT int mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*)); + +/* @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/config/solaris/ia32/config.h b/node_modules/lame/deps/mpg123/config/solaris/ia32/config.h new file mode 100644 index 0000000..e025375 --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/solaris/ia32/config.h @@ -0,0 +1,437 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +#define ABI_ALIGN_FUN 1 + +/* Define to use proper rounding. */ +/* #undef ACCURATE_ROUNDING */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +/* #undef ASMALIGN_EXP */ + +/* Define if __attribute__((aligned(16))) shall be used */ +/* #undef CCALIGN */ + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "oss" + +/* Define if building with dynamcally linked libmpg123 */ +/* #undef DYNAMIC_BUILD */ + +/* Define if FIFO support is enabled. */ +#define FIFO 1 + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the <alc.h> header file. */ +/* #undef HAVE_ALC_H */ + +/* Define to 1 if you have the <Alib.h> header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the <AL/alc.h> header file. */ +/* #undef HAVE_AL_ALC_H */ + +/* Define to 1 if you have the <AL/al.h> header file. */ +/* #undef HAVE_AL_AL_H */ + +/* Define to 1 if you have the <al.h> header file. */ +/* #undef HAVE_AL_H */ + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <asm/audioio.h> header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the <audios.h> header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */ +/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + +/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */ +/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + +/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have the <CUlib.h> header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */ +#define HAVE_GAI_ADDRCONFIG 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <langinfo.h> header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +/* #undef HAVE_LIBMX */ + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the <linux/soundcard.h> header file. */ +/* #undef HAVE_LINUX_SOUNDCARD_H */ + +/* Define to 1 if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if libltdl is available */ +/* #undef HAVE_LTDL */ + +/* Define to 1 if you have the <machine/soundcard.h> header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the <OpenAL/alc.h> header file. */ +/* #undef HAVE_OPENAL_ALC_H */ + +/* Define to 1 if you have the <OpenAL/al.h> header file. */ +/* #undef HAVE_OPENAL_AL_H */ + +/* Define to 1 if you have the <os2me.h> header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the <os2.h> header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the <sched.h> header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#define HAVE_SCHED_SETSCHEDULER 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#define HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the `setuid' function. */ +#define HAVE_SETUID 1 + +/* Define to 1 if you have the <signal.h> header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the <sndio.h> header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sun/audioio.h> header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audioio.h> header file. */ +#define HAVE_SYS_AUDIOIO_H 1 + +/* Define to 1 if you have the <sys/audio.h> header file. */ +#define HAVE_SYS_AUDIO_H 1 + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the <sys/signal.h> header file. */ +#define HAVE_SYS_SIGNAL_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/soundcard.h> header file. */ +#define HAVE_SYS_SOUNDCARD_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define this if you have the POSIX termios library */ +#define HAVE_TERMIOS 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the <windows.h> header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the <ws2tcpip.h> header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to indicate that float storage follows IEEE754. */ +#define IEEE_FLOAT 1 + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define this to the size of long type in bits, used for LFS small/native + alias functions. */ +#define LFS_ALIAS_BITS 32 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* The suffix for module files. */ +#define MODULE_FILE_SUFFIX ".la" + +/* Define if network support is enabled. */ +/* #undef NETWORK */ + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit and 24 bit integer output. */ +/* #undef NO_32BIT */ + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +/* #undef NO_REAL */ + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.14.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.14.4" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if modules are enabled */ +/* #undef USE_MODULES */ + +/* Version number of package */ +#define VERSION "1.14.4" + +/* Define to use Win32 named pipes */ +/* #undef WANT_WIN32_FIFO */ + +/* Define to use Win32 sockets */ +/* #undef WANT_WIN32_SOCKETS */ + +/* Define to use Unicode for Windows */ +/* #undef WANT_WIN32_UNICODE */ + +/* WinXP and above for ipv6 */ +/* #undef WINVER */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#define _FILE_OFFSET_BITS 64 + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* WinXP and above for ipv6 */ +/* #undef _WIN32_WINNT */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if <sys/types.h> does not define. */ +/* #undef int16_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef int32_t */ + +/* Define to `long int' if <sys/types.h> does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef size_t */ + +/* Define to `long' if <sys/types.h> does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if <sys/types.h> does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* #undef uint32_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef uintptr_t */ diff --git a/node_modules/lame/deps/mpg123/config/solaris/ia32/mpg123.h b/node_modules/lame/deps/mpg123/config/solaris/ia32/mpg123.h new file mode 100644 index 0000000..421288a --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/solaris/ia32/mpg123.h @@ -0,0 +1,1075 @@ +/* + libmpg123: MPEG Audio Decoder library (version 1.14.4) + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#ifndef MPG123_LIB_H +#define MPG123_LIB_H + +/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ + +/* A macro to check at compile time which set of API functions to expect. + This should be incremented at least each time a new symbol is added to the header. */ +#define MPG123_API_VERSION 36 + +/* These aren't actually in use... seems to work without using libtool. */ +#ifdef BUILD_MPG123_DLL +/* The dll exports. */ +#define EXPORT __declspec(dllexport) +#else +#ifdef LINK_MPG123_DLL +/* The exe imports. */ +#define EXPORT __declspec(dllimport) +#else +/* Nothing on normal/UNIX builds */ +#define EXPORT +#endif +#endif + +#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */ +#include <stdlib.h> +#include <sys/types.h> + +/* Simplified large file handling. + I used to have a check here that prevents building for a library with conflicting large file setup + (application that uses 32 bit offsets with library that uses 64 bits). + While that was perfectly fine in an environment where there is one incarnation of the library, + it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the + correct header matching the 32 bit library (where large files need explicit support) or + the 64 bit library (where there is no distinction). + + New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support, + and thus functions with added suffix (mpg123_open_64). + Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when + building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now. + Link failure is not the expected outcome of any half-sane usage anymore. + + More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names. +*/ + +/* + Now, the renaming of large file aware functions. + By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +*/ +#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) + +/* Need some trickery to concatenate the value(s) of the given macro(s). */ +#define MPG123_MACROCAT_REALLY(a, b) a ## b +#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b) +#ifndef MPG123_LARGESUFFIX +#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS) +#endif +#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX) + +#define mpg123_open MPG123_LARGENAME(mpg123_open) +#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd) +#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle) +#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode) +#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame) +#define mpg123_tell MPG123_LARGENAME(mpg123_tell) +#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe) +#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream) +#define mpg123_seek MPG123_LARGENAME(mpg123_seek) +#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek) +#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame) +#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe) +#define mpg123_index MPG123_LARGENAME(mpg123_index) +#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) +#define mpg123_position MPG123_LARGENAME(mpg123_position) +#define mpg123_length MPG123_LARGENAME(mpg123_length) +#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) +#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) +#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) +#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos) + +#endif /* largefile hackery */ + +#endif /* MPG123_NO_CONFIGURE */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \defgroup mpg123_init mpg123 library and handle setup + * + * Functions to initialise and shutdown the mpg123 library and handles. + * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) + * Tip: Use a RVA setting... + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder handle. */ +struct mpg123_handle_struct; + +/** Opaque structure for the libmpg123 decoder handle. + * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner. + */ +typedef struct mpg123_handle_struct mpg123_handle; + +/** Function to initialise the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + * + * \return MPG123_OK if successful, otherwise an error number. + */ +EXPORT int mpg123_init(void); + +/** Function to close down the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */ +EXPORT void mpg123_exit(void); + +/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()). + * and optional retrieval of an error code to feed to mpg123_plain_strerror(). + * Optional means: Any of or both the parameters may be NULL. + * + * \return Non-NULL pointer when successful. + */ +EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error); + +/** Delete handle, mh is either a valid mpg123 handle or NULL. */ +EXPORT void mpg123_delete(mpg123_handle *mh); + +/** Enumeration of the parameters types that it is possible to set/get. */ +enum mpg123_parms +{ + MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ + MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ + MPG123_ADD_FLAGS, /**< add some flags (integer) */ + MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */ + MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */ + MPG123_RVA, /**< one of the RVA choices above (integer) */ + MPG123_DOWNSPEED, /**< play a frame N times (integer) */ + MPG123_UPSPEED, /**< play every Nth frame (integer) */ + MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */ + MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */ + MPG123_ICY_INTERVAL, /**< stream contains ICY metadata with this interval (integer) */ + MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ + MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */ + MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ + MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */ + MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */ + ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/ + ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */ + ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */ +}; + +/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */ +enum mpg123_param_flags +{ + MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ + ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */ + ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */ + ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */ + ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */ + ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */ + ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */ + ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ + ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */ + ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ + ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */ + ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */ + ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */ + ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */ + ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */ + ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */ + ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */ +}; + +/** choices for MPG123_RVA */ +enum mpg123_param_rva +{ + MPG123_RVA_OFF = 0 /**< RVA disabled (default). */ + ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */ + ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */ + ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */ +}; + +/* TODO: Assess the possibilities and troubles of changing parameters during playback. */ + +/** Set a specific parameter, for a specific mpg123_handle, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_handle. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval); + +/** Feature set available for query with mpg123_feature. */ +enum mpg123_feature_set +{ + MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */ + ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */ + ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */ + ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */ + ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */ + ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */ + ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */ + ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */ + ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */ + ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */ + ,MPG123_FEATURE_PARSE_ICY /**< ICY support */ + ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */ +}; + +/** Query libmpg123 feature, 1 for success, 0 for unimplemented functions. */ +EXPORT int mpg123_feature(const enum mpg123_feature_set key); + +/* @} */ + + +/** \defgroup mpg123_error mpg123 error handling + * + * Functions to get text version of the error numbers and an enumeration + * of the error codes returned by libmpg123. + * + * Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * The positive range of return values is used for "useful" values when appropriate. + * + * @{ + */ + +/** Enumeration of the message and error codes and returned by libmpg123 functions. */ +enum mpg123_errors +{ + MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */ + MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */ + MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */ + MPG123_ERR=-1, /**< Generic Error */ + MPG123_OK=0, /**< Success */ + MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */ + MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */ + MPG123_BAD_RATE, /**< Invalid sample rate specified. */ + MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */ + MPG123_BAD_PARAM, /**< Bad parameter id! */ + MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */ + MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */ + MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */ + MPG123_BAD_DECODER, /**< Invalid decoder choice. */ + MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */ + MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */ + MPG123_BAD_RVA, /**< Invalid RVA mode. */ + MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */ + MPG123_NO_SPACE, /**< Not enough buffer space. */ + MPG123_BAD_TYPES, /**< Incompatible numeric data types. */ + MPG123_BAD_BAND, /**< Bad equalizer band. */ + MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */ + MPG123_ERR_READER, /**< Error reading the stream. */ + MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */ + MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/ + MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */ + MPG123_BAD_FILE, /**< File access error. */ + MPG123_NO_SEEK, /**< Seek not supported by stream. */ + MPG123_NO_READER, /**< No stream opened. */ + MPG123_BAD_PARS, /**< Bad parameter handle. */ + MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */ + MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */ + MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */ + MPG123_NO_8BIT, /**< No 8bit encoding possible. */ + MPG123_BAD_ALIGN, /**< Stack aligmnent error */ + MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */ + MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */ + MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */ + MPG123_BAD_KEY, /**< Bad key value given. */ + MPG123_NO_INDEX, /**< No frame index in this build. */ + MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */ + MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */ + MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */ + ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */ + ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */ + ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */ + ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */ + ,MPG123_INT_OVERFLOW /**< Some integer overflow. */ +}; + +/** Return a string describing that error errcode means. */ +EXPORT const char* mpg123_plain_strerror(int errcode); + +/** Give string describing what error has occured in the context of handle mh. + * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via + * char *errmsg = mpg123_strerror(mh) + * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. */ +EXPORT const char* mpg123_strerror(mpg123_handle *mh); + +/** Return the plain errcode intead of a string. */ +EXPORT int mpg123_errcode(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_decoder mpg123 decoder selection + * + * Functions to list and select the available decoders. + * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). + * + * @{ + */ + +/** Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). */ +EXPORT const char **mpg123_decoders(void); + +/** Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). */ +EXPORT const char **mpg123_supported_decoders(void); + +/** Set the chosen decoder to 'decoder_name' */ +EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name); + +/** Get the currently active decoder engine name. + The active decoder engine can vary depening on output constraints, + mostly non-resampling, integer output is accelerated via 3DNow & Co. but for other modes a fallback engine kicks in. + Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. + \return The decoder name or NULL on error. */ +EXPORT const char* mpg123_current_decoder(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_output mpg123 output audio format + * + * Functions to get and select the format of the decoded audio. + * + * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance. + * + * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including ptimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again). + * + * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness. + * + * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation. + * + * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format. + * + * @{ + */ + +/** An enum over all sample types possibly known to mpg123. + * The values are designed as bit flags to allow bitmasking for encoding families. + * + * Note that (your build of) libmpg123 does not necessarily support all these. + * Usually, you can expect the 8bit encodings and signed 16 bit. + * Also 32bit float will be usual beginning with mpg123-1.7.0 . + * What you should bear in mind is that (SSE, etc) optimized routines may be absent + * for some formats. We do have SSE for 16, 32 bit and float, though. + * 24 bit integer is done via postprocessing of 32 bit output -- just cutting + * the last byte, no rounding, even. If you want better, do it yourself. + * + * All formats are in native byte order. If you need different endinaness, you + * can simply postprocess the output buffers (libmpg123 wouldn't do anything else). + * mpg123_encsize() can be helpful there. + */ +enum mpg123_enc_enum +{ + MPG123_ENC_8 = 0x00f /**< 0000 0000 1111 Some 8 bit integer encoding. */ + ,MPG123_ENC_16 = 0x040 /**< 0000 0100 0000 Some 16 bit integer encoding. */ + ,MPG123_ENC_24 = 0x4000 /**< 0100 0000 0000 0000 Some 24 bit integer encoding. */ + ,MPG123_ENC_32 = 0x100 /**< 0001 0000 0000 Some 32 bit integer encoding. */ + ,MPG123_ENC_SIGNED = 0x080 /**< 0000 1000 0000 Some signed integer encoding. */ + ,MPG123_ENC_FLOAT = 0xe00 /**< 1110 0000 0000 Some float encoding. */ + ,MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) /**< 1101 0000 signed 16 bit */ + ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) /**< 0110 0000 unsigned 16 bit */ + ,MPG123_ENC_UNSIGNED_8 = 0x01 /**< 0000 0001 unsigned 8 bit */ + ,MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) /**< 1000 0010 signed 8 bit */ + ,MPG123_ENC_ULAW_8 = 0x04 /**< 0000 0100 ulaw 8 bit */ + ,MPG123_ENC_ALAW_8 = 0x08 /**< 0000 1000 alaw 8 bit */ + ,MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 /**< 0001 0001 1000 0000 signed 32 bit */ + ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 /**< 0010 0001 0000 0000 unsigned 32 bit */ + ,MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 /**< 0101 0000 1000 0000 signed 24 bit */ + ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 /**< 0110 0000 0000 0000 unsigned 24 bit */ + ,MPG123_ENC_FLOAT_32 = 0x200 /**< 0010 0000 0000 32bit float */ + ,MPG123_ENC_FLOAT_64 = 0x400 /**< 0100 0000 0000 64bit float */ + ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 + | MPG123_ENC_SIGNED_8 | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8 + | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32 + | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24 + | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 ) /**< Any encoding on the list. */ +}; + +/** They can be combined into one number (3) to indicate mono and stereo... */ +enum mpg123_channelcount +{ + MPG123_MONO = 1 + ,MPG123_STEREO = 2 +}; + +/** An array of supported standard sample rates + * These are possible native sample rates of MPEG audio files. + * You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. + * \param list Store a pointer to the sample rates array there. + * \param number Store the number of sample rates there. */ +EXPORT void mpg123_rates(const long **list, size_t *number); + +/** An array of supported audio encodings. + * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED). + * \param list Store a pointer to the encodings array there. + * \param number Store the number of encodings there. */ +EXPORT void mpg123_encodings(const int **list, size_t *number); + +/** Return the size (in bytes) of one mono sample of the named encoding. + * \param encoding The encoding value to analyze. + * \return positive size of encoding in bytes, 0 on invalid encoding. */ +EXPORT int mpg123_encsize(int encoding); + +/** Configure a mpg123 handle to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_format_none(mpg123_handle *mh); + +/** Configure mpg123 handle to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_format_all(mpg123_handle *mh); + +/** Set the audio format support of a mpg123_handle in detail: + * \param mh audio decoder handle + * \param rate The sample rate value (in Hertz). + * \param channels A combination of MPG123_STEREO and MPG123_MONO. + * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here. + * \return MPG123_OK on success, MPG123_ERR if there was an error. */ +EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings); + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_handle. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding); + +/** Get the current output format written to the addresses givenr. */ +EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding); + +/*@}*/ + + +/** \defgroup mpg123_input mpg123 file input and decoding + * + * Functions for input bitstream and decoding operations. + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * @{ + */ + +/* reading samples / triggering decoding, possible return values: */ +/** Enumeration of the error codes returned by libmpg123 functions. */ + +/** Open and prepare to decode the specified file by filesystem path. + * This does not open HTTP urls; libmpg123 contains no networking code. + * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed(). + */ +EXPORT int mpg123_open(mpg123_handle *mh, const char *path); + +/** Use an already opened file descriptor as the bitstream input + * mpg123_close() will _not_ close the file descriptor. + */ +EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_replace_reader_handle()! + * mpg123_close() will call the cleanup callback for your handle (if you gave one). + */ +EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); + +/** Open a new bitstream and prepare for direct feeding + * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. + */ +EXPORT int mpg123_open_feed(mpg123_handle *mh); + +/** Closes the source, if libmpg123 opened it. */ +EXPORT int mpg123_close(mpg123_handle *mh); + +/** Read from stream and decode up to outmemsize bytes. + * \param outmemory address of output buffer to write to + * \param outmemsize maximum number of bytes to write + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out for MPG123_DONE and friends!) */ +EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Feed data for a stream that has been opened with mpg123_open_feed(). + * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples. + * \param in input buffer + * \param size number of input bytes + * \return error/message code. */ +EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size); + +/** Decode MPEG Audio from inmemory to outmemory. + * This is very close to a drop-in replacement for old mpglib. + * When you give zero-sized output buffer the input will be parsed until + * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) + * without taking decoded data. + * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-). + * You can actually always decide if you want those specialized functions in separate steps or one call this one here. + * \param inmemory input buffer + * \param inmemsize number of input bytes + * \param outmemory output buffer + * \param outmemsize maximum number of output bytes + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out especially for MPG123_NEED_MORE) + */ +EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Decode next MPEG frame to internal buffer + * or read a frame and return after setting a new format. + * \param num current frame offset gets stored there + * \param audio This pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Decode current MPEG frame to internal buffer. + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + * \param num last frame offset gets stored there + * \param audio this pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Find, read and parse the next mp3 frame + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + */ +EXPORT int mpg123_framebyframe_next(mpg123_handle *mh); + +/** Get access to the raw input data for the last parsed frame. + * This gives you a direct look (and write access) to the frame body data. + * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()). + * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present. + * You can provide NULL for a parameter pointer when you are not interested in the value. + * + * \param header the 4-byte MPEG header + * \param bodydata pointer to the frame body stored in the handle (without the header) + * \param bodybytes size of frame body in bytes (without the header) + * \return MPG123_OK if there was a yet un-decoded frame to get the data from, MPG123_ERR otherwise (without further explanation, the error state of the mpg123_handle is not modified by this function). + */ +EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes); + +/** Get the input position (byte offset in stream) of the last parsed frame. + * This can be used for external seek index building, for example. + * It just returns the internally stored offset, regardless of validity -- you ensure that a valid frame has been parsed before! */ +EXPORT off_t mpg123_framepos(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_seek mpg123 position and seeking + * + * Functions querying and manipulating position in the decoded audio bitstream. + * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. + * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) + * The general usage is modelled after stdlib's ftell() and fseek(). + * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: + * - SEEK_SET: set position to (or near to) specified offset + * - SEEK_CUR: change position by offset from now + * - SEEK_END: set position to offset from end + * + * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. + * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! + * Short: When you care about the sample position, don't mess with those parameters;-) + * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). + * + * @{ + */ + +/** Returns the current position in samples. + * On the next read, you'd get that sample. */ +EXPORT off_t mpg123_tell(mpg123_handle *mh); + +/** Returns the frame number that the next read will give you data from. */ +EXPORT off_t mpg123_tellframe(mpg123_handle *mh); + +/** Returns the current byte offset in the input stream. */ +EXPORT off_t mpg123_tell_stream(mpg123_handle *mh); + +/** Seek to a desired sample offset. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); + +/** Seek to a desired sample offset in data feeding mode. + * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. + * \param input_offset The position it expects to be at the + * next time data is fed to mpg123_decode(). + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); + +/** Seek to a desired MPEG frame index. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); + +/** Return a MPEG frame offset corresponding to an offset in seconds. + * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. + * \return frame offset >= 0 or error/message code */ +EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec); + +/** Give access to the frame index table that is managed for seeking. + * You are asked not to modify the values... Use mpg123_set_index to set the + * seek index + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill); + +/** Set the frame index table + * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets + * to NULL and fill to 0 will clear the index and free the allocated memory used by the index. + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); + +/** Get information about current and remaining frames/seconds. + * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + * You provide an offset (in frames) from now and a number of output bytes + * served by libmpg123 but not yet played. You get the projected current frame + * and seconds, as well as the remaining frames/seconds. This does _not_ care + * about skipped samples due to gapless playback. */ +EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); + +/*@}*/ + + +/** \defgroup mpg123_voleq mpg123 volume and equalizer + * + * @{ + */ + +enum mpg123_channels +{ + MPG123_LEFT=0x1 /**< The Left Channel. */ + ,MPG123_RIGHT=0x2 /**< The Right Channel. */ + ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */ +}; + +/** Set the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. + * \param band The equaliser band to change (from 0 to 31) + * \param val The (linear) adjustment factor. */ +EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val); + +/** Get the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. + * \param band The equaliser band to change (from 0 to 31) + * \return The (linear) adjustment factor. */ +EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band); + +/** Reset the 32 Band Audio Equalizer settings to flat */ +EXPORT int mpg123_reset_eq(mpg123_handle *mh); + +/** Set the absolute output volume including the RVA setting, + * vol<0 just applies (a possibly changed) RVA setting. */ +EXPORT int mpg123_volume(mpg123_handle *mh, double vol); + +/** Adjust output volume including the RVA setting by chosen amount */ +EXPORT int mpg123_volume_change(mpg123_handle *mh, double change); + +/** Return current volume setting, the actual value due to RVA, and the RVA + * adjustment itself. It's all as double float value to abstract the sample + * format. The volume values are linear factors / amplitudes (not percent) + * and the RVA value is in decibels. */ +EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db); + +/* TODO: Set some preamp in addition / to replace internal RVA handling? */ + +/*@}*/ + + +/** \defgroup mpg123_status mpg123 status and information + * + * @{ + */ + +/** Enumeration of the mode types of Variable Bitrate */ +enum mpg123_vbr { + MPG123_CBR=0, /**< Constant Bitrate Mode (default) */ + MPG123_VBR, /**< Variable Bitrate Mode */ + MPG123_ABR /**< Average Bitrate Mode */ +}; + +/** Enumeration of the MPEG Versions */ +enum mpg123_version { + MPG123_1_0=0, /**< MPEG Version 1.0 */ + MPG123_2_0, /**< MPEG Version 2.0 */ + MPG123_2_5 /**< MPEG Version 2.5 */ +}; + + +/** Enumeration of the MPEG Audio mode. + * Only the mono mode has 1 channel, the others have 2 channels. */ +enum mpg123_mode { + MPG123_M_STEREO=0, /**< Standard Stereo. */ + MPG123_M_JOINT, /**< Joint Stereo. */ + MPG123_M_DUAL, /**< Dual Channel. */ + MPG123_M_MONO /**< Single Channel. */ +}; + + +/** Enumeration of the MPEG Audio flag bits */ +enum mpg123_flags { + MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */ + MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */ + MPG123_PRIVATE=0x4, /**< The private bit has been set. */ + MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */ +}; + +/** Data structure for storing information about a frame of MPEG Audio */ +struct mpg123_frameinfo +{ + enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */ + int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */ + long rate; /**< The sampling rate in Hz. */ + enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */ + int mode_ext; /**< The mode extension bit flag. */ + int framesize; /**< The size of the frame (in bytes, including header). */ + enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */ + int emphasis; /**< The emphasis type. */ + int bitrate; /**< Bitrate of the frame (kbps). */ + int abr_rate; /**< The target average bitrate. */ + enum mpg123_vbr vbr; /**< The VBR mode. */ +}; + +/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. */ +EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); + +/** Get the safe output buffer size for all cases (when you want to replace the internal buffer) */ +EXPORT size_t mpg123_safe_buffer(void); + +/** Make a full parsing scan of each frame in the file. ID3 tags are found. An accurate length + * value is stored. Seek index will be filled. A seek back to current position + * is performed. At all, this function refuses work when stream is + * not seekable. + * \return MPG123_OK or MPG123_ERR. + */ +EXPORT int mpg123_scan(mpg123_handle *mh); + +/** Return, if possible, the full (expected) length of current track in samples. + * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ +EXPORT off_t mpg123_length(mpg123_handle *mh); + +/** Override the value for file size in bytes. + * Useful for getting sensible track length values in feed mode or for HTTP streams. + * \return MPG123_OK or MPG123_ERR */ +EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size); + +/** Returns the time (seconds) per frame; <0 is error. */ +EXPORT double mpg123_tpf(mpg123_handle *mh); + +/** Returns the samples per frame for the most recently parsed frame; <0 is error. */ +EXPORT int mpg123_spf(mpg123_handle *mh); + +/** Get and reset the clip count. */ +EXPORT long mpg123_clip(mpg123_handle *mh); + + +/** The key values for state information from mpg123_getstate(). */ +enum mpg123_state +{ + MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true) */ + ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */ + ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files (the leading one featuring gapless info). */ +}; + +/** Get various current decoder/stream state information. + * \param key the key to identify the information to give. + * \param val the address to return (long) integer values to + * \param fval the address to return floating point values to + * \return MPG123_OK or MPG123_ERR for success + */ +EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval); + +/*@}*/ + + +/** \defgroup mpg123_metadata mpg123 metadata handling + * + * Functions to retrieve the metadata from MPEG Audio files and streams. + * Also includes string handling functions. + * + * @{ + */ + +/** Data structure for storing strings in a safer way than a standard C-String. + * Can also hold a number of null-terminated strings. */ +typedef struct +{ + char* p; /**< pointer to the string data */ + size_t size; /**< raw number of bytes allocated */ + size_t fill; /**< number of used bytes (including closing zero byte) */ +} mpg123_string; + +/** Create and allocate memory for a new mpg123_string */ +EXPORT void mpg123_init_string(mpg123_string* sb); + +/** Free-up mempory for an existing mpg123_string */ +EXPORT void mpg123_free_string(mpg123_string* sb); + +/** Change the size of a mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news); + +/** Increase size of a mpg123_string if necessary (it may stay larger). + * Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). + * That way, you can preallocate memory and safely work afterwards with pieces. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news); + +/** Copy the contents of one mpg123_string string to another. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to); + +/** Append a C-String to an mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff); + +/** Append a C-substring to an mpg123 string + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Set the conents of a mpg123_string to a C-string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff); + +/** Set the contents of a mpg123_string to a C-substring + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters). + * \return character count + * \param sb the string + * \param utf8 a flag to tell if the string is in utf8 encoding + * Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. +*/ +EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8); + +/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */ +enum mpg123_text_encoding +{ + mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */ + ,mpg123_text_utf8 = 1 /**< UTF-8 */ + ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */ + ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */ + ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */ + ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. + * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when + * you don't mess with the reserved code points. If you want to decode little endian data + * without BOM you need to prepend 0xff 0xfe yourself. */ + ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */ + ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, + * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 + * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 + * types (we expect a BOM before real data there), not so for utf16be!*/ + ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */ +}; + +/** The encoding byte values from ID3v2. */ +enum mpg123_id3_enc +{ + mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */ + ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */ + ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */ + ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */ + ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */ +}; + +/** Convert ID3 encoding byte to mpg123 encoding index. */ +EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte); + +/** Store text data in string, after converting to UTF-8 from indicated encoding + * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb) + * \param sb target string + * \param enc mpg123 text encoding value + * \param source source buffer with plain unsigned bytes (you might need to cast from char *) + * \param source_size number of bytes in the source buffer + * + * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). + * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). + */ +EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size); + +/** Sub data structure for ID3v2, for storing various text fields (including comments). + * This is for ID3v2 COMM, TXXX and all the other text fields. + * Only COMM and TXXX have a description, only COMM and USLT have a language. + * You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */ +typedef struct +{ + char lang[3]; /**< Three-letter language code (not terminated). */ + char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */ + mpg123_string description; /**< Empty for the generic comment... */ + mpg123_string text; /**< ... */ +} mpg123_text; + +/** Data structure for storing IDV3v2 tags. + * This structure is not a direct binary mapping with the file contents. + * The ID3v2 text frames are allowed to contain multiple strings. + * So check for null bytes until you reach the mpg123_string fill. + * All text is encoded in UTF-8. */ +typedef struct +{ + unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */ + mpg123_string *title; /**< Title string (pointer into text_list). */ + mpg123_string *artist; /**< Artist string (pointer into text_list). */ + mpg123_string *album; /**< Album string (pointer into text_list). */ + mpg123_string *year; /**< The year as a string (pointer into text_list). */ + mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */ + mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */ + /* Encountered ID3v2 fields are appended to these lists. + There can be multiple occurences, the pointers above always point to the last encountered data. */ + mpg123_text *comment_list; /**< Array of comments. */ + size_t comments; /**< Number of comments. */ + mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */ + size_t texts; /**< Numer of text fields. */ + mpg123_text *extra; /**< The array of extra (TXXX) fields. */ + size_t extras; /**< Number of extra text (TXXX) fields. */ +} mpg123_id3v2; + +/** Data structure for ID3v1 tags (the last 128 bytes of a file). + * Don't take anything for granted (like string termination)! + * Also note the change ID3v1.1 did: comment[28] = 0; comment[19] = track_number + * It is your task to support ID3v1 only or ID3v1.1 ...*/ +typedef struct +{ + char tag[3]; /**< Always the string "TAG", the classic intro. */ + char title[30]; /**< Title string. */ + char artist[30]; /**< Artist string. */ + char album[30]; /**< Album string. */ + char year[4]; /**< Year string. */ + char comment[30]; /**< Comment string. */ + unsigned char genre; /**< Genre index. */ +} mpg123_id3v1; + +#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ +#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ +#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ +#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ + +/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future). + The check function returns a combination of flags. */ +EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */ + +/** Clean up meta data storage (ID3v2 and ICY), freeing memory. */ +EXPORT void mpg123_meta_free(mpg123_handle *mh); + +/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call. + * v1 and/or v2 can be set to NULL when there is no corresponding data. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2); + +/** Point icy_meta to existing data structure wich may change on any next read/decode function call. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */ + +/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. + * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) . + * \param icy_text The input data in ICY encoding + * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */ +EXPORT char* mpg123_icy2utf8(const char* icy_text); + + +/* @} */ + + +/** \defgroup mpg123_advpar mpg123 advanced parameter API + * + * Direct access to a parameter set without full handle around it. + * Possible uses: + * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). + * - Use one set of parameters for multiple handles. + * + * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() + * family) directly return a fully qualified mpg123 error code, the ones + * operating on full handles normally MPG123_OK or MPG123_ERR, storing the + * specific error code itseld inside the handle. + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder parameters. */ +struct mpg123_pars_struct; + +/** Opaque structure for the libmpg123 decoder parameters. */ +typedef struct mpg123_pars_struct mpg123_pars; + +/** Create a handle with preset parameters. */ +EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error); + +/** Allocate memory for and return a pointer to a new mpg123_pars */ +EXPORT mpg123_pars *mpg123_new_pars(int *error); + +/** Delete and free up memory used by a mpg123_pars data structure */ +EXPORT void mpg123_delete_pars(mpg123_pars* mp); + +/** Configure mpg123 parameters to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_fmt_none(mpg123_pars *mp); + +/** Configure mpg123 parameters to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_fmt_all(mpg123_pars *mp); + +/** Set the audio format support of a mpg123_pars in detail: + \param rate The sample rate value (in Hertz). + \param channels A combination of MPG123_STEREO and MPG123_MONO. + \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no support). + \return 0 on success, -1 if there was an error. / +*/ +EXPORT int mpg123_fmt(mpg123_pars *mh, long rate, int channels, int encodings); /* 0 is good, -1 is error */ + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_pars. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_fmt_support(mpg123_pars *mh, long rate, int encoding); + +/** Set a specific parameter, for a specific mpg123_pars, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_pars. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval); + +/* @} */ + + +/** \defgroup mpg123_lowio mpg123 low level I/O + * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... + * + * @{ */ + +/** Replace default internal buffer with user-supplied buffer. + * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. */ +EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size); + +/** The max size of one frame's decoded output with current settings. + * Use that to determine an appropriate minimum buffer size for decoding one frame. */ +EXPORT size_t mpg123_outblock(mpg123_handle *mh); + +/** Replace low-level stream access functions; read and lseek as known in POSIX. + * You can use this to make any fancy file opening/closing yourself, + * using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a "real" file descriptor...). + * Setting a function to NULL means that the default internal read is + * used (active from next mpg123_open call on). + * Note: As it would be troublesome to mess with this while having a file open, + * this implies mpg123_close(). */ +EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int)); + +/** Replace I/O functions with your own ones operating on some kind of handle instead of integer descriptors. + * The handle is a void pointer, so you can pass any data you want... + * mpg123_open_handle() is the call you make to use the I/O defined here. + * There is no fallback to internal read/seek here. + * Note: As it would be troublesome to mess with this while having a file open, + * this mpg123_close() is implied here. + * \param r_read The callback for reading (behaviour like posix read). + * \param r_lseek The callback for seeking (like posix lseek). + * \param cleanup A callback to clean up an I/O handle on mpg123_close, can be NULL for none (you take care of cleaning your handles). */ +EXPORT int mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*)); + +/* @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/config/solaris/x64/config.h b/node_modules/lame/deps/mpg123/config/solaris/x64/config.h new file mode 100644 index 0000000..e9e1580 --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/solaris/x64/config.h @@ -0,0 +1,437 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +/* #undef ABI_ALIGN_FUN */ + +/* Define to use proper rounding. */ +/* #undef ACCURATE_ROUNDING */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +/* #undef ASMALIGN_EXP */ + +/* Define if __attribute__((aligned(16))) shall be used */ +#define CCALIGN 1 + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "oss" + +/* Define if building with dynamcally linked libmpg123 */ +/* #undef DYNAMIC_BUILD */ + +/* Define if FIFO support is enabled. */ +#define FIFO 1 + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the <alc.h> header file. */ +/* #undef HAVE_ALC_H */ + +/* Define to 1 if you have the <Alib.h> header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the <AL/alc.h> header file. */ +/* #undef HAVE_AL_ALC_H */ + +/* Define to 1 if you have the <AL/al.h> header file. */ +/* #undef HAVE_AL_AL_H */ + +/* Define to 1 if you have the <al.h> header file. */ +/* #undef HAVE_AL_H */ + +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the <asm/audioio.h> header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the <audios.h> header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */ +/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + +/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */ +/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + +/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have the <CUlib.h> header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */ +#define HAVE_GAI_ADDRCONFIG 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <langinfo.h> header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +/* #undef HAVE_LIBMX */ + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the <linux/soundcard.h> header file. */ +/* #undef HAVE_LINUX_SOUNDCARD_H */ + +/* Define to 1 if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if libltdl is available */ +/* #undef HAVE_LTDL */ + +/* Define to 1 if you have the <machine/soundcard.h> header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the <OpenAL/alc.h> header file. */ +/* #undef HAVE_OPENAL_ALC_H */ + +/* Define to 1 if you have the <OpenAL/al.h> header file. */ +/* #undef HAVE_OPENAL_AL_H */ + +/* Define to 1 if you have the <os2me.h> header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the <os2.h> header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the <sched.h> header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#define HAVE_SCHED_SETSCHEDULER 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#define HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the `setuid' function. */ +#define HAVE_SETUID 1 + +/* Define to 1 if you have the <signal.h> header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the <sndio.h> header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sun/audioio.h> header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the <sys/audioio.h> header file. */ +#define HAVE_SYS_AUDIOIO_H 1 + +/* Define to 1 if you have the <sys/audio.h> header file. */ +#define HAVE_SYS_AUDIO_H 1 + +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the <sys/resource.h> header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the <sys/signal.h> header file. */ +#define HAVE_SYS_SIGNAL_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/soundcard.h> header file. */ +#define HAVE_SYS_SOUNDCARD_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define this if you have the POSIX termios library */ +#define HAVE_TERMIOS 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the <windows.h> header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the <ws2tcpip.h> header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to indicate that float storage follows IEEE754. */ +#define IEEE_FLOAT 1 + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define this to the size of long type in bits, used for LFS small/native + alias functions. */ +#define LFS_ALIAS_BITS 64 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* The suffix for module files. */ +#define MODULE_FILE_SUFFIX ".la" + +/* Define if network support is enabled. */ +/* #undef NETWORK */ + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit and 24 bit integer output. */ +/* #undef NO_32BIT */ + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +/* #undef NO_REAL */ + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.14.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.14.4" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if modules are enabled */ +/* #undef USE_MODULES */ + +/* Version number of package */ +#define VERSION "1.14.4" + +/* Define to use Win32 named pipes */ +/* #undef WANT_WIN32_FIFO */ + +/* Define to use Win32 sockets */ +/* #undef WANT_WIN32_SOCKETS */ + +/* Define to use Unicode for Windows */ +/* #undef WANT_WIN32_UNICODE */ + +/* WinXP and above for ipv6 */ +/* #undef WINVER */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* WinXP and above for ipv6 */ +/* #undef _WIN32_WINNT */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if <sys/types.h> does not define. */ +/* #undef int16_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef int32_t */ + +/* Define to `long int' if <sys/types.h> does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef size_t */ + +/* Define to `long' if <sys/types.h> does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if <sys/types.h> does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +/* #undef uint32_t */ + +/* Define to `unsigned long' if <sys/types.h> does not define. */ +/* #undef uintptr_t */ diff --git a/node_modules/lame/deps/mpg123/config/solaris/x64/mpg123.h b/node_modules/lame/deps/mpg123/config/solaris/x64/mpg123.h new file mode 100644 index 0000000..421288a --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/solaris/x64/mpg123.h @@ -0,0 +1,1075 @@ +/* + libmpg123: MPEG Audio Decoder library (version 1.14.4) + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#ifndef MPG123_LIB_H +#define MPG123_LIB_H + +/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ + +/* A macro to check at compile time which set of API functions to expect. + This should be incremented at least each time a new symbol is added to the header. */ +#define MPG123_API_VERSION 36 + +/* These aren't actually in use... seems to work without using libtool. */ +#ifdef BUILD_MPG123_DLL +/* The dll exports. */ +#define EXPORT __declspec(dllexport) +#else +#ifdef LINK_MPG123_DLL +/* The exe imports. */ +#define EXPORT __declspec(dllimport) +#else +/* Nothing on normal/UNIX builds */ +#define EXPORT +#endif +#endif + +#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */ +#include <stdlib.h> +#include <sys/types.h> + +/* Simplified large file handling. + I used to have a check here that prevents building for a library with conflicting large file setup + (application that uses 32 bit offsets with library that uses 64 bits). + While that was perfectly fine in an environment where there is one incarnation of the library, + it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the + correct header matching the 32 bit library (where large files need explicit support) or + the 64 bit library (where there is no distinction). + + New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support, + and thus functions with added suffix (mpg123_open_64). + Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when + building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now. + Link failure is not the expected outcome of any half-sane usage anymore. + + More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names. +*/ + +/* + Now, the renaming of large file aware functions. + By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +*/ +#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) + +/* Need some trickery to concatenate the value(s) of the given macro(s). */ +#define MPG123_MACROCAT_REALLY(a, b) a ## b +#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b) +#ifndef MPG123_LARGESUFFIX +#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS) +#endif +#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX) + +#define mpg123_open MPG123_LARGENAME(mpg123_open) +#define mpg123_open_fd MPG123_LARGENAME(mpg123_open_fd) +#define mpg123_open_handle MPG123_LARGENAME(mpg123_open_handle) +#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode) +#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame) +#define mpg123_tell MPG123_LARGENAME(mpg123_tell) +#define mpg123_tellframe MPG123_LARGENAME(mpg123_tellframe) +#define mpg123_tell_stream MPG123_LARGENAME(mpg123_tell_stream) +#define mpg123_seek MPG123_LARGENAME(mpg123_seek) +#define mpg123_feedseek MPG123_LARGENAME(mpg123_feedseek) +#define mpg123_seek_frame MPG123_LARGENAME(mpg123_seek_frame) +#define mpg123_timeframe MPG123_LARGENAME(mpg123_timeframe) +#define mpg123_index MPG123_LARGENAME(mpg123_index) +#define mpg123_set_index MPG123_LARGENAME(mpg123_set_index) +#define mpg123_position MPG123_LARGENAME(mpg123_position) +#define mpg123_length MPG123_LARGENAME(mpg123_length) +#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize) +#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader) +#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle) +#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos) + +#endif /* largefile hackery */ + +#endif /* MPG123_NO_CONFIGURE */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \defgroup mpg123_init mpg123 library and handle setup + * + * Functions to initialise and shutdown the mpg123 library and handles. + * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) + * Tip: Use a RVA setting... + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder handle. */ +struct mpg123_handle_struct; + +/** Opaque structure for the libmpg123 decoder handle. + * Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner. + */ +typedef struct mpg123_handle_struct mpg123_handle; + +/** Function to initialise the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + * + * \return MPG123_OK if successful, otherwise an error number. + */ +EXPORT int mpg123_init(void); + +/** Function to close down the mpg123 library. + * This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */ +EXPORT void mpg123_exit(void); + +/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()). + * and optional retrieval of an error code to feed to mpg123_plain_strerror(). + * Optional means: Any of or both the parameters may be NULL. + * + * \return Non-NULL pointer when successful. + */ +EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error); + +/** Delete handle, mh is either a valid mpg123 handle or NULL. */ +EXPORT void mpg123_delete(mpg123_handle *mh); + +/** Enumeration of the parameters types that it is possible to set/get. */ +enum mpg123_parms +{ + MPG123_VERBOSE = 0, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ + MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ + MPG123_ADD_FLAGS, /**< add some flags (integer) */ + MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */ + MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */ + MPG123_RVA, /**< one of the RVA choices above (integer) */ + MPG123_DOWNSPEED, /**< play a frame N times (integer) */ + MPG123_UPSPEED, /**< play every Nth frame (integer) */ + MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */ + MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */ + MPG123_ICY_INTERVAL, /**< stream contains ICY metadata with this interval (integer) */ + MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ + MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */ + MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ + MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it). */ + MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */ + ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/ + ,MPG123_FEEDPOOL /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */ + ,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */ +}; + +/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */ +enum mpg123_param_flags +{ + MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ + ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */ + ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */ + ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */ + ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */ + ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */ + ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */ + ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ + ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */ + ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ + ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */ + ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */ + ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */ + ,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */ + ,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */ + ,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */ + ,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */ +}; + +/** choices for MPG123_RVA */ +enum mpg123_param_rva +{ + MPG123_RVA_OFF = 0 /**< RVA disabled (default). */ + ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */ + ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */ + ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */ +}; + +/* TODO: Assess the possibilities and troubles of changing parameters during playback. */ + +/** Set a specific parameter, for a specific mpg123_handle, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_handle. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval); + +/** Feature set available for query with mpg123_feature. */ +enum mpg123_feature_set +{ + MPG123_FEATURE_ABI_UTF8OPEN = 0 /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */ + ,MPG123_FEATURE_OUTPUT_8BIT /**< 8bit output */ + ,MPG123_FEATURE_OUTPUT_16BIT /**< 16bit output */ + ,MPG123_FEATURE_OUTPUT_32BIT /**< 32bit output */ + ,MPG123_FEATURE_INDEX /**< support for building a frame index for accurate seeking */ + ,MPG123_FEATURE_PARSE_ID3V2 /**< id3v2 parsing */ + ,MPG123_FEATURE_DECODE_LAYER1 /**< mpeg layer-1 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER2 /**< mpeg layer-2 decoder enabled */ + ,MPG123_FEATURE_DECODE_LAYER3 /**< mpeg layer-3 decoder enabled */ + ,MPG123_FEATURE_DECODE_ACCURATE /**< accurate decoder rounding */ + ,MPG123_FEATURE_DECODE_DOWNSAMPLE /**< downsample (sample omit) */ + ,MPG123_FEATURE_DECODE_NTOM /**< flexible rate decoding */ + ,MPG123_FEATURE_PARSE_ICY /**< ICY support */ + ,MPG123_FEATURE_TIMEOUT_READ /**< Reader with timeout (network). */ +}; + +/** Query libmpg123 feature, 1 for success, 0 for unimplemented functions. */ +EXPORT int mpg123_feature(const enum mpg123_feature_set key); + +/* @} */ + + +/** \defgroup mpg123_error mpg123 error handling + * + * Functions to get text version of the error numbers and an enumeration + * of the error codes returned by libmpg123. + * + * Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * The positive range of return values is used for "useful" values when appropriate. + * + * @{ + */ + +/** Enumeration of the message and error codes and returned by libmpg123 functions. */ +enum mpg123_errors +{ + MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */ + MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */ + MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */ + MPG123_ERR=-1, /**< Generic Error */ + MPG123_OK=0, /**< Success */ + MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */ + MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */ + MPG123_BAD_RATE, /**< Invalid sample rate specified. */ + MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */ + MPG123_BAD_PARAM, /**< Bad parameter id! */ + MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */ + MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */ + MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */ + MPG123_BAD_DECODER, /**< Invalid decoder choice. */ + MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */ + MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */ + MPG123_BAD_RVA, /**< Invalid RVA mode. */ + MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */ + MPG123_NO_SPACE, /**< Not enough buffer space. */ + MPG123_BAD_TYPES, /**< Incompatible numeric data types. */ + MPG123_BAD_BAND, /**< Bad equalizer band. */ + MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */ + MPG123_ERR_READER, /**< Error reading the stream. */ + MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */ + MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/ + MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */ + MPG123_BAD_FILE, /**< File access error. */ + MPG123_NO_SEEK, /**< Seek not supported by stream. */ + MPG123_NO_READER, /**< No stream opened. */ + MPG123_BAD_PARS, /**< Bad parameter handle. */ + MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */ + MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */ + MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */ + MPG123_NO_8BIT, /**< No 8bit encoding possible. */ + MPG123_BAD_ALIGN, /**< Stack aligmnent error */ + MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */ + MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */ + MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */ + MPG123_BAD_KEY, /**< Bad key value given. */ + MPG123_NO_INDEX, /**< No frame index in this build. */ + MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */ + MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */ + MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */ + ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */ + ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */ + ,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */ + ,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */ + ,MPG123_INT_OVERFLOW /**< Some integer overflow. */ +}; + +/** Return a string describing that error errcode means. */ +EXPORT const char* mpg123_plain_strerror(int errcode); + +/** Give string describing what error has occured in the context of handle mh. + * When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via + * char *errmsg = mpg123_strerror(mh) + * This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. */ +EXPORT const char* mpg123_strerror(mpg123_handle *mh); + +/** Return the plain errcode intead of a string. */ +EXPORT int mpg123_errcode(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_decoder mpg123 decoder selection + * + * Functions to list and select the available decoders. + * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). + * + * @{ + */ + +/** Return a NULL-terminated array of generally available decoder names (plain 8bit ASCII). */ +EXPORT const char **mpg123_decoders(void); + +/** Return a NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII). */ +EXPORT const char **mpg123_supported_decoders(void); + +/** Set the chosen decoder to 'decoder_name' */ +EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name); + +/** Get the currently active decoder engine name. + The active decoder engine can vary depening on output constraints, + mostly non-resampling, integer output is accelerated via 3DNow & Co. but for other modes a fallback engine kicks in. + Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. + \return The decoder name or NULL on error. */ +EXPORT const char* mpg123_current_decoder(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_output mpg123 output audio format + * + * Functions to get and select the format of the decoded audio. + * + * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance. + * + * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including ptimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again). + * + * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness. + * + * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation. + * + * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format. + * + * @{ + */ + +/** An enum over all sample types possibly known to mpg123. + * The values are designed as bit flags to allow bitmasking for encoding families. + * + * Note that (your build of) libmpg123 does not necessarily support all these. + * Usually, you can expect the 8bit encodings and signed 16 bit. + * Also 32bit float will be usual beginning with mpg123-1.7.0 . + * What you should bear in mind is that (SSE, etc) optimized routines may be absent + * for some formats. We do have SSE for 16, 32 bit and float, though. + * 24 bit integer is done via postprocessing of 32 bit output -- just cutting + * the last byte, no rounding, even. If you want better, do it yourself. + * + * All formats are in native byte order. If you need different endinaness, you + * can simply postprocess the output buffers (libmpg123 wouldn't do anything else). + * mpg123_encsize() can be helpful there. + */ +enum mpg123_enc_enum +{ + MPG123_ENC_8 = 0x00f /**< 0000 0000 1111 Some 8 bit integer encoding. */ + ,MPG123_ENC_16 = 0x040 /**< 0000 0100 0000 Some 16 bit integer encoding. */ + ,MPG123_ENC_24 = 0x4000 /**< 0100 0000 0000 0000 Some 24 bit integer encoding. */ + ,MPG123_ENC_32 = 0x100 /**< 0001 0000 0000 Some 32 bit integer encoding. */ + ,MPG123_ENC_SIGNED = 0x080 /**< 0000 1000 0000 Some signed integer encoding. */ + ,MPG123_ENC_FLOAT = 0xe00 /**< 1110 0000 0000 Some float encoding. */ + ,MPG123_ENC_SIGNED_16 = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) /**< 1101 0000 signed 16 bit */ + ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20) /**< 0110 0000 unsigned 16 bit */ + ,MPG123_ENC_UNSIGNED_8 = 0x01 /**< 0000 0001 unsigned 8 bit */ + ,MPG123_ENC_SIGNED_8 = (MPG123_ENC_SIGNED|0x02) /**< 1000 0010 signed 8 bit */ + ,MPG123_ENC_ULAW_8 = 0x04 /**< 0000 0100 ulaw 8 bit */ + ,MPG123_ENC_ALAW_8 = 0x08 /**< 0000 1000 alaw 8 bit */ + ,MPG123_ENC_SIGNED_32 = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 /**< 0001 0001 1000 0000 signed 32 bit */ + ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000 /**< 0010 0001 0000 0000 unsigned 32 bit */ + ,MPG123_ENC_SIGNED_24 = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 /**< 0101 0000 1000 0000 signed 24 bit */ + ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000 /**< 0110 0000 0000 0000 unsigned 24 bit */ + ,MPG123_ENC_FLOAT_32 = 0x200 /**< 0010 0000 0000 32bit float */ + ,MPG123_ENC_FLOAT_64 = 0x400 /**< 0100 0000 0000 64bit float */ + ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16 | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 + | MPG123_ENC_SIGNED_8 | MPG123_ENC_ULAW_8 | MPG123_ENC_ALAW_8 + | MPG123_ENC_SIGNED_32 | MPG123_ENC_UNSIGNED_32 + | MPG123_ENC_SIGNED_24 | MPG123_ENC_UNSIGNED_24 + | MPG123_ENC_FLOAT_32 | MPG123_ENC_FLOAT_64 ) /**< Any encoding on the list. */ +}; + +/** They can be combined into one number (3) to indicate mono and stereo... */ +enum mpg123_channelcount +{ + MPG123_MONO = 1 + ,MPG123_STEREO = 2 +}; + +/** An array of supported standard sample rates + * These are possible native sample rates of MPEG audio files. + * You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. + * \param list Store a pointer to the sample rates array there. + * \param number Store the number of sample rates there. */ +EXPORT void mpg123_rates(const long **list, size_t *number); + +/** An array of supported audio encodings. + * An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED). + * \param list Store a pointer to the encodings array there. + * \param number Store the number of encodings there. */ +EXPORT void mpg123_encodings(const int **list, size_t *number); + +/** Return the size (in bytes) of one mono sample of the named encoding. + * \param encoding The encoding value to analyze. + * \return positive size of encoding in bytes, 0 on invalid encoding. */ +EXPORT int mpg123_encsize(int encoding); + +/** Configure a mpg123 handle to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_format_none(mpg123_handle *mh); + +/** Configure mpg123 handle to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_format_all(mpg123_handle *mh); + +/** Set the audio format support of a mpg123_handle in detail: + * \param mh audio decoder handle + * \param rate The sample rate value (in Hertz). + * \param channels A combination of MPG123_STEREO and MPG123_MONO. + * \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here. + * \return MPG123_OK on success, MPG123_ERR if there was an error. */ +EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings); + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_handle. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding); + +/** Get the current output format written to the addresses givenr. */ +EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding); + +/*@}*/ + + +/** \defgroup mpg123_input mpg123 file input and decoding + * + * Functions for input bitstream and decoding operations. + * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + * @{ + */ + +/* reading samples / triggering decoding, possible return values: */ +/** Enumeration of the error codes returned by libmpg123 functions. */ + +/** Open and prepare to decode the specified file by filesystem path. + * This does not open HTTP urls; libmpg123 contains no networking code. + * If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed(). + */ +EXPORT int mpg123_open(mpg123_handle *mh, const char *path); + +/** Use an already opened file descriptor as the bitstream input + * mpg123_close() will _not_ close the file descriptor. + */ +EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_replace_reader_handle()! + * mpg123_close() will call the cleanup callback for your handle (if you gave one). + */ +EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); + +/** Open a new bitstream and prepare for direct feeding + * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. + */ +EXPORT int mpg123_open_feed(mpg123_handle *mh); + +/** Closes the source, if libmpg123 opened it. */ +EXPORT int mpg123_close(mpg123_handle *mh); + +/** Read from stream and decode up to outmemsize bytes. + * \param outmemory address of output buffer to write to + * \param outmemsize maximum number of bytes to write + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out for MPG123_DONE and friends!) */ +EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Feed data for a stream that has been opened with mpg123_open_feed(). + * It's give and take: You provide the bytestream, mpg123 gives you the decoded samples. + * \param in input buffer + * \param size number of input bytes + * \return error/message code. */ +EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size); + +/** Decode MPEG Audio from inmemory to outmemory. + * This is very close to a drop-in replacement for old mpglib. + * When you give zero-sized output buffer the input will be parsed until + * decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) + * without taking decoded data. + * Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-). + * You can actually always decide if you want those specialized functions in separate steps or one call this one here. + * \param inmemory input buffer + * \param inmemsize number of input bytes + * \param outmemory output buffer + * \param outmemsize maximum number of output bytes + * \param done address to store the number of actually decoded bytes to + * \return error/message code (watch out especially for MPG123_NEED_MORE) + */ +EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done); + +/** Decode next MPEG frame to internal buffer + * or read a frame and return after setting a new format. + * \param num current frame offset gets stored there + * \param audio This pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Decode current MPEG frame to internal buffer. + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + * \param num last frame offset gets stored there + * \param audio this pointer is set to the internal buffer to read the decoded audio from. + * \param bytes number of output bytes ready in the buffer + */ +EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); + +/** Find, read and parse the next mp3 frame + * Warning: This is experimental API that might change in future releases! + * Please watch mpg123 development closely when using it. + */ +EXPORT int mpg123_framebyframe_next(mpg123_handle *mh); + +/** Get access to the raw input data for the last parsed frame. + * This gives you a direct look (and write access) to the frame body data. + * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()). + * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present. + * You can provide NULL for a parameter pointer when you are not interested in the value. + * + * \param header the 4-byte MPEG header + * \param bodydata pointer to the frame body stored in the handle (without the header) + * \param bodybytes size of frame body in bytes (without the header) + * \return MPG123_OK if there was a yet un-decoded frame to get the data from, MPG123_ERR otherwise (without further explanation, the error state of the mpg123_handle is not modified by this function). + */ +EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes); + +/** Get the input position (byte offset in stream) of the last parsed frame. + * This can be used for external seek index building, for example. + * It just returns the internally stored offset, regardless of validity -- you ensure that a valid frame has been parsed before! */ +EXPORT off_t mpg123_framepos(mpg123_handle *mh); + +/*@}*/ + + +/** \defgroup mpg123_seek mpg123 position and seeking + * + * Functions querying and manipulating position in the decoded audio bitstream. + * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. + * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) + * The general usage is modelled after stdlib's ftell() and fseek(). + * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: + * - SEEK_SET: set position to (or near to) specified offset + * - SEEK_CUR: change position by offset from now + * - SEEK_END: set position to offset from end + * + * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. + * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! + * Short: When you care about the sample position, don't mess with those parameters;-) + * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). + * + * @{ + */ + +/** Returns the current position in samples. + * On the next read, you'd get that sample. */ +EXPORT off_t mpg123_tell(mpg123_handle *mh); + +/** Returns the frame number that the next read will give you data from. */ +EXPORT off_t mpg123_tellframe(mpg123_handle *mh); + +/** Returns the current byte offset in the input stream. */ +EXPORT off_t mpg123_tell_stream(mpg123_handle *mh); + +/** Seek to a desired sample offset. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); + +/** Seek to a desired sample offset in data feeding mode. + * This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. + * \param input_offset The position it expects to be at the + * next time data is fed to mpg123_decode(). + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); + +/** Seek to a desired MPEG frame index. + * Set whence to SEEK_SET, SEEK_CUR or SEEK_END. + * \return The resulting offset >= 0 or error/message code */ +EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); + +/** Return a MPEG frame offset corresponding to an offset in seconds. + * This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. + * \return frame offset >= 0 or error/message code */ +EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec); + +/** Give access to the frame index table that is managed for seeking. + * You are asked not to modify the values... Use mpg123_set_index to set the + * seek index + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill); + +/** Set the frame index table + * Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets + * to NULL and fill to 0 will clear the index and free the allocated memory used by the index. + * \param offsets pointer to the index array + * \param step one index byte offset advances this many MPEG frames + * \param fill number of recorded index offsets; size of the array */ +EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); + +/** Get information about current and remaining frames/seconds. + * WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + * You provide an offset (in frames) from now and a number of output bytes + * served by libmpg123 but not yet played. You get the projected current frame + * and seconds, as well as the remaining frames/seconds. This does _not_ care + * about skipped samples due to gapless playback. */ +EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left); + +/*@}*/ + + +/** \defgroup mpg123_voleq mpg123 volume and equalizer + * + * @{ + */ + +enum mpg123_channels +{ + MPG123_LEFT=0x1 /**< The Left Channel. */ + ,MPG123_RIGHT=0x2 /**< The Right Channel. */ + ,MPG123_LR=0x3 /**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */ +}; + +/** Set the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. + * \param band The equaliser band to change (from 0 to 31) + * \param val The (linear) adjustment factor. */ +EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val); + +/** Get the 32 Band Audio Equalizer settings. + * \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. + * \param band The equaliser band to change (from 0 to 31) + * \return The (linear) adjustment factor. */ +EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band); + +/** Reset the 32 Band Audio Equalizer settings to flat */ +EXPORT int mpg123_reset_eq(mpg123_handle *mh); + +/** Set the absolute output volume including the RVA setting, + * vol<0 just applies (a possibly changed) RVA setting. */ +EXPORT int mpg123_volume(mpg123_handle *mh, double vol); + +/** Adjust output volume including the RVA setting by chosen amount */ +EXPORT int mpg123_volume_change(mpg123_handle *mh, double change); + +/** Return current volume setting, the actual value due to RVA, and the RVA + * adjustment itself. It's all as double float value to abstract the sample + * format. The volume values are linear factors / amplitudes (not percent) + * and the RVA value is in decibels. */ +EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db); + +/* TODO: Set some preamp in addition / to replace internal RVA handling? */ + +/*@}*/ + + +/** \defgroup mpg123_status mpg123 status and information + * + * @{ + */ + +/** Enumeration of the mode types of Variable Bitrate */ +enum mpg123_vbr { + MPG123_CBR=0, /**< Constant Bitrate Mode (default) */ + MPG123_VBR, /**< Variable Bitrate Mode */ + MPG123_ABR /**< Average Bitrate Mode */ +}; + +/** Enumeration of the MPEG Versions */ +enum mpg123_version { + MPG123_1_0=0, /**< MPEG Version 1.0 */ + MPG123_2_0, /**< MPEG Version 2.0 */ + MPG123_2_5 /**< MPEG Version 2.5 */ +}; + + +/** Enumeration of the MPEG Audio mode. + * Only the mono mode has 1 channel, the others have 2 channels. */ +enum mpg123_mode { + MPG123_M_STEREO=0, /**< Standard Stereo. */ + MPG123_M_JOINT, /**< Joint Stereo. */ + MPG123_M_DUAL, /**< Dual Channel. */ + MPG123_M_MONO /**< Single Channel. */ +}; + + +/** Enumeration of the MPEG Audio flag bits */ +enum mpg123_flags { + MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */ + MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */ + MPG123_PRIVATE=0x4, /**< The private bit has been set. */ + MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */ +}; + +/** Data structure for storing information about a frame of MPEG Audio */ +struct mpg123_frameinfo +{ + enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */ + int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */ + long rate; /**< The sampling rate in Hz. */ + enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */ + int mode_ext; /**< The mode extension bit flag. */ + int framesize; /**< The size of the frame (in bytes, including header). */ + enum mpg123_flags flags; /**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */ + int emphasis; /**< The emphasis type. */ + int bitrate; /**< Bitrate of the frame (kbps). */ + int abr_rate; /**< The target average bitrate. */ + enum mpg123_vbr vbr; /**< The VBR mode. */ +}; + +/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure. */ +EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi); + +/** Get the safe output buffer size for all cases (when you want to replace the internal buffer) */ +EXPORT size_t mpg123_safe_buffer(void); + +/** Make a full parsing scan of each frame in the file. ID3 tags are found. An accurate length + * value is stored. Seek index will be filled. A seek back to current position + * is performed. At all, this function refuses work when stream is + * not seekable. + * \return MPG123_OK or MPG123_ERR. + */ +EXPORT int mpg123_scan(mpg123_handle *mh); + +/** Return, if possible, the full (expected) length of current track in samples. + * \return length >= 0 or MPG123_ERR if there is no length guess possible. */ +EXPORT off_t mpg123_length(mpg123_handle *mh); + +/** Override the value for file size in bytes. + * Useful for getting sensible track length values in feed mode or for HTTP streams. + * \return MPG123_OK or MPG123_ERR */ +EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size); + +/** Returns the time (seconds) per frame; <0 is error. */ +EXPORT double mpg123_tpf(mpg123_handle *mh); + +/** Returns the samples per frame for the most recently parsed frame; <0 is error. */ +EXPORT int mpg123_spf(mpg123_handle *mh); + +/** Get and reset the clip count. */ +EXPORT long mpg123_clip(mpg123_handle *mh); + + +/** The key values for state information from mpg123_getstate(). */ +enum mpg123_state +{ + MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true) */ + ,MPG123_BUFFERFILL /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */ + ,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files (the leading one featuring gapless info). */ +}; + +/** Get various current decoder/stream state information. + * \param key the key to identify the information to give. + * \param val the address to return (long) integer values to + * \param fval the address to return floating point values to + * \return MPG123_OK or MPG123_ERR for success + */ +EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval); + +/*@}*/ + + +/** \defgroup mpg123_metadata mpg123 metadata handling + * + * Functions to retrieve the metadata from MPEG Audio files and streams. + * Also includes string handling functions. + * + * @{ + */ + +/** Data structure for storing strings in a safer way than a standard C-String. + * Can also hold a number of null-terminated strings. */ +typedef struct +{ + char* p; /**< pointer to the string data */ + size_t size; /**< raw number of bytes allocated */ + size_t fill; /**< number of used bytes (including closing zero byte) */ +} mpg123_string; + +/** Create and allocate memory for a new mpg123_string */ +EXPORT void mpg123_init_string(mpg123_string* sb); + +/** Free-up mempory for an existing mpg123_string */ +EXPORT void mpg123_free_string(mpg123_string* sb); + +/** Change the size of a mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news); + +/** Increase size of a mpg123_string if necessary (it may stay larger). + * Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). + * That way, you can preallocate memory and safely work afterwards with pieces. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news); + +/** Copy the contents of one mpg123_string string to another. + * \return 0 on error, 1 on success */ +EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to); + +/** Append a C-String to an mpg123_string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff); + +/** Append a C-substring to an mpg123 string + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Set the conents of a mpg123_string to a C-string + * \return 0 on error, 1 on success */ +EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff); + +/** Set the contents of a mpg123_string to a C-substring + * \return 0 on error, 1 on success + * \param from offset to copy from + * \param count number of characters to copy (a null-byte is always appended) */ +EXPORT int mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count); + +/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters). + * \return character count + * \param sb the string + * \param utf8 a flag to tell if the string is in utf8 encoding + * Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. +*/ +EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8); + +/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */ +enum mpg123_text_encoding +{ + mpg123_text_unknown = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */ + ,mpg123_text_utf8 = 1 /**< UTF-8 */ + ,mpg123_text_latin1 = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */ + ,mpg123_text_icy = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */ + ,mpg123_text_cp1252 = 4 /**< Really CP-1252 without any guessing. */ + ,mpg123_text_utf16 = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. + * When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when + * you don't mess with the reserved code points. If you want to decode little endian data + * without BOM you need to prepend 0xff 0xfe yourself. */ + ,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */ + ,mpg123_text_utf16be = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, + * BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 + * One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 + * types (we expect a BOM before real data there), not so for utf16be!*/ + ,mpg123_text_max = 7 /**< Placeholder for the maximum encoding value. */ +}; + +/** The encoding byte values from ID3v2. */ +enum mpg123_id3_enc +{ + mpg123_id3_latin1 = 0 /**< Note: This sometimes can mean anything in practice... */ + ,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */ + ,mpg123_id3_utf16be = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */ + ,mpg123_id3_utf8 = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */ + ,mpg123_id3_enc_max = 3 /**< Placeholder to check valid range of encoding byte. */ +}; + +/** Convert ID3 encoding byte to mpg123 encoding index. */ +EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte); + +/** Store text data in string, after converting to UTF-8 from indicated encoding + * \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb) + * \param sb target string + * \param enc mpg123 text encoding value + * \param source source buffer with plain unsigned bytes (you might need to cast from char *) + * \param source_size number of bytes in the source buffer + * + * A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). + * Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). + */ +EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size); + +/** Sub data structure for ID3v2, for storing various text fields (including comments). + * This is for ID3v2 COMM, TXXX and all the other text fields. + * Only COMM and TXXX have a description, only COMM and USLT have a language. + * You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */ +typedef struct +{ + char lang[3]; /**< Three-letter language code (not terminated). */ + char id[4]; /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */ + mpg123_string description; /**< Empty for the generic comment... */ + mpg123_string text; /**< ... */ +} mpg123_text; + +/** Data structure for storing IDV3v2 tags. + * This structure is not a direct binary mapping with the file contents. + * The ID3v2 text frames are allowed to contain multiple strings. + * So check for null bytes until you reach the mpg123_string fill. + * All text is encoded in UTF-8. */ +typedef struct +{ + unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */ + mpg123_string *title; /**< Title string (pointer into text_list). */ + mpg123_string *artist; /**< Artist string (pointer into text_list). */ + mpg123_string *album; /**< Album string (pointer into text_list). */ + mpg123_string *year; /**< The year as a string (pointer into text_list). */ + mpg123_string *genre; /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */ + mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */ + /* Encountered ID3v2 fields are appended to these lists. + There can be multiple occurences, the pointers above always point to the last encountered data. */ + mpg123_text *comment_list; /**< Array of comments. */ + size_t comments; /**< Number of comments. */ + mpg123_text *text; /**< Array of ID3v2 text fields (including USLT) */ + size_t texts; /**< Numer of text fields. */ + mpg123_text *extra; /**< The array of extra (TXXX) fields. */ + size_t extras; /**< Number of extra text (TXXX) fields. */ +} mpg123_id3v2; + +/** Data structure for ID3v1 tags (the last 128 bytes of a file). + * Don't take anything for granted (like string termination)! + * Also note the change ID3v1.1 did: comment[28] = 0; comment[19] = track_number + * It is your task to support ID3v1 only or ID3v1.1 ...*/ +typedef struct +{ + char tag[3]; /**< Always the string "TAG", the classic intro. */ + char title[30]; /**< Title string. */ + char artist[30]; /**< Artist string. */ + char album[30]; /**< Album string. */ + char year[4]; /**< Year string. */ + char comment[30]; /**< Comment string. */ + unsigned char genre; /**< Genre index. */ +} mpg123_id3v1; + +#define MPG123_ID3 0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ +#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ +#define MPG123_ICY 0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ +#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ + +/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future). + The check function returns a combination of flags. */ +EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */ + +/** Clean up meta data storage (ID3v2 and ICY), freeing memory. */ +EXPORT void mpg123_meta_free(mpg123_handle *mh); + +/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call. + * v1 and/or v2 can be set to NULL when there is no corresponding data. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2); + +/** Point icy_meta to existing data structure wich may change on any next read/decode function call. + * \return Return value is MPG123_OK or MPG123_ERR, */ +EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */ + +/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. + * Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) . + * \param icy_text The input data in ICY encoding + * \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */ +EXPORT char* mpg123_icy2utf8(const char* icy_text); + + +/* @} */ + + +/** \defgroup mpg123_advpar mpg123 advanced parameter API + * + * Direct access to a parameter set without full handle around it. + * Possible uses: + * - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). + * - Use one set of parameters for multiple handles. + * + * The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() + * family) directly return a fully qualified mpg123 error code, the ones + * operating on full handles normally MPG123_OK or MPG123_ERR, storing the + * specific error code itseld inside the handle. + * + * @{ + */ + +/** Opaque structure for the libmpg123 decoder parameters. */ +struct mpg123_pars_struct; + +/** Opaque structure for the libmpg123 decoder parameters. */ +typedef struct mpg123_pars_struct mpg123_pars; + +/** Create a handle with preset parameters. */ +EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error); + +/** Allocate memory for and return a pointer to a new mpg123_pars */ +EXPORT mpg123_pars *mpg123_new_pars(int *error); + +/** Delete and free up memory used by a mpg123_pars data structure */ +EXPORT void mpg123_delete_pars(mpg123_pars* mp); + +/** Configure mpg123 parameters to accept no output format at all, + * use before specifying supported formats with mpg123_format */ +EXPORT int mpg123_fmt_none(mpg123_pars *mp); + +/** Configure mpg123 parameters to accept all formats + * (also any custom rate you may set) -- this is default. */ +EXPORT int mpg123_fmt_all(mpg123_pars *mp); + +/** Set the audio format support of a mpg123_pars in detail: + \param rate The sample rate value (in Hertz). + \param channels A combination of MPG123_STEREO and MPG123_MONO. + \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no support). + \return 0 on success, -1 if there was an error. / +*/ +EXPORT int mpg123_fmt(mpg123_pars *mh, long rate, int channels, int encodings); /* 0 is good, -1 is error */ + +/** Check to see if a specific format at a specific rate is supported + * by mpg123_pars. + * \return 0 for no support (that includes invalid parameters), MPG123_STEREO, + * MPG123_MONO or MPG123_STEREO|MPG123_MONO. */ +EXPORT int mpg123_fmt_support(mpg123_pars *mh, long rate, int encoding); + +/** Set a specific parameter, for a specific mpg123_pars, using a parameter + * type key chosen from the mpg123_parms enumeration, to the specified value. */ +EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue); + +/** Get a specific parameter, for a specific mpg123_pars. + * See the mpg123_parms enumeration for a list of available parameters. */ +EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval); + +/* @} */ + + +/** \defgroup mpg123_lowio mpg123 low level I/O + * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... + * + * @{ */ + +/** Replace default internal buffer with user-supplied buffer. + * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. */ +EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size); + +/** The max size of one frame's decoded output with current settings. + * Use that to determine an appropriate minimum buffer size for decoding one frame. */ +EXPORT size_t mpg123_outblock(mpg123_handle *mh); + +/** Replace low-level stream access functions; read and lseek as known in POSIX. + * You can use this to make any fancy file opening/closing yourself, + * using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a "real" file descriptor...). + * Setting a function to NULL means that the default internal read is + * used (active from next mpg123_open call on). + * Note: As it would be troublesome to mess with this while having a file open, + * this implies mpg123_close(). */ +EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int)); + +/** Replace I/O functions with your own ones operating on some kind of handle instead of integer descriptors. + * The handle is a void pointer, so you can pass any data you want... + * mpg123_open_handle() is the call you make to use the I/O defined here. + * There is no fallback to internal read/seek here. + * Note: As it would be troublesome to mess with this while having a file open, + * this mpg123_close() is implied here. + * \param r_read The callback for reading (behaviour like posix read). + * \param r_lseek The callback for seeking (like posix lseek). + * \param cleanup A callback to clean up an I/O handle on mpg123_close, can be NULL for none (you take care of cleaning your handles). */ +EXPORT int mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*)); + +/* @} */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/config/win/ia32/config.h b/node_modules/lame/deps/mpg123/config/win/ia32/config.h new file mode 100644 index 0000000..97814e3 --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/win/ia32/config.h @@ -0,0 +1,36 @@ +#define strcasecmp _strcmpi +#define strncasecmp _strnicmp +#define strdup _strdup + +#define HAVE_STRERROR 1 +#define HAVE_SYS_TYPES_H 1 + +#define HAVE_STRDUP +#define HAVE_STDLIB_H +#define HAVE_STRING_H + +/* We want some frame index, eh? */ +#define FRAME_INDEX 1 +#define INDEX_SIZE 1000 + +/* also gapless playback! */ +#define GAPLESS 1 +/* #ifdef GAPLESS +#undef GAPLESS +#endif */ + +/* #define DEBUG +#define EXTRA_DEBUG */ + +/* defined in "gyp" +#define REAL_IS_FLOAT */ + +#define inline __inline + +/* we are on win32 */ +#define HAVE_WINDOWS_H + +/* use the unicode support within libmpg123 */ +#ifdef UNICODE + #define WANT_WIN32_UNICODE +#endif diff --git a/node_modules/lame/deps/mpg123/config/win/ia32/mpg123.h b/node_modules/lame/deps/mpg123/config/win/ia32/mpg123.h new file mode 100644 index 0000000..470ee8a --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/win/ia32/mpg123.h @@ -0,0 +1,46 @@ +/* + mpg123_msvc: MPEG Audio Decoder library wrapper header for MS VC++ 2005 + + copyright 2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + initially written by Patrick Dehne and Thomas Orgis. +*/ +#ifndef MPG123_MSVC_H +#define MPG123_MSVC_H + +#include <tchar.h> +#include <stdlib.h> +#include <sys/types.h> + +typedef intptr_t ssize_t; + +// Needed for Visual Studio versions before VS 2010. +#if (_MSC_VER < 1600) +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +#else +#include <stdint.h> +#endif + +#define PRIiMAX "I64i" +typedef __int64 intmax_t; +// ftell returns long, _ftelli64 returns __int64 +// off_t is long, not __int64, use ftell +#define ftello ftell + +#define MPG123_NO_CONFIGURE +#include "mpg123.h.in" /* Yes, .h.in; we include the configure template! */ + +#ifdef __cplusplus +extern "C" { +#endif + + // Wrapper around mpg123_open that supports path names with unicode + // characters + EXPORT int mpg123_topen(mpg123_handle *fr, const _TCHAR *path); + EXPORT int mpg123_tclose(mpg123_handle *fr); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/config/win/x64/config.h b/node_modules/lame/deps/mpg123/config/win/x64/config.h new file mode 100644 index 0000000..97814e3 --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/win/x64/config.h @@ -0,0 +1,36 @@ +#define strcasecmp _strcmpi +#define strncasecmp _strnicmp +#define strdup _strdup + +#define HAVE_STRERROR 1 +#define HAVE_SYS_TYPES_H 1 + +#define HAVE_STRDUP +#define HAVE_STDLIB_H +#define HAVE_STRING_H + +/* We want some frame index, eh? */ +#define FRAME_INDEX 1 +#define INDEX_SIZE 1000 + +/* also gapless playback! */ +#define GAPLESS 1 +/* #ifdef GAPLESS +#undef GAPLESS +#endif */ + +/* #define DEBUG +#define EXTRA_DEBUG */ + +/* defined in "gyp" +#define REAL_IS_FLOAT */ + +#define inline __inline + +/* we are on win32 */ +#define HAVE_WINDOWS_H + +/* use the unicode support within libmpg123 */ +#ifdef UNICODE + #define WANT_WIN32_UNICODE +#endif diff --git a/node_modules/lame/deps/mpg123/config/win/x64/mpg123.h b/node_modules/lame/deps/mpg123/config/win/x64/mpg123.h new file mode 100644 index 0000000..470ee8a --- /dev/null +++ b/node_modules/lame/deps/mpg123/config/win/x64/mpg123.h @@ -0,0 +1,46 @@ +/* + mpg123_msvc: MPEG Audio Decoder library wrapper header for MS VC++ 2005 + + copyright 2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + initially written by Patrick Dehne and Thomas Orgis. +*/ +#ifndef MPG123_MSVC_H +#define MPG123_MSVC_H + +#include <tchar.h> +#include <stdlib.h> +#include <sys/types.h> + +typedef intptr_t ssize_t; + +// Needed for Visual Studio versions before VS 2010. +#if (_MSC_VER < 1600) +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +#else +#include <stdint.h> +#endif + +#define PRIiMAX "I64i" +typedef __int64 intmax_t; +// ftell returns long, _ftelli64 returns __int64 +// off_t is long, not __int64, use ftell +#define ftello ftell + +#define MPG123_NO_CONFIGURE +#include "mpg123.h.in" /* Yes, .h.in; we include the configure template! */ + +#ifdef __cplusplus +extern "C" { +#endif + + // Wrapper around mpg123_open that supports path names with unicode + // characters + EXPORT int mpg123_topen(mpg123_handle *fr, const _TCHAR *path); + EXPORT int mpg123_tclose(mpg123_handle *fr); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/configure b/node_modules/lame/deps/mpg123/configure new file mode 100755 index 0000000..20155ee --- /dev/null +++ b/node_modules/lame/deps/mpg123/configure @@ -0,0 +1,20267 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for mpg123 1.14.4. +# +# Report bugs to <mpg123-devel@lists.sourceforge.net>. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: mpg123-devel@lists.sourceforge.net about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='mpg123' +PACKAGE_TARNAME='mpg123' +PACKAGE_VERSION='1.14.4' +PACKAGE_STRING='mpg123 1.14.4' +PACKAGE_BUGREPORT='mpg123-devel@lists.sourceforge.net' +PACKAGE_URL='' + +ac_unique_file="src/mpg123.c" +ac_unique_file="doc" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_header_list= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +WIN32_CODES_FALSE +WIN32_CODES_TRUE +OUTPUT_LDFLAGS +OUTPUT_LIBS +OUTPUT_CFLAGS +OUTPUT_MOD +OUTPUT_OBJ +HAVE_DUMMY_FALSE +HAVE_DUMMY_TRUE +DUMMY_CFLAGS +DUMMY_LDFLAGS +DUMMY_LIBS +HAVE_OPENAL_FALSE +HAVE_OPENAL_TRUE +OPENAL_CFLAGS +OPENAL_LDFLAGS +OPENAL_LIBS +HAVE_MINT_FALSE +HAVE_MINT_TRUE +MINT_CFLAGS +MINT_LDFLAGS +MINT_LIBS +HAVE_SGI_FALSE +HAVE_SGI_TRUE +SGI_CFLAGS +SGI_LDFLAGS +SGI_LIBS +HAVE_OS2_FALSE +HAVE_OS2_TRUE +OS2_CFLAGS +OS2_LDFLAGS +OS2_LIBS +HAVE_HP_FALSE +HAVE_HP_TRUE +HP_CFLAGS +HP_LDFLAGS +HP_LIBS +HAVE_ARTS_FALSE +HAVE_ARTS_TRUE +ARTS_CFLAGS +ARTS_LDFLAGS +ARTS_LIBS +HAVE_ALIB_FALSE +HAVE_ALIB_TRUE +ALIB_CFLAGS +ALIB_LDFLAGS +ALIB_LIBS +HAVE_AIX_FALSE +HAVE_AIX_TRUE +AIX_CFLAGS +AIX_LDFLAGS +AIX_LIBS +HAVE_NAS_FALSE +HAVE_NAS_TRUE +NAS_CFLAGS +NAS_LDFLAGS +NAS_LIBS +HAVE_SDL_FALSE +HAVE_SDL_TRUE +SDL_LDFLAGS +HAVE_PULSE_FALSE +HAVE_PULSE_TRUE +PULSE_LDFLAGS +HAVE_PORTAUDIO_FALSE +HAVE_PORTAUDIO_TRUE +PORTAUDIO_CFLAGS +PORTAUDIO_LDFLAGS +PORTAUDIO_LIBS +HAVE_JACK_FALSE +HAVE_JACK_TRUE +JACK_LDFLAGS +HAVE_ESD_FALSE +HAVE_ESD_TRUE +ESD_LDFLAGS +HAVE_WIN32_FALSE +HAVE_WIN32_TRUE +WIN32_CFLAGS +WIN32_LDFLAGS +WIN32_LIBS +HAVE_SUN_FALSE +HAVE_SUN_TRUE +SUN_CFLAGS +SUN_LDFLAGS +SUN_LIBS +HAVE_SNDIO_FALSE +HAVE_SNDIO_TRUE +SNDIO_CFLAGS +SNDIO_LDFLAGS +SNDIO_LIBS +HAVE_COREAUDIO_FALSE +HAVE_COREAUDIO_TRUE +COREAUDIO_CFLAGS +COREAUDIO_LDFLAGS +COREAUDIO_LIBS +HAVE_OSS_FALSE +HAVE_OSS_TRUE +OSS_CFLAGS +OSS_LDFLAGS +OSS_LIBS +HAVE_ALSA_FALSE +HAVE_ALSA_TRUE +ALSA_CFLAGS +ALSA_LDFLAGS +ALSA_LIBS +SDL_LIBS +SDL_CFLAGS +ESD_LIBS +ESD_CFLAGS +PULSE_LIBS +PULSE_CFLAGS +JACK_LIBS +JACK_CFLAGS +PKG_CONFIG +DECODER_LOBJ +DECODER_OBJ +INCLUDE_SYS_TYPE_H +INCLUDE_STDLIB_H +INCLUDE_STDIO_H +LFS_LOBJ +EXEC_LT_LDFLAGS +LT_LDFLAGS +MODULE_OBJ +HAVE_MODULES_FALSE +HAVE_MODULES_TRUE +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +SED +LIBTOOL +OBJDUMP +DLLTOOL +AS +EGREP +GREP +CPP +am__fastdepCCAS_FALSE +am__fastdepCCAS_TRUE +CCASDEPMODE +CCASFLAGS +CCAS +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +API_VERSION +LIBMPG123_VERSION +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_modules +enable_static +enable_shared +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_debug +enable_nagging +enable_gapless +enable_fifo +enable_ipv6 +enable_network +enable_id3v2 +enable_string +enable_icy +enable_ntom +enable_downsample +enable_feeder +enable_messages +enable_int_quality +enable_16bit +enable_8bit +enable_32bit +enable_real +with_cpu +enable_buffer +enable_newoldwritesample +enable_layer1 +enable_layer2 +enable_layer3 +with_audio +with_default_audio +with_optimization +with_seektable +with_module_suffix +enable_largefile +enable_lfs_alias +enable_feature_report +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCAS +CCASFLAGS +CPP +PKG_CONFIG +JACK_CFLAGS +JACK_LIBS +PULSE_CFLAGS +PULSE_LIBS +ESD_CFLAGS +ESD_LIBS +SDL_CFLAGS +SDL_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures mpg123 1.14.4 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/mpg123] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of mpg123 1.14.4:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-modules=no/yes dynamically loadable output modules + --enable-static[=PKGS] build static libraries [default=no] + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-debug=no/yes turn on debugging + --enable-nagging=no/yes turn on GCC's pedantic nagging with error on warnings, also enables debugging + --enable-gapless=no/yes turn on gapless (enabled per default) + --enable-fifo=no/yes FIFO support for control interface (auto-enabled on linux) + --enable-ipv6=no/yes IPv6 support (actually any protocol your libc does with getaddrinfo) + --enable-network=no/yes network support (http streams / webradio) + --disable-id3v2=no/yes no ID3v2 parsing + --disable-string=no/yes no string API (this will disable ID3v2; main mpg123 won't build anymore) + --disable-icy=no/yes no ICY metainfo parsing/conversion (main mpg123 won't build!) + --disable-ntom=no/yes no flexible resampling + --disable-downsample=no/yes no downsampled decoding + --disable-feeder=no/yes no feeder decoding, no buffered readers + --disable-messages=no/yes no error/warning messages on the console + --enable-int-quality=yes/no use rounding instead of fast truncation for integer output, where possible + --disable-16bit=no/yes no 16 bit integer output + --disable-8bit=no/yes no 8 bit integer output + --disable-32bit=no/yes no 32 bit integer output (also 24 bit) + --disable-real=no/yes no real (floating point) output + --enable-buffer=yes/no disable audio buffer code (default uses system whitelist... proper checks later) + --enable-newoldwritesample=no/yes enable new/old WRITE_SAMPLE macro for non-accurate 16 bit output, faster on certain CPUs (default on on x86-32) + --disable-layer1=no/yes no layer I decoding + --disable-layer2=no/yes no layer II decoding + --disable-layer3=no/yes no layer III decoding + --disable-largefile omit support for large files + --disable-lfs-alias disable alias wrappers for largefile bitness (mpg123_seek_32 in addition to mpg123_seek, mpg123_seek_64 as alias on x86-64) + --disable-feature_report Disable feature report function + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + + --with-cpu=generic_fpu Use generic processor code with floating point arithmetic + --with-cpu=generic_float Plain alias to generic_fpu now... float output is a normal runtime option! + --with-cpu=generic_nofpu Use generic processor code with fixed point arithmetic (p.ex. ARM, experimental) + --with-cpu=generic_dither Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding. + --with-cpu=i386_fpu Use code optimized for i386 processors with floating point arithmetic + --with-cpu=i386_nofpu Use code optimized for i386 processors with fixed point arithmetic (experimental) + --with-cpu=i486 Use code optimized for i486 processors (only usable alone!) + --with-cpu=i586 Use code optimized for i586 processors + --with-cpu=i586_dither Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size + --with-cpu=3dnow Use code optimized for 3DNow processors + --with-cpu=3dnowext Use code optimized for 3DNowExt processors (K6-3+, Athlon) + --with-cpu=3dnowext_alone Really only 3DNowExt decoder, without 3DNow fallback for flexible rate + --with-cpu=mmx Use code optimized for MMX processors + --with-cpu=mmx_alone Really only MMX decoder, without i586 fallback for flexible rate + --with-cpu=sse Use code optimized for SSE processors + --with-cpu=sse_alone Really only SSE decoder, without i586 fallback for flexible rate + --with-cpu=x86 Pack all x86 opts into one binary (excluding i486, including dither) + --with-cpu=x86-64 Use code optimized for x86-64 processors (AMD64 and Intel64, including dithered generic) + --with-cpu=altivec Use code optimized for Altivec processors (PowerPC G4 and G5) + --with-cpu=ppc_nofpu Use code optimized for PowerPC processors with fixed point arithmetic (experimental) + --with-cpu=neon Use code optimized for ARM NEON SIMD engine (Cortex-A series) + --with-cpu=arm_nofpu Use code optimized for ARM processors with fixed point arithmetic (experimental) + + + --with-audio=<list of modules> Select a list (or only one) of audio output modules (comma or space separated list). + + + --with-default-audio=aix Use AIX as default audio output sub-system + --with-default-audio=alib Use Alib as default audio output sub-system (for HPUX) + --with-default-audio=alsa Use ALSA as default audio output sub-system + --with-default-audio=arts Use aRts as default audio output sub-system (KDE sound server) + --with-default-audio=dummy Use dummy as default audio (when no sound card is available) + --with-default-audio=esd Use ESoundD as default audio output sub-system + --with-default-audio=hp Use HP as default audio output sub-system + --with-default-audio=jack Use JACK as default low-latency audio server + --with-default-audio=coreaudio Use Mac OS X as default audio output sub-system (CoreAudio) + --with-default-audio=mint Use MinT as default audio output sub-system (Atari) + --with-default-audio=nas Use NAS as default audio output (Network Audio System) + --with-default-audio=os2 Use OS2 as default audio output sub-system + --with-default-audio=oss Use OSS as default audio output sub-system (/dev/dsp) + --with-default-audio=portaudio Use PortAudio as default audio output sub-system + --with-default-audio=pulse Use Pulse audio server as default audio output sub-system + --with-default-audio=sdl Use SDL as default audio output sub-system (Simple DirectMedia Layer) + --with-default-audio=sgi Use SGI as default audio output sub-system (IRIX) + --with-default-audio=sndio Use OpenBSD's sndio as default audio output sub-system + --with-default-audio=sun Use Sun as default audio output sub-system (/dev/audio) + --with-default-audio=win32 Use Win32 audio as default audio output sub-system + + + --with-optimization=0 No Optimization + --with-optimization=1 Limited Optimization (-O) (for gcc) + --with-optimization=2 Default Optimization (-O2 ...) (for gcc) + --with-optimization=3 More Optimize than default (-O3 ...) (for gcc) + --with-optimization=4 Optimize yet more (-O4 ...) (for gcc) + + + --with-seektable=<size> choose size of seek index table (0 disables it), default 1000 + + + --with-module-suffix=.la (default) Use libtool's .la files for loading modules. + --with-module-suffix=.so|.dll|... Specify the native module file suffix to bypass .la files. + + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) + CPP C preprocessor + PKG_CONFIG path to pkg-config utility + JACK_CFLAGS C compiler flags for JACK, overriding pkg-config + JACK_LIBS linker flags for JACK, overriding pkg-config + PULSE_CFLAGS + C compiler flags for PULSE, overriding pkg-config + PULSE_LIBS linker flags for PULSE, overriding pkg-config + ESD_CFLAGS C compiler flags for ESD, overriding pkg-config + ESD_LIBS linker flags for ESD, overriding pkg-config + SDL_CFLAGS C compiler flags for SDL, overriding pkg-config + SDL_LIBS linker flags for SDL, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to <mpg123-devel@lists.sourceforge.net>. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +mpg123 configure 1.14.4 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------------------- ## +## Report this to mpg123-devel@lists.sourceforge.net ## +## ------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 <conftest.val; ac_retval=0 +else + ac_retval=1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f conftest.val + + fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_compute_int +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by mpg123 $as_me 1.14.4, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +as_fn_append ac_header_list " stdlib.h" +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_header_list " sys/param.h" +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +API_VERSION=36 +LIB_PATCHLEVEL=6 +LIBMPG123_VERSION=$API_VERSION:$LIB_PATCHLEVEL:$API_VERSION + + + + +ac_aux_dir= +for ac_dir in build "$srcdir"/build; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in build \"$srcdir\"/build" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + +am__api_version='1.12' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='mpg123' + VERSION='1.14.4' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +ac_config_headers="$ac_config_headers src/config.h" + + + +# You get strange symptoms like jack module build failing because the AC_C_CONST failed to detect the working const support. +# In that case, the test failed because -Werror, not because no const there... +# After looking again, there are possibly more tests being obscured by false failures. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Werror in CFLAGS (It breaks tests)" >&5 +$as_echo_n "checking for -Werror in CFLAGS (It breaks tests)... " >&6; } +if echo "$CFLAGS" | grep Werror; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You have -Werror in CFLAGS. That may break some tests and make this configure bogus. +If you want paranoid compilation, use --enable-nagging option, which adds -Werror for gcc. +Also note that you shall not run make distcheck after configuring with --enable-nagging. +distcheck uses the generated CFLAGS... +Anyhow, continuing at your own risk." >&5 +$as_echo "$as_me: WARNING: You have -Werror in CFLAGS. That may break some tests and make this configure bogus. +If you want paranoid compilation, use --enable-nagging option, which adds -Werror for gcc. +Also note that you shall not run make distcheck after configuring with --enable-nagging. +distcheck uses the generated CFLAGS... +Anyhow, continuing at your own risk." >&2;} +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +buffer=enabled # try to build with buffer by default + + +LT_LDFLAGS=-export-dynamic +EXEC_LT_LDFLAGS= +be_static=no +all_static=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if you are up to something totally static with LDFLAGS/CFLAGS" >&5 +$as_echo_n "checking if you are up to something totally static with LDFLAGS/CFLAGS... " >&6; } +for f in $LDFLAGS $CFLAGS +do + case "$f" in + -all-static) + be_static=yes + all_static=yes + ;; + -static) + be_static=yes + ;; + esac +done +if test "x$be_static" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LT_LDFLAGS=-all-static + EXEC_LT_LDFLAGS="$LT_LDFLAGS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +if test "x$all_static" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Use -static in LDFLAGS for all-static linking! Your compiler may blow up on that -all-static. " >&5 +$as_echo "$as_me: WARNING: Use -static in LDFLAGS for all-static linking! Your compiler may blow up on that -all-static. " >&2;} +fi + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# By default we simply use the C compiler to build assembly code. + +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + + +depcc="$CCAS" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CCAS_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CCAS_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CCAS_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } +CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then + am__fastdepCCAS_TRUE= + am__fastdepCCAS_FALSE='#' +else + am__fastdepCCAS_TRUE='#' + am__fastdepCCAS_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + #include <sys/param.h> + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <limits.h> + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + +modules=auto +OUTPUT_OBJ="module.\$(OBJEXT)" +# Check whether --enable-modules was given. +if test "${enable_modules+set}" = set; then : + enableval=$enable_modules; + if test "x$enableval" = xyes + then + modules=enabled + else + modules=disabled + fi + +else + + if test "x$be_static" = "xyes"; then + modules=disabled + else + modules=auto + fi + +fi + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=no +fi + + + + + + + + + +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + +if test x"$enable_shared" = xno; then + modules=disabled + LT_LDFLAGS= +else + +$as_echo "#define DYNAMIC_BUILD 1" >>confdefs.h + +fi + +if test x"$modules" = xdisabled +then + echo "Modules disabled, not checking for libltdl." +else + have_ltdl=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dlinit in -lltdl" >&5 +$as_echo_n "checking for lt_dlinit in -lltdl... " >&6; } +if ${ac_cv_lib_ltdl_lt_dlinit+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lltdl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lt_dlinit (); +int +main () +{ +return lt_dlinit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ltdl_lt_dlinit=yes +else + ac_cv_lib_ltdl_lt_dlinit=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dlinit" >&5 +$as_echo "$ac_cv_lib_ltdl_lt_dlinit" >&6; } +if test "x$ac_cv_lib_ltdl_lt_dlinit" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default" +if test "x$ac_cv_header_ltdl_h" = xyes; then : + + have_ltdl=yes + +$as_echo "#define HAVE_LTDL 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found ltdl library but NOT the header file on your system" >&5 +$as_echo "$as_me: WARNING: Found ltdl library but NOT the header file on your system" >&2;} + +fi + + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ltdl library not found" >&5 +$as_echo "$as_me: WARNING: ltdl library not found" >&2;} + + +fi + + if test x"$modules" = xenabled -a x"$have_ltdl" = xno; then + as_fn_error $? "Modules enabled but no libltdl found! This will not work..." "$LINENO" 5 + fi + if test x"$modules" = xauto; then + if test x"$have_ltdl" = xyes; then + modules=enabled + echo "We found libltdl: Modules enabled." + else + echo "We did not find libltdl: Modules disabled." + modules=disabled + fi + fi +fi + +if test x"$modules" = xdisabled +then + echo "Modules disabled." +else +# Enable module support in source code + +$as_echo "#define USE_MODULES 1" >>confdefs.h + +fi + + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$lt_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$lt_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +if test x"$modules" = xdisabled +then + echo "Modules still disabled..." + MODULE_OBJ="legacy_module.\$(OBJEXT)" +else + MODULE_OBJ="module.\$(OBJEXT)" +fi + + if test "x$modules" = xenabled ; then + HAVE_MODULES_TRUE= + HAVE_MODULES_FALSE='#' +else + HAVE_MODULES_TRUE='#' + HAVE_MODULES_FALSE= +fi + + + + + + + +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; + if test "x$enableval" = xyes + then + debugging="enabled" + else + debugging="disabled" + fi + +else + debugging="disabled" + +fi + + +# Check whether --enable-nagging was given. +if test "${enable_nagging+set}" = set; then : + enableval=$enable_nagging; + if test "x$enableval" = xyes + then + nagging="enabled" + debugging="enabled" + else + nagging="disabled" + fi + +else + nagging="disabled" + +fi + + +if test x"$debugging" = xenabled; then + +$as_echo "#define DEBUG 1" >>confdefs.h + +fi + +# Check whether --enable-gapless was given. +if test "${enable_gapless+set}" = set; then : + enableval=$enable_gapless; + if test "x$enableval" = xyes + then + gapless="enabled" + +$as_echo "#define GAPLESS 1" >>confdefs.h + + else + gapless="disabled" + fi + +else + + gapless="enabled" + +$as_echo "#define GAPLESS 1" >>confdefs.h + + + +fi + + +# Check whether --enable-fifo was given. +if test "${enable_fifo+set}" = set; then : + enableval=$enable_fifo; + if test "x$enableval" = xyes + then + fifo="enabled" + else + fifo="disabled" + fi + +else + + fifo="auto" + + +fi + + +# Check whether --enable-ipv6 was given. +if test "${enable_ipv6+set}" = set; then : + enableval=$enable_ipv6; + if test "x$enableval" = xyes + then + ipv6="enabled" + else + ipv6="disabled" + fi + +else + + ipv6="auto" + + +fi + + +# Check whether --enable-network was given. +if test "${enable_network+set}" = set; then : + enableval=$enable_network; + if test "x$enableval" = xyes + then + network="enabled" + else + network="disabled" + fi + +else + + network="auto" + + +fi + + +s_fpu= +DECODER_OBJ= +DECODER_LOBJ= + + +id3v2=enabled +# Check whether --enable-id3v2 was given. +if test "${enable_id3v2+set}" = set; then : + enableval=$enable_id3v2; + if test "x$enableval" = xno; then + id3v2="disabled" + fi + +fi + + +# id3v2 depends on strings... so check that in between. +string=enabled +# Check whether --enable-string was given. +if test "${enable_string+set}" = set; then : + enableval=$enable_string; + if test "x$enableval" = xno; then + string="disabled" + fi + +fi + + +if test "x$string" = "xdisabled"; then + +$as_echo "#define NO_STRING 1" >>confdefs.h + + id3v2=disabled + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ID3v2 support disabled because of string API being disabled." >&5 +$as_echo "$as_me: WARNING: ID3v2 support disabled because of string API being disabled." >&2;} +else + DECODER_OBJ="$DECODER_OBJ stringbuf.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ stringbuf.lo" +fi + +if test "x$id3v2" = "xdisabled"; then + +$as_echo "#define NO_ID3V2 1" >>confdefs.h + +fi + +icy=enabled +# Check whether --enable-icy was given. +if test "${enable_icy+set}" = set; then : + enableval=$enable_icy; + if test "x$enableval" = xno; then + icy="disabled" + fi + +fi + + +if test "x$icy" = "xdisabled"; then + +$as_echo "#define NO_ICY 1" >>confdefs.h + +else + DECODER_OBJ="$DECODER_OBJ icy.\$(OBJEXT) icy2utf8.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ icy.lo icy2utf8.lo" +fi + +ntom=enabled +# Check whether --enable-ntom was given. +if test "${enable_ntom+set}" = set; then : + enableval=$enable_ntom; + if test "x$enableval" = xno; then + ntom="disabled" + fi + +fi + + +if test "x$ntom" = "xdisabled"; then + +$as_echo "#define NO_NTOM 1" >>confdefs.h + +else + DECODER_OBJ="$DECODER_OBJ ntom.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ ntom.lo" +fi + +downsample=enabled +# Check whether --enable-downsample was given. +if test "${enable_downsample+set}" = set; then : + enableval=$enable_downsample; + if test "x$enableval" = xno; then + downsample="disabled" + fi + +fi + + +if test "x$downsample" = "xdisabled"; then + +$as_echo "#define NO_DOWNSAMPLE 1" >>confdefs.h + +fi + +feeder=enabled +# Check whether --enable-feeder was given. +if test "${enable_feeder+set}" = set; then : + enableval=$enable_feeder; + if test "x$enableval" = xno; then + feeder="disabled" + fi + +fi + + +if test "x$feeder" = "xdisabled"; then + +$as_echo "#define NO_FEEDER 1" >>confdefs.h + +fi + +messages=enabled +# Check whether --enable-messages was given. +if test "${enable_messages+set}" = set; then : + enableval=$enable_messages; + if test "x$enableval" = xno; then + messages="disabled" + fi + +fi + + +if test "x$messages" = "xdisabled"; then + +$as_echo "#define NO_WARNING 1" >>confdefs.h + + +$as_echo "#define NO_ERRORMSG 1" >>confdefs.h + + +$as_echo "#define NO_ERETURN 1" >>confdefs.h + +fi + +integers=fast +# Check whether --enable-int-quality was given. +if test "${enable_int_quality+set}" = set; then : + enableval=$enable_int_quality; + if test "x$enableval" = xyes; then + integers=quality + +$as_echo "#define ACCURATE_ROUNDING 1" >>confdefs.h + + fi + +fi + + +int16=enabled +# Check whether --enable-16bit was given. +if test "${enable_16bit+set}" = set; then : + enableval=$enable_16bit; + if test "x$enableval" = xno; then + int16="disabled" + fi + +fi + + +int8=enabled +# Check whether --enable-8bit was given. +if test "${enable_8bit+set}" = set; then : + enableval=$enable_8bit; + if test "x$enableval" = xno; then + int8="disabled" + fi + +fi + + +int32=enabled +# Check whether --enable-32bit was given. +if test "${enable_32bit+set}" = set; then : + enableval=$enable_32bit; + if test "x$enableval" = xno; then + int32="disabled" + fi + +fi + + +real=enabled +# Check whether --enable-real was given. +if test "${enable_real+set}" = set; then : + enableval=$enable_real; + if test "x$enableval" = xno; then + real="disabled" + fi + +fi + + + +# Check whether --with-cpu was given. +if test "${with_cpu+set}" = set; then : + withval=$with_cpu; +fi + + + +# opt-in for IEEE754 floating point action +# We want to make sure not to apply hacks relying on IEEE754 storage format on platforms where we did not make sure that this actually is valid. +# It _should_ be fine for about all computers still out there, but we play safe. +ieee=no +case $host in + i?86-*|x86_64-*|powerpc*|sparc*) + ieee=yes + ;; +esac +if test "x$ieee" = xyes; then + echo "We assume IEEE754 floating point format." + +$as_echo "#define IEEE_FLOAT 1" >>confdefs.h + +fi + +newoldwritesample=disabled +case $host in + arm*-*-linux*) + # check that... perhaps we are better off on arm with kernel math emulation + cpu_type="arm_nofpu" + ;; + i386-*-linux*|i386-*-kfreebsd*-gnu) + cpu_type="i386_fpu" + newoldwritesample=enabled + ;; + i486-*-linux*|i486-*-kfreebsd*-gnu) + cpu_type="i486" + newoldwritesample=enabled + ;; + i586-*-linux*|i586-*-kfreebsd*-gnu) + cpu_type="x86" + newoldwritesample=enabled + ;; + i686-*-linux*|i686-*-kfreebsd*-gnu) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-linux*|x86_64-*-kfreebsd*-gnu) + cpu_type="x86-64_all" + ;; + *-*-linux*|*-*-kfreebsd*-gnu) + cpu_type="generic_fpu" + ;; + i386-apple-darwin10*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CPU type supports x86-64" >&5 +$as_echo_n "checking if CPU type supports x86-64... " >&6; } + case `sysctl -n hw.optional.x86_64` in + 1) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + cpu_type="x86-64_all" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + cpu_type="x86" + newoldwritesample=enabled + ;; + esac + ;; + i386-apple-darwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-apple-darwin*) + cpu_type="x86-64_all" + ;; + *-apple-darwin*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CPU type supports AltiVec" >&5 +$as_echo_n "checking if CPU type supports AltiVec... " >&6; } + case `machine` in + ppc7400 | ppc7450 | ppc970) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + cpu_type="altivec" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + cpu_type="generic_fpu" + ;; + esac + ;; + i?86-*-dragonfly* | i?86-*-freebsd* | i?86-*-midnightbsd* | i?86-*-mirbsd* | i?86-*-netbsd* | i?86-*-openbsd*) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-dragonfly* | x86_64-*-freebsd* | x86_64-*-midnightbsd* | x86_64-*-mirbsd* | x86_64-*-netbsd* | x86_64-*-openbsd*) + cpu_type="x86-64_all" + ;; + *-*-dragonfly* | *-*-freebsd* | *-*-midnightbsd* | *-*-mirbsd* | *-*-netbsd* | *-*-openbsd*) + cpu_type="generic_fpu" + ;; + i386-*-solaris*) + cpu_type=x86 + newoldwritesample=enabled + ;; + x86_64-*-solaris*) + cpu_type=x86-64_all + ;; + *-*-solaris*) + cpu_type="generic_fpu" + ;; + # os2-emx = OS/2 with some Unix fun; so p.ex. buffer works. + # Till we sorted out the assembler troubles, generic CPU is default. + i386-pc-os2-emx) + cpu_type=generic_fpu + newoldwritesample=enabled + ;; + x86_64-pc-os2-emx) + # We are optimistic hat the future knows OS/2 on x86-64;-) + cpu_type=generic_fpu + ;; + *-pc-os2-emx) + cpu_type="generic_fpu" + ;; + *-dec-osf*) + cpu_type="generic_fpu" + ;; + x86_64-pc-cygwin*) + cpu_type="x86-64_all" + ;; + i686-pc-cygwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + i586-pc-cygwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + i486-pc-cygwin*) + cpu_type="i486" + newoldwritesample=enabled + ;; + i386-pc-cygwin*) + cpu_type="i386" + newoldwritesample=enabled + ;; + *-pc-cygwin*) + cpu_type="generic_fpu" + ;; + i[3-7]86-*-mingw32*) + LIBS="$LIBS" + buffer=disabled + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-mingw32*) + LIBS="$LIBS" + buffer=disabled + cpu_type="x86-64" + ;; + i386-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="i386" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + newoldwritesample=enabled + ;; + i486-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="i486" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + newoldwritesample=enabled + ;; + i586-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="x86" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + newoldwritesample=enabled + ;; + i686-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="x86" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + newoldwritesample=enabled + ;; + x86_64-*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="x86-64_all" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown host operating system" >&5 +$as_echo "$as_me: WARNING: Unknown host operating system" >&2;} + cpu_type="generic_fpu" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + ;; +esac + +# Check whether --enable-buffer was given. +if test "${enable_buffer+set}" = set; then : + enableval=$enable_buffer; + if test "x$enableval" = xyes + then + echo "Note: Enabling buffer per request... perhaps it will not build anyway." + buffer="enabled" + else + echo "Note: Disabling buffer per request." + buffer="disabled" + fi + + +fi + + +# Check whether --enable-newoldwritesample was given. +if test "${enable_newoldwritesample+set}" = set; then : + enableval=$enable_newoldwritesample; + if test "x$enableval" = xyes + then + newoldwritesample=enabled + else + newoldwritesample=disabled + fi + +fi + + + + +if test "x$with_cpu" != "x"; then + cpu_type=$with_cpu +fi + +if test "x$cpu_type" = "xgeneric_nofpu"; then + real=disabled + int32=disabled +fi + +if test "x$cpu_type" = "xi386_nofpu"; then + real=disabled + int32=disabled +fi + +if test "x$cpu_type" = "xppc_nofpu"; then + real=disabled + int32=disabled +fi + +if test "x$cpu_type" = "xarm_nofpu"; then + real=disabled + int32=disabled +fi + +if test "x$int16" = "xdisabled"; then + +$as_echo "#define NO_16BIT 1" >>confdefs.h + +else + DECODER_OBJ="$DECODER_OBJ synth.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ synth.lo" +fi + +# 8bit works only through 16bit +if test "x$int16" = "xdisabled"; then + int8=disabled +fi +if test "x$int8" = "xdisabled"; then + +$as_echo "#define NO_8BIT 1" >>confdefs.h + +else + DECODER_OBJ="$DECODER_OBJ synth_8bit.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ synth_8bit.lo" +fi + +if test "x$int32" = "xdisabled"; then + +$as_echo "#define NO_32BIT 1" >>confdefs.h + +else + s_fpu="$s_fpu synth_s32" +fi + +if test "x$real" = "xdisabled"; then + +$as_echo "#define NO_REAL 1" >>confdefs.h + +else + s_fpu="$s_fpu synth_real" +fi + + + +layer1=enabled +# Check whether --enable-layer1 was given. +if test "${enable_layer1+set}" = set; then : + enableval=$enable_layer1; + if test "x$enableval" = xno; then + layer1="disabled" + fi + +fi + + +if test "x$layer1" = "xdisabled"; then + +$as_echo "#define NO_LAYER1 1" >>confdefs.h + +else + # layer1 needs code in layer2 + DECODER_OBJ="$DECODER_OBJ layer1.\$(OBJEXT) layer2.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer1.lo layer2.lo" +fi + +layer2=enabled +# Check whether --enable-layer2 was given. +if test "${enable_layer2+set}" = set; then : + enableval=$enable_layer2; + if test "x$enableval" = xno; then + layer2="disabled" + fi + +fi + + +if test "x$layer2" = "xdisabled"; then + +$as_echo "#define NO_LAYER2 1" >>confdefs.h + +else + # layer1 may have added the objects already + if test "x$layer1" = "xdisabled"; then + DECODER_OBJ="$DECODER_OBJ layer2.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer2.lo" + fi +fi + +layer3=enabled +# Check whether --enable-layer3 was given. +if test "${enable_layer3+set}" = set; then : + enableval=$enable_layer3; + if test "x$enableval" = xno; then + layer3="disabled" + fi + +fi + + +if test "x$layer3" = "xdisabled"; then + +$as_echo "#define NO_LAYER3 1" >>confdefs.h + +else + DECODER_OBJ="$DECODER_OBJ layer3.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer3.lo" +fi + + +# Check whether --with-audio was given. +if test "${with_audio+set}" = set; then : + withval=$with_audio; +fi + + +# Check whether --with-default-audio was given. +if test "${with_default_audio+set}" = set; then : + withval=$with_default_audio; +fi + + + +# Check whether --with-optimization was given. +if test "${with_optimization+set}" = set; then : + withval=$with_optimization; +fi + + + +# Check whether --with-seektable was given. +if test "${with_seektable+set}" = set; then : + withval=$with_seektable; +fi + + + + +# Dummy audio output module is always supported +output_modules="dummy" + +# Decide on module file suffix. Setting it != .la allows removal of .la files. + +# Check whether --with-module-suffix was given. +if test "${with_module_suffix+set}" = set; then : + withval=$with_module_suffix; +fi + +if test x"$with_module_suffix" = x; then + with_module_suffix=.la +fi + +cat >>confdefs.h <<_ACEOF +#define MODULE_FILE_SUFFIX "$with_module_suffix" +_ACEOF + + + +# based on posting from John Dalgliesh <johnd@defyne.org> on ffmpeg (LGPL) mailing list +# find if .align arg is power-of-two or not +asmalign_exp="unknown" +if test x"$asmalign_exp" = xunknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if .align takes 2-exponent" >&5 +$as_echo_n "checking if .align takes 2-exponent... " >&6; } + asmalign_exp="no" + echo '.align 3' > conftest.s + if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then + asmalign_exp="yes" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + rm -f conftest.o conftest.s +fi +if test x"$asmalign_exp" = xyes; then + +$as_echo "#define ASMALIGN_EXP 1" >>confdefs.h + +fi + +ccalign="unknown" +if test x"$ccalign" = xunknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking __attribute__((aligned(16)))" >&5 +$as_echo_n "checking __attribute__((aligned(16)))... " >&6; } + ccalign="no" + echo '__attribute__((aligned(16))) float var;' > conftest.c + if $CC -c -o conftest.o conftest.c >/dev/null 2>&1; then + ccalign="yes" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + rm -f conftest.o conftest.c +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in stdio.h stdlib.h string.h unistd.h sched.h sys/ioctl.h sys/types.h stdint.h limits.h inttypes.h sys/time.h sys/wait.h sys/resource.h sys/signal.h signal.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi + + +fi + +if test "x$ac_cv_sys_file_offset_bits" = x || echo "$ac_cv_sys_file_offset_bits" | $GREP '[^0-9]' > /dev/null; then + LFS_LOBJ= +else + # Add dual-mode wrapper code. + LFS_LOBJ=lfs_wrap.lo +fi + +# Using the lower level macros instead of AC_TYPE_* for compatibility with not freshest autoconf. +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned long +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" +if test "x$ac_cv_type_uintptr_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define uintptr_t unsigned long +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" +if test "x$ac_cv_type_ssize_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define ssize_t long +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default" +if test "x$ac_cv_type_int32_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define int32_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default" +if test "x$ac_cv_type_uint32_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define uint32_t unsigned int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default" +if test "x$ac_cv_type_int16_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define int16_t short +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default" +if test "x$ac_cv_type_uint16_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define uint16_t unsigned short +_ACEOF + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } +if ${ac_cv_sizeof_size_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_size_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (size_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_size_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ssize_t" >&5 +$as_echo_n "checking size of ssize_t... " >&6; } +if ${ac_cv_sizeof_ssize_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ssize_t))" "ac_cv_sizeof_ssize_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_ssize_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (ssize_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_ssize_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ssize_t" >&5 +$as_echo "$ac_cv_sizeof_ssize_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } +if ${ac_cv_sizeof_off_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_off_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (off_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_off_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int32_t" >&5 +$as_echo_n "checking size of int32_t... " >&6; } +if ${ac_cv_sizeof_int32_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int32_t))" "ac_cv_sizeof_int32_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int32_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int32_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int32_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int32_t" >&5 +$as_echo "$ac_cv_sizeof_int32_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT32_T $ac_cv_sizeof_int32_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + + +# The alias functions want to know the native off_t bits. +# "Native" also means large file offsets, if enabled, it's what is native to the mpg123 library. +if test "x$ac_cv_sizeof_long" = "x"; then + as_fn_error $? "Cannot determine sizeof(long)?" "$LINENO" 5 +else + LFS_ALIAS_BITS=`expr "$ac_cv_sizeof_long" "*" "8"` + +cat >>confdefs.h <<_ACEOF +#define LFS_ALIAS_BITS $LFS_ALIAS_BITS +_ACEOF + +fi + +lfs_alias=enabled +# Check whether --enable-lfs-alias was given. +if test "${enable_lfs_alias+set}" = set; then : + enableval=$enable_lfs_alias; + if test "x$enableval" = xno; then + lfs_alias="disabled" + fi + +else + + case $host in + *-cygwin*) + lfs_alias="disabled" + { $as_echo "$as_me:${as_lineno-$LINENO}: lfs-alias disabled for Cygwin, use --enable-lfs-alias explicitly to enable, only if you know what you are doing" >&5 +$as_echo "$as_me: lfs-alias disabled for Cygwin, use --enable-lfs-alias explicitly to enable, only if you know what you are doing" >&6;} + ;; + esac + + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want to enable alias wrappers for largefile" >&5 +$as_echo_n "checking if we want to enable alias wrappers for largefile... " >&6; } +if test "x$lfs_alias" = "xenabled"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LFS_LOBJ="$LFS_LOBJ lfs_alias.lo" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + +for ac_func in getpagesize +do : + ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" +if test "x$ac_cv_func_getpagesize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if ${ac_cv_func_mmap_fixed_mapped+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_mmap_fixed_mapped=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the file system buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propagated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ + +#include <fcntl.h> +#include <sys/mman.h> + +#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H +char *malloc (); +#endif + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include <sys/param.h> +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +int +main () +{ + char *data, *data2, *data3; + const char *cdata2; + int i, pagesize; + int fd, fd2; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + return 1; + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + return 2; + if (write (fd, data, pagesize) != pagesize) + return 3; + close (fd); + + /* Next, check that the tail of a page is zero-filled. File must have + non-zero length, otherwise we risk SIGBUS for entire page. */ + fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); + if (fd2 < 0) + return 4; + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) + return 5; + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + if (data2 == MAP_FAILED) + return 6; + for (i = 0; i < pagesize; ++i) + if (*(data2 + i)) + return 7; + close (fd2); + if (munmap (data2, pagesize)) + return 8; + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + return 9; + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + return 10; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + return 11; + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + return 12; + if (read (fd, data3, pagesize) != pagesize) + return 13; + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + return 14; + close (fd); + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_mmap_fixed_mapped=yes +else + ac_cv_func_mmap_fixed_mapped=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +if test $ac_cv_func_mmap_fixed_mapped = yes; then + +$as_echo "#define HAVE_MMAP 1" >>confdefs.h + +fi +rm -f conftest.mmap conftest.txt + + +# Check if system supports termios +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking POSIX termios" >&5 +$as_echo_n "checking POSIX termios... " >&6; } +if ${ac_cv_sys_posix_termios+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <unistd.h> +#include <termios.h> + +int +main () +{ +/* SunOS 4.0.3 has termios.h but not the library calls. */ + tcgetattr(0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_posix_termios=yes +else + ac_cv_sys_posix_termios=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_posix_termios" >&5 +$as_echo "$ac_cv_sys_posix_termios" >&6; } + +if test "x$ac_cv_sys_posix_termios" = "xyes"; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_TERMIOS 1 +_ACEOF + +fi + +for ac_func in random +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Check for sched_setscheduler +for ac_func in sched_setscheduler setuid getuid +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Check for setpriority +for ac_func in setpriority +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in strerror +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in setlocale nl_langinfo +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in strdup +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in atoll +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in mkfifo +do : + ac_fn_c_check_func "$LINENO" "mkfifo" "ac_cv_func_mkfifo" +if test "x$ac_cv_func_mkfifo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MKFIFO 1 +_ACEOF + have_mkfifo=yes +else + have_mkfifo=no +fi +done + + + +# locale headers +for ac_header in locale.h langinfo.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +# Headers for network (http) stuff +network_type=Unknown +for ac_header in netdb.h sys/param.h sys/socket.h netinet/in.h arpa/inet.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +if test "x$ac_cv_header_netdb_h" = "xyes" && + test "x$ac_cv_header_sys_param_h" = "xyes" && + test "x$ac_cv_header_sys_socket_h" = "xyes" && + test "x$ac_cv_header_netinet_in_h" = "xyes" && + test "x$ac_cv_header_arpa_inet_h" = "xyes"; then + have_network=yes + network_type=Posix +else + have_network=no +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 +$as_echo_n "checking for library containing gethostbyname... " >&6; } +if ${ac_cv_search_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_gethostbyname=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_gethostbyname+:} false; then : + break +fi +done +if ${ac_cv_search_gethostbyname+:} false; then : + +else + ac_cv_search_gethostbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 +$as_echo "$ac_cv_search_gethostbyname" >&6; } +ac_res=$ac_cv_search_gethostbyname +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 +$as_echo_n "checking for library containing socket... " >&6; } +if ${ac_cv_search_socket+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_socket=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_socket+:} false; then : + break +fi +done +if ${ac_cv_search_socket+:} false; then : + +else + ac_cv_search_socket=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 +$as_echo "$ac_cv_search_socket" >&6; } +ac_res=$ac_cv_search_socket +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +for ac_func in getaddrinfo +do : + ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" +if test "x$ac_cv_func_getaddrinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETADDRINFO 1 +_ACEOF + have_ipv6=yes +else + have_ipv6=no +fi +done + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working AI_ADDRCONFIG" >&5 +$as_echo_n "checking for working AI_ADDRCONFIG... " >&6; } +if ${apr_cv_gai_addrconfig+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + apr_cv_gai_addrconfig=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_NETDB_H +#include <netdb.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif + +int main(int argc, char **argv) { + struct addrinfo hints, *ai; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_ADDRCONFIG; + return getaddrinfo("localhost", NULL, &hints, &ai) != 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + apr_cv_gai_addrconfig=yes +else + apr_cv_gai_addrconfig=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_gai_addrconfig" >&5 +$as_echo "$apr_cv_gai_addrconfig" >&6; } + +if test $apr_cv_gai_addrconfig = yes; then + +$as_echo "#define HAVE_GAI_ADDRCONFIG 1" >>confdefs.h + +fi + + +# Substitutions for the installable mpg123.h header +if test "x$ac_cv_header_stdio_h" = "xyes"; then + INCLUDE_STDIO_H="#include <stdio.h>" +else + INCLUDE_STDIO_H="/* #include <stdio.h> is not available on this system */" +fi + + +if test "x$ac_cv_header_stdlib_h" = "xyes"; then + INCLUDE_STDLIB_H="#include <stdlib.h>" +else + INCLUDE_STDLIB_H="/* #include <stdlib.h> is not available on this system */" +fi + + +if test "x$ac_cv_header_sys_types_h" = "xyes"; then + INCLUDE_SYS_TYPE_H="#include <sys/types.h>" +else + INCLUDE_SYS_TYPE_H="/* #include <sys/types.h> is not available on this system */" +fi + + + +# Checks for maths libraries. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 +$as_echo_n "checking for sqrt in -lm... " >&6; } +if ${ac_cv_lib_m_sqrt+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqrt (); +int +main () +{ +return sqrt (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_sqrt=yes +else + ac_cv_lib_m_sqrt=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5 +$as_echo "$ac_cv_lib_m_sqrt" >&6; } +if test "x$ac_cv_lib_m_sqrt" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for powf in -lmx" >&5 +$as_echo_n "checking for powf in -lmx... " >&6; } +if ${ac_cv_lib_mx_powf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmx $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char powf (); +int +main () +{ +return powf (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mx_powf=yes +else + ac_cv_lib_mx_powf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mx_powf" >&5 +$as_echo "$ac_cv_lib_mx_powf" >&6; } +if test "x$ac_cv_lib_mx_powf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMX 1 +_ACEOF + + LIBS="-lmx $LIBS" + +fi + + +# attempt to make the signal stuff work... also with GENERIC - later +#if test x"$ac_cv_header_sys_signal_h" = xyes; then +# AC_CHECK_FUNCS( sigemptyset sigaddset sigprocmask sigaction ) +# if test x"$ac_cv_func_sigemptyset" = xyes && +# test x"$ac_cv_func_sigaddset" = xyes && +# test x"$ac_cv_func_sigprocmask" = xyes && +# test x"$ac_cv_func_sigaction" = xyes; then +# AC_DEFINE( +#fi + + +# do not assume gcc here, so no flags by default +ADD_CFLAGS="" +ADD_CPPFLAGS="" +ADD_LDFLAGS="" +LIBS="$LIBS" + +ac_fn_c_check_header_mongrel "$LINENO" "os2.h" "ac_cv_header_os2_h" "$ac_includes_default" +if test "x$ac_cv_header_os2_h" = xyes; then : + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOS2" +fi + + + +# If debugging is enabled then make warnings errors +if test x"$debugging" = xenabled; then + ADD_CFLAGS="-g" + # gcc specific... + if test x"$GCC" = xyes; then + ADD_CFLAGS="$ADD_CFLAGS -Wall -fno-strict-aliasing" + if test x"$nagging" = xenabled; then + ADD_CFLAGS="$ADD_CFLAGS -Werror -pedantic -DPLAIN_C89" + fi + fi +fi + +case $host in + i?86-*) + +$as_echo "#define ABI_ALIGN_FUN 1" >>confdefs.h + + ;; +esac + +s_altivec="synth_altivec dct64_altivec" +s_i386="dct64_i386" +s_i486="$s_i386 synth_i486 dct64_i486" +s_i586="$s_i386 synth_i586" +s_i586d="$s_i386 synth_i586_dither" +s_3dnow="$s_i386 synth_3dnow dct64_3dnow equalizer_3dnow" +s_3dnowext="$s_i386 dct64_3dnowext tabinit_mmx synth_3dnowext" +if test "x$layer3" = "xenabled"; then + s_3dnow="$s_3dnow dct36_3dnow" + s_3dnowext="$s_3dnowext dct36_3dnowext" +fi +s_mmx="$s_i386 dct64_mmx tabinit_mmx synth_mmx" +s_sse="$s_i386 tabinit_mmx dct64_sse dct64_sse_float synth_sse_float synth_stereo_sse_float synth_sse_s32 synth_stereo_sse_s32 " +s_x86_64="dct64_x86_64 dct64_x86_64_float synth_x86_64_float synth_x86_64_s32 synth_stereo_x86_64_float synth_stereo_x86_64_s32" +s_x86multi="getcpuflags" +s_dither="dither" +s_neon="dct64_neon dct64_neon_float synth_neon_float synth_neon_s32 synth_stereo_neon_float synth_stereo_neon_s32" + +# choose optimized 16bit decoder for SSE, quality or fast +# note: supporting deactivation of output formats for these decoders would need more logic here +if test "x$integers" = "xquality"; then + s_sse="$s_sse synth_sse_accurate synth_stereo_sse_accurate" + s_x86_64="$s_x86_64 synth_x86_64_accurate synth_stereo_x86_64_accurate" + s_arm="synth_arm_accurate" + s_neon="$s_neon synth_neon_accurate synth_stereo_neon_accurate" +else + s_sse="$s_sse synth_sse" # no stereo + s_x86_64="$s_x86_64 synth_x86_64 synth_stereo_x86_64" + s_arm="synth_arm" + s_neon="$s_neon synth_neon synth_stereo_neon" +fi + +case $cpu_type in + generic) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT" + more_sources="$s_fpu" + ccalign=no + ;; + generic_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_dither" + ccalign=no + ;; + generic_fpu | generic_float) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT" + more_sources="$s_fpu" + ccalign=no + ;; + generic_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FIXED" + more_sources= + ccalign=no + ;; + ppc_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_PPC -DREAL_IS_FIXED" + more_sources= + ccalign=no + ;; + arm_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_ARM -DREAL_IS_FIXED" + more_sources="$s_arm" + ccalign=no + ;; + altivec) + ADD_CFLAGS="$ADD_CFLAGS -maltivec" + ADD_CPPFLAGS="$ADD_CPPFLAGS -DREAL_IS_FLOAT -DOPT_ALTIVEC" + more_sources="$s_altivec $s_fpu" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -faltivec" >&5 +$as_echo_n "checking if $CC accepts -faltivec... " >&6; } + touch conftest.c + if $CC -faltivec -c -o conftest.o conftest.c >/dev/null 2>&1; then + ADD_CFLAGS="$ADD_CFLAGS -faltivec" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + rm -f conftest.o conftest.c + ;; + neon) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON -DREAL_IS_FLOAT" + more_sources="$s_neon $s_fpu" + ;; + i386) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386" + ccalign=no + ;; + i386_fpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386" + ccalign=no + ;; + i386_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FIXED" + more_sources="$s_i386" + ccalign=no + ;; + i486) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I486 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i486" + ccalign=no + ;; + i586) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586" + ;; + i586_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586d $s_dither" + ;; + 3dnow) + # legacy 3dnow had the 3dnow paired with i586... + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586 $s_3dnow $s_x86multi " + ;; + 3dnow_alone) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOW -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnow" + ;; + 3dnowext_alone) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOWEXT -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnowext" + ;; + 3dnowext) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnowext $s_3dnow $s_x86multi" + ;; + mmx_alone|mmx) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MMX -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_mmx" + ;; + sse_alone|sse) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_sse" + ;; + x86|x86_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_I386 -DOPT_I586 -DOPT_I586_DITHER -DOPT_MMX -DOPT_3DNOW -DOPT_3DNOWEXT -DOPT_SSE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386 $s_i586 $s_i586d $s_mmx $s_3dnow $s_3dnowext $s_sse $s_x86multi $s_dither" + ;; + x86-64) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_X86_64 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_x86_64" + ;; + x86-64_all|x86-64_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_X86_64 -DOPT_GENERIC -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_x86_64 $s_dither" + ;; + *) + as_fn_error $? "Unknown CPU type '$cpu_type'" "$LINENO" 5 + ;; +esac + +# Mac OS X specific linker flags +case $cpu_type in + 3dnow|3dnow_alone|3dnowext|3dnowext_alone|mmx|mmx_alone|sse|sse_alone|x86|x86_dither) + case $host in + i386-apple-darwin8*|*-apple-darwin10*) + ADD_LDFLAGS="$ADD_LDFLAGS -Wl,-read_only_relocs,suppress" + ;; + i386-apple-darwin9*) + ADD_CFLAGS="$ADD_CFLAGS -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" + ADD_LDFLAGS="$ADD_LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -Wl,-classic_linker -Wl,-read_only_relocs,suppress" + ;; + esac + ;; +esac + +# Check if we want feature report function. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want feature report function" >&5 +$as_echo_n "checking if we want feature report function... " >&6; } +feature_report=enabled +# Check whether --enable-feature_report was given. +if test "${enable_feature_report+set}" = set; then : + enableval=$enable_feature_report; + if test "x$enableval" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + feature_report=disabled + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi + + +if test "x$feature_report" = xenabled; then + more_sources="$more_sources feature" +fi + +for i in $more_sources +do + # Echo make sure every file is only once in the list. + echo "$DECODER_OBJ" | $GREP -v -w "$i\.\$(OBJEXT)" > /dev/null && DECODER_OBJ="$DECODER_OBJ $i.\$(OBJEXT)" + echo "$DECODER_LOBJ" | $GREP -v -w "$i\.lo" > /dev/null && DECODER_LOBJ="$DECODER_LOBJ $i.lo" +done + + + + +if test x"$ccalign" = xyes; then + +$as_echo "#define CCALIGN 1" >>confdefs.h + +fi + + + +# The full list of supported modules to check, first come, first serve. +check_modules="alsa oss coreaudio sndio sun win32 os2 esd jack portaudio pulse sdl nas arts openal dummy" +# The final list. +output_modules= + +check_forced=no +check_failed=no +if test "x$with_audio" != "x"; then + check_modules="`echo $with_audio|tr , ' '` dummy" + echo "Limiting outputs to build according to your preference: $check_modules" + check_forced=yes +fi + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi + +fi + +# Now go through the modules to check and do the chores. +for m in $check_modules +do + case "$m" in + dummy) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if you are too dumbing dumb for the dummy" >&5 +$as_echo_n "checking if you are too dumbing dumb for the dummy... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + output_modules="$output_modules dummy" + HAVE_DUMMY=yes + ;; + oss) + for ac_header in sys/soundcard.h linux/soundcard.h machine/soundcard.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test "x${ac_cv_header_sys_soundcard_h}" = "xyes" \ + -o "x${ac_cv_header_linux_soundcard_h}" = "xyes" \ + -o "x${ac_cv_header_machine_soundcard_h}" = "xyes"; + then + output_modules="$output_modules oss" + HAVE_OSS="yes" + else + check_failed=yes + fi + ;; + alsa) + ALSA_LIBS="-lasound" + # Check for ALSA + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5 +$as_echo_n "checking for snd_pcm_open in -lasound... " >&6; } +if ${ac_cv_lib_asound_snd_pcm_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lasound $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char snd_pcm_open (); +int +main () +{ +return snd_pcm_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_asound_snd_pcm_open=yes +else + ac_cv_lib_asound_snd_pcm_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_open" >&5 +$as_echo "$ac_cv_lib_asound_snd_pcm_open" >&6; } +if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default" +if test "x$ac_cv_header_alsa_asoundlib_h" = xyes; then : + output_modules="$output_modules alsa" HAVE_ALSA="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found ALSA library but NOT header files on your system" >&5 +$as_echo "$as_me: WARNING: Found ALSA library but NOT header files on your system" >&2;} +fi + + + + +fi + + if test "x$HAVE_ALSA" != xyes; then + check_failed=yes + fi + ;; + jack) + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JACK" >&5 +$as_echo_n "checking for JACK... " >&6; } + +if test -n "$JACK_CFLAGS"; then + pkg_cv_JACK_CFLAGS="$JACK_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jack\""; } >&5 + ($PKG_CONFIG --exists --print-errors "jack") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_JACK_CFLAGS=`$PKG_CONFIG --cflags "jack" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$JACK_LIBS"; then + pkg_cv_JACK_LIBS="$JACK_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"jack\""; } >&5 + ($PKG_CONFIG --exists --print-errors "jack") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_JACK_LIBS=`$PKG_CONFIG --libs "jack" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + JACK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "jack" 2>&1` + else + JACK_PKG_ERRORS=`$PKG_CONFIG --print-errors "jack" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$JACK_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_JACK="no" check_failed=yes +elif test $pkg_failed = untried; then + HAVE_JACK="no" check_failed=yes +else + JACK_CFLAGS=$pkg_cv_JACK_CFLAGS + JACK_LIBS=$pkg_cv_JACK_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + output_modules="$output_modules jack" HAVE_JACK="yes" +fi + ;; + pulse) + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PULSE" >&5 +$as_echo_n "checking for PULSE... " >&6; } + +if test -n "$PULSE_CFLAGS"; then + pkg_cv_PULSE_CFLAGS="$PULSE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse-simple\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpulse-simple") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PULSE_CFLAGS=`$PKG_CONFIG --cflags "libpulse-simple" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$PULSE_LIBS"; then + pkg_cv_PULSE_LIBS="$PULSE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse-simple\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpulse-simple") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PULSE_LIBS=`$PKG_CONFIG --libs "libpulse-simple" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + PULSE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libpulse-simple" 2>&1` + else + PULSE_PKG_ERRORS=`$PKG_CONFIG --print-errors "libpulse-simple" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PULSE_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_PULSE="no" check_failed=yes +elif test $pkg_failed = untried; then + HAVE_PULSE="no" check_failed=yes +else + PULSE_CFLAGS=$pkg_cv_PULSE_CFLAGS + PULSE_LIBS=$pkg_cv_PULSE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + output_modules="$output_modules pulse" HAVE_PULSE="yes" +fi + ;; + esd) + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ESD" >&5 +$as_echo_n "checking for ESD... " >&6; } + +if test -n "$ESD_CFLAGS"; then + pkg_cv_ESD_CFLAGS="$ESD_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"esound\""; } >&5 + ($PKG_CONFIG --exists --print-errors "esound") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ESD_CFLAGS=`$PKG_CONFIG --cflags "esound" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$ESD_LIBS"; then + pkg_cv_ESD_LIBS="$ESD_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"esound\""; } >&5 + ($PKG_CONFIG --exists --print-errors "esound") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ESD_LIBS=`$PKG_CONFIG --libs "esound" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + ESD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "esound" 2>&1` + else + ESD_PKG_ERRORS=`$PKG_CONFIG --print-errors "esound" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$ESD_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_ESD="no" check_failed=yes +elif test $pkg_failed = untried; then + HAVE_ESD="no" check_failed=yes +else + ESD_CFLAGS=$pkg_cv_ESD_CFLAGS + ESD_LIBS=$pkg_cv_ESD_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + output_modules="$output_modules esd" HAVE_ESD="yes" +fi + ;; + portaudio) + # Remember: This looks only insane because you chose an insane tab width! + PORTAUDIO_LIBS="-lportaudio" + PORTAUDIO_CFLAGS= + case $host in + *-*-mingw32) + # We tested portaudio with MME + if test "x$HAVE_PORTAUDIO" != "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pa_Initialize in -lportaudio" >&5 +$as_echo_n "checking for Pa_Initialize in -lportaudio... " >&6; } +if ${ac_cv_lib_portaudio_Pa_Initialize+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lportaudio -lwinmm + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Pa_Initialize (); +int +main () +{ +return Pa_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_portaudio_Pa_Initialize=yes +else + ac_cv_lib_portaudio_Pa_Initialize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_portaudio_Pa_Initialize" >&5 +$as_echo "$ac_cv_lib_portaudio_Pa_Initialize" >&6; } +if test "x$ac_cv_lib_portaudio_Pa_Initialize" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "portaudio.h" "ac_cv_header_portaudio_h" "$ac_includes_default" +if test "x$ac_cv_header_portaudio_h" = xyes; then : + output_modules="$output_modules portaudio" HAVE_PORTAUDIO_WINMM="yes" HAVE_PORTAUDIO="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found PortAudio library but NOT header files on your system" >&5 +$as_echo "$as_me: WARNING: Found PortAudio library but NOT header files on your system" >&2;} +fi + + + PORTAUDIO_LIBS="$PORTAUDIO_LIBS -lwinmm" + +else + HAVE_PORTAUDIO="no" +fi + + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pa_Initialize in -lportaudio" >&5 +$as_echo_n "checking for Pa_Initialize in -lportaudio... " >&6; } +if ${ac_cv_lib_portaudio_Pa_Initialize+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lportaudio $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Pa_Initialize (); +int +main () +{ +return Pa_Initialize (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_portaudio_Pa_Initialize=yes +else + ac_cv_lib_portaudio_Pa_Initialize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_portaudio_Pa_Initialize" >&5 +$as_echo "$ac_cv_lib_portaudio_Pa_Initialize" >&6; } +if test "x$ac_cv_lib_portaudio_Pa_Initialize" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "portaudio.h" "ac_cv_header_portaudio_h" "$ac_includes_default" +if test "x$ac_cv_header_portaudio_h" = xyes; then : + output_modules="$output_modules portaudio" HAVE_PORTAUDIO="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found PortAudio library but NOT header files on your system" >&5 +$as_echo "$as_me: WARNING: Found PortAudio library but NOT header files on your system" >&2;} +fi + + + + +fi + + ;; + esac + if test "x$HAVE_PORTAUDIO" != xyes; then + check_failed=yes + else + # See if we have v19 or v18 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pa_GetVersion in -lportaudio" >&5 +$as_echo_n "checking for Pa_GetVersion in -lportaudio... " >&6; } +if ${ac_cv_lib_portaudio_Pa_GetVersion+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lportaudio $PORTAUDIO_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Pa_GetVersion (); +int +main () +{ +return Pa_GetVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_portaudio_Pa_GetVersion=yes +else + ac_cv_lib_portaudio_Pa_GetVersion=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_portaudio_Pa_GetVersion" >&5 +$as_echo "$ac_cv_lib_portaudio_Pa_GetVersion" >&6; } +if test "x$ac_cv_lib_portaudio_Pa_GetVersion" = xyes; then : + : +else + +$as_echo "#define PORTAUDIO18 1" >>confdefs.h + +fi + + fi + ;; + sdl) + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL" >&5 +$as_echo_n "checking for SDL... " >&6; } + +if test -n "$SDL_CFLAGS"; then + pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SDL_LIBS"; then + pkg_cv_SDL_LIBS="$SDL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "sdl" 2>&1` + else + SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors "sdl" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SDL_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + HAVE_SDL="no" check_failed=yes +elif test $pkg_failed = untried; then + HAVE_SDL="no" check_failed=yes +else + SDL_CFLAGS=$pkg_cv_SDL_CFLAGS + SDL_LIBS=$pkg_cv_SDL_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + output_modules="$output_modules sdl" HAVE_SDL="yes" +fi + ;; + nas) + NAS_LIBS=-laudio + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AuOpenServer in -laudio" >&5 +$as_echo_n "checking for AuOpenServer in -laudio... " >&6; } +if ${ac_cv_lib_audio_AuOpenServer+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-laudio $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char AuOpenServer (); +int +main () +{ +return AuOpenServer (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_audio_AuOpenServer=yes +else + ac_cv_lib_audio_AuOpenServer=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_audio_AuOpenServer" >&5 +$as_echo "$ac_cv_lib_audio_AuOpenServer" >&6; } +if test "x$ac_cv_lib_audio_AuOpenServer" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "audio/audiolib.h" "ac_cv_header_audio_audiolib_h" "$ac_includes_default" +if test "x$ac_cv_header_audio_audiolib_h" = xyes; then : + output_modules="$output_modules nas" HAVE_NAS="yes" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found NAS library but NOT header files on your system" >&5 +$as_echo "$as_me: WARNING: Found NAS library but NOT header files on your system" >&2;} +fi + + + + +fi + + if test "x$HAVE_NAS" != xyes; then + check_failed=yes + fi + ;; + win32) + # Check for windows ... and win32 audio + # Does not work... instead just check for header + # AC_CHECK_LIB( [winmm], [waveOutOpen] ) + WIN32_LIBS=-lwinmm + for ac_header in windows.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + output_modules="$output_modules win32" HAVE_WIN32=yes +else + HAVE_WIN32=no check_failed=yes +fi + +done + + ;; + sndio) + SNDIO_LIBS=-lsndio + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sio_open in -lsndio" >&5 +$as_echo_n "checking for sio_open in -lsndio... " >&6; } +if ${ac_cv_lib_sndio_sio_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsndio $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sio_open (); +int +main () +{ +return sio_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sndio_sio_open=yes +else + ac_cv_lib_sndio_sio_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sndio_sio_open" >&5 +$as_echo "$ac_cv_lib_sndio_sio_open" >&6; } +if test "x$ac_cv_lib_sndio_sio_open" = xyes; then : + for ac_header in sndio.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sndio.h" "ac_cv_header_sndio_h" "$ac_includes_default" +if test "x$ac_cv_header_sndio_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SNDIO_H 1 +_ACEOF + output_modules="$output_modules sndio" HAVE_SNDIO="yes" +fi + +done + + + +fi + + if test "x$HAVE_SNDIO" != xyes; then + check_failed=yes + fi + ;; + sun) + for ac_header in sun/audioio.h sys/audioio.h asm/audioio.h sys/audio.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test "x${ac_cv_header_sun_audioio_h}" = "xyes" \ + -o "x${ac_cv_header_sys_audioio_h}" = "xyes" \ + -o "x${ac_cv_header_asm_audioio_h}" = "xyes"; + then + output_modules="$output_modules sun" + HAVE_SUN="yes" + else + check_failed=yes + fi + ;; + coreaudio) + COREAUDIO_LIBS="-framework AudioToolbox -framework AudioUnit -framework CoreServices" + for ac_header in AudioUnit/AudioUnit.h CoreServices/CoreServices.h AudioToolbox/AudioToolbox.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test "x${ac_cv_header_AudioUnit_AudioUnit_h}" = "xyes" \ + -a "x${ac_cv_header_CoreServices_CoreServices_h}" = "xyes" \ + -a "x${ac_cv_header_AudioToolbox_AudioToolbox_h}" = "xyes"; + then + if test x"$modules" = xdisabled; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling buffer because of directly linked CoreAudio! Use the module if you need the buffer." >&5 +$as_echo "$as_me: WARNING: Disabling buffer because of directly linked CoreAudio! Use the module if you need the buffer." >&2;} + buffer=disabled + fi + output_modules="$output_modules coreaudio" + HAVE_COREAUDIO="yes" + else + check_failed=yes + fi + ;; + arts) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for artsc" >&5 +$as_echo_n "checking for artsc... " >&6; } + if artsc-config; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + output_modules="$output_modules arts" + HAVE_ARTS=yes + ARTS_LIBS=`artsc-config --libs` + ARTS_CFLAGS=`artsc-config --cflags` + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + check_failed=yes + fi + ;; + openal) + for ac_header in OpenAL/al.h OpenAL/alc.h AL/al.h AL/alc.h al.h alc.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test "x${ac_cv_header_OpenAL_al_h}" = "xyes" \ + -a "x${ac_cv_header_OpenAL_alc_h}" = "xyes"; + then #Mac OS X + output_modules="$output_modules openal" + OPENAL_LIBS="-framework OpenAL" + OPENAL_CFLAGS="-DOPENAL_SUBDIR_OPENAL" + HAVE_OPENAL="yes" + elif test "x${ac_cv_header_AL_al_h}" = "xyes" \ + -a "x${ac_cv_header_AL_alc_h}" = "xyes"; + then #Linux + output_modules="$output_modules openal" + OPENAL_LIBS="-lopenal" + OPENAL_CFLAGS="-DOPENAL_SUBDIR_AL" + HAVE_OPENAL="yes" + elif test "x${ac_cv_header_al_h}" = "xyes" \ + -a "x${ac_cv_header_alc_h}" = "xyes"; + then #Windows? + output_modules="$output_modules openal" + OPENAL_LIBS="-lopenal" + OPENAL_CFLAGS="" + HAVE_OPENAL="yes" + else + check_failed=yes + fi + ;; + os2) + OS2_LIBS="-los2me -lmmpm2 -lsocket" + for ac_header in os2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "os2.h" "ac_cv_header_os2_h" "$ac_includes_default" +if test "x$ac_cv_header_os2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OS2_H 1 +_ACEOF + +fi + +done + + # os2me.h depends on os2.h + # Yes, that way of coding it is ugly. + if test "x${ac_cv_header_os2_h}" = xyes + then + # We mimick exactly the way how the header will be used. + # It seems to be picky... + for ac_header in os2me.h +do : + ac_fn_c_check_header_compile "$LINENO" "os2me.h" "ac_cv_header_os2me_h" "#define INCL_OS2MM +#define INCL_DOS +#define INCL_VIO +#define INCL_KBD +#include <os2.h> +# +" +if test "x$ac_cv_header_os2me_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OS2ME_H 1 +_ACEOF + +fi + +done + + fi + if test "x${ac_cv_header_os2_h}" = xyes \ + -a "x${ac_cv_header_os2me_h}" = xyes + then + output_modules="$output_modules os2" + HAVE_OS2=yes + else + check_failed=yes + fi + ;; +# from here on only forced tests, untested code + hp) + # What's the deal with that and alib? + UNSUPPORTED_AUDIO=yes + ac_fn_c_check_header_mongrel "$LINENO" "sys/audio.h" "ac_cv_header_sys_audio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_audio_h" = xyes; then : + output_modules="$output_modules hp" HAVE_HP=yes +else + check_failed=yes +fi + + + ;; + alib) + UNSUPPORTED_AUDIO=yes + # ALIB_CFLAGS="-I/opt/audio/include" + ALIB_LIBS=-lAlib + # These headers may not be all about audio but they are used. + for ac_header in Alib.h CUlib.h netdb.h netinet/in.h netinet/tcp.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + if test "x${ac_cv_header_Alib_h}" = xyes \ + -a "x${ac_cv_header_CUlib_h}" = xyes \ + -a "x${ac_cv_header_netdb_h}" = xyes \ + -a "x${ac_cv_header_netinet_in_h}" = xyes \ + -a "x${ac_cv_header_netinet_tcp_h}" = xyes + then + output_modules="$output_modules alib" + HAVE_ALIB=yes + else + check_failed=yes + fi + ;; + mint) + UNSUPPORTED_AUDIO=yes + for ac_header in audios.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "audios.h" "ac_cv_header_audios_h" "$ac_includes_default" +if test "x$ac_cv_header_audios_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_AUDIOS_H 1 +_ACEOF + output_modules="$output_modules mint" HAVE_MINT=yes +else + check_failes=yes +fi + +done + + ;; + aix) + UNSUPPORTED_AUDIO=yes + for ac_header in sys/audio.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/audio.h" "ac_cv_header_sys_audio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_audio_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_AUDIO_H 1 +_ACEOF + output_modules="$output_modules aix" HAVE_AIX=yes +else + check_failed=yes +fi + +done + + ;; + sgi) + UNSUPPORTED_AUDIO=yes + SGI_LIBS=-laudio + ac_fn_c_check_header_mongrel "$LINENO" "dmedia/audio.h" "ac_cv_header_dmedia_audio_h" "$ac_includes_default" +if test "x$ac_cv_header_dmedia_audio_h" = xyes; then : + output_modules="$output_modules sgi" HAVE_SGI=yes +else + check_failed=yes +fi + + + ;; + *) + as_fn_error $? "Unsupported/-known output '$m' demanded!" "$LINENO" 5 + ;; + esac +done + +if test "x$check_forced" = xyes -a "x$UNSUPPORTED_AUDIO" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You requested bulding of an unsupported audio module. Be prepared for happy hacking and please tell us about your experience!" >&5 +$as_echo "$as_me: WARNING: You requested bulding of an unsupported audio module. Be prepared for happy hacking and please tell us about your experience!" >&2;} +fi + +if test "x$check_forced" = xyes -a "x$check_failed" = "xyes"; then + as_fn_error $? "One/some of your requested audio modules failed the test!" "$LINENO" 5 +fi + +# When you extend check_modules, you should extend this: +#for i in alsa oss coreaudio sndio sun win32 esd jack portaudio pulse sdl nas aix alib arts hp os2 sgi mint openal dummy; do echo $i; done | +#perl -ne 'chomp; $big = uc($_); print <<EOT; +#AC_SUBST(${big}_LIBS) +#AC_SUBST(${big}_LDFLAGS) +#AC_SUBST(${big}_CFLAGS) +#AM_CONDITIONAL( [HAVE_$big], [test "x\$HAVE_$big" = xyes] ) +#EOT +#' + + + + if test "x$HAVE_ALSA" = xyes ; then + HAVE_ALSA_TRUE= + HAVE_ALSA_FALSE='#' +else + HAVE_ALSA_TRUE='#' + HAVE_ALSA_FALSE= +fi + + + + + if test "x$HAVE_OSS" = xyes ; then + HAVE_OSS_TRUE= + HAVE_OSS_FALSE='#' +else + HAVE_OSS_TRUE='#' + HAVE_OSS_FALSE= +fi + + + + + if test "x$HAVE_COREAUDIO" = xyes ; then + HAVE_COREAUDIO_TRUE= + HAVE_COREAUDIO_FALSE='#' +else + HAVE_COREAUDIO_TRUE='#' + HAVE_COREAUDIO_FALSE= +fi + + + + + if test "x$HAVE_SNDIO" = xyes ; then + HAVE_SNDIO_TRUE= + HAVE_SNDIO_FALSE='#' +else + HAVE_SNDIO_TRUE='#' + HAVE_SNDIO_FALSE= +fi + + + + + if test "x$HAVE_SUN" = xyes ; then + HAVE_SUN_TRUE= + HAVE_SUN_FALSE='#' +else + HAVE_SUN_TRUE='#' + HAVE_SUN_FALSE= +fi + + + + + if test "x$HAVE_WIN32" = xyes ; then + HAVE_WIN32_TRUE= + HAVE_WIN32_FALSE='#' +else + HAVE_WIN32_TRUE='#' + HAVE_WIN32_FALSE= +fi + + + + + if test "x$HAVE_ESD" = xyes ; then + HAVE_ESD_TRUE= + HAVE_ESD_FALSE='#' +else + HAVE_ESD_TRUE='#' + HAVE_ESD_FALSE= +fi + + + + + if test "x$HAVE_JACK" = xyes ; then + HAVE_JACK_TRUE= + HAVE_JACK_FALSE='#' +else + HAVE_JACK_TRUE='#' + HAVE_JACK_FALSE= +fi + + + + + if test "x$HAVE_PORTAUDIO" = xyes ; then + HAVE_PORTAUDIO_TRUE= + HAVE_PORTAUDIO_FALSE='#' +else + HAVE_PORTAUDIO_TRUE='#' + HAVE_PORTAUDIO_FALSE= +fi + + + + + if test "x$HAVE_PULSE" = xyes ; then + HAVE_PULSE_TRUE= + HAVE_PULSE_FALSE='#' +else + HAVE_PULSE_TRUE='#' + HAVE_PULSE_FALSE= +fi + + + + + if test "x$HAVE_SDL" = xyes ; then + HAVE_SDL_TRUE= + HAVE_SDL_FALSE='#' +else + HAVE_SDL_TRUE='#' + HAVE_SDL_FALSE= +fi + + + + + if test "x$HAVE_NAS" = xyes ; then + HAVE_NAS_TRUE= + HAVE_NAS_FALSE='#' +else + HAVE_NAS_TRUE='#' + HAVE_NAS_FALSE= +fi + + + + + if test "x$HAVE_AIX" = xyes ; then + HAVE_AIX_TRUE= + HAVE_AIX_FALSE='#' +else + HAVE_AIX_TRUE='#' + HAVE_AIX_FALSE= +fi + + + + + if test "x$HAVE_ALIB" = xyes ; then + HAVE_ALIB_TRUE= + HAVE_ALIB_FALSE='#' +else + HAVE_ALIB_TRUE='#' + HAVE_ALIB_FALSE= +fi + + + + + if test "x$HAVE_ARTS" = xyes ; then + HAVE_ARTS_TRUE= + HAVE_ARTS_FALSE='#' +else + HAVE_ARTS_TRUE='#' + HAVE_ARTS_FALSE= +fi + + + + + if test "x$HAVE_HP" = xyes ; then + HAVE_HP_TRUE= + HAVE_HP_FALSE='#' +else + HAVE_HP_TRUE='#' + HAVE_HP_FALSE= +fi + + + + + if test "x$HAVE_OS2" = xyes ; then + HAVE_OS2_TRUE= + HAVE_OS2_FALSE='#' +else + HAVE_OS2_TRUE='#' + HAVE_OS2_FALSE= +fi + + + + + if test "x$HAVE_SGI" = xyes ; then + HAVE_SGI_TRUE= + HAVE_SGI_FALSE='#' +else + HAVE_SGI_TRUE='#' + HAVE_SGI_FALSE= +fi + + + + + if test "x$HAVE_MINT" = xyes ; then + HAVE_MINT_TRUE= + HAVE_MINT_FALSE='#' +else + HAVE_MINT_TRUE='#' + HAVE_MINT_FALSE= +fi + + + + + if test "x$HAVE_OPENAL" = xyes ; then + HAVE_OPENAL_TRUE= + HAVE_OPENAL_FALSE='#' +else + HAVE_OPENAL_TRUE='#' + HAVE_OPENAL_FALSE= +fi + + + + + if test "x$HAVE_DUMMY" = xyes ; then + HAVE_DUMMY_TRUE= + HAVE_DUMMY_FALSE='#' +else + HAVE_DUMMY_TRUE='#' + HAVE_DUMMY_FALSE= +fi + + +# Did user choose default audio subsystem ? +if test "x$with_default_audio" != "x"; then + default_output_module=$with_default_audio +else + default_output_module=`echo "$output_modules" | $AWK '{ print $1 }'` +fi + +# That's (beginning of) the list for mpg123's internal default. +default_output_modules=$default_output_module + +OUTPUT_OBJ= +OUTPUT_MOD= +OUTPUT_CFLAGS= +OUTPUT_LIBS= +OUTPUT_LDFLAGS= + +# Setup the static build. +if test "x$modules" = xdisabled +then + echo "Preparing static output $default_output_module" + OUTPUT_MOD="$default_output_module" + OUTPUT_OBJ="output/$default_output_module.\$(OBJEXT)" + OUTPUT_CFLAGS= + OUTPUT_LIBS= + # That feels stupid... what about hashed arrays? + case $OUTPUT_MOD in + # Here's a script for that tedious list, perhaps to be outsourced together with the one in src/output/Makefile.am +#for i in alsa coreaudio esd jack nas oss portaudio pulse sdl sndio sun win32 aix alib arts hp os2 sgi mint; do echo $i; done | +#perl -ne 'chomp; $big = uc($_); print <<EOT; +# $_) +# OUTPUT_LIBS="\$${big}_LIBS" +# OUTPUT_LDFLAGS="\$${big}_LDFLAGS" +# OUTPUT_CFLAGS="\$${big}_CFLAGS" +# ;; +#EOT +#' + alsa) + OUTPUT_LIBS="$ALSA_LIBS" + OUTPUT_LDFLAGS="$ALSA_LDFLAGS" + OUTPUT_CFLAGS="$ALSA_CFLAGS" + ;; + coreaudio) + OUTPUT_LIBS="$COREAUDIO_LIBS" + OUTPUT_LDFLAGS="$COREAUDIO_LDFLAGS" + OUTPUT_CFLAGS="$COREAUDIO_CFLAGS" + ;; + esd) + OUTPUT_LIBS="$ESD_LIBS" + OUTPUT_LDFLAGS="$ESD_LDFLAGS" + OUTPUT_CFLAGS="$ESD_CFLAGS" + ;; + jack) + OUTPUT_LIBS="$JACK_LIBS" + OUTPUT_LDFLAGS="$JACK_LDFLAGS" + OUTPUT_CFLAGS="$JACK_CFLAGS" + ;; + nas) + OUTPUT_LIBS="$NAS_LIBS" + OUTPUT_LDFLAGS="$NAS_LDFLAGS" + OUTPUT_CFLAGS="$NAS_CFLAGS" + ;; + oss) + OUTPUT_LIBS="$OSS_LIBS" + OUTPUT_LDFLAGS="$OSS_LDFLAGS" + OUTPUT_CFLAGS="$OSS_CFLAGS" + ;; + portaudio) + OUTPUT_LIBS="$PORTAUDIO_LIBS" + OUTPUT_LDFLAGS="$PORTAUDIO_LDFLAGS" + OUTPUT_CFLAGS="$PORTAUDIO_CFLAGS" + ;; + pulse) + OUTPUT_LIBS="$PULSE_LIBS" + OUTPUT_LDFLAGS="$PULSE_LDFLAGS" + OUTPUT_CFLAGS="$PULSE_CFLAGS" + ;; + sdl) + OUTPUT_LIBS="$SDL_LIBS" + OUTPUT_LDFLAGS="$SDL_LDFLAGS" + OUTPUT_CFLAGS="$SDL_CFLAGS" + ;; + sndio) + OUTPUT_LIBS="$SNDIO_LIBS" + OUTPUT_LDFLAGS="$SNDIO_LDFLAGS" + OUTPUT_CFLAGS="$SNDIO_CFLAGS" + ;; + sun) + OUTPUT_LIBS="$SUN_LIBS" + OUTPUT_LDFLAGS="$SUN_LDFLAGS" + OUTPUT_CFLAGS="$SUN_CFLAGS" + ;; + win32) + OUTPUT_LIBS="$WIN32_LIBS" + OUTPUT_LDFLAGS="$WIN32_LDFLAGS" + OUTPUT_CFLAGS="$WIN32_CFLAGS" + ;; + aix) + OUTPUT_LIBS="$AIX_LIBS" + OUTPUT_LDFLAGS="$AIX_LDFLAGS" + OUTPUT_CFLAGS="$AIX_CFLAGS" + ;; + alib) + OUTPUT_LIBS="$ALIB_LIBS" + OUTPUT_LDFLAGS="$ALIB_LDFLAGS" + OUTPUT_CFLAGS="$ALIB_CFLAGS" + ;; + arts) + OUTPUT_LIBS="$ARTS_LIBS" + OUTPUT_LDFLAGS="$ARTS_LDFLAGS" + OUTPUT_CFLAGS="$ARTS_CFLAGS" + ;; + hp) + OUTPUT_LIBS="$HP_LIBS" + OUTPUT_LDFLAGS="$HP_LDFLAGS" + OUTPUT_CFLAGS="$HP_CFLAGS" + ;; + os2) + OUTPUT_LIBS="$OS2_LIBS" + OUTPUT_LDFLAGS="$OS2_LDFLAGS" + OUTPUT_CFLAGS="$OS2_CFLAGS" + ;; + sgi) + OUTPUT_LIBS="$SGI_LIBS" + OUTPUT_LDFLAGS="$SGI_LDFLAGS" + OUTPUT_CFLAGS="$SGI_CFLAGS" + ;; + mint) + OUTPUT_LIBS="$MINT_LIBS" + OUTPUT_LDFLAGS="$MINT_LDFLAGS" + OUTPUT_CFLAGS="$MINT_CFLAGS" + ;; + openal) + OUTPUT_LIBS="$OPENAL_LIBS" + OUTPUT_LDFLAGS="$OPENAL_LDFLAGS" + OUTPUT_CFLAGS="$OPENAL_CFLAGS" + ;; + esac +else + # Now make a comma-separated list again... eliminating the possible duplicate and dummy. + for i in $output_modules + do + if test $i != $default_output_module && test $i != dummy; then + default_output_modules=$default_output_modules,$i + fi + done +fi + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_OUTPUT_MODULE "$default_output_modules" +_ACEOF + + + + + + + + + + +CFLAGS="$ADD_CFLAGS $CFLAGS" +if test x"$buffer" = xdisabled; then + ADD_CPPFLAGS="$ADD_CPPFLAGS -DNOXFERMEM" +fi +if test x"$newoldwritesample" = xenabled; then + ADD_CPPFLAGS="$ADD_CPPFLAGS -DNEWOLD_WRITE_SAMPLE" +fi +CPPFLAGS="$ADD_CPPFLAGS $CPPFLAGS" +LDFLAGS="$ADD_LDFLAGS $LDFLAGS" + +# None chosen? +if test "x$with_optimization" = "x"; then + if test x"$debugging" = xenabled; then + with_optimization="0" + else + # enable (gcc specific) default opts only with gcc + if test "x$GCC" = xyes; then + with_optimization="2" + else + with_optimization="0" + fi + fi +fi + +case $with_optimization in + 0) + # No Optimizations + CFLAGS="$CFLAGS" + ;; + 1) + CFLAGS="-O $CFLAGS" + ;; + 2) + CFLAGS="-O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS" + ;; + 3) + CFLAGS="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS" + ;; + 4) + CFLAGS="-O4 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS" + ;; + *) + as_fn_error $? "Unknown optimizations level '$with_optimization'" "$LINENO" 5 + ;; +esac + +if test "x$GCC" = xyes && echo "$CFLAGS" | $GREP 'mpreferred-stack-boundary=' > /dev/null; then + case $cpu_type in + x86 | i586* | mmx | sse | 3dnow* | altivec) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are trying to mess with stack alignment. I know better. " >&5 +$as_echo "$as_me: WARNING: You are trying to mess with stack alignment. I know better. " >&2;} + CFLAGS="$CFLAGS -mpreferred-stack-boundary=4" + ;; + esac +fi + + +if test "x$with_seektable" = "x"; then + seektable=1000 +else + seektable=$with_seektable +fi + +if test "$seektable" -gt 0; then + +$as_echo "#define FRAME_INDEX 1" >>confdefs.h + +fi +# Define that always... also without frame index enabled. + +cat >>confdefs.h <<_ACEOF +#define INDEX_SIZE $seektable +_ACEOF + + +# Check if we want Unicode for Win32. Cygwin does not need _wopen +win32_specific_codes=disabled +win32_unicode=unneeded +win32_sockets=disabled +win32_sockets_working=no +win32_wide_working=no +win32_winver_bump=no +for ac_header in windows.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + win32_specific_codes=enabled +fi + +done + +if test "x$win32_specific_codes" = xenabled && test "x$host_os" != "xcygwin"; then + +#### Check for Wide functions + ac_fn_c_check_func "$LINENO" "_wopen" "ac_cv_func__wopen" +if test "x$ac_cv_func__wopen" = xyes; then : + win32_unicode=enabled +else + win32_unicode=disabled +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want Unicode File Open for Win32" >&5 +$as_echo_n "checking if we want Unicode File Open for Win32... " >&6; } + if test "x$win32_unicode" = xenabled; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Unicode functions working" >&5 +$as_echo_n "checking if Unicode functions working... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <windows.h> + #include <stdlib.h> + int main() + { + MultiByteToWideChar (0, 0, NULL, 0, NULL, 0); + WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL); + return 0; + } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_wide_working=yes +else + win32_winver_bump=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "x$win32_wide_working" = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define WINVER 0x501 + #define _WIN32_WINNT 0x501 + #include <windows.h> + #include <stdlib.h> + int main() + { + MultiByteToWideChar (0, 0, NULL, 0, NULL, 0); + WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL); + return 0; + } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_wide_working=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + if test "x$win32_wide_working" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WANT_WIN32_UNICODE 1" >>confdefs.h + + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unicode File Open for Win32 disabled" >&5 +$as_echo "$as_me: WARNING: Unicode File Open for Win32 disabled" >&2;} + fi + +#### Check for Network functions + for ac_header in ws2tcpip.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WS2TCPIP_H 1 +_ACEOF + win32_sockets=enabled +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please update your headers to support winsock 2.2." >&5 +$as_echo "$as_me: WARNING: Please update your headers to support winsock 2.2." >&2;} +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we want Win32 sockets" >&5 +$as_echo_n "checking if we want Win32 sockets... " >&6; } + if test "x$win32_sockets" = "xenabled" && test "x$network" != "xdisabled"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if winsock2 API is available" >&5 +$as_echo_n "checking if winsock2 API is available... " >&6; } + wsoldlibs="$LIBS" + LIBS="$LIBS -lws2_32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <winsock2.h> + #include <ws2tcpip.h> + #include <stdlib.h> + int main() + { + getaddrinfo(NULL, NULL, NULL, NULL); + freeaddrinfo(NULL); + return 0; + } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_sockets_working=yes +else + win32_winver_bump=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "x$win32_sockets_working" = "xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking deeper if winsock2 API is available" >&5 +$as_echo_n "checking deeper if winsock2 API is available... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define WINVER 0x501 + #define _WIN32_WINNT 0x501 + #include <winsock2.h> + #include <ws2tcpip.h> + #include <stdlib.h> + int main() + { + getaddrinfo(NULL, NULL, NULL, NULL); + freeaddrinfo(NULL); + return 0; + } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_sockets_working=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + if test "x$win32_sockets_working" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WANT_WIN32_SOCKETS 1" >>confdefs.h + + network_type=Winsock2 + have_network=yes + have_ipv6=yes + else + LIBS="$wsoldlibs" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please update your headers to support winsock 2.2." >&5 +$as_echo "$as_me: WARNING: Please update your headers to support winsock 2.2." >&2;} + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + +#### Check for Win32 Named Pipe functions +win32_fifo_working=no +if test x$win32_specific_codes = xenabled; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have Named Pipes" >&5 +$as_echo_n "checking if we have Named Pipes... " >&6; } + if test "x$fifo" != "xdisabled"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <windows.h> + int main(){ + CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + return 0; + } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_fifo_working=yes +else + win32_winver_bump=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "x$win32_fifo_working" != "xyes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define WINVER 0x501 + #define _WIN32_WINNT 0x501 + #include <windows.h> + int main(){ + CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + return 0; + } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + win32_fifo_working=yes +else + win32_fifo_working=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + fi + have_mkfifo=$win32_fifo_working + if test "x$win32_fifo_working" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WANT_WIN32_FIFO 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi +fi + +#### WINVER Bump +if test x$win32_specific_codes = xenabled; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if WINVER and _WIN32_WINNT needs version bumps" >&5 +$as_echo_n "checking if WINVER and _WIN32_WINNT needs version bumps... " >&6; } + if test "x$win32_winver_bump" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define WINVER 0x0501" >>confdefs.h + + +$as_echo "#define _WIN32_WINNT 0x0501" >>confdefs.h + + # getaddrinfo and freeaddrinfo are available for Win2K and above + # Bug: MinGW.org w32api ws2tcpip.h incorrectly wants (_WIN32_WINNT >= 0x0501) for getaddrinfo and freeaddrinfo + # MultiByteToWideChar and WideCharToMultiByte are available for Win2K and above + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi +fi + +fi #END OF WIN32 CHECKS + +#### Use Win32 support codes + if test "x$win32_specific_codes" = xenabled ; then + WIN32_CODES_TRUE= + WIN32_CODES_FALSE='#' +else + WIN32_CODES_TRUE='#' + WIN32_CODES_FALSE= +fi + + +if test x"$network" = xauto; then + if test x"$have_network" = xyes; then + network=enabled + else + network=disabled + fi +fi +if test x"$ipv6" = xauto; then + if test x"$have_ipv6" = xyes; then + ipv6=enabled + else + ipv6=disabled + fi +fi + + +if test x"$fifo" = xauto; then + if test x"$have_mkfifo" = xyes; then + fifo=enabled + else + fifo=disabled + fi +fi + +if test x"$fifo" = xenabled; then + +$as_echo "#define FIFO 1" >>confdefs.h + + if test x"$have_mkfifo" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You forced FIFO code while I think there is no mkfifo() available! " >&5 +$as_echo "$as_me: WARNING: You forced FIFO code while I think there is no mkfifo() available! " >&2;} + fi +fi + +if test x"$network" = xenabled; then + +$as_echo "#define NETWORK 1" >>confdefs.h + + if test x"$have_network" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You forced network code while I think there is support missing! " >&5 +$as_echo "$as_me: WARNING: You forced network code while I think there is support missing! " >&2;} + fi +fi + +if test x"$ipv6" = xenabled; then + +$as_echo "#define IPV6 1" >>confdefs.h + + if test x"$have_ipv6" = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You forced IPv6 code while I think there is no getaddrinfo() available! " >&5 +$as_echo "$as_me: WARNING: You forced IPv6 code while I think there is no getaddrinfo() available! " >&2;} + fi +fi + + +# Do that here to prevent the above tests usign -lltdl... +if test "x$modules" = xenabled; then + LIBS="-lltdl $LIBS" +fi + +ac_config_files="$ac_config_files Makefile libmpg123.pc mpg123.spec doc/Makefile src/Makefile src/output/Makefile src/libmpg123/Makefile src/libmpg123/mpg123.h" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${HAVE_MODULES_TRUE}" && test -z "${HAVE_MODULES_FALSE}"; then + as_fn_error $? "conditional \"HAVE_MODULES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_ALSA_TRUE}" && test -z "${HAVE_ALSA_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ALSA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OSS_TRUE}" && test -z "${HAVE_OSS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OSS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_COREAUDIO_TRUE}" && test -z "${HAVE_COREAUDIO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_COREAUDIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SNDIO_TRUE}" && test -z "${HAVE_SNDIO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SNDIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SUN_TRUE}" && test -z "${HAVE_SUN_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SUN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_WIN32_TRUE}" && test -z "${HAVE_WIN32_FALSE}"; then + as_fn_error $? "conditional \"HAVE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_ESD_TRUE}" && test -z "${HAVE_ESD_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ESD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_JACK_TRUE}" && test -z "${HAVE_JACK_FALSE}"; then + as_fn_error $? "conditional \"HAVE_JACK\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_PORTAUDIO_TRUE}" && test -z "${HAVE_PORTAUDIO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_PORTAUDIO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_PULSE_TRUE}" && test -z "${HAVE_PULSE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_PULSE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SDL_TRUE}" && test -z "${HAVE_SDL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SDL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_NAS_TRUE}" && test -z "${HAVE_NAS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_NAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_AIX_TRUE}" && test -z "${HAVE_AIX_FALSE}"; then + as_fn_error $? "conditional \"HAVE_AIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_ALIB_TRUE}" && test -z "${HAVE_ALIB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ALIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_ARTS_TRUE}" && test -z "${HAVE_ARTS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ARTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_HP_TRUE}" && test -z "${HAVE_HP_FALSE}"; then + as_fn_error $? "conditional \"HAVE_HP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OS2_TRUE}" && test -z "${HAVE_OS2_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OS2\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SGI_TRUE}" && test -z "${HAVE_SGI_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SGI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_MINT_TRUE}" && test -z "${HAVE_MINT_FALSE}"; then + as_fn_error $? "conditional \"HAVE_MINT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_OPENAL_TRUE}" && test -z "${HAVE_OPENAL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_OPENAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_DUMMY_TRUE}" && test -z "${HAVE_DUMMY_FALSE}"; then + as_fn_error $? "conditional \"HAVE_DUMMY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WIN32_CODES_TRUE}" && test -z "${WIN32_CODES_FALSE}"; then + as_fn_error $? "conditional \"WIN32_CODES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by mpg123 $as_me 1.14.4, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to <mpg123-devel@lists.sourceforge.net>." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +mpg123 config.status 1.14.4 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libmpg123.pc") CONFIG_FILES="$CONFIG_FILES libmpg123.pc" ;; + "mpg123.spec") CONFIG_FILES="$CONFIG_FILES mpg123.spec" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/output/Makefile") CONFIG_FILES="$CONFIG_FILES src/output/Makefile" ;; + "src/libmpg123/Makefile") CONFIG_FILES="$CONFIG_FILES src/libmpg123/Makefile" ;; + "src/libmpg123/mpg123.h") CONFIG_FILES="$CONFIG_FILES src/libmpg123/mpg123.h" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' <confdefs.h | sed ' +s/'"$ac_delim"'/"\\\ +"/g' >>$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + + + + +echo " + $PACKAGE_NAME $PACKAGE_VERSION + + Install path ............ $prefix + CPU Optimization ........ $cpu_type + Compiler Optimization ... $with_optimization + Gapless Support ......... $gapless + Debugging ............... $debugging + Seek table size ......... $seektable + FIFO support ............ $fifo + Buffer .................. $buffer + Network (http streams) .. $network + Network Sockets ......... $network_type + IPv6 (getaddrinfo) ...... $ipv6" +if test x"$LARGEFILE_BITS" = x; then + echo " File offsets ............ default" +else + echo " File offsets ............ $LARGEFILE_BITS" + echo " The lib will (try to) support default offset size, too." +fi +echo " LFS alias symbols ....... $lfs_alias ($LFS_ALIAS_BITS)" + +echo " Alignment checks ........ $aligncheck" +if test x"$aligncheck" = xenabled; then + if test x"$ccalign" != xyes; then + echo " (without effect since special alignment is not employed)" + fi + if test x"$GCC" = xyes; then + echo " (note that newer gcc 4.x versions do not use/need the align check)" + fi +fi +echo -n " + Core libmpg123 features: + Integer conversion ...... $integers + New/old WRITE_SAMPLE .... $newoldwritesample + Layer I ................. $layer1 + Layer II ................ $layer2 + Layer III ............... $layer3 + NtoM resampling ......... $ntom + downsampled decoding .... $downsample + Feeder/buffered input ... $feeder + ID3v2 parsing ........... $id3v2 + String API .............. $string + ICY parsing/conversion .. $icy + Error/warning messages .. $messages + Win32 Unicode File Open.. $win32_unicode + Feature Report Function.. $feature_report + Output formats (nofpu will disable all but 16 or 8 bit!): + 8 bit integer ........... $int8 + 16 bit integer .......... $int16 + 32/24 bit integer ....... $int32 + real (32 bit float) ..... $real + +Note: Disabling core features is not commonly done and some combinations might not build/work. If you encounter such a case, help yourself (and provide a patch) or just poke the maintainers. +" +# just an empty line +echo + +echo " Modules ................. $modules" +echo " Module suffix ........... $with_module_suffix" +echo " Checked audio modules ... $check_modules + Detected audio support ..$output_modules + Default output module ... $default_output_module +" +if test x"$modules" = xdisabled; then +echo "The _single_ active output module is being statically linked in. +" +fi +if test x"$with_optimization" = x0; then + echo "No optimization flags chosen, make sure you have something basic in your CFLAGS at least... +" +fi +if test x"$debugging" = xenabled; then + echo "CFLAGS='$CFLAGS'" + echo "LIBS='$LIBS'" +else + echo "Next type 'make' and then 'make install'." +fi diff --git a/node_modules/lame/deps/mpg123/configure.ac b/node_modules/lame/deps/mpg123/configure.ac new file mode 100644 index 0000000..f4badf5 --- /dev/null +++ b/node_modules/lame/deps/mpg123/configure.ac @@ -0,0 +1,2178 @@ +dnl configure.ac: source for the configure script + +dnl copyright by the mpg123 project - free software under the terms of the LGPL 2.1 +dnl see COPYING and AUTHORS files in distribution or http://mpg123.org +dnl initially written by Nicholas J. Humfrey + +dnl Require autoconf version >= 2.57 +AC_PREREQ(2.57) + + +dnl ############# Initialisation +AC_INIT([mpg123], [1.14.4], [mpg123-devel@lists.sourceforge.net]) +dnl Increment API_VERSION when the API gets changes (new functions). +API_VERSION=36 +LIB_PATCHLEVEL=6 +dnl Since we want to be backwards compatible, both sides get set to API_VERSION. +LIBMPG123_VERSION=$API_VERSION:$LIB_PATCHLEVEL:$API_VERSION +AC_SUBST(LIBMPG123_VERSION) +AC_SUBST(API_VERSION) + +AC_CONFIG_SRCDIR(src/mpg123.c) +AC_CONFIG_AUX_DIR(build) +AC_CONFIG_SRCDIR(doc) +AC_CONFIG_MACRO_DIR([m4]) +AC_CANONICAL_HOST + +dnl Version 1.7 of automake is recommended +AM_INIT_AUTOMAKE(1.7) +AM_CONFIG_HEADER(src/config.h) + + +# You get strange symptoms like jack module build failing because the AC_C_CONST failed to detect the working const support. +# In that case, the test failed because -Werror, not because no const there... +# After looking again, there are possibly more tests being obscured by false failures. +AC_MSG_CHECKING([for -Werror in CFLAGS (It breaks tests)]) +if echo "$CFLAGS" | grep Werror; then + AC_MSG_RESULT([yes]) + AC_MSG_WARN([You have -Werror in CFLAGS. That may break some tests and make this configure bogus. +If you want paranoid compilation, use --enable-nagging option, which adds -Werror for gcc. +Also note that you shall not run make distcheck after configuring with --enable-nagging. +distcheck uses the generated CFLAGS... +Anyhow, continuing at your own risk.]) +else + AC_MSG_RESULT([no]) +fi + +buffer=enabled # try to build with buffer by default + +dnl ############# Compiler and tools Checks + +LT_LDFLAGS=-export-dynamic +EXEC_LT_LDFLAGS= +be_static=no +all_static=no +AC_MSG_CHECKING([if you are up to something totally static with LDFLAGS/CFLAGS]) +for f in $LDFLAGS $CFLAGS +do + case "$f" in + -all-static) + be_static=yes + all_static=yes + ;; + -static) + be_static=yes + ;; + esac +done +if test "x$be_static" = xyes; then + AC_MSG_RESULT([yes]) + LT_LDFLAGS=-all-static + EXEC_LT_LDFLAGS="$LT_LDFLAGS" +else + AC_MSG_RESULT([no]) +fi +if test "x$all_static" = xyes; then + AC_MSG_WARN( Use -static in LDFLAGS for all-static linking! Your compiler may blow up on that -all-static. ) +fi + +AM_PROG_AS +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +dnl "Checking for egrep is broken after removal of libltdl stuff... checks use $EGREP, so searching it here." +AC_PROG_EGREP +AC_C_CONST +AC_INLINE +AC_C_BIGENDIAN + +dnl ############# Use Libtool for dynamic module loading + +modules=auto +OUTPUT_OBJ="module.\$(OBJEXT)" +AC_ARG_ENABLE(modules, +[ --enable-modules=[no/yes] dynamically loadable output modules], +[ + if test "x$enableval" = xyes + then + modules=enabled + else + modules=disabled + fi +], +[ + if test "x$be_static" = "xyes"; then + modules=disabled + else + modules=auto + fi +]) + +dnl We only want shared libraries by default +AC_DISABLE_STATIC +AC_ENABLE_SHARED + +if test x"$enable_shared" = xno; then + modules=disabled + LT_LDFLAGS= +else + AC_DEFINE(DYNAMIC_BUILD, 1, [ Define if building with dynamcally linked libmpg123]) +fi + +if test x"$modules" = xdisabled +then + echo "Modules disabled, not checking for libltdl." +else + have_ltdl=no + AC_CHECK_LIB( [ltdl], [lt_dlinit], + [ AC_CHECK_HEADER( [ltdl.h], + [ + have_ltdl=yes + AC_DEFINE(HAVE_LTDL, 1, [ Define if libltdl is available ]) + ], + [ + AC_MSG_WARN([Found ltdl library but NOT the header file on your system]) + ] ) + ], + [ + AC_MSG_WARN([ltdl library not found]) + ] + ) + if test x"$modules" = xenabled -a x"$have_ltdl" = xno; then + AC_MSG_ERROR([Modules enabled but no libltdl found! This will not work...]) + fi + if test x"$modules" = xauto; then + if test x"$have_ltdl" = xyes; then + modules=enabled + echo "We found libltdl: Modules enabled." + else + echo "We did not find libltdl: Modules disabled." + modules=disabled + fi + fi +fi + +if test x"$modules" = xdisabled +then + echo "Modules disabled." +else +# Enable module support in source code +AC_DEFINE( USE_MODULES, 1, [Define if modules are enabled] ) +fi + +dnl Configure libtool + +AC_LIBTOOL_WIN32_DLL +AM_PROG_LIBTOOL + +if test x"$modules" = xdisabled +then + echo "Modules still disabled..." + MODULE_OBJ="legacy_module.\$(OBJEXT)" +else + MODULE_OBJ="module.\$(OBJEXT)" +fi + +AM_CONDITIONAL( [HAVE_MODULES], [test "x$modules" = xenabled] ) + +AC_SUBST(MODULE_OBJ) +AC_SUBST(LT_LDFLAGS) +AC_SUBST(EXEC_LT_LDFLAGS) + +dnl ############## Configurable Options + +AC_ARG_ENABLE(debug, + [ --enable-debug=[no/yes] turn on debugging], + [ + if test "x$enableval" = xyes + then + debugging="enabled" + else + debugging="disabled" + fi + ], + [ debugging="disabled" ] +) + +AC_ARG_ENABLE(nagging, + [ --enable-nagging=[no/yes] turn on GCC's pedantic nagging with error on warnings, also enables debugging ], + [ + if test "x$enableval" = xyes + then + nagging="enabled" + debugging="enabled" + else + nagging="disabled" + fi + ], + [ nagging="disabled" ] +) + +if test x"$debugging" = xenabled; then + AC_DEFINE(DEBUG, 1, [ Define if debugging is enabled. ]) +fi + +AC_ARG_ENABLE(gapless, + [ --enable-gapless=[no/yes] turn on gapless (enabled per default)], + [ + if test "x$enableval" = xyes + then + gapless="enabled" + AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ]) + else + gapless="disabled" + fi + ], + [ + gapless="enabled" + AC_DEFINE(GAPLESS, 1, [ Define if gapless is enabled. ]) + ] +) + +AC_ARG_ENABLE(fifo, + [ --enable-fifo=[no/yes] FIFO support for control interface (auto-enabled on linux) ], + [ + if test "x$enableval" = xyes + then + fifo="enabled" + else + fifo="disabled" + fi + ], + [ + fifo="auto" + ] +) + +AC_ARG_ENABLE(ipv6, + [ --enable-ipv6=[no/yes] IPv6 support (actually any protocol your libc does with getaddrinfo) ], + [ + if test "x$enableval" = xyes + then + ipv6="enabled" + else + ipv6="disabled" + fi + ], + [ + ipv6="auto" + ] +) + +AC_ARG_ENABLE(network, + [ --enable-network=[no/yes] network support (http streams / webradio) ], + [ + if test "x$enableval" = xyes + then + network="enabled" + else + network="disabled" + fi + ], + [ + network="auto" + ] +) + +dnl Optional objects list, depends on decoder choice and core feature selection. +dnl Not just for specific decoders anymore... +s_fpu= +DECODER_OBJ= +DECODER_LOBJ= + +dnl Core features that can be disabled to reduce binary size. + +id3v2=enabled +AC_ARG_ENABLE(id3v2, + [ --disable-id3v2=[no/yes] no ID3v2 parsing ], + [ + if test "x$enableval" = xno; then + id3v2="disabled" + fi + ], []) + +# id3v2 depends on strings... so check that in between. +string=enabled +AC_ARG_ENABLE(string, + [ --disable-string=[no/yes] no string API (this will disable ID3v2; main mpg123 won't build anymore) ], + [ + if test "x$enableval" = xno; then + string="disabled" + fi + ], []) + +if test "x$string" = "xdisabled"; then + AC_DEFINE(NO_STRING, 1, [ Define to disable string functions. ]) + id3v2=disabled + AC_MSG_WARN([ID3v2 support disabled because of string API being disabled.]) +else + DECODER_OBJ="$DECODER_OBJ stringbuf.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ stringbuf.lo" +fi + +if test "x$id3v2" = "xdisabled"; then + AC_DEFINE(NO_ID3V2, 1, [ Define to disable ID3v2 parsing. ]) +fi + +icy=enabled +AC_ARG_ENABLE(icy, + [ --disable-icy=[no/yes] no ICY metainfo parsing/conversion (main mpg123 won't build!) ], + [ + if test "x$enableval" = xno; then + icy="disabled" + fi + ], []) + +if test "x$icy" = "xdisabled"; then + AC_DEFINE(NO_ICY, 1, [ Define to disable ICY handling. ]) +else + DECODER_OBJ="$DECODER_OBJ icy.\$(OBJEXT) icy2utf8.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ icy.lo icy2utf8.lo" +fi + +ntom=enabled +AC_ARG_ENABLE(ntom, + [ --disable-ntom=[no/yes] no flexible resampling ], + [ + if test "x$enableval" = xno; then + ntom="disabled" + fi + ], []) + +if test "x$ntom" = "xdisabled"; then + AC_DEFINE(NO_NTOM, 1, [ Define to disable ntom resampling. ]) +else + DECODER_OBJ="$DECODER_OBJ ntom.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ ntom.lo" +fi + +downsample=enabled +AC_ARG_ENABLE(downsample, + [ --disable-downsample=[no/yes] no downsampled decoding ], + [ + if test "x$enableval" = xno; then + downsample="disabled" + fi + ], []) + +if test "x$downsample" = "xdisabled"; then + AC_DEFINE(NO_DOWNSAMPLE, 1, [ Define to disable downsampled decoding. ]) +fi + +feeder=enabled +AC_ARG_ENABLE(feeder, + [ --disable-feeder=[no/yes] no feeder decoding, no buffered readers ], + [ + if test "x$enableval" = xno; then + feeder="disabled" + fi + ], []) + +if test "x$feeder" = "xdisabled"; then + AC_DEFINE(NO_FEEDER, 1, [ Define to disable feeder and buffered readers. ]) +fi + +messages=enabled +AC_ARG_ENABLE(messages, + [ --disable-messages=[no/yes] no error/warning messages on the console ], + [ + if test "x$enableval" = xno; then + messages="disabled" + fi + ], []) + +if test "x$messages" = "xdisabled"; then + AC_DEFINE(NO_WARNING, 1, [ Define to disable warning messages. ]) + AC_DEFINE(NO_ERRORMSG, 1, [ Define to disable error messages. ]) + AC_DEFINE(NO_ERETURN, 1, [ Define to disable error messages in combination with a return value (the return is left intact). ]) +fi + +integers=fast +AC_ARG_ENABLE(int-quality, +[ --enable-int-quality=[yes/no] use rounding instead of fast truncation for integer output, where possible ], +[ + if test "x$enableval" = xyes; then + integers=quality + AC_DEFINE(ACCURATE_ROUNDING, 1, [ Define to use proper rounding. ]) + fi +], []) + +int16=enabled +AC_ARG_ENABLE(16bit, + [ --disable-16bit=[no/yes] no 16 bit integer output ], + [ + if test "x$enableval" = xno; then + int16="disabled" + fi + ], []) + +int8=enabled +AC_ARG_ENABLE(8bit, + [ --disable-8bit=[no/yes] no 8 bit integer output ], + [ + if test "x$enableval" = xno; then + int8="disabled" + fi + ], []) + +int32=enabled +AC_ARG_ENABLE(32bit, + [ --disable-32bit=[no/yes] no 32 bit integer output (also 24 bit) ], + [ + if test "x$enableval" = xno; then + int32="disabled" + fi + ], []) + +real=enabled +AC_ARG_ENABLE(real, + [ --disable-real=[no/yes] no real (floating point) output ], + [ + if test "x$enableval" = xno; then + real="disabled" + fi + ], []) + +AC_ARG_WITH([cpu], [ + --with-cpu=generic[_fpu] Use generic processor code with floating point arithmetic + --with-cpu=generic_float Plain alias to generic_fpu now... float output is a normal runtime option! + --with-cpu=generic_nofpu Use generic processor code with fixed point arithmetic (p.ex. ARM, experimental) + --with-cpu=generic_dither Use generic processor code with floating point arithmetic and dithering for 1to1 16bit decoding. + --with-cpu=i386[_fpu] Use code optimized for i386 processors with floating point arithmetic + --with-cpu=i386_nofpu Use code optimized for i386 processors with fixed point arithmetic (experimental) + --with-cpu=i486 Use code optimized for i486 processors (only usable alone!) + --with-cpu=i586 Use code optimized for i586 processors + --with-cpu=i586_dither Use code optimized for i586 processors with dithering (noise shaping), adds 256K to binary size + --with-cpu=3dnow Use code optimized for 3DNow processors + --with-cpu=3dnowext Use code optimized for 3DNowExt processors (K6-3+, Athlon) + --with-cpu=3dnowext_alone Really only 3DNowExt decoder, without 3DNow fallback for flexible rate + --with-cpu=mmx Use code optimized for MMX processors + --with-cpu=mmx_alone Really only MMX decoder, without i586 fallback for flexible rate + --with-cpu=sse Use code optimized for SSE processors + --with-cpu=sse_alone Really only SSE decoder, without i586 fallback for flexible rate + --with-cpu=x86 Pack all x86 opts into one binary (excluding i486, including dither) + --with-cpu=x86-64 Use code optimized for x86-64 processors (AMD64 and Intel64, including dithered generic) + --with-cpu=altivec Use code optimized for Altivec processors (PowerPC G4 and G5) + --with-cpu=ppc_nofpu Use code optimized for PowerPC processors with fixed point arithmetic (experimental) + --with-cpu=neon Use code optimized for ARM NEON SIMD engine (Cortex-A series) + --with-cpu=arm_nofpu Use code optimized for ARM processors with fixed point arithmetic (experimental) +]) + + +# opt-in for IEEE754 floating point action +# We want to make sure not to apply hacks relying on IEEE754 storage format on platforms where we did not make sure that this actually is valid. +# It _should_ be fine for about all computers still out there, but we play safe. +ieee=no +case $host in + i?86-*|x86_64-*|powerpc*|sparc*) + ieee=yes + ;; +esac +if test "x$ieee" = xyes; then + echo "We assume IEEE754 floating point format." + AC_DEFINE(IEEE_FLOAT, 1, [ Define to indicate that float storage follows IEEE754. ]) +fi + +newoldwritesample=disabled +case $host in + arm*-*-linux*) + # check that... perhaps we are better off on arm with kernel math emulation + cpu_type="arm_nofpu" + ;; + i386-*-linux*|i386-*-kfreebsd*-gnu) + cpu_type="i386_fpu" + newoldwritesample=enabled + ;; + i486-*-linux*|i486-*-kfreebsd*-gnu) + cpu_type="i486" + newoldwritesample=enabled + ;; + i586-*-linux*|i586-*-kfreebsd*-gnu) + cpu_type="x86" + newoldwritesample=enabled + ;; + i686-*-linux*|i686-*-kfreebsd*-gnu) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-linux*|x86_64-*-kfreebsd*-gnu) + cpu_type="x86-64_all" + ;; + *-*-linux*|*-*-kfreebsd*-gnu) + cpu_type="generic_fpu" + ;; + i386-apple-darwin10*) + AC_MSG_CHECKING([if CPU type supports x86-64]) + case `sysctl -n hw.optional.x86_64` in + 1) + AC_MSG_RESULT([yes]) + cpu_type="x86-64_all" + ;; + *) + AC_MSG_RESULT([no]) + cpu_type="x86" + newoldwritesample=enabled + ;; + esac + ;; + i386-apple-darwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-apple-darwin*) + cpu_type="x86-64_all" + ;; + *-apple-darwin*) + AC_MSG_CHECKING([if CPU type supports AltiVec]) + case `machine` in + ppc7400 | ppc7450 | ppc970) + AC_MSG_RESULT([yes]) + cpu_type="altivec" + ;; + *) + AC_MSG_RESULT([no]) + cpu_type="generic_fpu" + ;; + esac + ;; + i?86-*-dragonfly* | i?86-*-freebsd* | i?86-*-midnightbsd* | i?86-*-mirbsd* | i?86-*-netbsd* | i?86-*-openbsd*) + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-dragonfly* | x86_64-*-freebsd* | x86_64-*-midnightbsd* | x86_64-*-mirbsd* | x86_64-*-netbsd* | x86_64-*-openbsd*) + cpu_type="x86-64_all" + ;; + *-*-dragonfly* | *-*-freebsd* | *-*-midnightbsd* | *-*-mirbsd* | *-*-netbsd* | *-*-openbsd*) + cpu_type="generic_fpu" + ;; + i386-*-solaris*) + cpu_type=x86 + newoldwritesample=enabled + ;; + x86_64-*-solaris*) + cpu_type=x86-64_all + ;; + *-*-solaris*) + cpu_type="generic_fpu" + ;; + # os2-emx = OS/2 with some Unix fun; so p.ex. buffer works. + # Till we sorted out the assembler troubles, generic CPU is default. + i386-pc-os2-emx) + cpu_type=generic_fpu + newoldwritesample=enabled + ;; + x86_64-pc-os2-emx) + # We are optimistic hat the future knows OS/2 on x86-64;-) + cpu_type=generic_fpu + ;; + *-pc-os2-emx) + cpu_type="generic_fpu" + ;; + *-dec-osf*) + cpu_type="generic_fpu" + ;; + x86_64-pc-cygwin*) + cpu_type="x86-64_all" + ;; + i686-pc-cygwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + i586-pc-cygwin*) + cpu_type="x86" + newoldwritesample=enabled + ;; + i486-pc-cygwin*) + cpu_type="i486" + newoldwritesample=enabled + ;; + i386-pc-cygwin*) + cpu_type="i386" + newoldwritesample=enabled + ;; + *-pc-cygwin*) + cpu_type="generic_fpu" + ;; + i@<:@3-7@:>@86-*-mingw32*) + LIBS="$LIBS" + buffer=disabled + cpu_type="x86" + newoldwritesample=enabled + ;; + x86_64-*-mingw32*) + LIBS="$LIBS" + buffer=disabled + cpu_type="x86-64" + ;; + i386-*) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="i386" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + newoldwritesample=enabled + ;; + i486-*) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="i486" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + newoldwritesample=enabled + ;; + i586-*) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="x86" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + newoldwritesample=enabled + ;; + i686-*) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="x86" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + newoldwritesample=enabled + ;; + x86_64-*) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="x86-64_all" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + ;; + *) + AC_MSG_WARN([Unknown host operating system]) + cpu_type="generic_fpu" + buffer=disabled + ADD_CPPFLAGS="-DGENERIC $ADD_CPPFLAGS" + ;; +esac + +AC_ARG_ENABLE(buffer, + [ --enable-buffer=[yes/no] disable audio buffer code (default uses system whitelist... proper checks later) ], + [ + if test "x$enableval" = xyes + then + echo "Note: Enabling buffer per request... perhaps it will not build anyway." + buffer="enabled" + else + echo "Note: Disabling buffer per request." + buffer="disabled" + fi + ] +) + +AC_ARG_ENABLE(newoldwritesample, +[ --enable-newoldwritesample=[no/yes] enable new/old WRITE_SAMPLE macro for non-accurate 16 bit output, faster on certain CPUs (default on on x86-32)], +[ + if test "x$enableval" = xyes + then + newoldwritesample=enabled + else + newoldwritesample=disabled + fi +]) + + + +dnl Did user choose other CPU type ? +if test "x$with_cpu" != "x"; then + cpu_type=$with_cpu +fi + +if test "x$cpu_type" = "xgeneric_nofpu"; then + real=disabled + int32=disabled +fi + +if test "x$cpu_type" = "xi386_nofpu"; then + real=disabled + int32=disabled +fi + +if test "x$cpu_type" = "xppc_nofpu"; then + real=disabled + int32=disabled +fi + +if test "x$cpu_type" = "xarm_nofpu"; then + real=disabled + int32=disabled +fi + +if test "x$int16" = "xdisabled"; then + AC_DEFINE(NO_16BIT, 1, [ Define to disable 16 bit integer output. ]) +else + DECODER_OBJ="$DECODER_OBJ synth.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ synth.lo" +fi + +# 8bit works only through 16bit +if test "x$int16" = "xdisabled"; then + int8=disabled +fi +if test "x$int8" = "xdisabled"; then + AC_DEFINE(NO_8BIT, 1, [ Define to disable 8 bit integer output. ]) +else + DECODER_OBJ="$DECODER_OBJ synth_8bit.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ synth_8bit.lo" +fi + +if test "x$int32" = "xdisabled"; then + AC_DEFINE(NO_32BIT, 1, [ Define to disable 32 bit and 24 bit integer output. ]) +else + s_fpu="$s_fpu synth_s32" +fi + +if test "x$real" = "xdisabled"; then + AC_DEFINE(NO_REAL, 1, [ Define to disable real output. ]) +else + s_fpu="$s_fpu synth_real" +fi + + + +layer1=enabled +AC_ARG_ENABLE(layer1, + [ --disable-layer1=[no/yes] no layer I decoding ], + [ + if test "x$enableval" = xno; then + layer1="disabled" + fi + ], []) + +if test "x$layer1" = "xdisabled"; then + AC_DEFINE(NO_LAYER1, 1, [ Define to disable layer I. ]) +else + # layer1 needs code in layer2 + DECODER_OBJ="$DECODER_OBJ layer1.\$(OBJEXT) layer2.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer1.lo layer2.lo" +fi + +layer2=enabled +AC_ARG_ENABLE(layer2, + [ --disable-layer2=[no/yes] no layer II decoding ], + [ + if test "x$enableval" = xno; then + layer2="disabled" + fi + ], []) + +if test "x$layer2" = "xdisabled"; then + AC_DEFINE(NO_LAYER2, 1, [ Define to disable layer II. ]) +else + # layer1 may have added the objects already + if test "x$layer1" = "xdisabled"; then + DECODER_OBJ="$DECODER_OBJ layer2.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer2.lo" + fi +fi + +layer3=enabled +AC_ARG_ENABLE(layer3, + [ --disable-layer3=[no/yes] no layer III decoding ], + [ + if test "x$enableval" = xno; then + layer3="disabled" + fi + ], []) + +if test "x$layer3" = "xdisabled"; then + AC_DEFINE(NO_LAYER3, 1, [ Define to disable layer III. ]) +else + DECODER_OBJ="$DECODER_OBJ layer3.\$(OBJEXT)" + DECODER_LOBJ="$DECODER_LOBJ layer3.lo" +fi + +AC_ARG_WITH([audio], [ + --with-audio=<list of modules> Select a list (or only one) of audio output modules (comma or space separated list). +]) +AC_ARG_WITH([default-audio], [ + --with-default-audio=aix Use AIX as default audio output sub-system + --with-default-audio=alib Use Alib as default audio output sub-system (for HPUX) + --with-default-audio=alsa Use ALSA as default audio output sub-system + --with-default-audio=arts Use aRts as default audio output sub-system (KDE sound server) + --with-default-audio=dummy Use dummy as default audio (when no sound card is available) + --with-default-audio=esd Use ESoundD as default audio output sub-system + --with-default-audio=hp Use HP as default audio output sub-system + --with-default-audio=jack Use JACK as default low-latency audio server + --with-default-audio=coreaudio Use Mac OS X as default audio output sub-system (CoreAudio) + --with-default-audio=mint Use MinT as default audio output sub-system (Atari) + --with-default-audio=nas Use NAS as default audio output (Network Audio System) + --with-default-audio=os2 Use OS2 as default audio output sub-system + --with-default-audio=oss Use OSS as default audio output sub-system (/dev/dsp) + --with-default-audio=portaudio Use PortAudio as default audio output sub-system + --with-default-audio=pulse Use Pulse audio server as default audio output sub-system + --with-default-audio=sdl Use SDL as default audio output sub-system (Simple DirectMedia Layer) + --with-default-audio=sgi Use SGI as default audio output sub-system (IRIX) + --with-default-audio=sndio Use OpenBSD's sndio as default audio output sub-system + --with-default-audio=sun Use Sun as default audio output sub-system (/dev/audio) + --with-default-audio=win32 Use Win32 audio as default audio output sub-system +]) + +AC_ARG_WITH([optimization], [ + --with-optimization=0 No Optimization + --with-optimization=1 Limited Optimization (-O) (for gcc) + --with-optimization=2 Default Optimization (-O2 ...) (for gcc) + --with-optimization=3 More Optimize than default (-O3 ...) (for gcc) + --with-optimization=4 Optimize yet more (-O4 ...) (for gcc) +]) + +AC_ARG_WITH([seektable], [ + --with-seektable=<size> choose size of seek index table (0 disables it), default 1000 +]) + + +dnl ############## Modules + +# Dummy audio output module is always supported +output_modules="dummy" + +# Decide on module file suffix. Setting it != .la allows removal of .la files. +AC_ARG_WITH([module-suffix], [ + --with-module-suffix=.la (default) Use libtool's .la files for loading modules. + --with-module-suffix=[.so|.dll|...] Specify the native module file suffix to bypass .la files. +]) +if test x"$with_module_suffix" = x; then + with_module_suffix=.la +fi +AC_DEFINE_UNQUOTED( MODULE_FILE_SUFFIX, "$with_module_suffix", [The suffix for module files.] ) + +dnl ############## Assembler, compiler properties + +# based on posting from John Dalgliesh <johnd@defyne.org> on ffmpeg (LGPL) mailing list +# find if .align arg is power-of-two or not +asmalign_exp="unknown" +if test x"$asmalign_exp" = xunknown; then + AC_MSG_CHECKING([if .align takes 2-exponent]) + asmalign_exp="no" + echo '.align 3' > conftest.s + if $CCAS -c -o conftest.o conftest.s 1>/dev/null 2>&1; then + asmalign_exp="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + rm -f conftest.o conftest.s +fi +if test x"$asmalign_exp" = xyes; then + AC_DEFINE(ASMALIGN_EXP, 1, [ Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. ]) +fi + +ccalign="unknown" +if test x"$ccalign" = xunknown; then + AC_MSG_CHECKING([__attribute__((aligned(16)))]) + ccalign="no" + echo '__attribute__((aligned(16))) float var;' > conftest.c + if $CC -c -o conftest.o conftest.c >/dev/null 2>&1; then + ccalign="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + rm -f conftest.o conftest.c +fi + +dnl We apply alignment hints only to cpus that need it. +dnl See further below for the definition of CCALIGN + +dnl ############## Really basic headers, needed for other checks. + +AC_HEADER_STDC +dnl Is it too paranoid to specifically check for stdint.h and limits.h? +AC_CHECK_HEADERS([stdio.h stdlib.h string.h unistd.h sched.h sys/ioctl.h sys/types.h stdint.h limits.h inttypes.h sys/time.h sys/wait.h sys/resource.h sys/signal.h signal.h]) + +dnl ############## Types + +dnl Large file support stuff needs cleanup. There are superfluous variables. + +dnl Detect large file support, enable switches if needed. +AC_SYS_LARGEFILE +dnl If we do have a switch for large files, rename off_t-aware API calls. +dnl Using the file_offset_bits variable here is fine for linux (possibly Solaris), +dnl Others... we'll have to see. +dnl Note: I started writing this with with multiline replacements. +dnl Does not work. Automake insists on putting these into Makefiles where they break things. +if test "x$ac_cv_sys_file_offset_bits" = x || echo "$ac_cv_sys_file_offset_bits" | $GREP '@<:@^0-9@:>@' > /dev/null; then + dnl if it has non-numeric chars or is empty... ignore... + LFS_LOBJ= +else + # Add dual-mode wrapper code. + LFS_LOBJ=lfs_wrap.lo +fi + +# Using the lower level macros instead of AC_TYPE_* for compatibility with not freshest autoconf. +AC_CHECK_TYPE(size_t, unsigned long) +AC_CHECK_TYPE(uintptr_t, unsigned long) +AC_CHECK_TYPE(ssize_t, long) +AC_CHECK_TYPE(off_t, long int) +AC_CHECK_TYPE(int32_t, int) +AC_CHECK_TYPE(uint32_t, unsigned int) +AC_CHECK_TYPE(int16_t, short) +AC_CHECK_TYPE(uint16_t, unsigned short) +AC_CHECK_SIZEOF(size_t,4) +AC_CHECK_SIZEOF(ssize_t,4) +AC_CHECK_SIZEOF(off_t,4) +AC_CHECK_SIZEOF(int32_t) +AC_CHECK_SIZEOF(long,4) + +# The alias functions want to know the native off_t bits. +# "Native" also means large file offsets, if enabled, it's what is native to the mpg123 library. +if test "x$ac_cv_sizeof_long" = "x"; then + AC_MSG_ERROR([Cannot determine sizeof(long)?]) +else + LFS_ALIAS_BITS=`expr "$ac_cv_sizeof_long" "*" "8"` + AC_DEFINE_UNQUOTED([LFS_ALIAS_BITS], $LFS_ALIAS_BITS, + [Define this to the size of long type in bits, used for LFS small/native alias functions.]) +fi + +lfs_alias=enabled +AC_ARG_ENABLE(lfs-alias, + [ --disable-lfs-alias disable alias wrappers for largefile bitness (mpg123_seek_32 in addition to mpg123_seek, mpg123_seek_64 as alias on x86-64) ], + [ + if test "x$enableval" = xno; then + lfs_alias="disabled" + fi + ], + [ + case $host in + *-cygwin*) + lfs_alias="disabled" + AC_MSG_NOTICE([lfs-alias disabled for Cygwin, use --enable-lfs-alias explicitly to enable, only if you know what you are doing]) + ;; + esac + + ]) + +AC_MSG_CHECKING([if we want to enable alias wrappers for largefile]) +if test "x$lfs_alias" = "xenabled"; then + AC_MSG_RESULT([yes]) + LFS_LOBJ="$LFS_LOBJ lfs_alias.lo" +else + AC_MSG_RESULT([no]) +fi + +AC_SUBST(LFS_LOBJ) + + +dnl ############## Function Checks + +AC_FUNC_MMAP + +# Check if system supports termios +AC_SYS_POSIX_TERMIOS +if test "x$ac_cv_sys_posix_termios" = "xyes"; then + AC_DEFINE_UNQUOTED([HAVE_TERMIOS], 1, + [Define this if you have the POSIX termios library]) +fi + +AC_CHECK_FUNCS( random ) + +# Check for sched_setscheduler +AC_CHECK_FUNCS( sched_setscheduler setuid getuid) + +# Check for setpriority +AC_CHECK_FUNCS( setpriority ) + +AC_CHECK_FUNCS( strerror ) + +AC_CHECK_FUNCS( setlocale nl_langinfo ) + +AC_CHECK_FUNCS( strdup ) + +AC_CHECK_FUNCS( atoll ) + +AC_CHECK_FUNCS( mkfifo, [ have_mkfifo=yes ], [ have_mkfifo=no ] ) + +dnl ############## Header and Library Checks + +# locale headers +AC_CHECK_HEADERS([locale.h langinfo.h]) +# Headers for network (http) stuff +network_type=Unknown +AC_CHECK_HEADERS([netdb.h sys/param.h sys/socket.h netinet/in.h arpa/inet.h]) +if test "x$ac_cv_header_netdb_h" = "xyes" && + test "x$ac_cv_header_sys_param_h" = "xyes" && + test "x$ac_cv_header_sys_socket_h" = "xyes" && + test "x$ac_cv_header_netinet_in_h" = "xyes" && + test "x$ac_cv_header_arpa_inet_h" = "xyes"; then + have_network=yes + network_type=Posix +else + have_network=no +fi + +dnl trying to get that socket lib settled in one line +AC_SEARCH_LIBS(gethostbyname, nsl socket) +dnl OK, two lines... Solaris needs -lnsl -lsocket +AC_SEARCH_LIBS(socket, socket) + +AC_CHECK_FUNCS( getaddrinfo, [ have_ipv6=yes ], [ have_ipv6=no ] ) + +APR_CHECK_GETADDRINFO_ADDRCONFIG() + +# Substitutions for the installable mpg123.h header +if test "x$ac_cv_header_stdio_h" = "xyes"; then + INCLUDE_STDIO_H="#include <stdio.h>" +else + INCLUDE_STDIO_H="/* #include <stdio.h> is not available on this system */" +fi +AC_SUBST(INCLUDE_STDIO_H) + +if test "x$ac_cv_header_stdlib_h" = "xyes"; then + INCLUDE_STDLIB_H="#include <stdlib.h>" +else + INCLUDE_STDLIB_H="/* #include <stdlib.h> is not available on this system */" +fi +AC_SUBST(INCLUDE_STDLIB_H) + +if test "x$ac_cv_header_sys_types_h" = "xyes"; then + INCLUDE_SYS_TYPE_H="#include <sys/types.h>" +else + INCLUDE_SYS_TYPE_H="/* #include <sys/types.h> is not available on this system */" +fi +AC_SUBST(INCLUDE_SYS_TYPE_H) + + +# Checks for maths libraries. +AC_CHECK_LIB([m], [sqrt]) +AC_CHECK_LIB([mx], [powf]) + +# attempt to make the signal stuff work... also with GENERIC - later +#if test x"$ac_cv_header_sys_signal_h" = xyes; then +# AC_CHECK_FUNCS( sigemptyset sigaddset sigprocmask sigaction ) +# if test x"$ac_cv_func_sigemptyset" = xyes && +# test x"$ac_cv_func_sigaddset" = xyes && +# test x"$ac_cv_func_sigprocmask" = xyes && +# test x"$ac_cv_func_sigaction" = xyes; then +# AC_DEFINE( +#fi + +dnl ############## Choose compiler flags and CPU + +# do not assume gcc here, so no flags by default +ADD_CFLAGS="" +ADD_CPPFLAGS="" +ADD_LDFLAGS="" +LIBS="$LIBS" + +AC_CHECK_HEADER([os2.h], [ADD_CPPFLAGS="$ADD_CPPFLAGS -DOS2"]) + +# If debugging is enabled then make warnings errors +if test x"$debugging" = xenabled; then + ADD_CFLAGS="-g" + # gcc specific... + if test x"$GCC" = xyes; then + ADD_CFLAGS="$ADD_CFLAGS -Wall -fno-strict-aliasing" + if test x"$nagging" = xenabled; then + ADD_CFLAGS="$ADD_CFLAGS -Werror -pedantic -DPLAIN_C89" + fi + fi +fi + +dnl Only try the attribute_align_arg mumbo-jumbo on x86, x86-64 warns/errors out on that attribute. +dnl ...dunno even what about other architectures. +case $host in + i?86-*) + AC_DEFINE(ABI_ALIGN_FUN, 1, [ Define if your architecture wants/needs/can use attribute_align_arg and alignment checks. It is for 32bit x86... ]) + ;; +esac + +s_altivec="synth_altivec dct64_altivec" +s_i386="dct64_i386" +s_i486="$s_i386 synth_i486 dct64_i486" +s_i586="$s_i386 synth_i586" +s_i586d="$s_i386 synth_i586_dither" +s_3dnow="$s_i386 synth_3dnow dct64_3dnow equalizer_3dnow" +s_3dnowext="$s_i386 dct64_3dnowext tabinit_mmx synth_3dnowext" +if test "x$layer3" = "xenabled"; then + s_3dnow="$s_3dnow dct36_3dnow" + s_3dnowext="$s_3dnowext dct36_3dnowext" +fi +s_mmx="$s_i386 dct64_mmx tabinit_mmx synth_mmx" +s_sse="$s_i386 tabinit_mmx dct64_sse dct64_sse_float synth_sse_float synth_stereo_sse_float synth_sse_s32 synth_stereo_sse_s32 " +s_x86_64="dct64_x86_64 dct64_x86_64_float synth_x86_64_float synth_x86_64_s32 synth_stereo_x86_64_float synth_stereo_x86_64_s32" +s_x86multi="getcpuflags" +s_dither="dither" +s_neon="dct64_neon dct64_neon_float synth_neon_float synth_neon_s32 synth_stereo_neon_float synth_stereo_neon_s32" + +# choose optimized 16bit decoder for SSE, quality or fast +# note: supporting deactivation of output formats for these decoders would need more logic here +if test "x$integers" = "xquality"; then + s_sse="$s_sse synth_sse_accurate synth_stereo_sse_accurate" + s_x86_64="$s_x86_64 synth_x86_64_accurate synth_stereo_x86_64_accurate" + s_arm="synth_arm_accurate" + s_neon="$s_neon synth_neon_accurate synth_stereo_neon_accurate" +else + s_sse="$s_sse synth_sse" # no stereo + s_x86_64="$s_x86_64 synth_x86_64 synth_stereo_x86_64" + s_arm="synth_arm" + s_neon="$s_neon synth_neon synth_stereo_neon" +fi + +dnl CPU specific compiler flags and sources +case $cpu_type in + generic) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT" + more_sources="$s_fpu" + ccalign=no + ;; + generic_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_dither" + ccalign=no + ;; +dnl Not disabling buffer for float mode... check that this is OK now! + generic_fpu | generic_float) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FLOAT" + more_sources="$s_fpu" + ccalign=no + ;; + generic_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_GENERIC -DREAL_IS_FIXED" + more_sources= + ccalign=no + ;; + ppc_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_PPC -DREAL_IS_FIXED" + more_sources= + ccalign=no + ;; + arm_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_ARM -DREAL_IS_FIXED" + more_sources="$s_arm" + ccalign=no + ;; + altivec) + ADD_CFLAGS="$ADD_CFLAGS -maltivec" + ADD_CPPFLAGS="$ADD_CPPFLAGS -DREAL_IS_FLOAT -DOPT_ALTIVEC" + more_sources="$s_altivec $s_fpu" + AC_MSG_CHECKING([if $CC accepts -faltivec]) + touch conftest.c + if $CC -faltivec -c -o conftest.o conftest.c >/dev/null 2>&1; then + ADD_CFLAGS="$ADD_CFLAGS -faltivec" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + rm -f conftest.o conftest.c + ;; + neon) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_NEON -DREAL_IS_FLOAT" + more_sources="$s_neon $s_fpu" + ;; + i386) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386" + ccalign=no + ;; + i386_fpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386" + ccalign=no + ;; + i386_nofpu) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I386 -DREAL_IS_FIXED" + more_sources="$s_i386" + ccalign=no + ;; + i486) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I486 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i486" + ccalign=no + ;; + i586) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586" + ;; + i586_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_I586_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586d $s_dither" + ;; + 3dnow) + # legacy 3dnow had the 3dnow paired with i586... + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_I586 -DOPT_3DNOW -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i586 $s_3dnow $s_x86multi " + ;; + 3dnow_alone) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOW -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnow" + ;; + 3dnowext_alone) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_3DNOWEXT -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnowext" + ;; + 3dnowext) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_3DNOW -DOPT_3DNOWEXT -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_3dnowext $s_3dnow $s_x86multi" + ;; + mmx_alone|mmx) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MMX -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_mmx" + ;; + sse_alone|sse) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_SSE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_sse" + ;; + x86|x86_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_I386 -DOPT_I586 -DOPT_I586_DITHER -DOPT_MMX -DOPT_3DNOW -DOPT_3DNOWEXT -DOPT_SSE -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_i386 $s_i586 $s_i586d $s_mmx $s_3dnow $s_3dnowext $s_sse $s_x86multi $s_dither" + ;; + x86-64) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_X86_64 -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_x86_64" + ;; + x86-64_all|x86-64_dither) + ADD_CPPFLAGS="$ADD_CPPFLAGS -DOPT_MULTI -DOPT_X86_64 -DOPT_GENERIC -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT" + more_sources="$s_fpu $s_x86_64 $s_dither" + ;; + *) + AC_MSG_ERROR([Unknown CPU type '$cpu_type']) + ;; +esac + +# Mac OS X specific linker flags +case $cpu_type in + 3dnow|3dnow_alone|3dnowext|3dnowext_alone|mmx|mmx_alone|sse|sse_alone|x86|x86_dither) + case $host in + i386-apple-darwin8*|*-apple-darwin10*) + ADD_LDFLAGS="$ADD_LDFLAGS -Wl,-read_only_relocs,suppress" + ;; + i386-apple-darwin9*) + ADD_CFLAGS="$ADD_CFLAGS -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" + ADD_LDFLAGS="$ADD_LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -Wl,-classic_linker -Wl,-read_only_relocs,suppress" + ;; + esac + ;; +esac + +# Check if we want feature report function. +AC_MSG_CHECKING([if we want feature report function]) +feature_report=enabled +AC_ARG_ENABLE(feature_report, + [ --disable-feature_report Disable feature report function ], + [ + if test "x$enableval" = xno; then + AC_MSG_RESULT([no]) + feature_report=disabled + else + AC_MSG_RESULT([yes]) + fi + ], + [AC_MSG_RESULT([yes])]) + +if test "x$feature_report" = xenabled; then + more_sources="$more_sources feature" +fi + +for i in $more_sources +do + # Echo make sure every file is only once in the list. + echo "$DECODER_OBJ" | $GREP -v -w "$i\.\$(OBJEXT)" > /dev/null && DECODER_OBJ="$DECODER_OBJ $i.\$(OBJEXT)" + echo "$DECODER_LOBJ" | $GREP -v -w "$i\.lo" > /dev/null && DECODER_LOBJ="$DECODER_LOBJ $i.lo" +done + +AC_SUBST(DECODER_OBJ) +AC_SUBST(DECODER_LOBJ) + +dnl Finally insert the code switch for alignment, above cpu selection having possibly changed the setting. +if test x"$ccalign" = xyes; then + AC_DEFINE(CCALIGN, 1, [ Define if __attribute__((aligned(16))) shall be used ]) +fi + + +dnl ############## Output module choice + +# The full list of supported modules to check, first come, first serve. +check_modules="alsa oss coreaudio sndio sun win32 os2 esd jack portaudio pulse sdl nas arts openal dummy" +# The final list. +output_modules= + +check_forced=no +check_failed=no +if test "x$with_audio" != "x"; then + check_modules="`echo $with_audio|tr , ' '` dummy" + echo "Limiting outputs to build according to your preference: $check_modules" + check_forced=yes +fi + +PKG_PROG_PKG_CONFIG([]) + +# Now go through the modules to check and do the chores. +for m in $check_modules +do + case "$m" in + dummy) + AC_MSG_CHECKING([if you are too dumbing dumb for the dummy]) + AC_MSG_RESULT([no]) + output_modules="$output_modules dummy" + HAVE_DUMMY=yes + ;; + oss) + AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h]) + if test "x${ac_cv_header_sys_soundcard_h}" = "xyes" \ + -o "x${ac_cv_header_linux_soundcard_h}" = "xyes" \ + -o "x${ac_cv_header_machine_soundcard_h}" = "xyes"; + then + output_modules="$output_modules oss" + HAVE_OSS="yes" + else + check_failed=yes + fi + ;; + alsa) + ALSA_LIBS="-lasound" + # Check for ALSA + AC_CHECK_LIB( [asound], [snd_pcm_open], + [ AC_CHECK_HEADER( [alsa/asoundlib.h], + [ output_modules="$output_modules alsa" HAVE_ALSA="yes"], + [ AC_MSG_WARN([Found ALSA library but NOT header files on your system]) ] ) + ] + ) + if test "x$HAVE_ALSA" != xyes; then + check_failed=yes + fi + ;; + jack) + PKG_CHECK_MODULES(JACK, jack, output_modules="$output_modules jack" HAVE_JACK="yes", HAVE_JACK="no" check_failed=yes) + ;; + pulse) + PKG_CHECK_MODULES(PULSE, libpulse-simple, output_modules="$output_modules pulse" HAVE_PULSE="yes", HAVE_PULSE="no" check_failed=yes) + ;; + esd) + PKG_CHECK_MODULES(ESD, esound, output_modules="$output_modules esd" HAVE_ESD="yes", HAVE_ESD="no" check_failed=yes) + ;; + portaudio) + # Remember: This looks only insane because you chose an insane tab width! + PORTAUDIO_LIBS="-lportaudio" + PORTAUDIO_CFLAGS= + case $host in + *-*-mingw32) + # We tested portaudio with MME + if test "x$HAVE_PORTAUDIO" != "xyes"; then + AC_CHECK_LIB( [portaudio], [Pa_Initialize], + [ AC_CHECK_HEADER( [portaudio.h], + [ output_modules="$output_modules portaudio" HAVE_PORTAUDIO_WINMM="yes" HAVE_PORTAUDIO="yes" ], + [ AC_MSG_WARN([Found PortAudio library but NOT header files on your system]) ] ) + PORTAUDIO_LIBS="$PORTAUDIO_LIBS -lwinmm" + ], + [ HAVE_PORTAUDIO="no"], + [ -lwinmm ] + ) + fi + ;; + *) + AC_CHECK_LIB( [portaudio], [Pa_Initialize], + [ AC_CHECK_HEADER( [portaudio.h], + [ output_modules="$output_modules portaudio" HAVE_PORTAUDIO="yes" ], + [ AC_MSG_WARN([Found PortAudio library but NOT header files on your system]) ] ) + ] + ) + ;; + esac + if test "x$HAVE_PORTAUDIO" != xyes; then + check_failed=yes + else + # See if we have v19 or v18 + AC_CHECK_LIB( [portaudio], [Pa_GetVersion], [:], [AC_DEFINE( [PORTAUDIO18], 1, [Define if portaudio v18 API is wanted.]) ], [$PORTAUDIO_LIBS] ) + fi + ;; + sdl) + PKG_CHECK_MODULES(SDL, sdl, output_modules="$output_modules sdl" HAVE_SDL="yes", HAVE_SDL="no" check_failed=yes) + ;; + nas) + NAS_LIBS=-laudio + AC_CHECK_LIB( [audio], [AuOpenServer], + [ AC_CHECK_HEADER( [audio/audiolib.h], + [ output_modules="$output_modules nas" HAVE_NAS="yes"], + [ AC_MSG_WARN([Found NAS library but NOT header files on your system]) ] ) + ] + ) + if test "x$HAVE_NAS" != xyes; then + check_failed=yes + fi + ;; + win32) + # Check for windows ... and win32 audio + # Does not work... instead just check for header + # AC_CHECK_LIB( [winmm], [waveOutOpen] ) + WIN32_LIBS=-lwinmm + AC_CHECK_HEADERS([windows.h], output_modules="$output_modules win32" HAVE_WIN32=yes, HAVE_WIN32=no check_failed=yes) + ;; + sndio) + SNDIO_LIBS=-lsndio + AC_CHECK_LIB([sndio], [sio_open], + [AC_CHECK_HEADERS([sndio.h], + [output_modules="$output_modules sndio" HAVE_SNDIO="yes"]) + ] + ) + if test "x$HAVE_SNDIO" != xyes; then + check_failed=yes + fi + ;; + sun) + AC_CHECK_HEADERS([sun/audioio.h sys/audioio.h asm/audioio.h sys/audio.h]) + if test "x${ac_cv_header_sun_audioio_h}" = "xyes" \ + -o "x${ac_cv_header_sys_audioio_h}" = "xyes" \ + -o "x${ac_cv_header_asm_audioio_h}" = "xyes"; + then + output_modules="$output_modules sun" + HAVE_SUN="yes" + else + check_failed=yes + fi + ;; + coreaudio) + COREAUDIO_LIBS="-framework AudioToolbox -framework AudioUnit -framework CoreServices" + AC_CHECK_HEADERS([AudioUnit/AudioUnit.h CoreServices/CoreServices.h AudioToolbox/AudioToolbox.h]) + if test "x${ac_cv_header_AudioUnit_AudioUnit_h}" = "xyes" \ + -a "x${ac_cv_header_CoreServices_CoreServices_h}" = "xyes" \ + -a "x${ac_cv_header_AudioToolbox_AudioToolbox_h}" = "xyes"; + then + if test x"$modules" = xdisabled; then + AC_MSG_WARN([Disabling buffer because of directly linked CoreAudio! Use the module if you need the buffer.]) + buffer=disabled + fi + output_modules="$output_modules coreaudio" + HAVE_COREAUDIO="yes" + else + check_failed=yes + fi + ;; + arts) + AC_MSG_CHECKING([for artsc]) + if artsc-config; then + AC_MSG_RESULT([yes]) + output_modules="$output_modules arts" + HAVE_ARTS=yes + ARTS_LIBS=`artsc-config --libs` + ARTS_CFLAGS=`artsc-config --cflags` + else + AC_MSG_RESULT([no]) + check_failed=yes + fi + ;; + openal) + AC_CHECK_HEADERS([OpenAL/al.h OpenAL/alc.h AL/al.h AL/alc.h al.h alc.h]) + if test "x${ac_cv_header_OpenAL_al_h}" = "xyes" \ + -a "x${ac_cv_header_OpenAL_alc_h}" = "xyes"; + then #Mac OS X + output_modules="$output_modules openal" + OPENAL_LIBS="-framework OpenAL" + OPENAL_CFLAGS="-DOPENAL_SUBDIR_OPENAL" + HAVE_OPENAL="yes" + elif test "x${ac_cv_header_AL_al_h}" = "xyes" \ + -a "x${ac_cv_header_AL_alc_h}" = "xyes"; + then #Linux + output_modules="$output_modules openal" + OPENAL_LIBS="-lopenal" + OPENAL_CFLAGS="-DOPENAL_SUBDIR_AL" + HAVE_OPENAL="yes" + elif test "x${ac_cv_header_al_h}" = "xyes" \ + -a "x${ac_cv_header_alc_h}" = "xyes"; + then #Windows? + output_modules="$output_modules openal" + OPENAL_LIBS="-lopenal" + OPENAL_CFLAGS="" + HAVE_OPENAL="yes" + else + check_failed=yes + fi + ;; + os2) + OS2_LIBS="-los2me -lmmpm2 -lsocket" + AC_CHECK_HEADERS([os2.h]) + # os2me.h depends on os2.h + # Yes, that way of coding it is ugly. + if test "x${ac_cv_header_os2_h}" = xyes + then + # We mimick exactly the way how the header will be used. + # It seems to be picky... + AC_CHECK_HEADERS([os2me.h], [], [], [#define INCL_OS2MM +#define INCL_DOS +#define INCL_VIO +#define INCL_KBD +#include <os2.h> +#]) + fi + if test "x${ac_cv_header_os2_h}" = xyes \ + -a "x${ac_cv_header_os2me_h}" = xyes + then + output_modules="$output_modules os2" + HAVE_OS2=yes + else + check_failed=yes + fi + ;; +# from here on only forced tests, untested code + hp) + # What's the deal with that and alib? + UNSUPPORTED_AUDIO=yes + AC_CHECK_HEADER([sys/audio.h], [output_modules="$output_modules hp" HAVE_HP=yes], [check_failed=yes]) + ;; + alib) + UNSUPPORTED_AUDIO=yes + # ALIB_CFLAGS="-I/opt/audio/include" + ALIB_LIBS=-lAlib + # These headers may not be all about audio but they are used. + AC_CHECK_HEADERS([ Alib.h CUlib.h netdb.h netinet/in.h netinet/tcp.h]) + if test "x${ac_cv_header_Alib_h}" = xyes \ + -a "x${ac_cv_header_CUlib_h}" = xyes \ + -a "x${ac_cv_header_netdb_h}" = xyes \ + -a "x${ac_cv_header_netinet_in_h}" = xyes \ + -a "x${ac_cv_header_netinet_tcp_h}" = xyes + then + output_modules="$output_modules alib" + HAVE_ALIB=yes + else + check_failed=yes + fi + ;; + mint) + UNSUPPORTED_AUDIO=yes + AC_CHECK_HEADERS([audios.h], [output_modules="$output_modules mint" HAVE_MINT=yes], [check_failes=yes]) + ;; + aix) + UNSUPPORTED_AUDIO=yes + AC_CHECK_HEADERS([sys/audio.h], [output_modules="$output_modules aix" HAVE_AIX=yes], [check_failed=yes]) + ;; + sgi) + UNSUPPORTED_AUDIO=yes + SGI_LIBS=-laudio + AC_CHECK_HEADER([dmedia/audio.h], [output_modules="$output_modules sgi" HAVE_SGI=yes], [check_failed=yes]) + ;; + *) + AC_MSG_ERROR([Unsupported/-known output '$m' demanded!]) + ;; + esac +done + +if test "x$check_forced" = xyes -a "x$UNSUPPORTED_AUDIO" = xyes; then + AC_MSG_WARN([You requested bulding of an unsupported audio module. Be prepared for happy hacking and please tell us about your experience!]) +fi + +if test "x$check_forced" = xyes -a "x$check_failed" = "xyes"; then + AC_MSG_ERROR([One/some of your requested audio modules failed the test!]) +fi + +# When you extend check_modules, you should extend this: +#for i in alsa oss coreaudio sndio sun win32 esd jack portaudio pulse sdl nas aix alib arts hp os2 sgi mint openal dummy; do echo $i; done | +#perl -ne 'chomp; $big = uc($_); print <<EOT; +#AC_SUBST(${big}_LIBS) +#AC_SUBST(${big}_LDFLAGS) +#AC_SUBST(${big}_CFLAGS) +#AM_CONDITIONAL( [HAVE_$big], [test "x\$HAVE_$big" = xyes] ) +#EOT +#' +AC_SUBST(ALSA_LIBS) +AC_SUBST(ALSA_LDFLAGS) +AC_SUBST(ALSA_CFLAGS) +AM_CONDITIONAL( [HAVE_ALSA], [test "x$HAVE_ALSA" = xyes] ) +AC_SUBST(OSS_LIBS) +AC_SUBST(OSS_LDFLAGS) +AC_SUBST(OSS_CFLAGS) +AM_CONDITIONAL( [HAVE_OSS], [test "x$HAVE_OSS" = xyes] ) +AC_SUBST(COREAUDIO_LIBS) +AC_SUBST(COREAUDIO_LDFLAGS) +AC_SUBST(COREAUDIO_CFLAGS) +AM_CONDITIONAL( [HAVE_COREAUDIO], [test "x$HAVE_COREAUDIO" = xyes] ) +AC_SUBST(SNDIO_LIBS) +AC_SUBST(SNDIO_LDFLAGS) +AC_SUBST(SNDIO_CFLAGS) +AM_CONDITIONAL( [HAVE_SNDIO], [test "x$HAVE_SNDIO" = xyes] ) +AC_SUBST(SUN_LIBS) +AC_SUBST(SUN_LDFLAGS) +AC_SUBST(SUN_CFLAGS) +AM_CONDITIONAL( [HAVE_SUN], [test "x$HAVE_SUN" = xyes] ) +AC_SUBST(WIN32_LIBS) +AC_SUBST(WIN32_LDFLAGS) +AC_SUBST(WIN32_CFLAGS) +AM_CONDITIONAL( [HAVE_WIN32], [test "x$HAVE_WIN32" = xyes] ) +AC_SUBST(ESD_LIBS) +AC_SUBST(ESD_LDFLAGS) +AC_SUBST(ESD_CFLAGS) +AM_CONDITIONAL( [HAVE_ESD], [test "x$HAVE_ESD" = xyes] ) +AC_SUBST(JACK_LIBS) +AC_SUBST(JACK_LDFLAGS) +AC_SUBST(JACK_CFLAGS) +AM_CONDITIONAL( [HAVE_JACK], [test "x$HAVE_JACK" = xyes] ) +AC_SUBST(PORTAUDIO_LIBS) +AC_SUBST(PORTAUDIO_LDFLAGS) +AC_SUBST(PORTAUDIO_CFLAGS) +AM_CONDITIONAL( [HAVE_PORTAUDIO], [test "x$HAVE_PORTAUDIO" = xyes] ) +AC_SUBST(PULSE_LIBS) +AC_SUBST(PULSE_LDFLAGS) +AC_SUBST(PULSE_CFLAGS) +AM_CONDITIONAL( [HAVE_PULSE], [test "x$HAVE_PULSE" = xyes] ) +AC_SUBST(SDL_LIBS) +AC_SUBST(SDL_LDFLAGS) +AC_SUBST(SDL_CFLAGS) +AM_CONDITIONAL( [HAVE_SDL], [test "x$HAVE_SDL" = xyes] ) +AC_SUBST(NAS_LIBS) +AC_SUBST(NAS_LDFLAGS) +AC_SUBST(NAS_CFLAGS) +AM_CONDITIONAL( [HAVE_NAS], [test "x$HAVE_NAS" = xyes] ) +AC_SUBST(AIX_LIBS) +AC_SUBST(AIX_LDFLAGS) +AC_SUBST(AIX_CFLAGS) +AM_CONDITIONAL( [HAVE_AIX], [test "x$HAVE_AIX" = xyes] ) +AC_SUBST(ALIB_LIBS) +AC_SUBST(ALIB_LDFLAGS) +AC_SUBST(ALIB_CFLAGS) +AM_CONDITIONAL( [HAVE_ALIB], [test "x$HAVE_ALIB" = xyes] ) +AC_SUBST(ARTS_LIBS) +AC_SUBST(ARTS_LDFLAGS) +AC_SUBST(ARTS_CFLAGS) +AM_CONDITIONAL( [HAVE_ARTS], [test "x$HAVE_ARTS" = xyes] ) +AC_SUBST(HP_LIBS) +AC_SUBST(HP_LDFLAGS) +AC_SUBST(HP_CFLAGS) +AM_CONDITIONAL( [HAVE_HP], [test "x$HAVE_HP" = xyes] ) +AC_SUBST(OS2_LIBS) +AC_SUBST(OS2_LDFLAGS) +AC_SUBST(OS2_CFLAGS) +AM_CONDITIONAL( [HAVE_OS2], [test "x$HAVE_OS2" = xyes] ) +AC_SUBST(SGI_LIBS) +AC_SUBST(SGI_LDFLAGS) +AC_SUBST(SGI_CFLAGS) +AM_CONDITIONAL( [HAVE_SGI], [test "x$HAVE_SGI" = xyes] ) +AC_SUBST(MINT_LIBS) +AC_SUBST(MINT_LDFLAGS) +AC_SUBST(MINT_CFLAGS) +AM_CONDITIONAL( [HAVE_MINT], [test "x$HAVE_MINT" = xyes] ) +AC_SUBST(OPENAL_LIBS) +AC_SUBST(OPENAL_LDFLAGS) +AC_SUBST(OPENAL_CFLAGS) +AM_CONDITIONAL( [HAVE_OPENAL], [test "x$HAVE_OPENAL" = xyes] ) +AC_SUBST(DUMMY_LIBS) +AC_SUBST(DUMMY_LDFLAGS) +AC_SUBST(DUMMY_CFLAGS) +AM_CONDITIONAL( [HAVE_DUMMY], [test "x$HAVE_DUMMY" = xyes] ) + +# Did user choose default audio subsystem ? +if test "x$with_default_audio" != "x"; then + default_output_module=$with_default_audio +else + default_output_module=`echo "$output_modules" | $AWK '{ print $1 }'` +fi + +# That's (beginning of) the list for mpg123's internal default. +default_output_modules=$default_output_module + +OUTPUT_OBJ= +OUTPUT_MOD= +OUTPUT_CFLAGS= +OUTPUT_LIBS= +OUTPUT_LDFLAGS= + +# Setup the static build. +if test "x$modules" = xdisabled +then + echo "Preparing static output $default_output_module" + OUTPUT_MOD="$default_output_module" + OUTPUT_OBJ="output/$default_output_module.\$(OBJEXT)" + OUTPUT_CFLAGS= + OUTPUT_LIBS= + # That feels stupid... what about hashed arrays? + case $OUTPUT_MOD in + # Here's a script for that tedious list, perhaps to be outsourced together with the one in src/output/Makefile.am +#for i in alsa coreaudio esd jack nas oss portaudio pulse sdl sndio sun win32 aix alib arts hp os2 sgi mint; do echo $i; done | +#perl -ne 'chomp; $big = uc($_); print <<EOT; +# $_) +# OUTPUT_LIBS="\$${big}_LIBS" +# OUTPUT_LDFLAGS="\$${big}_LDFLAGS" +# OUTPUT_CFLAGS="\$${big}_CFLAGS" +# ;; +#EOT +#' + alsa) + OUTPUT_LIBS="$ALSA_LIBS" + OUTPUT_LDFLAGS="$ALSA_LDFLAGS" + OUTPUT_CFLAGS="$ALSA_CFLAGS" + ;; + coreaudio) + OUTPUT_LIBS="$COREAUDIO_LIBS" + OUTPUT_LDFLAGS="$COREAUDIO_LDFLAGS" + OUTPUT_CFLAGS="$COREAUDIO_CFLAGS" + ;; + esd) + OUTPUT_LIBS="$ESD_LIBS" + OUTPUT_LDFLAGS="$ESD_LDFLAGS" + OUTPUT_CFLAGS="$ESD_CFLAGS" + ;; + jack) + OUTPUT_LIBS="$JACK_LIBS" + OUTPUT_LDFLAGS="$JACK_LDFLAGS" + OUTPUT_CFLAGS="$JACK_CFLAGS" + ;; + nas) + OUTPUT_LIBS="$NAS_LIBS" + OUTPUT_LDFLAGS="$NAS_LDFLAGS" + OUTPUT_CFLAGS="$NAS_CFLAGS" + ;; + oss) + OUTPUT_LIBS="$OSS_LIBS" + OUTPUT_LDFLAGS="$OSS_LDFLAGS" + OUTPUT_CFLAGS="$OSS_CFLAGS" + ;; + portaudio) + OUTPUT_LIBS="$PORTAUDIO_LIBS" + OUTPUT_LDFLAGS="$PORTAUDIO_LDFLAGS" + OUTPUT_CFLAGS="$PORTAUDIO_CFLAGS" + ;; + pulse) + OUTPUT_LIBS="$PULSE_LIBS" + OUTPUT_LDFLAGS="$PULSE_LDFLAGS" + OUTPUT_CFLAGS="$PULSE_CFLAGS" + ;; + sdl) + OUTPUT_LIBS="$SDL_LIBS" + OUTPUT_LDFLAGS="$SDL_LDFLAGS" + OUTPUT_CFLAGS="$SDL_CFLAGS" + ;; + sndio) + OUTPUT_LIBS="$SNDIO_LIBS" + OUTPUT_LDFLAGS="$SNDIO_LDFLAGS" + OUTPUT_CFLAGS="$SNDIO_CFLAGS" + ;; + sun) + OUTPUT_LIBS="$SUN_LIBS" + OUTPUT_LDFLAGS="$SUN_LDFLAGS" + OUTPUT_CFLAGS="$SUN_CFLAGS" + ;; + win32) + OUTPUT_LIBS="$WIN32_LIBS" + OUTPUT_LDFLAGS="$WIN32_LDFLAGS" + OUTPUT_CFLAGS="$WIN32_CFLAGS" + ;; + aix) + OUTPUT_LIBS="$AIX_LIBS" + OUTPUT_LDFLAGS="$AIX_LDFLAGS" + OUTPUT_CFLAGS="$AIX_CFLAGS" + ;; + alib) + OUTPUT_LIBS="$ALIB_LIBS" + OUTPUT_LDFLAGS="$ALIB_LDFLAGS" + OUTPUT_CFLAGS="$ALIB_CFLAGS" + ;; + arts) + OUTPUT_LIBS="$ARTS_LIBS" + OUTPUT_LDFLAGS="$ARTS_LDFLAGS" + OUTPUT_CFLAGS="$ARTS_CFLAGS" + ;; + hp) + OUTPUT_LIBS="$HP_LIBS" + OUTPUT_LDFLAGS="$HP_LDFLAGS" + OUTPUT_CFLAGS="$HP_CFLAGS" + ;; + os2) + OUTPUT_LIBS="$OS2_LIBS" + OUTPUT_LDFLAGS="$OS2_LDFLAGS" + OUTPUT_CFLAGS="$OS2_CFLAGS" + ;; + sgi) + OUTPUT_LIBS="$SGI_LIBS" + OUTPUT_LDFLAGS="$SGI_LDFLAGS" + OUTPUT_CFLAGS="$SGI_CFLAGS" + ;; + mint) + OUTPUT_LIBS="$MINT_LIBS" + OUTPUT_LDFLAGS="$MINT_LDFLAGS" + OUTPUT_CFLAGS="$MINT_CFLAGS" + ;; + openal) + OUTPUT_LIBS="$OPENAL_LIBS" + OUTPUT_LDFLAGS="$OPENAL_LDFLAGS" + OUTPUT_CFLAGS="$OPENAL_CFLAGS" + ;; + esac +else + # Now make a comma-separated list again... eliminating the possible duplicate and dummy. + for i in $output_modules + do + if test $i != $default_output_module && test $i != dummy; then + default_output_modules=$default_output_modules,$i + fi + done +fi + +AC_DEFINE_UNQUOTED( DEFAULT_OUTPUT_MODULE, "$default_output_modules", [The default audio output module(s) to use] ) + + +AC_SUBST(OUTPUT_OBJ) +AC_SUBST(OUTPUT_MOD) +AC_SUBST(OUTPUT_CFLAGS) +AC_SUBST(OUTPUT_LIBS) +AC_SUBST(OUTPUT_LDFLAGS) + +dnl ############## Compiler Optimizations + +CFLAGS="$ADD_CFLAGS $CFLAGS" +if test x"$buffer" = xdisabled; then + ADD_CPPFLAGS="$ADD_CPPFLAGS -DNOXFERMEM" +fi +if test x"$newoldwritesample" = xenabled; then + ADD_CPPFLAGS="$ADD_CPPFLAGS -DNEWOLD_WRITE_SAMPLE" +fi +CPPFLAGS="$ADD_CPPFLAGS $CPPFLAGS" +LDFLAGS="$ADD_LDFLAGS $LDFLAGS" + +# None chosen? +if test "x$with_optimization" = "x"; then + if test x"$debugging" = xenabled; then + with_optimization="0" + else + # enable (gcc specific) default opts only with gcc + if test "x$GCC" = xyes; then + with_optimization="2" + else + with_optimization="0" + fi + fi +fi + +case $with_optimization in + 0) + # No Optimizations + CFLAGS="$CFLAGS" + ;; + 1) + CFLAGS="-O $CFLAGS" + ;; + 2) + CFLAGS="-O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS" + ;; + 3) + CFLAGS="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS" + ;; + 4) + CFLAGS="-O4 -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $CFLAGS" + ;; + *) + AC_MSG_ERROR([Unknown optimizations level '$with_optimization']) + ;; +esac + +dnl If using gcc, prevent a bad alignment option from breaking things. +dnl Let's default to safe 16-byte alignment for any special x86 or altivec stuff. +if test "x$GCC" = xyes && echo "$CFLAGS" | $GREP 'mpreferred-stack-boundary=' > /dev/null; then + case $cpu_type in + x86 | i586* | mmx | sse | 3dnow* | altivec) + AC_MSG_WARN( [ You are trying to mess with stack alignment. I know better. ] ) + CFLAGS="$CFLAGS -mpreferred-stack-boundary=4" + ;; + esac +fi + +dnl ############## Seektable size + +if test "x$with_seektable" = "x"; then + seektable=1000 +else + seektable=$with_seektable +fi + +if test "$seektable" -gt 0; then + AC_DEFINE(FRAME_INDEX, 1, [ Define if frame index should be used. ]) +fi +# Define that always... also without frame index enabled. +AC_DEFINE_UNQUOTED(INDEX_SIZE, $seektable, [size of the frame index seek table]) + +dnl ############## Win32 function checks +# Check if we want Unicode for Win32. Cygwin does not need _wopen +win32_specific_codes=disabled +win32_unicode=unneeded +win32_sockets=disabled +win32_sockets_working=no +win32_wide_working=no +win32_winver_bump=no +AC_CHECK_HEADERS([windows.h], [win32_specific_codes=enabled]) +if test "x$win32_specific_codes" = xenabled && test "x$host_os" != "xcygwin"; then + +#### Check for Wide functions + AC_CHECK_FUNC([_wopen], [win32_unicode=enabled],[win32_unicode=disabled]) + AC_MSG_CHECKING([if we want Unicode File Open for Win32]) + if test "x$win32_unicode" = xenabled; then + AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([if Unicode functions working]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #include <windows.h> + #include <stdlib.h> + int main() + { + MultiByteToWideChar (0, 0, NULL, 0, NULL, 0); + WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL); + return 0; + } + ])], [win32_wide_working=yes], [win32_winver_bump=yes]) + if test "x$win32_wide_working" = xno; then + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #define WINVER 0x501 + #define _WIN32_WINNT 0x501 + #include <windows.h> + #include <stdlib.h> + int main() + { + MultiByteToWideChar (0, 0, NULL, 0, NULL, 0); + WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL); + return 0; + } + ])], [win32_wide_working=yes], [AC_MSG_RESULT([no])]) + fi + if test "x$win32_wide_working" = xyes; then + AC_MSG_RESULT([yes]) + AC_DEFINE([WANT_WIN32_UNICODE], [1], [ Define to use Unicode for Windows ]) + fi + else + AC_MSG_WARN([Unicode File Open for Win32 disabled]) + fi + +#### Check for Network functions + AC_CHECK_HEADERS([ws2tcpip.h], [win32_sockets=enabled], [AC_MSG_WARN([Please update your headers to support winsock 2.2.])]) + AC_MSG_CHECKING([if we want Win32 sockets]) + if test "x$win32_sockets" = "xenabled" && test "x$network" != "xdisabled"; then + AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([if winsock2 API is available]) + wsoldlibs="$LIBS" + LIBS="$LIBS -lws2_32" + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #include <winsock2.h> + #include <ws2tcpip.h> + #include <stdlib.h> + int main() + { + getaddrinfo(NULL, NULL, NULL, NULL); + freeaddrinfo(NULL); + return 0; + } + ])], [win32_sockets_working=yes], [win32_winver_bump=yes]) + if test "x$win32_sockets_working" = "xno"; then + AC_MSG_CHECKING([deeper if winsock2 API is available]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #define WINVER 0x501 + #define _WIN32_WINNT 0x501 + #include <winsock2.h> + #include <ws2tcpip.h> + #include <stdlib.h> + int main() + { + getaddrinfo(NULL, NULL, NULL, NULL); + freeaddrinfo(NULL); + return 0; + } + ])], [win32_sockets_working=yes], [AC_MSG_RESULT([no])]) + fi + if test "x$win32_sockets_working" = "xyes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE([WANT_WIN32_SOCKETS], [1], [ Define to use Win32 sockets ]) + network_type=Winsock2 + have_network=yes + have_ipv6=yes + else + LIBS="$wsoldlibs" + AC_MSG_WARN([Please update your headers to support winsock 2.2.]) + fi + else + AC_MSG_RESULT([no]) + fi + +#### Check for Win32 Named Pipe functions +win32_fifo_working=no +if test x$win32_specific_codes = xenabled; then + AC_MSG_CHECKING([if we have Named Pipes]) + if test "x$fifo" != "xdisabled"; then + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #include <windows.h> + int main(){ + CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + return 0; + }])],[win32_fifo_working=yes],[win32_winver_bump=yes]) + if test "x$win32_fifo_working" != "xyes"; then + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #define WINVER 0x501 + #define _WIN32_WINNT 0x501 + #include <windows.h> + int main(){ + CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL); + return 0; + }])],[win32_fifo_working=yes],[win32_fifo_working=no]) + fi + fi + have_mkfifo=$win32_fifo_working + if test "x$win32_fifo_working" = "xyes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE([WANT_WIN32_FIFO], [1], [ Define to use Win32 named pipes ]) + else + AC_MSG_RESULT([no]) + fi +fi + +#### WINVER Bump +if test x$win32_specific_codes = xenabled; then + AC_MSG_CHECKING([if WINVER and _WIN32_WINNT needs version bumps]) + if test "x$win32_winver_bump" = "xyes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE([WINVER], [0x0501], [ WinXP and above for ipv6 ]) + AC_DEFINE([_WIN32_WINNT], [0x0501], [ WinXP and above for ipv6 ]) + # getaddrinfo and freeaddrinfo are available for Win2K and above + # Bug: MinGW.org w32api ws2tcpip.h incorrectly wants (_WIN32_WINNT >= 0x0501) for getaddrinfo and freeaddrinfo + # MultiByteToWideChar and WideCharToMultiByte are available for Win2K and above + else + AC_MSG_RESULT([no]) + fi +fi + +fi #END OF WIN32 CHECKS + +#### Use Win32 support codes +AM_CONDITIONAL([WIN32_CODES], [ test "x$win32_specific_codes" = xenabled ]) + +if test x"$network" = xauto; then + if test x"$have_network" = xyes; then + network=enabled + else + network=disabled + fi +fi +if test x"$ipv6" = xauto; then + if test x"$have_ipv6" = xyes; then + ipv6=enabled + else + ipv6=disabled + fi +fi + +dnl ############## FIFO enable + +if test x"$fifo" = xauto; then + if test x"$have_mkfifo" = xyes; then + fifo=enabled + else + fifo=disabled + fi +fi + +if test x"$fifo" = xenabled; then + AC_DEFINE(FIFO, 1, [ Define if FIFO support is enabled. ]) + if test x"$have_mkfifo" = xno; then + AC_MSG_WARN( [ You forced FIFO code while I think there is no mkfifo() available! ] ) + fi +fi + +dnl ############## Network enable +if test x"$network" = xenabled; then + AC_DEFINE(NETWORK, 1, [ Define if network support is enabled. ]) + if test x"$have_network" = xno; then + AC_MSG_WARN( [ You forced network code while I think there is support missing! ] ) + fi +fi + +if test x"$ipv6" = xenabled; then + AC_DEFINE(IPV6, 1, [ Define if IPV6 support is enabled. ]) + if test x"$have_ipv6" = xno; then + AC_MSG_WARN( [ You forced IPv6 code while I think there is no getaddrinfo() available! ] ) + fi +fi + +dnl ############## Final Output + +# Do that here to prevent the above tests usign -lltdl... +if test "x$modules" = xenabled; then + LIBS="-lltdl $LIBS" +fi + +AC_CONFIG_FILES([ + Makefile + libmpg123.pc + mpg123.spec + doc/Makefile + src/Makefile + src/output/Makefile + src/libmpg123/Makefile + src/libmpg123/mpg123.h +]) + +AC_OUTPUT + + + +dnl ############## Display Message + +echo " + $PACKAGE_NAME $PACKAGE_VERSION + + Install path ............ $prefix + CPU Optimization ........ $cpu_type + Compiler Optimization ... $with_optimization + Gapless Support ......... $gapless + Debugging ............... $debugging + Seek table size ......... $seektable + FIFO support ............ $fifo + Buffer .................. $buffer + Network (http streams) .. $network + Network Sockets ......... $network_type + IPv6 (getaddrinfo) ...... $ipv6" +if test x"$LARGEFILE_BITS" = x; then + echo " File offsets ............ default" +else + echo " File offsets ............ $LARGEFILE_BITS" + echo " The lib will (try to) support default offset size, too." +fi +echo " LFS alias symbols ....... $lfs_alias ($LFS_ALIAS_BITS)" + +echo " Alignment checks ........ $aligncheck" +if test x"$aligncheck" = xenabled; then + if test x"$ccalign" != xyes; then + echo " (without effect since special alignment is not employed)" + fi + if test x"$GCC" = xyes; then + echo " (note that newer gcc 4.x versions do not use/need the align check)" + fi +fi +echo -n " + Core libmpg123 features: + Integer conversion ...... $integers + New/old WRITE_SAMPLE .... $newoldwritesample + Layer I ................. $layer1 + Layer II ................ $layer2 + Layer III ............... $layer3 + NtoM resampling ......... $ntom + downsampled decoding .... $downsample + Feeder/buffered input ... $feeder + ID3v2 parsing ........... $id3v2 + String API .............. $string + ICY parsing/conversion .. $icy + Error/warning messages .. $messages + Win32 Unicode File Open.. $win32_unicode + Feature Report Function.. $feature_report + Output formats (nofpu will disable all but 16 or 8 bit!): + 8 bit integer ........... $int8 + 16 bit integer .......... $int16 + 32/24 bit integer ....... $int32 + real (32 bit float) ..... $real + +Note: Disabling core features is not commonly done and some combinations might not build/work. If you encounter such a case, help yourself (and provide a patch) or just poke the maintainers. +" +# just an empty line +echo + +echo " Modules ................. $modules" +echo " Module suffix ........... $with_module_suffix" +echo " Checked audio modules ... $check_modules + Detected audio support ..$output_modules + Default output module ... $default_output_module +" +if test x"$modules" = xdisabled; then +echo "The _single_ active output module is being statically linked in. +" +fi +if test x"$with_optimization" = x0; then + echo "No optimization flags chosen, make sure you have something basic in your CFLAGS at least... +" +fi +if test x"$debugging" = xenabled; then + echo "CFLAGS='$CFLAGS'" + echo "LIBS='$LIBS'" +else + echo "Next type 'make' and then 'make install'." +fi diff --git a/node_modules/lame/deps/mpg123/doc/ACCURACY b/node_modules/lame/deps/mpg123/doc/ACCURACY new file mode 100644 index 0000000..cd84833 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/ACCURACY @@ -0,0 +1,2 @@ +We do regular testing of ISO MPEG compliant decoder accuracy, automatic with snapshot generation each night at least, with results shown on the front page of http://mpg123.org . +Since version 1.8.0, mpg123 really looks fine in that area... it's fast and sounds good;-) diff --git a/node_modules/lame/deps/mpg123/doc/BENCHMARKING b/node_modules/lame/deps/mpg123/doc/BENCHMARKING new file mode 100644 index 0000000..cf080eb --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/BENCHMARKING @@ -0,0 +1,110 @@ +O-tone Michael Hipp: The mp3 benchmarking lie? +---------------------------------------------- + +Let's write a few notes about benchmarking the different mp3 decoders, +which are available. 'top' is NOT a benchmark, it's a simple check +how a program performs. The sad thing with 'top' is, that it has some +problems with the measurement of threaded programs of programs only +requesting short chunks of processor time. So, the only real test is +probably decoding a stream without threads with 100% CPU time and +measure the time how long your machine needs for it. +You can do this with mpg123 by doing a + time mpg123 -t mp3stream.mp3 +or + time mpg123 -s mp3stream.mp3 > /dev/null +if you additionally want to measure the I/O time. + +If you find a player, which claims to be 10 or even more times faster than the +current players: just don't believe it. A factor of 2 MAY BE possible. + + +Thomas's mpg123 decision process +-------------------------------- + +I made some tests back then when I wondered if there is a point in using another "modern" mp3 decoder for my mixing daemon. This was around Dec. 2004 till Feb. 2005 with current versions (0.59r-thorX in the case of mpg123). What follows is a copy of the DECODERS file in the dermixd distribution: + +What decoder should one use? + +----- + MP3 +----- + +mpg123 is the old-fashioned way, uncertain license, may have some problems with extraordinary files (huge id3v2 tags, other specialities?), but fast. Has EQ control; interactive frontend interface (in parts hacked by me...). + +mpg321: is popular these days... interface? speed? + +madplay: is becoming popular these days, handles RVA2 by itself... can't provide an interface nor EQ + + +speed: + +decoding Dirty Guitar with NULL output, pentium-optimized (not more): + +decoder user time/s +mpg123 23 +madplay(hq) 46 +madplay(speed) 34 +mpg321(hq) 62 +mpg321(speed) 49 + + +So, there is still a strong technical point in using mpg123... even when my 366MHz-Laptop can easily handle several decoders at once with either of the programs, every percent cpu usage drags on the battery... and takes the cpu time from the real work + +----- + OGG +----- + +7,9M /tmp/dirty_guitar-q3.ogg +11M /tmp/dirty_guitar-q5.ogg +13M /tmp/dirty_guitar-q6.ogg +15M /tmp/dirty_guitar-q7.ogg +22M /tmp/dirty_guitar-q9.ogg +29M /tmp/dirty_guitar-q10.ogg +14M /tmp/dirty_guitar-std.mp3 +101M /tmp/dirty_guitar.wav + +speed of ogg123: + +quality user time/s +3 31 +5 36 +6 38 +7 39 +10 55 + +So, with similar care as mpg123 concerning some (assembler?) optimization, ogg could well come close to "fast" mp3 decoding. +Does ist sound better, then? + + +A review from the new maintainer +-------------------------------- + +Now it's 2006, 23th of July. Still the same laptop, still the same mp3 file. +I just want to update the number for current mpg123 with the mmx optimization. +I should also see if competition (well, ogg, at least?) improved in the year that passed... but looking only at mp3, that reduces to the question if mpg123 got faster or slower. +Neither on the mpg321 site or the MAD site (ftp dir) did I find any new version. MAD is still 0.15.1b (0.15.2b for madplay), mpg321 still 0.2.10 . +Well, I can look at mplayer's mpg123 spawn called mp3lib that has been taken care for over the time. +But apart from that, will mpg123 stand alone on the field of console mp3 engines that are actively maintained??? +To have at least some twist, I now measured the output of raw data to stdout (to /dev/null) instead of decoding alone. The hardware and largely the software is still the same (now kernel 2.6.11 instead of 2.6.?). +I've only used the "high quality" mad players - the earlier measurements give a hint about the difference to the "speed" variant. + +mpg123-0.60-beta1, underworld_@_dirty_guitar.mp3 + +gcc-3.3.3 +CFLAGS=-O2 -finline-functions -march=pentium2 +built with the new autoconf/make system +machine in X11 running fluxbox, no active load (like a year ago) +measuring second run (with cached file) + +time for -s > /dev/null decode... +pentium: 24s +pentium, MMX: 19s +pentium, MMX, gapless (runtime-disabled): 19s +pentium, MMX, gapless (also runtime-enabled): 19s +mpg321 0.2.10, high quality: 64s +madplay 0.15.2b, high quality: 56s + +With the file length being m:s 9:58 (598s), for mpg123 that makes theoretical realtime cpu 3-4% for the PII-366. +Incidentally, `top` agrees there: it shows 3.0-3.3% CPU usage for the MMX/gapless binary during normal OSS playback. + +I feel unable to benchmark the mp3 playback of mplayer - I don't see an option to make it decode audio as fast as possible (I only know -benhcmark and -noaudio; with esp. the latter not helping me there). diff --git a/node_modules/lame/deps/mpg123/doc/BUGS b/node_modules/lame/deps/mpg123/doc/BUGS new file mode 100644 index 0000000..22139c8 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/BUGS @@ -0,0 +1,3 @@ +If you find a bug, please check for and report it in the sourceforge bug tracking system: + + http://sourceforge.net/tracker/?atid=733194&group_id=135704&func=browse diff --git a/node_modules/lame/deps/mpg123/doc/CONTACT b/node_modules/lame/deps/mpg123/doc/CONTACT new file mode 100644 index 0000000..3bfc2cd --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/CONTACT @@ -0,0 +1,17 @@ +If you have a problem with some mp3 file or with your platform that should be supported by mpg123, please post on the mpg123 user mailing list + + mpg123-users@lists.sourceforge.net + +Any ideas for feature improvements or any other suggestions concerning development may be better placed at + + mpg123-devel@lists.sourceforge.net + +If you don't want to subscribe to these, you can also drop a note to + + maintainer@mpg123.org + +But if you want to subscribe and participate in the open discussion or just browse the mailing list archives, see + + http://sourceforge.net/mail/?group_id=135704 + +(or just http://sourceforge.net/projects/mpg123 and click through). diff --git a/node_modules/lame/deps/mpg123/doc/LICENSE b/node_modules/lame/deps/mpg123/doc/LICENSE new file mode 100644 index 0000000..0ede421 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/LICENSE @@ -0,0 +1,22 @@ +GNU says that the license terms go into a file called COPYING. +Go over to COPYING to read the license, then. + +Or... + +You stay a bit with me here and read some not really important text. +You could imagine that there was some important text here, though. +You could also imagine that you were not sitting + in your office / living room / bathroom + in front of one of these evil electronic brains + (you didn't _print_ this file, did you?) + but being at some happy place, far, far away. +You could also imagine being at some unhappy place. +If you indeed are at such an unhappy place, imagine you were sitting + in your office / living room / bathroom + in front of this shiny, though evil, electronic brain. + Reading this pointless text. + Wondering about what you could have achieved in the past moments + if you wouldn't have continued reading this pointless text. + Wondering if anything is worth being achieved at all. + Or if it all is just... +pointless. diff --git a/node_modules/lame/deps/mpg123/doc/Makefile.am b/node_modules/lame/deps/mpg123/doc/Makefile.am new file mode 100644 index 0000000..c44558b --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/Makefile.am @@ -0,0 +1,32 @@ +## Makefile.am: produce Makefile.in from this + +## copyright by the mpg123 project - free software under the terms of the LGPL 2.1 +## see COPYING and AUTHORS files in distribution or http://mpg123.org +## initially written by Nicholas J. Humfrey + + +EXTRA_DIST = \ + BENCHMARKING \ + BUGS \ + CONTACT \ + PATENTS \ + README.3DNOW \ + README.gain \ + README.remote \ + ROAD_TO_LGPL \ + TODO \ + LICENSE \ + THANKS \ + ACCURACY \ + libmpg123_speed.txt \ + doxyhead.xhtml \ + doxy_examples.c \ + doxygen.conf \ + examples/mpg123_to_wav.c \ + examples/scan.c \ + examples/mpglib.c \ + examples/id3dump.c \ + examples/feedseek.c \ + examples/dump_seekindex.c \ + examples/extract_frames.c \ + examples/Makefile diff --git a/node_modules/lame/deps/mpg123/doc/Makefile.in b/node_modules/lame/deps/mpg123/doc/Makefile.in new file mode 100644 index 0000000..55b8a28 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/Makefile.in @@ -0,0 +1,490 @@ +# Makefile.in generated by automake 1.12.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in THANKS TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/addrconfig.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AIX_CFLAGS = @AIX_CFLAGS@ +AIX_LDFLAGS = @AIX_LDFLAGS@ +AIX_LIBS = @AIX_LIBS@ +ALIB_CFLAGS = @ALIB_CFLAGS@ +ALIB_LDFLAGS = @ALIB_LDFLAGS@ +ALIB_LIBS = @ALIB_LIBS@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LDFLAGS = @ALSA_LDFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMTAR = @AMTAR@ +API_VERSION = @API_VERSION@ +AR = @AR@ +ARTS_CFLAGS = @ARTS_CFLAGS@ +ARTS_LDFLAGS = @ARTS_LDFLAGS@ +ARTS_LIBS = @ARTS_LIBS@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COREAUDIO_CFLAGS = @COREAUDIO_CFLAGS@ +COREAUDIO_LDFLAGS = @COREAUDIO_LDFLAGS@ +COREAUDIO_LIBS = @COREAUDIO_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DECODER_LOBJ = @DECODER_LOBJ@ +DECODER_OBJ = @DECODER_OBJ@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMMY_CFLAGS = @DUMMY_CFLAGS@ +DUMMY_LDFLAGS = @DUMMY_LDFLAGS@ +DUMMY_LIBS = @DUMMY_LIBS@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_LDFLAGS = @ESD_LDFLAGS@ +ESD_LIBS = @ESD_LIBS@ +EXEC_LT_LDFLAGS = @EXEC_LT_LDFLAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HP_CFLAGS = @HP_CFLAGS@ +HP_LDFLAGS = @HP_LDFLAGS@ +HP_LIBS = @HP_LIBS@ +INCLUDE_STDIO_H = @INCLUDE_STDIO_H@ +INCLUDE_STDLIB_H = @INCLUDE_STDLIB_H@ +INCLUDE_SYS_TYPE_H = @INCLUDE_SYS_TYPE_H@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBS = @JACK_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LFS_LOBJ = @LFS_LOBJ@ +LIBMPG123_VERSION = @LIBMPG123_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_LDFLAGS = @LT_LDFLAGS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MINT_CFLAGS = @MINT_CFLAGS@ +MINT_LDFLAGS = @MINT_LDFLAGS@ +MINT_LIBS = @MINT_LIBS@ +MKDIR_P = @MKDIR_P@ +MODULE_OBJ = @MODULE_OBJ@ +NAS_CFLAGS = @NAS_CFLAGS@ +NAS_LDFLAGS = @NAS_LDFLAGS@ +NAS_LIBS = @NAS_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENAL_CFLAGS = @OPENAL_CFLAGS@ +OPENAL_LDFLAGS = @OPENAL_LDFLAGS@ +OPENAL_LIBS = @OPENAL_LIBS@ +OS2_CFLAGS = @OS2_CFLAGS@ +OS2_LDFLAGS = @OS2_LDFLAGS@ +OS2_LIBS = @OS2_LIBS@ +OSS_CFLAGS = @OSS_CFLAGS@ +OSS_LDFLAGS = @OSS_LDFLAGS@ +OSS_LIBS = @OSS_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +OUTPUT_CFLAGS = @OUTPUT_CFLAGS@ +OUTPUT_LDFLAGS = @OUTPUT_LDFLAGS@ +OUTPUT_LIBS = @OUTPUT_LIBS@ +OUTPUT_MOD = @OUTPUT_MOD@ +OUTPUT_OBJ = @OUTPUT_OBJ@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PORTAUDIO_CFLAGS = @PORTAUDIO_CFLAGS@ +PORTAUDIO_LDFLAGS = @PORTAUDIO_LDFLAGS@ +PORTAUDIO_LIBS = @PORTAUDIO_LIBS@ +PULSE_CFLAGS = @PULSE_CFLAGS@ +PULSE_LDFLAGS = @PULSE_LDFLAGS@ +PULSE_LIBS = @PULSE_LIBS@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LDFLAGS = @SDL_LDFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SGI_CFLAGS = @SGI_CFLAGS@ +SGI_LDFLAGS = @SGI_LDFLAGS@ +SGI_LIBS = @SGI_LIBS@ +SHELL = @SHELL@ +SNDIO_CFLAGS = @SNDIO_CFLAGS@ +SNDIO_LDFLAGS = @SNDIO_LDFLAGS@ +SNDIO_LIBS = @SNDIO_LIBS@ +STRIP = @STRIP@ +SUN_CFLAGS = @SUN_CFLAGS@ +SUN_LDFLAGS = @SUN_LDFLAGS@ +SUN_LIBS = @SUN_LIBS@ +VERSION = @VERSION@ +WIN32_CFLAGS = @WIN32_CFLAGS@ +WIN32_LDFLAGS = @WIN32_LDFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + BENCHMARKING \ + BUGS \ + CONTACT \ + PATENTS \ + README.3DNOW \ + README.gain \ + README.remote \ + ROAD_TO_LGPL \ + TODO \ + LICENSE \ + THANKS \ + ACCURACY \ + libmpg123_speed.txt \ + doxyhead.xhtml \ + doxy_examples.c \ + doxygen.conf \ + examples/mpg123_to_wav.c \ + examples/scan.c \ + examples/mpglib.c \ + examples/id3dump.c \ + examples/feedseek.c \ + examples/dump_seekindex.c \ + examples/extract_frames.c \ + examples/Makefile + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/mpg123/doc/PATENTS b/node_modules/lame/deps/mpg123/doc/PATENTS new file mode 100644 index 0000000..7197e09 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/PATENTS @@ -0,0 +1,39 @@ +Some notes about patents and mpg123 by Thomas Orgis +--------------------------------------------------- + +There has been a lot of confusion over mp3 (or more generic mpeg audio) patents and licensing issues due to the patents held by Fraunhofer and marketed by Thomson. +So, yes, there are patents held by Fraunhofer that are claimed to cover mpeg audio technology. There are also claims that they cover any similar technology (like OGG). +You may argue if these patents are valid at all (being illegal software patents, or being preceeded by known scientific publications), but they are internationally accepted by patent authorities and if you want to use mp3 commercially you should check + + http://www.mp3licensing.org + +for the Fraunhofer/Thomson opinion and their terms. + +Since mpg123 is only a mpeg audio player, a good deal of patents that describe the encoding process (the tricky part) will not apply. +Also, statements from the patent holders up to now always allowed the non-commercial distribution of mpeg audio decoders without any fee. +They want you to pay for a license when you want to make money by selling a decoder, though. We don't sell mpg123. +Additionally, one should not forget the fact that the ideas are getting old; the basic (funded by government, btw.) research was somewhen back around the 80s and many patents are going to expire soon, best example in Germany: + +P/DE 35 06 912 Method of transmission of an audio signal using grouping of amplitude values + +Application was 22.02.1986 in Germany (and around Europe in the same time Jan/Feb 1986). +German patents last 20 years... now we have 24.07.2006. Time has come... + +The idea of a patent is to make the inventor open the invention to the public by giving him some safe time to turn this invention into economical benefit. +People using (and improving!) the technology freely after that time is _the_ most important aspect of that idea. + +Oh, I should mention the "core" mp3 patent (from http://gauss.ffii.org/PatentView/EP287578): + +DE 3629434 / EP287578 Digital coding process + +Application date in Germany was 29.08.1986 - that means that in a month from now (remember: 24.07.2006) this patent finds its natural end. + +Then, there are other patents listed on the Fraunhofer/Thomson website that came very late... The one about join stereo coding was aplied for in Feb 1995. Did mpg123 implement that already back then? History is a bit blurry there... +There is a patent applied for in 1997, but probably covering encoding only. Still, even if that weren't the case - the basic decoding functionality of mpg123 didn't change that much after 1997; and they couldn't have patented existing functionality. +In general, few patents seem to cover decoders at all. Of course, with me being no lawyer, that statement is not trustworthy... + +Bottom line is: + +While Fraunhofer/Thomson don't want to charge free software players - they said that a long time ago, the time for they being able to place such charges is expiring or has already expired. One should really think before adding mp3pro/surround support to mpg123, though, since there are for sure more recent patents for that. + +And don't forget: The progress bar is covered by a patent, too. diff --git a/node_modules/lame/deps/mpg123/doc/README.3DNOW b/node_modules/lame/deps/mpg123/doc/README.3DNOW new file mode 100644 index 0000000..98aae5a --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/README.3DNOW @@ -0,0 +1,56 @@ +************************************************************************ +* 3DNow! support by KIMURA Takuhiro <kim@hannah.ipc.miyakyo-u.ac.jp> * +* <kim@comtec.co.jp> * +* (http://hannah.ipc.miyakyo-u.ac.jp/kim/) * +* Syuuhei Kashiyama <squash@mb.kcom.ne.jp> * +* (http://user.ecc.u-tokyo.ac.jp/~g810370/)* +************************************************************************ + +----------------------------- +What's new in patch for 0.59r +----------------------------- +- 3DNow! optimized decode routine (decode_3dnow.s,dct36_3dnow.s ; + these code based Syuuhei Kashiyama's 3DNow! patch for mpg123-0.59o) +- 3DNow! optimized equalizer (equalizer_3dnow.s ; do_equalizer() only) +- target "linux-3dnow-alsa" "linux-3dnow-esd" added (untested) +- automatic detect 3DNow! support CPU from CPUFLAGS (getcpuflags.s) + (i.e. use floating-pointer decode routine if your CPU isn't support + 3DNow! or MMX instructions) + +------------- +Added options +------------- +"--test-3dnow" : display result of autodetect and exit +"--force-3dnow" : force use of 3DNow! optimized decoder + (it will cause SIGILL if your CPU isn't support 3DNow! or MMX + instructions) +"--no-3dnow" : force use of floating-pointer decoder + +----------- +How to make +----------- +[1] To make 3DNow! optimized mpg123,you need binutils-2.9.1.0.15 or later. + You can find the most recent binutils (2.9.1.0.25 until 23.Jun.1999) at + - kernel.org (and mirrors) : /pub/linux/devel/gcc/ + - http://hannah.ipc.miyakyo-u.ac.jp/kim/Linux/binutils/ + (Takuhiro's local copy) + etc. +[2] Type "make linux-3dnow" (OSS) + or "make linux-3dnow-alsa" (ALSA). +[3] Enjoy! + +------------------ +Precompiled binary +------------------ +You can get precompiled binary of mpg123 (with 3DNow! support) from + http://hannah.ipc.miyakyo-u.ac.jp/kim/Linux/mpg123/ + +---------- +References +---------- +Useful sources of information on optimizing 3DNow! code include: +- AMD 3DNow! Technology Manual (Publication #21928) + English: http://www.amd.com/K6/k6docs/pdf/21928d.pdf + (Japanese: http://www.amd.com/japan/K6/k6docs/j21928c.pdf) +- AMD-K6-2 Processor Code Optimization Application Note (Publication #21924) + English: http://www.amd.com/K6/k6docs/pdf/21924b.pdf diff --git a/node_modules/lame/deps/mpg123/doc/README.gain b/node_modules/lame/deps/mpg123/doc/README.gain new file mode 100644 index 0000000..e12fc5a --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/README.gain @@ -0,0 +1,171 @@ +Thomas Orgis on RVA, Gain and Pain + + +Ok, so I'm going to add RVA/ReplayGain support... the problem there is not to read these valus from ID3 or Lame, not even to do the adjustment itself. +The problem is more to figure out how to interpret the dB values one gets there. + +Main players in the field of relative volume adjustment / soft gain (without modifying actual audio data): + +http://www1.cs.columbia.edu/~cvaill/normalize/ + ...writing RVA2 ID3v2tags for dB offset to user target amplitude, default being -12dB(FS) +http://www.replaygain.org/ + ...store the difference to reference of 83dB(SPL) ... somewhere + +Both calculate some running RMS and do statistics with this - the main difference is the potentially different target level. +Also both know two basic types of adjustment: Per track to make all tracks sound at the same sevel (track / radio) and the one with default meaning to keep the loudness relations over albums (batch / audiophile). + +dB can mean many things and also the raw value of a PCM sample doesn't equal directly to loudness (power of a wave != amplitude). + +So that says the ReplayGain about applying the adjustment: + + scale=10.^(replay_gain/20); + +luckily, this is the same that I worked out on my own for the normalize RVA values in my mixplayer script: + + return 10**($s/20); + +I'll take that interpretaion of dB -> linear scale factor for samples for granted, then. + +The replay_gain value is meant in the standard to represent the offset to 83dB(SPL - depending on your amplifier...), having in mind that actual most wanted average playback level should be 83dB(SPL) (defined by movie ppl as the loudness of a -20dB(FS) signal, leaving room for louder stuff). +But then there is the proposal to add 6dB preamp for pop music - am I judging music types with mpg123?? +These 6dB are in fact the real world since lots of programs use 89dB(SPL...) as reference. +Thus, lame since 3.95.1 (according to MADplay's Rob Leslie who discussed with Lame ppl, verified in 3.96 source) stores the adjustment to 89dB. +To make that all sound the same, one should add 6bB to lame <3.95.1 ReplayGain values and use later ones verbatim - achieving 89dB everytime, whatever that may mean in reality out of my speakers (my Marantz' volume knob doesn't have a scale at all - be it dB or percent;-). + +A funny aspect of this 6dB issue is to tell lame 3.95.1 from lame 3.95 + +As for normalize... the desired playback level is essentially undefined. Ignoring that and realizing that mpg123 has no way to determine real world sound power anyway, one has to just take the provided dB values and apply with the formula above. +The user is responsible for providing files with his desired settings... for that reason I also won't follow the ReplayGain demand/suggestion that a player should apply an average of gains of previous tracks if the current one lacks a setting. + +So, well. Considering that ReplayGain (at least the radio one) being stored by current lame on encoding, I suppose that if there are RVA2 values in ID3v2 tags, these were added by a conscious user act and are overriding the ReplayGain ones. + +I already read ReplayGain entries in Lame tag... should add ID3v2 parsing. Especially since the lame tag is ambignous because of the 6dB issue... I cannot distinguish 3.95.1 from 3.95 by reading the tag - frick! +But wait... 6dB? + +[thomas@thorvas /home/thomas-data/mpg123-neu/lame-3.96.1]$ frontend/lame --cbr -T /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 ../testfiles/happy_man_lame-3.96.1.mp3 +ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding. +LAME version 3.96.1 (http://lame.sourceforge.net/) +Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz +Encoding /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 + to ../testfiles/happy_man_lame-3.96.1.mp3 +Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3 + Frame | CPU time/estim | REAL time/estim | play/CPU | ETA + 6371/6374 (100%)| 1:41/ 1:41| 1:47/ 1:47| 1.6353x| 0:00 +average: 128.0 kbps LR: 754 (11.83%) MS: 5620 (88.17%) + +Writing LAME Tag...done +ReplayGain: -7.4dB +revmethod = 1 +encoder padding: 1728 + +[thomas@thorvas /home/thomas-data/mpg123-neu/lame-3.95.1]$ frontend/lame --cbr -T /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 ../testfiles/happy_man.mp3 +ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding. +LAME version 3.95 (http://www.mp3dev.org/) +Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz +Encoding /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 + to ../testfiles/happy_man.mp3 +Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3 + Frame | CPU time/estim | REAL time/estim | play/CPU | ETA + 6371/6374 (100%)| 1:36/ 1:36| 1:48/ 1:48| 1.7289x| 0:00 +average: 128.0 kbps LR: 759 (11.91%) MS: 5615 (88.09%) + +Writing LAME Tag...done +ReplayGain: -7.4dB + +[thomas@thorvas /home/thomas-data/mpg123-neu/lame-3.95]$ frontend/lame --cbr -T /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 ../testfiles/happy_man_lame-3.95.mp3 +ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding. +LAME version 3.95 (http://www.mp3dev.org/) +Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz +Encoding /mnt/knecht_mp3/music/covenant/2006_skyshaper/03-happy_man.mp3 + to ../testfiles/happy_man_lame-3.95.mp3 +Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3 + Frame | CPU time/estim | REAL time/estim | play/CPU | ETA + 6371/6374 (100%)| 1:37/ 1:37| 1:43/ 1:43| 1.7041x| 0:00 +average: 128.0 kbps LR: 759 (11.91%) MS: 5615 (88.09%) + +Writing LAME Tag...done +ReplayGain: -13.4dB + + +Together with the gain values read from tags: + +3.96.1: -1.0dB (claimed -7.4dB) +3.95: -1.0dB (claimed -7.4dB) +3.95: -0.6dB (claimed -13.4dB) + +So, the difference of 6dB shows in the values lame prints on the command line... but the lame tags only have 0.4dB difference and are much lower anyway - do I parse them correctly? + +Opinion of normalize of these files: -2dB. Great. I guess the -1 is what lame really meant, then... + + +Storage places +============== + +Points 1, 2 and 4 implemented to some respect. + + +1. Lame/Info tag + +supposedly in format according to the proposed standard - but I yet have to verify if Lame really does this. +see http://gabriel.mp3-tech.org/mp3infotag.html + + +2. ID3v2 RVA2 frame(s) + +Normalize does that. Rare is the software reading that. +I've never seen those frames since id3v2 -l doesn't know them. + + +3. APE tags + +Gah, another Tag format. Foobar2000 uses this as default. +It's getting real-hy messy folks + + +4. Per convention in ID3 tags + +Well, I myself once used the ID3v1 comment field for storing the mix rva value (textual) ... but that is a tad too unspecific. +I then also used user-defined ID3v2 comments like that: + +[thomas@thorvas /home/thomas-data/mpg123-neu/svn/trunk]$ id3v2 -l /mnt/knecht_mp3/music/underworld/second_toughest_in_the_infants/02-banstyle_sappys_curry.mp3 +id3v1 tag info for /mnt/knecht_mp3/music/underworld/second_toughest_in_the_infants/02-banstyle_sappys_curry.mp3: +Title : banstyle sappys curry Artist: underworld +Album : second toughest in the infants Year: 0 , Genre: Other (12) +Comment: Created by Grip Track: 2 +id3v2 tag info for /mnt/knecht_mp3/music/underworld/second_toughest_in_the_infants/02-banstyle_sappys_curry.mp3: +TYER (Year): 0 +TRCK (Track number/Position in set): 2 +COMM (Comments): (ID3v1 Comment)[XXX]: Created by Grip +TCON (Content type): Other (12) +TPE1 (Lead performer(s)/Soloist(s)): underworld +TALB (Album/Movie/Show title): second toughest in the infants +TIT2 (Title/songname/content description): banstyle sappys curry +COMM (Comments): (RVA)[]: 4.3291 +COMM (Comments): (RVA_ALBUM)[]: 3.666101 + +That still doesn't look like a bad Idea to me. Not bothering with byte ordering and whatnot. Just atof(id3v2_comm_rva). +One could still add dB, though. + +Another convention is (rockbox mailinglist, not checked myself) used by Foobar: + +TXXX (User defined text information): (replaygain_track_gain): -7.17 dB +TXXX (User defined text information): (replaygain_track_peak): 1.057122 +TXXX (User defined text information): (replaygain_album_gain): -6.53 dB +TXXX (User defined text information): (replaygain_album_peak): 1.107456 + +So what are custom comment fields for when there are also custom text fields? They look very similar to me. + + +5. Leave the haunted music file alone and store metadata externally. + +That's the only sane way for stuff like album art... and it's the way I do it in my music archive. the wrapper script reads the adjustment values and then sets an adjusted volume. +That's fine for my mixing daemon that manupulates the pcm data anyway, but it would be nice to have this functionality in the minimalist console mode. too. +Even more since it can be done without additional cpu power during decoding (well, one-time set up of the decode tables is needed for every track) similar to the equalizer. +I could simply start with text files with lines like + +RVA_MIX: 3.4dB +RVA_ALBUM: 1.7dB + +Prob here is that the effort to open and parse that extra file may hinder gapless decoding between tracks... +Well, one could parse all metadata files for a list of tracks before playback starts. +But all this won't work for streams via stdin (hm, one could argue if the stream needs RVA at all). diff --git a/node_modules/lame/deps/mpg123/doc/README.remote b/node_modules/lame/deps/mpg123/doc/README.remote new file mode 100644 index 0000000..f16932a --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/README.remote @@ -0,0 +1,218 @@ +Control interface to generic frontends + +The generic remote interface allows frontends to easily control +mpg123 by commands through stdin/stdout. To start the generic +remote interface, start mpg123 with parameter -R. + +In case of a frontend that starts mpg123 with the -s option to read the audio from stdout, the --remote-err option is automatically activated to send responses to stderr so that stdout stays clean for audio. + +(Still the case?) +As an example it's used by IRMP3, a tool that allows you to +control mpg123 with a standard infrared remote control. See +http://www.fasta.fh-dortmund.de/users/andy/irmp3/ for more +information. + +You can also specify --fifo <path> to create a named pipe at <path> and listen on that for commands instead stdin. +That way, you can deliberately control mpg123 by echoing into the named pipe from any terminal / program. +The command respones are still sent to standard out or standard error (depending on -s or --remote-err switches). + + +COMMAND CODES +------------- + +You can get this info via the control command "help". + +HELP/H: command listing (LONG/SHORT forms), command case insensitve + +LOAD/L <trackname>: load and start playing resource <trackname> + +LOADPAUSED/LP <trackname>: load but do not start playing resource <trackname> + +LOADLIST <entry> <url>: load a playlist from given <url>, and display its entries, optionally load and play one of these specificed by the integer <entry> (<0: just list, 0: play last track, >0:play track with that position in list) + +PAUSE/P: pause playback + +STOP/S: stop playback (closes file) + +JUMP/J <frame>|<+offset>|<-offset>|<[+|-]seconds>s: jump to mpeg frame <frame> or change position by offset, same in seconds if number followed by "s" + +VOLUME/V <percent>: set volume in % (0..100...); float value + +RVA off|(mix|radio)|(album|audiophile): set rva mode + +EQ/E <channel> <band> <value>: set equalizer value for frequency band 0 to 31 on channel 1 (left) or 2 (right) or 3 (both) + +EQFILE <filename>: load EQ settings from a file + +SHOWEQ: show all equalizer settings (as <channel> <band> <value> lines in a SHOWEQ block (like TAG)) + +SEEK/K <sample>|<+offset>|<-offset>: jump to output sample position <samples> or change position by offset + +SCAN: scan through the file, building seek index + +SAMPLE: print out the sample position and total number of samples + +SEQ <bass> <mid> <treble>: simple eq setting... + +PITCH <[+|-]value>: adjust playback speed (+0.01 is 1 % faster) + +SILENCE: be silent during playback (meaning silence in text form) + +STATE: Print auxilliary state info in several lines (just try it to see what info is there). + +TAG/T: Print all available (ID3) tag info, for ID3v2 that gives output of all collected text fields, using the ID3v2.3/4 4-character names. + The output is multiple lines, begin marked by "@T {", end by "@T }". + ID3v1 data is like in the @I info lines (see below), just with "@T" in front. + An ID3v2 data field is introduced via ([ ... ] means optional): + @T ID3v2.<NAME>[ [lang(<LANG>)] desc(<description>)]: + The lines of data follow with "=" prefixed: + @T =<one line of content in UTF-8 encoding> +meaning of the @S stream info: + +S <mpeg-version> <layer> <sampling freq> <mode(stereo/mono/...)> <mode_ext> <framesize> <stereo> <copyright> <error_protected> <emphasis> <bitrate> <extension> <vbr(0/1=yes/no)> +The @I lines after loading a track give some ID3 info, the format: + @I ID3:artist album year comment genretext + where artist,album and comment are exactly 30 characters each, year is 4 characters, genre text unspecified. + You will encounter "@I ID3.genre:<number>" and "@I ID3.track:<number>". + Then, there is an excerpt of ID3v2 info in the structure + @I ID3v2.title:Blabla bla Bla + for every line of the "title" data field. Likewise for other fields (author, album, etc). + + +RESPONSE CODES +-------------- + +Note: mpg123 returns errors on stderr, so your frontend should + look not only at stdout but also at stderr for responses. + It is a good idea to use --remote-err and just look at stderr. + +@R MPG123 (ThOr) v7 + Startup version message. Everything after MPG123 is auxilliary information about behaviour and command support, ID3v2 tag support is new in v3. + +@I ID3:<a><b><c> + Status message after loading a song (ID3 song info) + a = title (exactly 30 chars) + b = artist (exactly 30 chars) + c = album (exactly 30 chars) + d = year (exactly 4 chars) + e = comment (exactly 30 chars) + f = genre (string) + +@I ID3.genre:<number> +@I ID3.track:<number> + Optional lines with additional ID3v1 info (if present): Genre ID and track number in set. + +@I ID3v2.title:<text> + After loading a track with ID3v2 info, such lines occur for every line of the "title" data field and likewise for other fields (author, album, etc). + +@I <a> + Status message after loading a song (no ID3 song info) + a = filename without path and extension + +@I LISTENTRY <n>: <url> + printout of playlists loaded with LOADLIST + +@S <a> <b> ... + Stream info at beginning of playback, meaning + S <mpeg-version> <layer> <sampling freq> <mode(stereo/mono/...)> <mode_ext> <framesize> <stereo> <copyright> <error_protected> <emphasis> <bitrate> <extension> <vbr(0/1=yes/no)> + +@S <a> <b> <c> <d> <e> <f> <g> <h> <i> <j> <k> <l> + Status message after loading a song (stream info) + a = mpeg type (string) + b = layer (int) + c = sampling frequency (int) + d = mode (string) + e = mode extension (int) + f = framesize (int) + g = stereo (int) + h = copyright (int) + i = error protection (int) + j = emphasis (int) + k = bitrate (int) + l = extension (int) + +@F <a> <b> <c> <d> + Status message during playing (frame info) + a = framecount (int) + b = frames left this song (int) + c = seconds (float) + d = seconds left (float) + +@P <a> + Playing status + a = 0: playing stopped + a = 1: playing paused + a = 2: playing unpaused + +@E <a> + An error occured + Errors may be also reported by mpg123 through + stderr (without @E) + a = error message (string) + +@J <n> + Jumped to frame n. + +@RVA <mode> + Switched to specified RVA mode. + +@V <volume>% + Set volume to specified value (float, percent). + +@<x> : <y> : <z> + Set equalizer value z for band y of channel x. + +@bass: <b> mid: <m> treble: <t> + Set simple equalizer control for bass, mid, treble. + +@T <response from TAG command> + The output is multiple lines, begin marked by "@T {", end by "@T }". + ID3v1 data is like in the @I info lines, just with "@T" in front. + An ID3v2 data field is introduced via ([ ... ] means optional): + @T ID3v2.<NAME>[ [lang(<LANG>)] desc(<description>)]: + The lines of data follow with "=" prefixed: + @T =<one line of content in UTF-8 encoding> + + +EQUALIZER CONTROL (History) +--------------------------- + +WARNING: The interpretation of the command arguments changed. The channel is either 1 or 2 or 3 (left, right, both). +It used to be 0 or 1 for left or right but the change slipped through during libmpg123 work and now it is a fact. +Sorry. + +Cold Feet Audio Patch for MPG123 + +10.07.2002 + +This is a dirty little hack to enable the equalizer in mpg123's +generic_control interface. It works like this, there are two +different channels on the equalizer and 32 frequencys. + +The hack just enables mpg123's built in equalizer to run real-time. +We haven't built in any capability to save the eq, you're frontend +will have to handle that part, and init the eq on the startup of +mpg123. + +K, it works like this: + +#./mpg123 -R - <---- This command will start mpg123 in 'frontend' mode. + +If you want to send it some eq values you'd send it: +eq X Y V[ENTER] + +X = The channel. It can be either 0 or 1. I haven't put any error checking + in, so it probably wouldn't be a good idea to go out of bounds. (integer) +Y = This is the frequency, it can be 0 to 31. 0 being closer to treble and + 31 being closer to bass. (integer) +V = The raw value of your equalizer setting. I've found that the values work + best between 0.00 and 3.00. When mpg123 starts up, all of them are set + to 1.00. + +OK, have fun! If you have any questions or found some bugs, please contact +nutcase@dtmf.org + +Thanks, +nut + +Note by Thomas Orgis: The contact appears to be dead. diff --git a/node_modules/lame/deps/mpg123/doc/ROAD_TO_LGPL b/node_modules/lame/deps/mpg123/doc/ROAD_TO_LGPL new file mode 100644 index 0000000..c2d2313 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/ROAD_TO_LGPL @@ -0,0 +1,270 @@ +The License of mpg123 +===================== + + by Thomas Orgis <thomas@orgis.org> + +1. Story: The Odyssey, The Decision +----------------------------------- + +This is the 17th of July in the year 2006, after half a year of preparation and the contributor email campaign running for over 3 months, I'm going to draw a conclusion about the licensing of the mpg123 project. + + +The license conditions of mpg123 have been subject to dispute and rejection by parts of the free software world in the past... +We want to have it straight now. +Michael doesn't have much freetime to maintain the code and bother with requests by companies wanting to use mpglib. +So, he already decided to place mpglib under LGPL and mpg123 under GPL in the past. +Now, after I applied for taking over maintainership we decided on placing as much code of the whole project as possible under LGPL to ease future code migration and merging between mpg123 and mpglib. + +That decision was followed by a lot of work to track down as many contributors to both Michael's development tree and my -thor one as possible to ask them for explicit LGPL support statements. +I wrote to every Name/eMail address I could track down (including internet search for new addresses), regardless of the question if there indeed is some code left by that person. +I asked them to utter any problem they may have with LGPL license as well as contacting me if there are _no_ issues. + +Of course, without having to ask again, supporters of LGPL are the initial author and the two current maintainers: + + Michael Hipp + Nicholas J. Humfrey + Thomas Orgis + +Also, new stuff was included with explicit LGPL permission from + + Adrian Bacon + Romain Dolbeau + Guillaume Outters + +Plus there is stuff pending with permission from + + Zuxy Meng + +Now for the folks having made suggestions and contributions over the years... +In the first round starting in March 2006 I wrote the initial mail to anyone I could get. That resulted in some positive responses - examples: + + "I don't remember what I did, but LGPL is fine by me." + + "No problem for me." + + "Any code I may have contributed to the mpg123 project at any time in the +past are hereby licensed to you under the GNU Lesser General Public" + + "it's fine with me if mpg123 goes LGPL. + However, my contribution to mpg123 was very minor, and I'm not even sure if + any of my code is still in the current version." + +A good number of eMail addresses is just broken (years have passed...) and another good number of addresses are either totally unknown or not known to be good or bad since no response (not even bounce - thanks, spam!) came back in over 3 months. + +Some statistics for the first run: 86 total , 15 positive, 37 broken email, 34 unknown + +Positive: + Andreas Neuhaus + Chris Butler + Colin Watson + Daniel Kobras + Daniel O'Connor + Daniel Skarda + Erik B. Andersen + Helge Deller + Juergen Schoew + Martin Denn + Munechika SUMIKAWA + Oliver Fromme + Petr Stehlik + Robert Bihlmeyer + Samuel Audet + Shane Wegner + Stefan Bieschewski + Steven Schultz + Tillmann Steinbrecher + Tomas Oegren + Tommi Virtanen + +Then, an investigation of the code revealed a core of people having actually left traces in the code. +Some more effort was put in tracking them down, with the partial success of having found some new, working email addresses and thus having some more positive responses . +But also, it showed that the main number of people is not reachable anymore. + +Creators (of a whole file, driver...): 16 total, 5 positive, 2 broken email, 9 unknown + +Positive: + Andreas Neuhaus + Juergen Schoew + Oliver Fromme + Petr Stehlik + Samuel Audet + +Modders: 7 total, 1 positive, 2 broken mail, 4 unknown + +Positive: + Tomas Oegren + + +That shows two things: + + 1. It's impossible to get a response from everyone having contributed in some way. + 2. Everyone who I reached supports the license change to LGPL + + +So, for the sake of getting a reasonable step forward, I'm going to close the case. +There are three categories of code: + +1. written by Michael or some other contributor who explicitly supports LGPL + + Clear case: LGPL + +2. contributed years ago without license notice + + The grounded assumption of can be made that the contributor accepted Michael's conditions, esp. the part about the software being available without cost. + Furthermore they gave the code into Michael's hands or placed patches in the internet without any claims concerning commercial uses - wich were not covered by the old COPYING file. + Based on the assumption of acceptance for the mpg123 COPYING file and the included rule of Michael's decision for any further use, this code is to be placed under LGPL by Michael's decision. + +3. contributed with notice + + Some code includes a note about it being GPL. Well, one has to respect that. + + +That results in the bulk of mpg123 being LGPL and possibly some parts GPL only. + + +2. The Inventory +---------------- + +I will now examine the files of the mpg123 svn trunk as of 17.07.2006 with their respective legal status: + +Stuff added by current maintainers, thus being LGPL: + + scripts/debugdef.pl + AUTHORS + autogen.sh + configure.ac + Makefile.am + MakeLegacy.sh + src/audio_jack.c + src/audio_libao.c + src/Makefile.am + src/audio_alsa09.c + src/config.h.legacy + src/debug.h + src/layer3.h + +Non-Code files from Michael, maintainers or just trivial content (safely LGPL, then): + + BENCHMARKING + BUGS + CHANGES + equalize.dat + INSTALL + mpg123.1 + COPYING + TODO + README + README.3DNOW + README.cfa + README.new + README.remote + README.thor + README.WIN32 + test.pl + BENCHMARKING.thor + CONTACT + +sources under LGPLv2.1: + +by Michael: + + audio.c + audio_dummy.c + audio.h + audio_hp.c + audio_oss.c + audio_sun.c + common.c + common.h + dct64.c + dct64_i386.c + decode_2to1.c + decode_4to1.c + decode.c + decode_i386.c + decode_ntom.c + Makefile.legacy + equalizer.c + getbits.c + getbits.h + huffman.h + l2tables.h + layer1.c + layer2.c + layer3.c + mpg123.c + mpg123.h + readers.c + system.c + tabinit.c + term.c + term.h + +by contributors: + + audio_aix.c: Juergen Schoew, Tomas Oegren, Niklas Edmundsson + audio_alib.c: Erwan Ducroquet + audio_esd.c: Eric B. Mitchell + audio_macosx.c: Guillaume Outters + audio_mint.c: Petr Stehlik + audio_nas.c: Martin Denn + audio_os2.c: Samuel Audet + audio_sgi.c: Thomas Woerner + audio_win32.c: Tony Million + buffer.c: Oliver Fromme + buffer.h: Daniel Kobras / Oliver Fromme + control_generic.c: Andreas Neuhaus, Michael Hipp, Thomas Orgis + dct36_3dnow.s: Syuuhei Kashiyama + dct64_3dnow.s: Syuuhei Kashiyama + dct64_altivec.c: Romain Dolbeau + dct64_i486.c: Fabrice Bellard + decode_3dnow.s: Syuuhei Kashiyama + decode_i486.c: Fabrice Bellard + decode_i586_dither.s: Stefan Bieschewski, Adrian Bacon + decode_i586.s: Stefan Bieschewski + decode_MMX.s: higway + dct64_MMX.s: higway + tabinit_MMX.s: higway + equalizer_3dnow.s: KIMURA Takuhiro + genre.h: Shane Wegner + getcpuflags.s: KIMURA Takuhiro + getlopt.c: Oliver Fromme + getlopt.h: Oliver Fromme + httpget.c: Oliver Fromme + wav.c: Samuel Audet + xfermem.c: Oliver Fromme + xfermem.h: Oliver Fromme + Makefile.win32: Michael Hipp / Tony Million + +GPLv2 + + audio_alsa.c: by Anders Semb Hermansen, Jaroslav Kysela, Ville Syrjala + + +To be removed from distribution and thus not licensed in any special way: + +precompiled/ +tools/ + +The mpglib source is not part of the core mpg123 distribution anymore - it's written by Michael, it's LGPL, it shall become a real library with own distribution and be married to mpg123 again. + + +3. Conclusion +------------- + +The decoder core Michael's work and under LGPL without question. +Oliver Fromme is more of a co-author than "just" a project contributor, but he explicitly agreed to LGPL anyway. +So, the core functionality is really safe without doubt. + +Contributors added mainly output drivers (perhaps coming from some freely available reference implementation) and CPU optimizations. +Having explicit permission from a good deal of major contributors, the LGPL is quite comfortable here, too. +I won't hide that there are explicit statements missing for MMX and 3DNow! optimizations (and the i486 opt, for that matter) due to unreachable authors. +But I feel safe to make it LGPL there, too, because of the argument of them having given the code to Michael to incorporate it into mpg123 - without any own terms, implying that they agree to Michael's terms. + +There is one file left that carries an explicit GPL (_no_ LGPL) statement: the old alsa output. This file won't work on current Linux systems, anyway. +Alsa is available through libao. There will probably be a new alsa output. +So, even that one GPL exception may vanish in future, but I'll keep it for now as there may be someone who still has an alsa installation for that it works. + +For now that means mpg123 is LGPL with the exception of one file that is GPL only. + +End. diff --git a/node_modules/lame/deps/mpg123/doc/THANKS b/node_modules/lame/deps/mpg123/doc/THANKS new file mode 100644 index 0000000..b01b668 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/THANKS @@ -0,0 +1,13 @@ +There are authors who write code and there are people who point us to what code to write, show us our errors and generally are trying hard to compensate the time the developers spent coding and not actually using the software. +These people are very valuable, indeed - let's thank our + +Testers (alphapetical): + +- Gabor Z. Papp +- "Gates Fan" +- JonY +- Serge Simon and the R.O.M. 106.5 FM Team (http://www.rom.lu/) + who motivated the --loop and --timeout modes and furthermore supported the maintainer with a donation on sf.net and a real bottle of wine from Luxembourg! +- Willy Tarreau + +Heck, let's thank all of you who contributed bug reports, suggestions... those who took mpg123 source and compiled it on uncommon platforms. diff --git a/node_modules/lame/deps/mpg123/doc/TODO b/node_modules/lame/deps/mpg123/doc/TODO new file mode 100644 index 0000000..63653a7 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/TODO @@ -0,0 +1,63 @@ +We badly need: + - header reorganization (lots of stuff don't belong to mpg123.h) + - integer type safety - STOP using ints where size_t or at least long would be appropriate (expecially stream readers) + - sprintf -> snprintf (maybe with switch to support ancient libc; or replacement by us) + - rewrite httpget.c; that thing has been a can of bugs for years and I understand why when I look at it (way too many cooks) + - really parse ID3V2 tags instead of skipping; done for RVA values... using the string info (just?) needs some Unicode/Locale handling + - check support for fixed point arithmentic; generic_nofpu seems wo work generally, but resampling does not sound nice + +From Nicholas: + - Seperate out MPEG Audio decoder (only) into seperate library + - Allow choice of audio output at runtime, rather than compile time + - Choose processor optimization at runtime, rather than compile time? + +From Michael (some time after/around pre-0.59s): + +- add CRC check. +- add 'free format stream' support. +- optimize layer2.c: + step_two: fraction as pointer .. + process first channel 0 than channel 1 + copy channel 0 to channel 1 for: i >= jsbound +- better frame reader .. especially for layer 3 - DONE by a good deal by Thomas +- MPEG system stream decoder +- check again layer1 !! (Layer-1 support not heavily tested ..) + Problems with Layer1 fl7 reference stream +- Write a special (optimized) 'single channel' decode. +- optimized dct64 for down sampling modes +- native audio support for AIX and DEC +- update manpage +- optimizations for downsampling modes on layer2 and layer1 + +MORE TODO: (partially done) +--------------------------- + +A few notes on how mpg123 tries to select a 'good' +audio encoding and frequency. (not full implemented yet!!) + +- mpg123 tries to set the settings you specify on the command line + in the order of its appearence (exclusiv .. no fallback then) + (-r <rate>, --mono, --stereo, --8bit, etc ) + +- after this, mpg123 tries to set + 1. the number of channels (or fallback to mono if stereo isn't possible) + 2. the audioformat to 16 bit (or fallback to 8bit) + 3. the "best" frequency: (in this order) + - the exact stream frequency or fallback to + - 2:1 frequency or fallback to + - 4:1 frequency or try the + - nearest frequency lower than the frequency of your stream + mpg123 automagically converts the rate. + +So, if you think (or even know), that your hardware supports a higher +frequency only with eg. mono,8bit you must force mpg123 to play mono +and 8bit. ("--8bit -m") etc.... + +If you wanna a constant format eg to output the data to stdout you +must explicit force it with eg: '-r 44100 --stereo' +Else the format will be the format of the mpeg stream. + + + + + diff --git a/node_modules/lame/deps/mpg123/doc/doxy_examples.c b/node_modules/lame/deps/mpg123/doc/doxy_examples.c new file mode 100644 index 0000000..6fc851b --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/doxy_examples.c @@ -0,0 +1,21 @@ +/** \defgroup mpg123_examples example programs using libmpg123 + @{ */ + +/** \file mpg123_to_wav.c A simple MPEG audio to WAV converter using libmpg123 (read) and libsndfile (write). + ...an excersize on two simple APIs. */ + +/** \file mpglib.c Example program mimicking the old mpglib test program. + It takes an MPEG bitstream from standard input and writes raw audio to standard output. + This is an use case of the mpg123_decode() in and out function in the feeder mode, quite close to classic mpglib usage and thus a template to convert from that to libmpg123. +*/ + +/** \file scan.c Example program that examines the exact length of an MPEG file. + It opens a list of files and does mpg123_scan() on each and reporting the mpg123_length() before and after that. */ + +/** \file id3dump.c Parse ID3 info and print to standard output. */ + +/** \file extract_frames.c Parse stream and extract only the valid MPEG frames to standard output. */ + +/** \file feedseek.c Fuzzy feeder seeking. */ + +/* @} */ diff --git a/node_modules/lame/deps/mpg123/doc/doxygen.conf b/node_modules/lame/deps/mpg123/doc/doxygen.conf new file mode 100644 index 0000000..74616c7 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/doxygen.conf @@ -0,0 +1,41 @@ + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# + +PROJECT_NAME = "libmpg123" +OUTPUT_DIRECTORY = . +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +FULL_PATH_NAMES = NO + +INPUT = doxy_examples.c examples/mpg123_to_wav.c examples/mpglib.c examples/scan.c examples/feedseek.c examples/id3dump.c ../src/libmpg123/mpg123.h +OPTIMIZE_OUTPUT_FOR_C = YES +EXTRACT_ALL = NO +HIDE_UNDOC_MEMBERS = NO +QUIET = YES +WARNINGS = YES +SOURCE_BROWSER = YES + +GENERATE_HTML = YES +HTML_OUTPUT = html +DISABLE_INDEX = YES +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +ENUM_VALUES_PER_LINE = 2 + + +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +PREDEFINED = EXPORT= + +GENERATE_HTML = YES +GENERATE_LATEX = NO +GENERATE_RTF = NO +GENERATE_MAN = YES +MAN_LINKS = YES +GENERATE_XML = NO + +HTML_HEADER = doxyhead.xhtml +HTML_FILE_EXTENSION = .shtml diff --git a/node_modules/lame/deps/mpg123/doc/doxyhead.xhtml b/node_modules/lame/deps/mpg123/doc/doxyhead.xhtml new file mode 100644 index 0000000..87186f3 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/doxyhead.xhtml @@ -0,0 +1,12 @@ +<!--#include virtual="../header.html" --> +<title>$title + + + + +
+ Note: + This API doc is automatically generated from the current development version that you can get via Subversion or as a daily snapshot from http://mpg123.org/snapshot. + There may be differences (additions) compared to the latest stable release. See NEWS.libmpg123 and the overall NEWS file on libmpg123 versions and important changes between them.
+ Let me emphasize that the policy for libmpg123 is to always stay backwards compatible -- only additions are planned (and it's not yet planned to change the plans;-). +
diff --git a/node_modules/lame/deps/mpg123/doc/examples/Makefile b/node_modules/lame/deps/mpg123/doc/examples/Makefile new file mode 100644 index 0000000..52f1b07 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/examples/Makefile @@ -0,0 +1,48 @@ +targets = feedseek mpg123_to_wav mpg123_to_wav_replaced_io scan id3dump mpglib dump_seekindex extract_frames + +all: $(targets) + +# On largefile-aware systems you might want to use these instead: +#MPG123_CFLAGS := $(shell pkg-config --cflags libmpg123_64) +#MPG123_LDFLAGS := $(shell pkg-config --libs libmpg123_64) +# This works on sane setups where off_t is off_t, and just that. +ifeq ($(MPG123_PREFIX),) + MPG123_CFLAGS := $(shell pkg-config --cflags libmpg123) + MPG123_LDFLAGS := $(shell pkg-config --libs libmpg123) +else # Yeah, that's with GNU/Linux in mind, at least GNU ld ... + MPG123_CFLAGS := -I$(MPG123_PREFIX)/include + MPG123_LDFLAGS := -L$(MPG123_PREFIX)/lib -Wl,-rpath $(MPG123_PREFIX)/lib -lmpg123 +endif +SND_CFLAGS := $(shell pkg-config --cflags sndfile) +SND_LDFLAGS := $(shell pkg-config --libs sndfile) + +# Oder of libs not that important here... +compile = $(CC) $(CPPFLAGS) $(CFLAGS) $(MPG123_CFLAGS) +linkflags = $(MPG123_LDFLAGS) $(LDFLAGS) + +mpg123_to_wav: mpg123_to_wav.c + $(compile) -o mpg123_to_wav mpg123_to_wav.c $(SND_CFLAGS) $(SND_LDFLAGS) $(linkflags) + +mpg123_to_wav_replaced_io: mpg123_to_wav_replaced_io.c + $(compile) -o $@ $< $(SND_CFLAGS) $(SND_LDFLAGS) $(linkflags) + +feedseek: feedseek.c + $(compile) -o feedseek feedseek.c $(linkflags) + +scan: scan.c + $(compile) -o scan scan.c $(linkflags) + +id3dump:id3dump.c + $(compile) -o id3dump id3dump.c $(linkflags) + +dump_seekindex: dump_seekindex.c + $(compile) -o dump_seekindex dump_seekindex.c $(linkflags) + +mpglib: mpglib.c + $(compile) -o mpglib mpglib.c $(linkflags) + +extract_frames: extract_frames.c + $(compile) -o $@ $< $(linkflags) + +clean: + rm -vf $(targets) diff --git a/node_modules/lame/deps/mpg123/doc/examples/dump_seekindex.c b/node_modules/lame/deps/mpg123/doc/examples/dump_seekindex.c new file mode 100644 index 0000000..9b6dae0 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/examples/dump_seekindex.c @@ -0,0 +1,41 @@ +/* + dump_seekindex: Scan a mpeg file and dump its seek index. + + copyright 2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Patrick Dehne +*/ + +#include +#include + +int main(int argc, char **argv) +{ + mpg123_handle *m; + off_t* offsets; + off_t step; + size_t fill, i; + + if(argc != 2) + { + fprintf(stderr, "\nI will dump the frame index of an MPEG audio file.\n"); + fprintf(stderr, "\nUsage: %s \n\n", argv[0]); + return -1; + } + mpg123_init(); + m = mpg123_new(NULL, NULL); + mpg123_param(m, MPG123_RESYNC_LIMIT, -1, 0); + mpg123_param(m, MPG123_INDEX_SIZE, -1, 0); + mpg123_open(m, argv[1]); + mpg123_scan(m); + + mpg123_index(m, &offsets, &step, &fill); + for(i=0; i + +/* unistd.h is not available under MSVC, + io.h defines the read and write functions */ +#ifndef _MSC_VER +#include +#else +#include +#endif + +#include + +int do_work(mpg123_handle *m); + +int main(int argc, char **argv) +{ + int ret = 0; + mpg123_handle *m; + + mpg123_init(); + m = mpg123_new(NULL, &ret); + + if(m == NULL) + { + fprintf(stderr, "Cannot create handle: %s", mpg123_plain_strerror(ret)); + } + else + { + fprintf(stderr, "I'll take your dirty MPEG audio from standard input and will write the extrated pure MPEG data to stadard output.\n"); + if(argc > 1 && strcmp(argv[1], "--noinfo") == 0) + { + fprintf(stderr, "Enabling parsing/consuming of the Info frame so that it will not appear in output.\n"); + ret = mpg123_param(m, MPG123_REMOVE_FLAGS, MPG123_IGNORE_INFOFRAME, 0.); + } + else + { + fprintf(stderr, "If you'd have given --noinfo as argument, I would omit a LAME/Xing info frame.\n"); + ret = mpg123_param(m, MPG123_ADD_FLAGS, MPG123_IGNORE_INFOFRAME, 0.); + } + if(ret == 0) ret = do_work(m); + + if(ret != 0) fprintf(stderr, "Some error occured: %s\n", mpg123_strerror(m)); + + + mpg123_delete(m); /* Closes, too. */ + } + mpg123_exit(); + + return ret; +} + +int do_work(mpg123_handle *m) +{ + int ret; + size_t count = 0; + ret = mpg123_open_fd(m, STDIN_FILENO); + if(ret != MPG123_OK) return ret; + + while( (ret = mpg123_framebyframe_next(m)) == MPG123_OK || ret == MPG123_NEW_FORMAT ) + { + unsigned long header; + unsigned char *bodydata; + size_t bodybytes; + if(mpg123_framedata(m, &header, &bodydata, &bodybytes) == MPG123_OK) + { + /* Need to extract the 4 header bytes from the native storage in the correct order. */ + unsigned char hbuf[4]; + int i; + for(i=0; i<4; ++i) hbuf[i] = (unsigned char) ((header >> ((3-i)*8)) & 0xff); + + /* Now write out both header and data, fire and forget. */ + write(STDOUT_FILENO, hbuf, 4); + write(STDOUT_FILENO, bodydata, bodybytes); + fprintf(stderr, "%zu: header 0x%08x, %zu body bytes\n", ++count, header, bodybytes); + } + } + + if(ret != MPG123_DONE) + fprintf(stderr, "Some error occured (non-fatal?): %s\n", mpg123_strerror(m)); + + fprintf(stderr, "Done with %zu MPEG frames.\n", count); + + return 0; +} diff --git a/node_modules/lame/deps/mpg123/doc/examples/feedseek.c b/node_modules/lame/deps/mpg123/doc/examples/feedseek.c new file mode 100644 index 0000000..8f68d17 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/examples/feedseek.c @@ -0,0 +1,238 @@ +/* + feedseek: test program for libmpg123, showing how to use fuzzy seeking in feeder mode + copyright 2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#include +#include + +#define INBUFF 16384 * 2 * 2 +#define WAVE_FORMAT_PCM 0x0001 +#define WAVE_FORMAT_IEEE_FLOAT 0x0003 + +FILE *out; +size_t totaloffset, dataoffset; +long rate; +int channels, enc; +unsigned short bitspersample, wavformat; + +// write wav header +void initwav() +{ + unsigned int tmp32 = 0; + unsigned short tmp16 = 0; + + fwrite("RIFF", 1, 4, out); + totaloffset = ftell(out); + + fwrite(&tmp32, 1, 4, out); // total size + fwrite("WAVE", 1, 4, out); + fwrite("fmt ", 1, 4, out); + tmp32 = 16; + fwrite(&tmp32, 1, 4, out); // format length + tmp16 = wavformat; + fwrite(&tmp16, 1, 2, out); // format + tmp16 = channels; + fwrite(&tmp16, 1, 2, out); // channels + tmp32 = rate; + fwrite(&tmp32, 1, 4, out); // sample rate + tmp32 = rate * bitspersample/8 * channels; + fwrite(&tmp32, 1, 4, out); // bytes / second + tmp16 = bitspersample/8 * channels; // float 16 or signed int 16 + fwrite(&tmp16, 1, 2, out); // block align + tmp16 = bitspersample; + fwrite(&tmp16, 1, 2, out); // bits per sample + fwrite("data ", 1, 4, out); + tmp32 = 0; + dataoffset = ftell(out); + fwrite(&tmp32, 1, 4, out); // data length +} + +// rewrite wav header with final length infos +void closewav() +{ + unsigned int tmp32 = 0; + unsigned short tmp16 = 0; + + long total = ftell(out); + fseek(out, totaloffset, SEEK_SET); + tmp32 = total - (totaloffset + 4); + fwrite(&tmp32, 1, 4, out); + fseek(out, dataoffset, SEEK_SET); + tmp32 = total - (dataoffset + 4); + + fwrite(&tmp32, 1, 4, out); +} + +// determine correct wav format and bits per sample +// from mpg123 enc value +void initwavformat() +{ + if(enc & MPG123_ENC_FLOAT_64) + { + bitspersample = 64; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if(enc & MPG123_ENC_FLOAT_32) + { + bitspersample = 32; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if(enc & MPG123_ENC_16) + { + bitspersample = 16; + wavformat = WAVE_FORMAT_PCM; + } + else + { + bitspersample = 8; + wavformat = WAVE_FORMAT_PCM; + } +} + +int main(int argc, char **argv) +{ + unsigned char buf[INBUFF]; + unsigned char *audio; + FILE *in; + mpg123_handle *m; + int ret, state; + size_t inc, outc; + off_t len, num; + size_t bytes; + off_t inoffset; + inc = outc = 0; + + if(argc < 3) + { + fprintf(stderr,"Please supply in and out filenames\n"); + return -1; + } + + mpg123_init(); + + m = mpg123_new(NULL, &ret); + if(m == NULL) + { + fprintf(stderr,"Unable to create mpg123 handle: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + mpg123_param(m, MPG123_VERBOSE, 2, 0); + + ret = mpg123_param(m, MPG123_FLAGS, MPG123_FUZZY | MPG123_SEEKBUFFER | MPG123_GAPLESS, 0); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to set library options: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + // Let the seek index auto-grow and contain an entry for every frame + ret = mpg123_param(m, MPG123_INDEX_SIZE, -1, 0); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to set index size: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + ret = mpg123_format_none(m); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to disable all output formats: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + // Use float output + ret = mpg123_format(m, 44100, MPG123_MONO | MPG123_STEREO, MPG123_ENC_FLOAT_32); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to set float output formats: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + ret = mpg123_open_feed(m); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable open feed: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + in = fopen(argv[1], "rb"); + if(in == NULL) + { + fprintf(stderr,"Unable to open input file %s\n", argv[1]); + return -1; + } + + out = fopen(argv[2], "wb"); + if(out == NULL) + { + fclose(in); + fprintf(stderr,"Unable to open output file %s\n", argv[2]); + return -1; + } + + fprintf(stderr, "Seeking...\n"); + /* That condition is tricky... parentheses are crucial... */ + while((ret = mpg123_feedseek(m, 95000, SEEK_SET, &inoffset)) == MPG123_NEED_MORE) + { + len = fread(buf, sizeof(unsigned char), INBUFF, in); + if(len <= 0) + break; + inc += len; + + state = mpg123_feed(m, buf, len); + if(state == MPG123_ERR) + { + fprintf(stderr, "Error: %s", mpg123_strerror(m)); + return -1; + } + } + if(ret == MPG123_ERR) + { + fprintf(stderr, "Feedseek failed: %s\n", mpg123_strerror(m)); + return -1; + } + + fseek(in, inoffset, SEEK_SET); + + fprintf(stderr, "Starting decode...\n"); + while(1) + { + len = fread(buf, sizeof(unsigned char), INBUFF, in); + if(len <= 0) + break; + inc += len; + ret = mpg123_feed(m, buf, len); + + while(ret != MPG123_ERR && ret != MPG123_NEED_MORE) + { + ret = mpg123_decode_frame(m, &num, &audio, &bytes); + if(ret == MPG123_NEW_FORMAT) + { + mpg123_getformat(m, &rate, &channels, &enc); + initwavformat(); + initwav(); + fprintf(stderr, "New format: %li Hz, %i channels, encoding value %i\n", rate, channels, enc); + } + fwrite(audio, sizeof(unsigned char), bytes, out); + outc += bytes; + } + + if(ret == MPG123_ERR) + { + fprintf(stderr, "Error: %s", mpg123_strerror(m)); + break; + } + } + + fprintf(stderr, "Finished\n", (unsigned long)inc, (unsigned long)outc); + + closewav(); + fclose(out); + fclose(in); + mpg123_delete(m); + mpg123_exit(); + return 0; +} diff --git a/node_modules/lame/deps/mpg123/doc/examples/id3dump.c b/node_modules/lame/deps/mpg123/doc/examples/id3dump.c new file mode 100644 index 0000000..649e331 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/examples/id3dump.c @@ -0,0 +1,178 @@ +/* + id3dump: Print ID3 tags of files, scanned using libmpg123. + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "mpg123.h" +#include +#include "stdio.h" +#include "sys/types.h" + +/* Helper for v1 printing, get these strings their zero byte. */ +void safe_print(char* name, char *data, size_t size) +{ + char safe[31]; + if(size>30) return; + + memcpy(safe, data, size); + safe[size] = 0; + printf("%s: %s\n", name, safe); +} + +/* Print out ID3v1 info. */ +void print_v1(mpg123_id3v1 *v1) +{ + safe_print("Title", v1->title, sizeof(v1->title)); + safe_print("Artist", v1->artist, sizeof(v1->artist)); + safe_print("Album", v1->album, sizeof(v1->album)); + safe_print("Year", v1->year, sizeof(v1->year)); + safe_print("Comment", v1->comment, sizeof(v1->comment)); + printf("Genre: %i", v1->genre); +} + +/* Split up a number of lines separated by \n, \r, both or just zero byte + and print out each line with specified prefix. */ +void print_lines(const char* prefix, mpg123_string *inlines) +{ + size_t i; + int hadcr = 0, hadlf = 0; + char *lines = NULL; + char *line = NULL; + size_t len = 0; + + if(inlines != NULL && inlines->fill) + { + lines = inlines->p; + len = inlines->fill; + } + else return; + + line = lines; + for(i=0; ititle); + print_lines("Artist: ", v2->artist); + print_lines("Album: ", v2->album); + print_lines("Year: ", v2->year); + print_lines("Comment: ", v2->comment); + print_lines("Genre: ", v2->genre); +} + +/* Print out all stored ID3v2 fields with their 4-character IDs. */ +void print_raw_v2(mpg123_id3v2 *v2) +{ + size_t i; + for(i=0; itexts; ++i) + { + char id[5]; + char lang[4]; + memcpy(id, v2->text[i].id, 4); + id[4] = 0; + memcpy(lang, v2->text[i].lang, 3); + lang[3] = 0; + if(v2->text[i].description.fill) + printf("%s language(%s) description(%s)\n", id, lang, v2->text[i].description.p); + else printf("%s language(%s)\n", id, lang); + + print_lines(" ", &v2->text[i].text); + } + for(i=0; iextras; ++i) + { + char id[5]; + memcpy(id, v2->extra[i].id, 4); + id[4] = 0; + printf( "%s description(%s)\n", + id, + v2->extra[i].description.fill ? v2->extra[i].description.p : "" ); + print_lines(" ", &v2->extra[i].text); + } + for(i=0; icomments; ++i) + { + char id[5]; + char lang[4]; + memcpy(id, v2->comment_list[i].id, 4); + id[4] = 0; + memcpy(lang, v2->comment_list[i].lang, 3); + lang[3] = 0; + printf( "%s description(%s) language(%s): \n", + id, + v2->comment_list[i].description.fill ? v2->comment_list[i].description.p : "", + lang ); + print_lines(" ", &v2->comment_list[i].text); + } +} + +int main(int argc, char **argv) +{ + int i; + mpg123_handle* m; + if(argc < 2) + { + fprintf(stderr, "\nI will print some ID3 tag fields of MPEG audio files.\n"); + fprintf(stderr, "\nUsage: %s \n\n", argv[0]); + return -1; + } + mpg123_init(); + m = mpg123_new(NULL, NULL); + + for(i=1; i < argc; ++i) + { + mpg123_id3v1 *v1; + mpg123_id3v2 *v2; + int meta; + if(mpg123_open(m, argv[i]) != MPG123_OK) + { + fprintf(stderr, "Cannot open %s: %s\n", argv[i], mpg123_strerror(m)); + continue; + } + mpg123_scan(m); + meta = mpg123_meta_check(m); + if(meta & MPG123_ID3 && mpg123_id3(m, &v1, &v2) == MPG123_OK) + { + printf("Tag data on %s:\n", argv[i]); + printf("\n==== ID3v1 ====\n"); + if(v1 != NULL) print_v1(v1); + + printf("\n==== ID3v2 ====\n"); + if(v2 != NULL) print_v2(v2); + + printf("\n==== ID3v2 Raw frames ====\n"); + if(v2 != NULL) print_raw_v2(v2); + } + else printf("Nothing found for %s.\n", argv[i]); + + mpg123_close(m); + } + mpg123_delete(m); + mpg123_exit(); + return 0; +} diff --git a/node_modules/lame/deps/mpg123/doc/examples/mpg123_to_wav.c b/node_modules/lame/deps/mpg123/doc/examples/mpg123_to_wav.c new file mode 100644 index 0000000..9193875 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/examples/mpg123_to_wav.c @@ -0,0 +1,118 @@ +/* + mpg123_to_wav.c + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Nicholas Humfrey +*/ + +#include +#include +#include +#include + + +void usage() +{ + printf("Usage: mpg123_to_wav [s16|f32 [ ]]\n"); + exit(99); +} + +void cleanup(mpg123_handle *mh) +{ + /* It's really to late for error checks here;-) */ + mpg123_close(mh); + mpg123_delete(mh); + mpg123_exit(); +} + +int main(int argc, char *argv[]) +{ + SNDFILE* sndfile = NULL; + SF_INFO sfinfo; + mpg123_handle *mh = NULL; + unsigned char* buffer = NULL; + size_t buffer_size = 0; + size_t done = 0; + int channels = 0, encoding = 0; + long rate = 0; + int err = MPG123_OK; + off_t samples = 0; + + if (argc<3) usage(); + printf( "Input file: %s\n", argv[1]); + printf( "Output file: %s\n", argv[2]); + + err = mpg123_init(); + if(err != MPG123_OK || (mh = mpg123_new(NULL, &err)) == NULL) + { + fprintf(stderr, "Basic setup goes wrong: %s", mpg123_plain_strerror(err)); + cleanup(mh); + return -1; + } + + /* Simple hack to enable floating point output. */ + if(argc >= 4 && !strcmp(argv[3], "f32")) mpg123_param(mh, MPG123_ADD_FLAGS, MPG123_FORCE_FLOAT, 0.); + + /* Let mpg123 work with the file, that excludes MPG123_NEED_MORE messages. */ + if( mpg123_open(mh, argv[1]) != MPG123_OK + /* Peek into track and get first output format. */ + || mpg123_getformat(mh, &rate, &channels, &encoding) != MPG123_OK ) + { + fprintf( stderr, "Trouble with mpg123: %s\n", mpg123_strerror(mh) ); + cleanup(mh); + return -1; + } + + if(encoding != MPG123_ENC_SIGNED_16 && encoding != MPG123_ENC_FLOAT_32) + { /* Signed 16 is the default output format anyways; it would actually by only different if we forced it. + So this check is here just for this explanation. */ + cleanup(mh); + fprintf(stderr, "Bad encoding: 0x%x!\n", encoding); + return -2; + } + /* Ensure that this output format will not change (it could, when we allow it). */ + mpg123_format_none(mh); + mpg123_format(mh, rate, channels, encoding); + + bzero(&sfinfo, sizeof(sfinfo) ); + sfinfo.samplerate = rate; + sfinfo.channels = channels; + sfinfo.format = SF_FORMAT_WAV|(encoding == MPG123_ENC_SIGNED_16 ? SF_FORMAT_PCM_16 : SF_FORMAT_FLOAT); + printf("Creating WAV with %i channels and %liHz.\n", channels, rate); + + sndfile = sf_open(argv[2], SFM_WRITE, &sfinfo); + if(sndfile == NULL){ fprintf(stderr, "Cannot open output file!\n"); cleanup(mh); return -2; } + + /* Buffer could be almost any size here, mpg123_outblock() is just some recommendation. + Important, especially for sndfile writing, is that the size is a multiple of sample size. */ + buffer_size = argc >= 5 ? atol(argv[4]) : mpg123_outblock(mh); + buffer = malloc( buffer_size ); + + do + { + sf_count_t more_samples; + err = mpg123_read( mh, buffer, buffer_size, &done ); + more_samples = encoding == MPG123_ENC_SIGNED_16 + ? sf_write_short(sndfile, (short*)buffer, done/sizeof(short)) + : sf_write_float(sndfile, (float*)buffer, done/sizeof(float)); + if(more_samples < 0 || more_samples*mpg123_encsize(encoding) != done) + { + fprintf(stderr, "Warning: Written number of samples does not match the byte count we got from libmpg123: %li != %li\n", (long)(more_samples*mpg123_encsize(encoding)), (long)done); + } + samples += more_samples; + /* We are not in feeder mode, so MPG123_OK, MPG123_ERR and MPG123_NEW_FORMAT are the only possibilities. + We do not handle a new format, MPG123_DONE is the end... so abort on anything not MPG123_OK. */ + } while (err==MPG123_OK); + + if(err != MPG123_DONE) + fprintf( stderr, "Warning: Decoding ended prematurely because: %s\n", + err == MPG123_ERR ? mpg123_strerror(mh) : mpg123_plain_strerror(err) ); + + sf_close( sndfile ); + + samples /= channels; + printf("%li samples written.\n", (long)samples); + cleanup(mh); + return 0; +} diff --git a/node_modules/lame/deps/mpg123/doc/examples/mpglib.c b/node_modules/lame/deps/mpg123/doc/examples/mpglib.c new file mode 100644 index 0000000..4ee1a1d --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/examples/mpglib.c @@ -0,0 +1,92 @@ +/* + mpglib: test program for libmpg123, in the style of the legacy mpglib test program + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include + +/* unistd.h is not available under MSVC, + io.h defines the read and write functions */ +#ifndef _MSC_VER +#include +#else +#include +#endif + +#ifdef _WIN32 +#include +#endif + +#include + +#define INBUFF 16384 +#define OUTBUFF 32768 + +int main(int argc, char **argv) +{ + size_t size; + unsigned char buf[INBUFF]; /* input buffer */ + unsigned char out[OUTBUFF]; /* output buffer */ + ssize_t len; + int ret; + size_t in = 0, outc = 0; + mpg123_handle *m; + +#ifdef _WIN32 +_setmode(_fileno(stdin),_O_BINARY); +_setmode(_fileno(stdout),_O_BINARY); +#endif + + mpg123_init(); + m = mpg123_new(argc > 1 ? argv[1] : NULL, &ret); + if(m == NULL) + { + fprintf(stderr,"Unable to create mpg123 handle: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + mpg123_param(m, MPG123_VERBOSE, 2, 0); /* Brabble a bit about the parsing/decoding. */ + + /* Now mpg123 is being prepared for feeding. The main loop will read chunks from stdin and feed them to mpg123; + then take decoded data as available to write to stdout. */ + mpg123_open_feed(m); + if(m == NULL) return -1; + + fprintf(stderr, "Feed me some MPEG audio to stdin, I will decode to stdout.\n"); + while(1) /* Read and write until everything is through. */ + { + len = read(0,buf,INBUFF); + if(len <= 0) + { + fprintf(stderr, "input data end\n"); + break; + } + in += len; + /* Feed input chunk and get first chunk of decoded audio. */ + ret = mpg123_decode(m,buf,len,out,OUTBUFF,&size); + if(ret == MPG123_NEW_FORMAT) + { + long rate; + int channels, enc; + mpg123_getformat(m, &rate, &channels, &enc); + fprintf(stderr, "New format: %li Hz, %i channels, encoding value %i\n", rate, channels, enc); + } + write(1,out,size); + outc += size; + while(ret != MPG123_ERR && ret != MPG123_NEED_MORE) + { /* Get all decoded audio that is available now before feeding more input. */ + ret = mpg123_decode(m,NULL,0,out,OUTBUFF,&size); + write(1,out,size); + outc += size; + } + if(ret == MPG123_ERR){ fprintf(stderr, "some error: %s", mpg123_strerror(m)); break; } + } + fprintf(stderr, "%lu bytes in, %lu bytes out\n", (unsigned long)in, (unsigned long)outc); + + /* Done decoding, now just clean up and leave. */ + mpg123_delete(m); + mpg123_exit(); + return 0; +} diff --git a/node_modules/lame/deps/mpg123/doc/examples/scan.c b/node_modules/lame/deps/mpg123/doc/examples/scan.c new file mode 100644 index 0000000..df9b999 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/examples/scan.c @@ -0,0 +1,47 @@ +/* + scan: Estimate length (sample count) of a mpeg file and compare to length from exact scan. + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +/* Note the lack of error checking here. + While it would be nicer to inform the user about troubles, libmpg123 is designed _not_ to bite you on operations with invalid handles , etc. + You just jet invalid results on invalid operations... */ + +#include +#include + +int main(int argc, char **argv) +{ + mpg123_handle *m; + int i; + if(argc < 2) + { + fprintf(stderr, "\nI will give you the estimated and exact sample lengths of MPEG audio files.\n"); + fprintf(stderr, "\nUsage: %s \n\n", argv[0]); + return -1; + } + mpg123_init(); + m = mpg123_new(NULL, NULL); + mpg123_param(m, MPG123_RESYNC_LIMIT, -1, 0); /* New in library version 0.0.1 . */ + for(i = 1; i < argc; ++i) + { + off_t a, b; + + mpg123_open(m, argv[i]); + + a = mpg123_length(m); + mpg123_scan(m); + b = mpg123_length(m); + + mpg123_close(m); + + printf("File %i: estimated %li vs. scanned %li\n", i, (long)a, (long)b); + } + + mpg123_delete(m); + mpg123_exit(); + return 0; +} diff --git a/node_modules/lame/deps/mpg123/doc/libmpg123_speed.txt b/node_modules/lame/deps/mpg123/doc/libmpg123_speed.txt new file mode 100644 index 0000000..1d48648 --- /dev/null +++ b/node_modules/lame/deps/mpg123/doc/libmpg123_speed.txt @@ -0,0 +1,84 @@ +This is historic... one should make a new investigation. +What I can say that a quick test of pre0.59s versus 1.7.3 with generic decoder on my x86-64 GNU/Linux box is not able to call a winner (or looser, for that matter). +Though, 1.8.0 will make the new libmpg123 a winner, because there is new optimization code going on! + +The move to libmpg123 means some more code separation / interfacing and especially the move of any local static variables into the mpg123_handle to make multiple stream handling possible. +That may very well have an impact on performance of the mpg123 decoder. +I made some tests, even using gcc's -pg option and gprof, with mixed result: SSE and MMX on my Thinkpad X31 are slower, especially the asm synth funtion, while the generic code is fine. +On the other hand, on a K6-3+ using the same gcc version 4.1.2, the library based mpg123 is _faster_ for MMX and 3DNowExt. +Epecially the mmx synth is faster... while the 3DNowExt synth is slower, too (it's the same code as SSE synth, just calling different dct64) - but speedups in other regions still make 3DNowExt of the library mpg123 more efficient. + +What I can clearly say is that dropping the multi-cpu support via ./configure --with-cpu does help in for both monolithic and library mpg123, but that is no wonder as it removes indirection. +The main point stays, though: On my Thinkpad the library is slow, on the K6-3+ it's fast. + +What's the point to get here? I am not sure. We're depending on the compiler optimization (btw: Intel Compiler doesn't change the relation for the Thinkpad; not tested on the K6). +I guess that for my Thinkpad another gcc version could invert the picture again... +Also, I am not sure how far I should trust the gprof analysis... but it can be right; even when there is no apparent cause for the speed difference in the code itself, it could be some effect of cache and memory access. +Some reordering of instructions and data... for sure that happened. + +I'll need further numbers to conclude anything about the (positive/negative) impact my code changes have. + +OK, ran the test of trunk against branches/mpg123lib on my media box with AMD Geode (AthlonXP, actually): + +thomas@kiste:~$ for i in mpg123-lib mpg123-trunk; do for cpu in mmx 3dnowext sse; do echo $i $cpu; time $i/src/mpg123 --cpu $cpu -q -t /thorma/var/music/metallica/ride_the_lightning/*.mp3; done; done +mpg123-lib mmx + +real 0m25.949s +user 0m25.395s +sys 0m0.534s +mpg123-lib 3dnowext + +real 0m25.442s +user 0m24.863s +sys 0m0.558s +mpg123-lib sse + +real 0m25.794s +user 0m25.214s +sys 0m0.562s +mpg123-trunk mmx + +real 0m26.650s +user 0m26.004s +sys 0m0.626s +mpg123-trunk 3dnowext + +real 0m25.886s +user 0m25.262s +sys 0m0.600s +mpg123-trunk sse + +real 0m25.695s +user 0m25.136s +sys 0m0.539s +thomas@kiste:~$ for i in mpg123-lib mpg123-trunk; do for cpu in 3dnow; do echo $i $cpu; time $i/src/mpg123 --cpu $cpu -q -t /thorma/var/music/metallica/ride_the_lightning/*.mp3; done; done +mpg123-lib 3dnow + +real 0m33.011s +user 0m32.365s +sys 0m0.621s +mpg123-trunk 3dnow + +real 0m32.830s +user 0m32.192s +sys 0m0.619s + + +You can't really make a decision there. It's tight. +What worries me a bit is the total loose of 3DNow against MMX - should it be that drastic? +Well, it's higher quality, at least. + + +Addendum: The game on an K6-3+ + +On mpg123 < 1.8.0, he 3DNowExt decoder used to be slower than the 3DNow decoder. Only recently it has been observed, that the simplification of the runtime decoder choice code sped up that one significantly, towards the same performance level as the single-decoder build of mpg123 1.6.4 (-with-cpu=3dnowext_alone having broken build in later versions:-/). +We are talking about a difference of 20% here... there is something special about the K6-3+ that makes is that sensitive to how the function pointers get thrown around. + +Example numbers: Dynamic x86 build of 1.6.4, 3DNowExt needs 5.9 s, 3DNow 5.6 s. +3DNowExt-only build: 4.9 s +3DNow-only build: 5.6 s +Now... dynamic build of mpg123 trunk of 2010-05-24: 3DNowExt 4.9 s, 3DNow 5.6 s. That's how it should be. One might investigate how exactly the old ways before mpg123 1.8 worked against the K6-3+ ... possibly helping performance issues seen with the mpg123 coded for MPlayer on that CPU. + +-- +Thomas. + diff --git a/node_modules/lame/deps/mpg123/equalize.dat b/node_modules/lame/deps/mpg123/equalize.dat new file mode 100644 index 0000000..8cefb34 --- /dev/null +++ b/node_modules/lame/deps/mpg123/equalize.dat @@ -0,0 +1,37 @@ +# in every line, there are two values. One for the left +# and one for the right cahnnel. +# the first line is the multiplicator for the lowest frequency band +# the 32th line for the highest freq. band +# +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 +1.0 1.0 diff --git a/node_modules/lame/deps/mpg123/libmpg123.pc.in b/node_modules/lame/deps/mpg123/libmpg123.pc.in new file mode 100644 index 0000000..198ff70 --- /dev/null +++ b/node_modules/lame/deps/mpg123/libmpg123.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libmpg123 +Description: An optimised MPEG Audio decoder +Requires: +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lmpg123 +Cflags: -I${includedir} diff --git a/node_modules/lame/deps/mpg123/m4/addrconfig.m4 b/node_modules/lame/deps/mpg123/m4/addrconfig.m4 new file mode 100644 index 0000000..5494509 --- /dev/null +++ b/node_modules/lame/deps/mpg123/m4/addrconfig.m4 @@ -0,0 +1,34 @@ +dnl Check whether the AI_ADDRCONFIG flag can be used with getaddrinfo +dnl Taken from APR ... +AC_DEFUN([APR_CHECK_GETADDRINFO_ADDRCONFIG], [ + AC_CACHE_CHECK(for working AI_ADDRCONFIG, apr_cv_gai_addrconfig, [ + AC_TRY_RUN([ +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +int main(int argc, char **argv) { + struct addrinfo hints, *ai; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_ADDRCONFIG; + return getaddrinfo("localhost", NULL, &hints, &ai) != 0; +}], [apr_cv_gai_addrconfig=yes], + [apr_cv_gai_addrconfig=no], + [apr_cv_gai_addrconfig=no])]) + +if test $apr_cv_gai_addrconfig = yes; then + AC_DEFINE(HAVE_GAI_ADDRCONFIG, 1, [Define if getaddrinfo accepts the AI_ADDRCONFIG flag]) +fi +]) diff --git a/node_modules/lame/deps/mpg123/m4/libtool.m4 b/node_modules/lame/deps/mpg123/m4/libtool.m4 new file mode 100644 index 0000000..44e0ecf --- /dev/null +++ b/node_modules/lame/deps/mpg123/m4/libtool.m4 @@ -0,0 +1,7982 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/node_modules/lame/deps/mpg123/m4/ltoptions.m4 b/node_modules/lame/deps/mpg123/m4/ltoptions.m4 new file mode 100644 index 0000000..5d9acd8 --- /dev/null +++ b/node_modules/lame/deps/mpg123/m4/ltoptions.m4 @@ -0,0 +1,384 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/node_modules/lame/deps/mpg123/m4/ltsugar.m4 b/node_modules/lame/deps/mpg123/m4/ltsugar.m4 new file mode 100644 index 0000000..9000a05 --- /dev/null +++ b/node_modules/lame/deps/mpg123/m4/ltsugar.m4 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/node_modules/lame/deps/mpg123/m4/ltversion.m4 b/node_modules/lame/deps/mpg123/m4/ltversion.m4 new file mode 100644 index 0000000..07a8602 --- /dev/null +++ b/node_modules/lame/deps/mpg123/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/node_modules/lame/deps/mpg123/m4/lt~obsolete.m4 b/node_modules/lame/deps/mpg123/m4/lt~obsolete.m4 new file mode 100644 index 0000000..c573da9 --- /dev/null +++ b/node_modules/lame/deps/mpg123/m4/lt~obsolete.m4 @@ -0,0 +1,98 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/node_modules/lame/deps/mpg123/makedll.sh b/node_modules/lame/deps/mpg123/makedll.sh new file mode 100644 index 0000000..2fe9ef6 --- /dev/null +++ b/node_modules/lame/deps/mpg123/makedll.sh @@ -0,0 +1,19 @@ +#!/bin/sh +if test -e Makefile; then + make clean +fi +options="$@" +echo "using options: $options" +CFLAGS="-march=i686" ./configure --disable-modules --with-cpu=x86_dither $options && +cd src/libmpg123 && +make && +cp .libs/libmpg123-0.dll ../../ && +cp .libs/libmpg123-0.dll.def ../../libmpg123-0.def +cd ../../ && +echo "Now run that lib tool... perhaps you want to strip, too. +Hints: + strip --strip-unneeded libmpg123-0.dll + lib /machine:i386 /def:libmpg123-0.def" || +echo You got some trouble. + + diff --git a/node_modules/lame/deps/mpg123/man1/mpg123.1 b/node_modules/lame/deps/mpg123/man1/mpg123.1 new file mode 100644 index 0000000..e9e665e --- /dev/null +++ b/node_modules/lame/deps/mpg123/man1/mpg123.1 @@ -0,0 +1,512 @@ +.TH mpg123 1 "31 Jan 2008" +.SH NAME +mpg123 \- play audio MPEG 1.0/2.0/2.5 stream (layers 1, 2 and 3) +.SH SYNOPSIS +.B mpg123 +[ +.B options +] +.IR file " ... | " URL " ... | " +.B \- +.SH DESCRIPTION +.B mpg123 +reads one or more +.IR file\^ s +(or standard input if ``\-'' is specified) or +.IR URL\^ s +and plays them on the audio device (default) or +outputs them to stdout. +.IR file\^ / URL +is assumed to be an MPEG audio bit stream. +.SH OPERANDS +The following operands are supported: +.TP 8 +.IR file (s) +The path name(s) of one or more input files. They must be +valid MPEG-1.0/2.0/2.5 audio layer 1, 2 or 3 bit streams. +If a dash ``\-'' is specified, MPEG data will +be read from the standard input. Furthermore, any name +starting with ``http://'' is recognized as +.I URL +(see next section). +.SH OPTIONS +.B mpg123 +options may be either the traditional POSIX one letter options, +or the GNU style long options. POSIX style options start with a +single ``\-'', while GNU long options start with ``\-\^\-''. +Option arguments (if needed) follow separated by whitespace (not ``=''). +Note that some options can be absent from your installation when disabled in the build process. +.SH INPUT OPTIONS +.TP +\fB\-k \fInum\fR, \fB\-\^\-skip \fInum +Skip first +.I num +frames. By default the decoding starts at the first frame. +.TP +\fB\-n \fInum\fR, \fB\-\^\-frames \fInum +Decode only +.I num +frames. By default the complete stream is decoded. +.TP +.BR \-\-fuzzy +Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC). +Without that, seeks need a first scan through the file before they can jump at positions. +You can decide here: sample-accurate operation with gapless features or faster (fuzzy) seeking. +.TP +.BR \-y ", " \-\^\-no\-resync +Do NOT try to resync and continue decoding if an error occurs in +the input file. Normally, +.B mpg123 +tries to keep the playback alive at all costs, including skipping invalid material and searching new header when something goes wrong. +With this switch you can make it bail out on data errors +(and perhaps spare your ears a bad time). Note that this switch has been renamed from \-\-resync. +The old name still works, but is not advertised or recommened to use (subject to removal in future). +.TP +\fB\-\^-resync\-limit \fIbytes\fR +Set number of bytes to search for valid MPEG data once lost in stream; <0 means search whole stream. +If you know there are huge chunks of invalid data in your files... here is your hammer. +Note: Only since version 1.14 this also increases the amount of junk skipped on beginning. +.TP +\fB\-p \fIURL \fR| \fBnone\fR, \fB\-\^\-proxy \fIURL \fR| \fBnone +The specified +.I proxy +will be used for HTTP requests. It +should be specified as full URL (``http://host.domain:port/''), +but the ``http://'' prefix, the port number and the trailing +slash are optional (the default port is 80). Specifying +.B none +means not to use any proxy, and to retrieve files directly +from the respective servers. See also the +``HTTP SUPPORT'' section. +.TP +\fB\-u \fIauth\fR, \fB\-\^\-auth \fIauth +HTTP authentication to use when recieving files via HTTP. +The format used is user:password. +.TP +\fB\-@ \fIfile\fR, \fB\-\^\-list \fIfile +Read filenames and/or URLs of MPEG audio streams from the specified +.I file +in addition to the ones specified on the command line (if any). +Note that +.I file +can be either an ordinary file, a dash ``\-'' to indicate that +a list of filenames/URLs is to be read from the standard input, +or an URL pointing to a an appropriate list file. Note: only +one +.B \-@ +option can be used (if more than one is specified, only the +last one will be recognized). +.TP +\fB\-l \fIn\fR, \fB\-\^\-listentry \fIn +Of the playlist, play specified entry only. +.I n +is the number of entry starting at 1. A value of 0 is the default and means playling the whole list, a negative value means showing of the list of titles with their numbers... +.TP +\fB\-\-loop \fItimes\fR +for looping track(s) a certain number of times, < 0 means infinite loop (not with \-\-random!). +.TP +.BR \-\-keep\-open +For remote control mode: Keep loaded file open after reaching end. +.TP +\fB\-\-timeout \fIseconds\fR +Timeout in (integer) seconds before declaring a stream dead (if <= 0, wait forever). +.TP +.BR \-z ", " \-\^\-shuffle +Shuffle play. Randomly shuffles the order of files specified on the command +line, or in the list file. +.TP +.BR \-Z ", " \-\-random +Continuous random play. Keeps picking a random file from the command line +or the play list. Unlike shuffle play above, random play never ends, and +plays individual songs more than once. +.TP +\fB\-\^\-no\-icy\-meta +Do not accept ICY meta data. +.TP +\fB\-i, \-\^-\index +Index / scan through the track before playback. +This fills the index table for seeking (if enabled in libmpg123) and may make the operating system cache the file contents for smoother operating on playback. +.TP +\fB\-\-index\-size \fIsize\fR +Set the number of entries in the seek frame index table. +.TP +\fB\-\-preframes \fInum\fR +Set the number of frames to be read as lead-in before a seeked-to position. +This serves to fill the layer 3 bit reservoir, which is needed to faithfully reproduce a certain sample at a certain position. +Note that for layer 3, a minimum of 1 is enforced (because of frame overlap), and for layer 1 and 2, this is limited to 2 (no bit reservoir in that case, but engine spin-up anyway). + +.SH OUTPUT and PROCESSING OPTIONS +.TP +\fB\-o \fImodule\fR, \-\^\-output \fImodule\fR +Select audio output module. You can provide a comma-separated list to use the first one that works. +.TP +\fB\-\^\-list\-modules +List the available modules. +.TP +\fB\-a \fIdev\fR, \fB\-\^\-audiodevice \fIdev +Specify the audio device to use. The default is +system-dependent (usually /dev/audio or /dev/dsp). +Use this option if you have multiple audio devices and +the default is not what you want. +.TP +.BR \-s ", " \-\^\-stdout +The decoded audio samples are written to standard output, +instead of playing them through the audio device. This +option must be used if your audio hardware is not supported +by +.BR mpg123 . +The output format per default is raw (headerless) linear PCM audio data, +16 bit, stereo, host byte order (you can force mono or 8bit). +.TP +\fB\-O \fIfile\fR, \fB\-\^\-outfile +Write raw output into a file (instead of simply redirecting standard output to a file with the shell). +.TP +\fB\-w \fIfile\fR, \fB\-\^\-wav +Write output as WAV file. This will cause the MPEG stream to be decoded +and saved as file +.I file +, or standard output if +.I - +is used as file name. You can also use +.I --au +and +.I --cdr +for AU and CDR format, respectively. +.TP +\fB\-\^\-au \fIfile +Does not play the MPEG file but writes it to +.I file +in SUN audio format. If \- is used as the filename, the AU file is +written to stdout. +.TP +\fB\-\^\-cdr \fIfile +Does not play the MPEG file but writes it to +.I file +as a CDR file. If \- is used as the filename, the CDR file is written +to stdout. +.TP +.BR \-\-reopen +Forces reopen of the audiodevice after ever song +.TP +.BR \-\-cpu\ \fIdecoder\-type +Selects a certain decoder (optimized for specific CPU), for example i586 or MMX. +The list of available decoders can vary; depending on the build and what your CPU supports. +This options is only availabe when the build actually includes several optimized decoders. +.TP +.BR \-\-test\-cpu +Tests your CPU and prints a list of possible choices for \-\-cpu. +.TP +.BR \-\-list\-cpu +Lists all available decoder choices, regardless of support by your CPU. +.TP +\fB\-g \fIgain\fR, \fB\-\^\-gain \fIgain +[DEPRECATED] Set audio hardware output gain (default: don't change). The unit of the gain value is hardware and output module dependent. +(This parameter is only provided for backwards compatibility and may be removed in the future without prior notice. Use the audio player for playing and a mixer app for mixing, UNIX style!) +.TP +\fB\-f \fIfactor\fR, \fB\-\^\-scale \fIfactor +Change scale factor (default: 32768). +.TP +.BR \-\-rva-mix,\ \-\-rva-radio +Enable RVA (relative volume adjustment) using the values stored for ReplayGain radio mode / mix mode with all tracks roughly equal loudness. +The first valid information found in ID3V2 Tags (Comment named RVA or the RVA2 frame) or ReplayGain header in Lame/Info Tag is used. +.TP +.BR \-\-rva-album,\ \-\-rva-audiophile +Enable RVA (relative volume adjustment) using the values stored for ReplayGain audiophile mode / album mode with usually the effect of adjusting album loudness but keeping relative loudness inside album. +The first valid information found in ID3V2 Tags (Comment named RVA_ALBUM or the RVA2 frame) or ReplayGain header in Lame/Info Tag is used. +.TP +.BR \-0 ", " \-\^\-single0 "; " \-1 ", " \-\^\-single1 +Decode only channel 0 (left) or channel 1 (right), +respectively. These options are available for +stereo MPEG streams only. +.TP +.BR \-m ", " \-\^\-mono ", " \-\^\-mix ", " \-\^\-singlemix +Mix both channels / decode mono. It takes less +CPU time than full stereo decoding. +.TP +.BR \-\-stereo +Force stereo output +.TP +\fB\-r \fIrate\fR, \fB\-\^\-rate \fIrate +Set sample rate (default: automatic). You may want to +change this if you need a constant bitrate independent of +the mpeg stream rate. mpg123 automagically converts the +rate. You should then combine this with \-\-stereo or \-\-mono. +.TP +.BR \-2 ", " \-\^\-2to1 "; " \-4 ", " \-\^\-4to1 +Performs a downsampling of ratio 2:1 (22 kHz) or 4:1 (11 kHz) +on the output stream, respectively. Saves some CPU cycles, but +at least the 4:1 ratio sounds ugly. +.TP +.BR \-\-pitch\ \fIvalue +Set hardware pitch (speedup/down, 0 is neutral; 0.05 is 5%). This changes the output sampling rate, so it only works in the range your audio system/hardware supports. +.TP +.BR \-\-8bit +Forces 8bit output +.TP +\fB\-\^\-float +Forces f32 encoding +.TP +\fp\-e \fIenc\fR, \fB\-\^\-encoding \fIenc +Choose output sample encoding. Possible values look like f32 (32-bit floating point), s32 (32-bit signed integer), u32 (32-bit unsigned integer) and the variants with different numbers of bits (s24, u24, s16, u16, s8, u8) and also special variants like ulaw and alaw 8-bit. +See the output of mpg123's longhelp for actually available encodings. +.TP +\fB\-d \fIn\fR, \fB\-\^\-doublespeed \fIn +Only play every +.IR n 'th +frame. This will cause the MPEG stream +to be played +.I n +times faster, which can be used for special +effects. Can also be combined with the +.B \-\^\-halfspeed +option to play 3 out of 4 frames etc. Don't expect great +sound quality when using this option. +.TP +\fB\-h \fIn\fR, \fB\-\^\-halfspeed \fIn +Play each frame +.I n +times. This will cause the MPEG stream +to be played at +.IR 1 / n 'th +speed (n times slower), which can be +used for special effects. Can also be combined with the +.B \-\^\-doublespeed +option to double every third frame or things like that. +Don't expect great sound quality when using this option. +.TP +\fB\-E \fIfile\fR, \fB\-\^\-equalizer +Enables equalization, taken from +.IR file . +The file needs to contain 32 lines of data, additional comment lines may +be prefixed with +.IR # . +Each data line consists of two floating-point entries, separated by +whitespace. They specify the multipliers for left and right channel of +a certain frequency band, respectively. The first line corresponds to the +lowest, the 32nd to the highest frequency band. +Note that you can control the equalizer interactively with the generic control interface. +.TP +\fB\-\^\-gapless +Enable code that cuts (junk) samples at beginning and end of tracks, enabling gapless transitions between MPEG files when encoder padding and codec delays would prevent it. +This is enabled per default beginning with mpg123 version 1.0.0 . +.TP +\fB\-\^\-no\-gapless +Disable the gapless code. That gives you MP3 decodings that include encoder delay and padding plus mpg123's decoder delay. +.TP +\fB\-D \fIn\fR, \fB\-\-delay \fIn +Insert a delay of \fIn\fR seconds before each track. +.TP +.BR "\-o h" ", " \-\^\-headphones +Direct audio output to the headphone connector (some hardware only; AIX, HP, SUN). +.TP +.BR "\-o s" ", " \-\^\-speaker +Direct audio output to the speaker (some hardware only; AIX, HP, SUN). +.TP +.BR "\-o l" ", " \-\^\-lineout +Direct audio output to the line-out connector (some hardware only; AIX, HP, SUN). +.TP +\fB\-b \fIsize\fR, \fB\-\^\-buffer \fIsize +Use an audio output buffer of +.I size +Kbytes. This is useful to bypass short periods of heavy +system activity, which would normally cause the audio output +to be interrupted. +You should specify a buffer size of at least 1024 +(i.e. 1 Mb, which equals about 6 seconds of audio data) or more; +less than about 300 does not make much sense. The default is 0, +which turns buffering off. +.TP +\fB\-\^\-preload \fIfraction +Wait for the buffer to be filled to +.I fraction +before starting playback (fraction between 0 and 1). You can tune this prebuffering to either get faster sound to your ears or safer uninterrupted web radio. +Default is 1 (wait for full buffer before playback). +.TP +\fB\-\^\-smooth +Keep buffer over track boundaries -- meaning, do not empty the buffer between tracks for possibly some added smoothness. + +.SH MISC OPTIONS + +.TP +.BR \-t ", " \-\^\-test +Test mode. The audio stream is decoded, but no output occurs. +.TP +.BR \-c ", " \-\^\-check +Check for filter range violations (clipping), and report them for each frame +if any occur. +.TP +.BR \-v ", " \-\^\-verbose +Increase the verbosity level. For example, displays the frame +numbers during decoding. +.TP +.BR \-q ", " \-\^\-quiet +Quiet. Suppress diagnostic messages. +.TP +.BR \-C ", " \-\^\-control +Enable terminal control keys. By default use 's' or the space bar to stop/restart (pause, unpause) playback, 'f' to jump forward to the next song, 'b' to jump back to the +beginning of the song, ',' to rewind, '.' to fast forward, and 'q' to quit. +Type 'h' for a full list of available controls. +.TP +\fB\-\^\-title +In an xterm, or rxvt (compatible, TERM environment variable is examined), change the window's title to the name of song currently +playing. +.TP +\fB\-\^\-long\-tag +Display ID3 tag info always in long format with one line per item (artist, title, ...) +.TP +.BR \-\-utf8 +Regardless of environment, print metadata in UTF-8 (otherwise, when not using UTF-8 locale, you'll get ASCII stripdown). +.TP +.BR \-R ", " \-\^\-remote +Activate generic control interface. +.B mpg123 +will then read and execute commands from stdin. Basic usage is ``load '' to play some file and the obvious ``pause'', ``command. +``jump '' will jump/seek to a given point (MPEG frame number). +Issue ``help'' to get a full list of commands and syntax. +.TP +.BR \-\^\-remote\-err +Print responses for generic control mode to standard error, not standard out. +This is automatically triggered when using +.B -s +\fN. +.TP +\fB\-\-fifo \fIpath +Create a fifo / named pipe on the given path and use that for reading commands instead of standard input. +.TP +\fB\-\^\-aggressive +Tries to get higher priority +.TP +.BR \-T ", " \-\-realtime +Tries to gain realtime priority. This option usually requires root +privileges to have any effect. +.TP +.BR \-? ", " \-\^\-help +Shows short usage instructions. +.TP +.BR \-\^\-longhelp +Shows long usage instructions. +.TP +.BR \-\^\-version +Print the version string. +.SH HTTP SUPPORT +In addition to reading MPEG audio streams from ordinary +files and from the standard input, +.B mpg123 +supports retrieval of MPEG audio files or playlists via the HTTP protocol, +which is used in the World Wide Web (WWW). Such files are +specified using a so-called URL, which starts with ``http://''. When a file with +that prefix is encountered, +.B mpg123 +attempts to open an HTTP connection to the server in order to +retrieve that file to decode and play it. +.P +It is often useful to retrieve files through a WWW cache or +so-called proxy. To accomplish this, +.B mpg123 +examines the environment for variables named +.BR MP3_HTTP_PROXY ", " http_proxy " and " HTTP_PROXY , +in this order. The value of the first one that is set will +be used as proxy specification. To override this, you can +use the +.B \-p +command line option (see the ``OPTIONS'' section). Specifying +.B "\-p none" +will enforce contacting the server directly without using +any proxy, even if one of the above environment variables +is set. +.P +Note that, in order to play MPEG audio files from a WWW +server, it is necessary that the connection to that server +is fast enough. For example, a 128 kbit/s MPEG file +requires the network connection to be at least 128 kbit/s +(16 kbyte/s) plus protocol overhead. If you suffer from +short network outages, you should try the +.B \-b +option (buffer) to bypass such outages. If your network +connection is generally not fast enough to retrieve MPEG +audio files in realtime, you can first download the files +to your local harddisk (e.g. using +.BR wget (1)) +and then play them from there. +.P +If authentication is needed to access the file it can be +specified with the +.BR "\-u user:pass". +.SH INTERRUPT +When in terminal control mode, you can quit via pressing the q key, +while any time you can abort +.B mpg123 +by pressing Ctrl-C. If not in terminal control mode, this will +skip to the next file (if any). If you want to abort playing immediately +in that case, press Ctrl-C twice in short succession (within about one second). +.P +Note that the result of quitting +.B mpg123 +pressing Ctrl-C might not be audible +immediately, due to audio data buffering in the audio device. +This delay is system dependent, but it is usually not more +than one or two seconds. +.SH "SEE ALSO" +.BR wget (1), +.BR sox (1), +.SH NOTES +MPEG audio decoding requires a good deal of CPU performance, +especially layer-3. To decode it in realtime, you should +have at least an i486DX4, Pentium, Alpha, SuperSparc or equivalent +processor. You can also use the +.B -m +option to decode mono only, which reduces the CPU load +somewhat for layer-3 streams. See also the +.BR \-2 " and " \-4 +options. +.P +If everything else fails, use the +.B \-s +option to decode to standard output, direct it into a file +and then use an appropriate utility to play that file. +You might have to use a tool such as +.BR sox (1) +to convert the output to an audio format suitable for +your audio player. +.P +If your system is generally fast enough to decode in +realtime, but there are sometimes periods of heavy +system load (such as cronjobs, users logging in remotely, +starting of ``big'' programs etc.) causing the +audio output to be interrupted, then you should use +the +.B \-b +option to use a buffer of reasonable size (at least 1000 Kbytes). +.SH BUGS +.P +Mostly MPEG-1 layer 2 and 3 are tested in real life. +Please report any issues and provide test files to help fixing them. +.P +Free format streams are not supported, but they could be (there is some code). +.P +No CRC error checking is performed. +.P +Some platforms lack audio hardware support; you may be able to use the +.B -s +switch to feed the decoded data to a program that can play it on your audio device. +Notably, this includes Tru64 with MME, but you should be able to install and use OSS there (it perhaps will perform better as MME would anyway). +.SH AUTHORS +.TP +Maintainers: +.br +Thomas Orgis , +.br +Nicholas J. Humfrey +.TP +Creator: +.br +Michael Hipp +.TP +Uses code or ideas from various people, see the AUTHORS file accompanying the source code. +.SH LICENSE +.B mpg123 +is licensed under the GNU Lesser/Library General Public License, LGPL, version 2.1 . +.SH WEBSITE +http://www.mpg123.org +.br +http://sourceforge.net/projects/mpg123 diff --git a/node_modules/lame/deps/mpg123/mpg123.gyp b/node_modules/lame/deps/mpg123/mpg123.gyp new file mode 100644 index 0000000..eaccebc --- /dev/null +++ b/node_modules/lame/deps/mpg123/mpg123.gyp @@ -0,0 +1,240 @@ +# This file is used with the GYP meta build system. +# http://code.google.com/p/gyp +# To build try this: +# svn co http://gyp.googlecode.com/svn/trunk gyp +# ./gyp/gyp -f make --depth=. mpg123.gyp +# make +# ./out/Debug/test + +{ + 'variables': { + 'target_arch%': 'ia32', + }, + 'target_defaults': { + 'default_configuration': 'Debug', + 'configurations': { + 'Debug': { + 'defines': [ 'DEBUG', '_DEBUG' ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 1, # static debug + }, + }, + }, + 'Release': { + 'defines': [ 'NDEBUG' ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 0, # static release + }, + }, + } + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'conditions': [ + ['OS=="mac"', { + 'conditions': [ + ['target_arch=="ia32"', { 'xcode_settings': { 'ARCHS': [ 'i386' ] } }], + ['target_arch=="x64"', { 'xcode_settings': { 'ARCHS': [ 'x86_64' ] } }] + ], + }], + ] + }, + + 'targets': [ + { + 'target_name': 'mpg123', + 'product_prefix': 'lib', + 'type': 'static_library', + 'variables': { + 'conditions': [ + # "mpg123_cpu" is the cpu optimization to use + # Windows uses "i386_fpu" even on x64 to avoid compiling .S asm files + # (I don't think the 64-bit ASM files are compatible with `ml`/`ml64`...) + ['OS=="win"', { 'mpg123_cpu%': 'i386_fpu' }, + { 'conditions': [ + ['target_arch=="arm"', { 'mpg123_cpu%': 'arm_nofpu' }], + ['target_arch=="ia32"', { 'mpg123_cpu%': 'i386_fpu' }], + ['target_arch=="x64"', { 'mpg123_cpu%': 'x86-64' }], + ]}], + ] + }, + 'sources': [ + 'src/libmpg123/compat.c', + 'src/libmpg123/parse.c', + 'src/libmpg123/frame.c', + 'src/libmpg123/format.c', + 'src/libmpg123/dct64.c', + 'src/libmpg123/equalizer.c', + 'src/libmpg123/id3.c', + 'src/libmpg123/optimize.c', + 'src/libmpg123/readers.c', + 'src/libmpg123/tabinit.c', + 'src/libmpg123/libmpg123.c', + 'src/libmpg123/index.c', + 'src/libmpg123/stringbuf.c', + 'src/libmpg123/icy.c', + 'src/libmpg123/icy2utf8.c', + 'src/libmpg123/ntom.c', + 'src/libmpg123/synth.c', + 'src/libmpg123/synth_8bit.c', + 'src/libmpg123/layer1.c', + 'src/libmpg123/layer2.c', + 'src/libmpg123/layer3.c', + 'src/libmpg123/feature.c', + ], + 'include_dirs': [ + 'src/libmpg123', + # platform and arch-specific headers + 'config/<(OS)/<(target_arch)', + ], + 'defines': [ + 'PIC', + 'NOXFERMEM', + 'HAVE_CONFIG_H', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'src/libmpg123', + # platform and arch-specific headers + 'config/<(OS)/<(target_arch)', + ] + }, + 'conditions': [ + ['mpg123_cpu=="arm_nofpu"', { + 'defines': [ + 'OPT_ARM', + 'REAL_IS_FIXED', + 'NEWOLD_WRITE_SAMPLE', + ], + 'sources': [ + 'src/libmpg123/synth_arm.S', + ], + }], + ['mpg123_cpu=="i386_fpu"', { + 'defines': [ + 'OPT_I386', + 'REAL_IS_FLOAT', + 'NEWOLD_WRITE_SAMPLE', + ], + 'sources': [ + 'src/libmpg123/synth_s32.c', + 'src/libmpg123/synth_real.c', + 'src/libmpg123/dct64_i386.c', + ], + }], + ['mpg123_cpu=="x86-64"', { + 'defines': [ + 'OPT_X86_64', + 'REAL_IS_FLOAT', + ], + 'sources': [ + 'src/libmpg123/dct64_x86_64.S', + 'src/libmpg123/dct64_x86_64_float.S', + 'src/libmpg123/synth_s32.c', + 'src/libmpg123/synth_real.c', + 'src/libmpg123/synth_stereo_x86_64.S', + 'src/libmpg123/synth_stereo_x86_64_float.S', + 'src/libmpg123/synth_stereo_x86_64_s32.S', + 'src/libmpg123/synth_x86_64.S', + 'src/libmpg123/synth_x86_64_s32.S', + 'src/libmpg123/synth_x86_64_float.S', + ], + }], + ], + }, + + { + 'target_name': 'output', + 'product_prefix': 'lib', + 'type': 'static_library', + 'variables': { + 'conditions': [ + # "mpg123_backend" is the audio backend to use + ['OS=="mac"', { 'mpg123_backend%': 'coreaudio' }], + ['OS=="win"', { 'mpg123_backend%': 'win32' }], + ['OS=="linux"', { 'mpg123_backend%': 'alsa' }], + ['OS=="freebsd"', { 'mpg123_backend%': 'alsa' }], + ['OS=="solaris"', { 'mpg123_backend%': 'sun' }], + ] + }, + 'include_dirs': [ + 'src', + 'src/output', + 'src/libmpg123', + # platform and arch-specific headers + 'config/<(OS)/<(target_arch)', + ], + 'defines': [ + 'PIC', + 'NOXFERMEM', + 'REAL_IS_FLOAT', + 'HAVE_CONFIG_H', + 'BUILDING_OUTPUT_MODULES=1' + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'src', + 'src/output', + 'src/libmpg123', + # platform and arch-specific headers + 'config/<(OS)/<(target_arch)', + ] + }, + 'conditions': [ + ['mpg123_backend=="alsa"', { + 'link_settings': { + 'libraries': [ + '-lasound', + ] + } + }], + ['mpg123_backend=="coreaudio"', { + 'link_settings': { + 'libraries': [ + '-framework AudioToolbox', + '-framework AudioUnit', + '-framework CoreServices', + ], + }, + }], + ['mpg123_backend=="openal"', { + 'defines': [ + 'OPENAL_SUBDIR_OPENAL' + ], + 'link_settings': { + 'libraries': [ + '-framework OpenAL', + ] + } + }], + ['mpg123_backend=="win32"', { + 'link_settings': { + 'libraries': [ + '-lwinmm.lib', + ], + } + }], + ], + 'sources': [ 'src/output/<(mpg123_backend).c' ], + }, + + { + 'target_name': 'test', + 'type': 'executable', + 'dependencies': [ 'mpg123' ], + 'sources': [ 'test.c' ] + }, + + { + 'target_name': 'output_test', + 'type': 'executable', + 'dependencies': [ 'output' ], + 'sources': [ 'test_output.c' ] + } + ] +} diff --git a/node_modules/lame/deps/mpg123/mpg123.spec b/node_modules/lame/deps/mpg123/mpg123.spec new file mode 100644 index 0000000..a34a573 --- /dev/null +++ b/node_modules/lame/deps/mpg123/mpg123.spec @@ -0,0 +1,68 @@ +# This is a generic spec file that should "just work" with rpmbuild on any distro. +# Make sure you have appropriate -devel packes installed: +# - the package providing libltdl.so and .la (libtool or libtool-devel) +# - devel packages for alsa, sdl, etc... to build the respective output modules. +Summary: The fast console mpeg audio decoder/player. +Name: mpg123 +Version: 1.14.4 +Release: 1 +URL: http://www.mpg123.org/ +License: GPL +Group: Applications/Multimedia +Packager: Michael Ryzhykh +Source: http://www.mpg123.org/download/mpg123-%{version}.tar.bz2 +BuildRoot: %_tmppath/%name-%version +Prefix: /usr +# That is specific to fedora 4 already. +#BuildPrereq: libtool-ltdl-devel + +%description +This is a console based decoder/player for mono/stereo mpeg audio files, +probably more familiar as MP3 or MP2 files. It's focus is speed. +It can play MPEG1.0/2.0/2.5 layer I, II, II (1, 2, 3;-) files +(VBR files are fine, too) and produce output on a number of different ways: +raw data to stdout and different sound systems depending on your platform. + +%package devel +Summary: Files needed for development with mpg123 +Group: Development/Libraries + +%description devel +Libraries and header files for development with mpg123. + +%prep +%setup -q -n %name-%version + +%build +%configure --with-cpu=x86_dither --enable-shared --enable-static --disable-ltdl-install +make + +%install +%{__rm} -rf %{buildroot} +%makeinstall + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr(755,root,root) +%{_bindir}/* +%defattr(644,root,root) +%doc %{_mandir}/*/mpg123.1.gz +%{_libdir}/libmpg123.so.* +%{_libdir}/mpg123/output_*.la +%{_libdir}/mpg123/output_*.so + +%files devel +%defattr(644,root,root) +%{_libdir}/pkgconfig/libmpg123.pc +%{_includedir}/*.h +%{_libdir}/libmpg123.a +%{_libdir}/libmpg123.la +%{_libdir}/libmpg123.so +%exclude %{_libdir}/mpg123/output_*.a + +%changelog +* Tue Jan 1 2008 Michael Ryzhykh +- Initial Version. + diff --git a/node_modules/lame/deps/mpg123/mpg123.spec.in b/node_modules/lame/deps/mpg123/mpg123.spec.in new file mode 100644 index 0000000..754b0c8 --- /dev/null +++ b/node_modules/lame/deps/mpg123/mpg123.spec.in @@ -0,0 +1,68 @@ +# This is a generic spec file that should "just work" with rpmbuild on any distro. +# Make sure you have appropriate -devel packes installed: +# - the package providing libltdl.so and .la (libtool or libtool-devel) +# - devel packages for alsa, sdl, etc... to build the respective output modules. +Summary: The fast console mpeg audio decoder/player. +Name: @PACKAGE_NAME@ +Version: @PACKAGE_VERSION@ +Release: 1 +URL: http://www.mpg123.org/ +License: GPL +Group: Applications/Multimedia +Packager: Michael Ryzhykh +Source: http://www.mpg123.org/download/mpg123-%{version}.tar.bz2 +BuildRoot: %_tmppath/%name-%version +Prefix: /usr +# That is specific to fedora 4 already. +#BuildPrereq: libtool-ltdl-devel + +%description +This is a console based decoder/player for mono/stereo mpeg audio files, +probably more familiar as MP3 or MP2 files. It's focus is speed. +It can play MPEG1.0/2.0/2.5 layer I, II, II (1, 2, 3;-) files +(VBR files are fine, too) and produce output on a number of different ways: +raw data to stdout and different sound systems depending on your platform. + +%package devel +Summary: Files needed for development with mpg123 +Group: Development/Libraries + +%description devel +Libraries and header files for development with mpg123. + +%prep +%setup -q -n %name-%version + +%build +%configure --with-cpu=x86_dither --enable-shared --enable-static --disable-ltdl-install +make + +%install +%{__rm} -rf %{buildroot} +%makeinstall + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr(755,root,root) +%{_bindir}/* +%defattr(644,root,root) +%doc %{_mandir}/*/mpg123.1.gz +%{_libdir}/libmpg123.so.* +%{_libdir}/mpg123/output_*.la +%{_libdir}/mpg123/output_*.so + +%files devel +%defattr(644,root,root) +%{_libdir}/pkgconfig/libmpg123.pc +%{_includedir}/*.h +%{_libdir}/libmpg123.a +%{_libdir}/libmpg123.la +%{_libdir}/libmpg123.so +%exclude %{_libdir}/mpg123/output_*.a + +%changelog +* Tue Jan 1 2008 Michael Ryzhykh +- Initial Version. + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2005/libmpg123/libmpg123.vcproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2005/libmpg123/libmpg123.vcproj new file mode 100644 index 0000000..36a0174 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2005/libmpg123/libmpg123.vcproj @@ -0,0 +1,741 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008/dump_seekindex/dump_seekindex.vcproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/dump_seekindex/dump_seekindex.vcproj new file mode 100644 index 0000000..63d72c5 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/dump_seekindex/dump_seekindex.vcproj @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008/feedseek/feedseek.vcproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/feedseek/feedseek.vcproj new file mode 100644 index 0000000..edd66e8 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/feedseek/feedseek.vcproj @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008/libmpg123/libmpg123.vcproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/libmpg123/libmpg123.vcproj new file mode 100644 index 0000000..e81f608 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/libmpg123/libmpg123.vcproj @@ -0,0 +1,1357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008/mpg123.sln b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/mpg123.sln new file mode 100644 index 0000000..5e6369e --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/mpg123.sln @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpg123", "libmpg123\libmpg123.vcproj", "{67CAA87B-7CF1-4F93-BB67-21C513F40803}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpglib", "mpglib\mpglib.vcproj", "{9FB32EE1-C45A-4CCD-9AC8-112C43AF80A7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "feedseek", "feedseek\feedseek.vcproj", "{472481BF-11B6-41A9-BF6A-8BE16A7F8FD6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scan", "scan\scan.vcproj", "{245C2785-2FA9-4A6B-8558-35BB8473AEA1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_seekindex", "dump_seekindex\dump_seekindex.vcproj", "{B086EA3E-700A-4DED-A91D-85ED8A79A8FC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Win32.ActiveCfg = Debug_Generic|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Win32.Build.0 = Debug_Generic|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Win32.ActiveCfg = Release_Generic_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Win32.Build.0 = Release_Generic_Dll|Win32 + {9FB32EE1-C45A-4CCD-9AC8-112C43AF80A7}.Debug|Win32.ActiveCfg = Debug|Win32 + {9FB32EE1-C45A-4CCD-9AC8-112C43AF80A7}.Debug|Win32.Build.0 = Debug|Win32 + {9FB32EE1-C45A-4CCD-9AC8-112C43AF80A7}.Release|Win32.ActiveCfg = Release|Win32 + {9FB32EE1-C45A-4CCD-9AC8-112C43AF80A7}.Release|Win32.Build.0 = Release|Win32 + {472481BF-11B6-41A9-BF6A-8BE16A7F8FD6}.Debug|Win32.ActiveCfg = Debug|Win32 + {472481BF-11B6-41A9-BF6A-8BE16A7F8FD6}.Debug|Win32.Build.0 = Debug|Win32 + {472481BF-11B6-41A9-BF6A-8BE16A7F8FD6}.Release|Win32.ActiveCfg = Release|Win32 + {472481BF-11B6-41A9-BF6A-8BE16A7F8FD6}.Release|Win32.Build.0 = Release|Win32 + {245C2785-2FA9-4A6B-8558-35BB8473AEA1}.Debug|Win32.ActiveCfg = Debug|Win32 + {245C2785-2FA9-4A6B-8558-35BB8473AEA1}.Debug|Win32.Build.0 = Debug|Win32 + {245C2785-2FA9-4A6B-8558-35BB8473AEA1}.Release|Win32.ActiveCfg = Release|Win32 + {245C2785-2FA9-4A6B-8558-35BB8473AEA1}.Release|Win32.Build.0 = Release|Win32 + {B086EA3E-700A-4DED-A91D-85ED8A79A8FC}.Debug|Win32.ActiveCfg = Debug|Win32 + {B086EA3E-700A-4DED-A91D-85ED8A79A8FC}.Debug|Win32.Build.0 = Debug|Win32 + {B086EA3E-700A-4DED-A91D-85ED8A79A8FC}.Release|Win32.ActiveCfg = Release|Win32 + {B086EA3E-700A-4DED-A91D-85ED8A79A8FC}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008/mpglib/mpglib.vcproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/mpglib/mpglib.vcproj new file mode 100644 index 0000000..b331f1b --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/mpglib/mpglib.vcproj @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008/scan/scan.vcproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/scan/scan.vcproj new file mode 100644 index 0000000..e6befe6 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008/scan/scan.vcproj @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/2008clr.sln b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/2008clr.sln new file mode 100644 index 0000000..c5562a5 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/2008clr.sln @@ -0,0 +1,81 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpg123clr", "mpg123clr\mpg123clr.vcproj", "{99E8B20E-9C29-46BC-B766-A50F237D88BF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "scanclr", "examples\scanclr\scanclr.csproj", "{53664927-0A21-4056-A5D5-C6A1B4B1F839}" + ProjectSection(ProjectDependencies) = postProject + {99E8B20E-9C29-46BC-B766-A50F237D88BF} = {99E8B20E-9C29-46BC-B766-A50F237D88BF} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "feedseekclr", "examples\feedseekclr\feedseekclr.csproj", "{626B52AB-1E46-46FB-A259-03DCE3994BE6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReplaceReaderclr", "examples\ReplaceReaderclr\ReplaceReaderclr.csproj", "{6415FBC0-44EC-4158-8A24-127D9BAC5CEA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpg123", "..\2008\libmpg123\libmpg123.vcproj", "{67CAA87B-7CF1-4F93-BB67-21C513F40803}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Debug|Win32.ActiveCfg = Debug|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Debug|Win32.Build.0 = Debug|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Release|Any CPU.ActiveCfg = Release|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Release|Mixed Platforms.Build.0 = Release|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Release|Win32.ActiveCfg = Release|Win32 + {99E8B20E-9C29-46BC-B766-A50F237D88BF}.Release|Win32.Build.0 = Release|Win32 + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Debug|Any CPU.Build.0 = Debug|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Debug|Win32.ActiveCfg = Debug|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Release|Any CPU.ActiveCfg = Release|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Release|Any CPU.Build.0 = Release|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {53664927-0A21-4056-A5D5-C6A1B4B1F839}.Release|Win32.ActiveCfg = Release|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Debug|Win32.ActiveCfg = Debug|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Release|Any CPU.Build.0 = Release|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {626B52AB-1E46-46FB-A259-03DCE3994BE6}.Release|Win32.ActiveCfg = Release|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Release|Any CPU.Build.0 = Release|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA}.Release|Win32.ActiveCfg = Release|Any CPU + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Any CPU.ActiveCfg = Debug_x86_Dll_Minimal|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Mixed Platforms.ActiveCfg = Debug_Generic_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Mixed Platforms.Build.0 = Debug_Generic_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Win32.ActiveCfg = Debug_x86_Dll_Minimal|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Win32.Build.0 = Debug_x86_Dll_Minimal|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Any CPU.ActiveCfg = Release_x86_Dll_Minimal|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Mixed Platforms.ActiveCfg = Release_Generic_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Mixed Platforms.Build.0 = Release_Generic_Dll|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Win32.ActiveCfg = Release_x86_Dll_Minimal|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Win32.Build.0 = Release_x86_Dll_Minimal|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs new file mode 100644 index 0000000..1059a9a --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Program.cs @@ -0,0 +1,435 @@ +/* + replacereaderclr: test program for mpg123clr, showing how to use ReplaceReader in a CLR enviro. + copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + initially written by Malcolm Boczek + + not to be used as an example of good coding practices, note the total absence of error handling!!! +*/ + +/* + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.12.0.0 14-Apr-10 Added ReplaceReaderHandle sample code (mb) +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.IO; // for ReplaceReaderHandle example +using System.Runtime.InteropServices; // for ReplaceReaderHandle example + +using mpg123clr; + +namespace ReplaceReaderclr +{ + class Program + { + private unsafe static int MyReadFunc(int a, void* b, uint c) + { + // need to call posix read function here... + + // PosixRead is an example, substitute your replacement function here. + int ret = mpg123.PosixRead(a, b, c); + + return ret; + } + + private static int MySeekFunc(int a, int b, int c) + { + // NOTE: Largefile conflict with use of "int" position values. + // Convert to long if off_t is defined as long long + + // need to call posix lseek function here... + + // PosixSeek is an example, substitute your replacement function here. + int ret = mpg123.PosixSeek(a, b, c); + + return ret; + } + + private unsafe static int MyHandleReadFunc(void* a, void* b, uint c) + { + GCHandle gch = GCHandle.FromIntPtr((IntPtr)a); + BinaryReader br = (BinaryReader)gch.Target; + + byte[] buf = br.ReadBytes((int)c); + + // NOTE: no discernible performance difference between Marshal.Copy and ptr++ loop + Marshal.Copy(buf, 0, (IntPtr)b, buf.Length); + +// byte* ptr = (byte*)b; +// for (int i = 0, l = buf.Length; i < l; i++) +// *(ptr++) = buf[i]; + + return buf.Length; + } + + private unsafe static int MyHandleSeekFunc(void* a, int b, int c) + { + // NOTE: Largefile conflict with use of "int" position values. + // Convert to long if off_t is defined as long long + + GCHandle gch = GCHandle.FromIntPtr((IntPtr)a); + BinaryReader br = (BinaryReader)gch.Target; + + return (int)br.BaseStream.Seek(b, (SeekOrigin)c); + } + + private unsafe static void MyHandleCleanFunc(void* a) + { + GCHandle gch = GCHandle.FromIntPtr((IntPtr)a); + BinaryReader br = (BinaryReader)gch.Target; + + br.Close(); + } + + static unsafe void Main(string[] args) + { + if (args.Length == 0) + { + Console.WriteLine("I need a file to work on:\n\nPress any key to exit."); + while (Console.Read() == 0) ; + return; + } + mpg123clr.mpg.ErrorCode err; + + string filename = args[0]; + + err = mpg123.mpg123_init(); + Console.WriteLine("Init:"); + + RunReplaceReaderTest(filename); + RunReplaceReaderHandleTest(filename); + RunFrameByFrameTest(filename); + + Console.WriteLine("\nPress any key to exit:"); + while (Console.Read() == 0) ; + + mpg123.mpg123_exit(); + } + + static unsafe void RunReplaceReaderTest(string filename) + { + mpg123clr.mpg.ErrorCode err; + + mpg123 mp = new mpg123(); + err = mp.mpg123_new(); + + // ReplaceReader example + mpg123clr.mpg123.ReadDelegate rdel = MyReadFunc; + mpg123clr.mpg123.SeekDelegate sdel = MySeekFunc; + err = mp.mpg123_replace_reader(rdel, sdel); + + //err = mp.mpg123_open(args[0]); + err = mp.mpg123_open(filename); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Error: " + mp.mpg123_strerror()); + } + else + { + Console.WriteLine("Open:"); + + // Show available decoders + string[] Decoders = mp.mpg123_decoders(); + + if (Decoders.Length > 0) + { + Console.WriteLine("\nDecoders:"); + foreach (string str in Decoders) Console.WriteLine(str); + } + + // Show supported decoders + string[] supDecoders = mp.mpg123_supported_decoders(); + + if (supDecoders.Length > 0) + { + Console.WriteLine("\nSupported Decoders:"); + foreach (string str in supDecoders) Console.WriteLine(str); + } + + // Show actual decoder + Console.WriteLine("\nDecoder: " + mp.mpg123_current_decoder()); + + // Show estimated file length + Console.WriteLine("\nLength Estimate: " + mp.mpg123_length().ToString()); + + // Scan - gets actual details including ID3v2 and Frame offsets + err = mp.mpg123_scan(); + + // Show actual file length + if (err == mpg123clr.mpg.ErrorCode.ok) Console.WriteLine("Length Actual : " + mp.mpg123_length().ToString()); + + // Get ID3 data + mpg123clr.id3.mpg123id3v1 iv1; + mpg123clr.id3.mpg123id3v2 iv2; + err = mp.mpg123_id3(out iv1, out iv2); + + // Show ID3v2 data + Console.WriteLine("\nTitle : " + iv2.title); + Console.WriteLine("Artist : " + iv2.artist); + Console.WriteLine("Album : " + iv2.album); + Console.WriteLine("Comment: " + iv2.comment); + Console.WriteLine("Year : " + iv2.year); + + // Demo seek (back to start of file - note: scan should already have done this) + long pos = mp.mpg123_seek(0, System.IO.SeekOrigin.Begin); + + long[] frameindex; + long step; + err = mp.mpg123_index(out frameindex, out step); + + if (err == mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("\nFrameIndex:"); + foreach (long idx in frameindex) + { + // Console.WriteLine(idx.ToString()); + } + } + + int num; + uint cnt; + IntPtr audio; + + // Walk the file - effectively decode the data without using it... + Console.WriteLine("\nWalking : " + iv2.title); + DateTime dte, dts = DateTime.Now; + + while (err == mpg123clr.mpg.ErrorCode.ok || err == mpg123clr.mpg.ErrorCode.new_format) + { + err = mp.mpg123_decode_frame(out num, out audio, out cnt); + + // do something with "audio" here.... + } + + dte = DateTime.Now; + + TimeSpan ts = dte - dts; + Console.WriteLine("Duration: " + ts.ToString()); + + mp.mpg123_close(); + } + + mp.Dispose(); + } + + static unsafe void RunReplaceReaderHandleTest(string filename) + { + mpg123clr.mpg.ErrorCode err; + + mpg123 mp = new mpg123(); + err = mp.mpg123_new(); + + // ReplaceReader example + mpg123clr.mpg123.ReadHandleDelegate rdel = MyHandleReadFunc; + mpg123clr.mpg123.SeekHandleDelegate sdel = MyHandleSeekFunc; + mpg123clr.mpg123.CleanupHandleDelegate cdel = MyHandleCleanFunc; + err = mp.mpg123_replace_reader_handle(rdel, sdel, cdel); + + //err = mp.mpg123_open(args[0]); + BinaryReader br = new BinaryReader(File.OpenRead(filename)); + + err = mp.mpg123_open_handle(br); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Error: " + mp.mpg123_strerror()); + } + else + { + Console.WriteLine("Open:"); + + // Show available decoders + string[] Decoders = mp.mpg123_decoders(); + + if (Decoders.Length > 0) + { + Console.WriteLine("\nDecoders:"); + foreach (string str in Decoders) Console.WriteLine(str); + } + + // Show supported decoders + string[] supDecoders = mp.mpg123_supported_decoders(); + + if (supDecoders.Length > 0) + { + Console.WriteLine("\nSupported Decoders:"); + foreach (string str in supDecoders) Console.WriteLine(str); + } + + // Show actual decoder + Console.WriteLine("\nDecoder: " + mp.mpg123_current_decoder()); + + // Show estimated file length + Console.WriteLine("\nLength Estimate: " + mp.mpg123_length().ToString()); + + // Scan - gets actual details including ID3v2 and Frame offsets + err = mp.mpg123_scan(); + + // Show actual file length + if (err == mpg123clr.mpg.ErrorCode.ok) Console.WriteLine("Length Actual : " + mp.mpg123_length().ToString()); + + // Get ID3 data + mpg123clr.id3.mpg123id3v1 iv1; + mpg123clr.id3.mpg123id3v2 iv2; + err = mp.mpg123_id3(out iv1, out iv2); + + // Show ID3v2 data + Console.WriteLine("\nTitle : " + iv2.title); + Console.WriteLine("Artist : " + iv2.artist); + Console.WriteLine("Album : " + iv2.album); + Console.WriteLine("Comment: " + iv2.comment); + Console.WriteLine("Year : " + iv2.year); + + // Demo seek (back to start of file - note: scan should already have done this) + long pos = mp.mpg123_seek(0, System.IO.SeekOrigin.Begin); + + long[] frameindex; + long step; + err = mp.mpg123_index(out frameindex, out step); + + if (err == mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("\nFrameIndex:"); + foreach (long idx in frameindex) + { + // Console.WriteLine(idx.ToString()); + } + } + + int num; + uint cnt; + IntPtr audio; + + // Walk the file - effectively decode the data without using it... + Console.WriteLine("\nWalking : " + iv2.title); + DateTime dte, dts = DateTime.Now; + + while (err == mpg123clr.mpg.ErrorCode.ok || err == mpg123clr.mpg.ErrorCode.new_format) + { + err = mp.mpg123_decode_frame(out num, out audio, out cnt); + + // do something with "audio" here.... + } + + dte = DateTime.Now; + + TimeSpan ts = dte - dts; + Console.WriteLine("Duration: " + ts.ToString()); + + mp.mpg123_close(); + } + + mp.Dispose(); + + } + + static unsafe void RunFrameByFrameTest(string filename) + { + mpg123clr.mpg.ErrorCode err; + + mpg123 mp = new mpg123(); + err = mp.mpg123_new(); + + err = mp.mpg123_open(filename); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Error: " + mp.mpg123_strerror()); + } + else + { + Console.WriteLine("Open:"); + + // Show available decoders + string[] Decoders = mp.mpg123_decoders(); + + if (Decoders.Length > 0) + { + Console.WriteLine("\nDecoders:"); + foreach (string str in Decoders) Console.WriteLine(str); + } + + // Show supported decoders + string[] supDecoders = mp.mpg123_supported_decoders(); + + if (supDecoders.Length > 0) + { + Console.WriteLine("\nSupported Decoders:"); + foreach (string str in supDecoders) Console.WriteLine(str); + } + + // Show actual decoder + Console.WriteLine("\nDecoder: " + mp.mpg123_current_decoder()); + + // Show estimated file length + Console.WriteLine("\nLength Estimate: " + mp.mpg123_length().ToString()); + + // Scan - gets actual details including ID3v2 and Frame offsets + err = mp.mpg123_scan(); + + // Show actual file length + if (err == mpg123clr.mpg.ErrorCode.ok) Console.WriteLine("Length Actual : " + mp.mpg123_length().ToString()); + + // Get ID3 data + mpg123clr.id3.mpg123id3v1 iv1; + mpg123clr.id3.mpg123id3v2 iv2; + err = mp.mpg123_id3(out iv1, out iv2); + + // Show ID3v2 data + Console.WriteLine("\nTitle : " + iv2.title); + Console.WriteLine("Artist : " + iv2.artist); + Console.WriteLine("Album : " + iv2.album); + Console.WriteLine("Comment: " + iv2.comment); + Console.WriteLine("Year : " + iv2.year); + + // Demo seek (back to start of file - note: scan should already have done this) + long pos = mp.mpg123_seek(0, System.IO.SeekOrigin.Begin); + + long[] frameindex; + long step; + err = mp.mpg123_index(out frameindex, out step); + + if (err == mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("\nFrameIndex:"); + foreach (long idx in frameindex) + { + // Console.WriteLine(idx.ToString()); + } + } + + int num; + uint cnt; + IntPtr audio; + + // Walk the file - effectively decode the data without using it... + Console.WriteLine("\nFrame Walking : " + iv2.title); + DateTime dte, dts = DateTime.Now; + + while (err == mpg123clr.mpg.ErrorCode.ok || err == mpg123clr.mpg.ErrorCode.new_format) + { + err = mp.mpg123_framebyframe_decode(out num, out audio, out cnt); + err = mp.mpg123_framebyframe_next(); + + // do something with "audio" here.... + } + + dte = DateTime.Now; + + TimeSpan ts = dte - dts; + Console.WriteLine("Duration: " + ts.ToString()); + + mp.mpg123_close(); + } + + mp.Dispose(); + + } + } +} diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3f7d5ef --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ReplaceReaderclr")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ReplaceReaderclr")] +[assembly: AssemblyCopyright("© mpg123 project 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c65bdebb-51d7-41ba-875d-b2c938f187fc")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj new file mode 100644 index 0000000..0b858f7 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/ReplaceReaderclr/ReplaceReaderclr.csproj @@ -0,0 +1,72 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6415FBC0-44EC-4158-8A24-127D9BAC5CEA} + Exe + Properties + ReplaceReaderclr + ReplaceReaderclr + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + x86 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {99E8B20E-9C29-46BC-B766-A50F237D88BF} + mpg123clr + + + + + + if exist "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" copy /y "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" "$(TargetDir)" + + \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/Program.cs b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/Program.cs new file mode 100644 index 0000000..93e0bf8 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/Program.cs @@ -0,0 +1,331 @@ +/* + feedseekclr: test program for mpg123clr, showing how to use fuzzy seeking in feeder mode + copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + based on feedseek.c example for libmpg123. + + Comment (Malcolm Boczek) + this CLR example has been written to allow easy comparison to the original feedseek.c example + and uses some constructs that would not normally be used in a C# environment, + eg: byte[]/ASCII text, Marshal.Copy, static fields, lots of casts etc. +*/ + +/* + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.IO; +using System.Runtime.InteropServices; + +using mpg123clr; + +namespace feedseekclr +{ + class Program + { + const int WAVE_FORMAT_PCM = 0x0001; + const int WAVE_FORMAT_IEEE_FLOAT = 0x0003; + + static BinaryWriter _out; + static long totaloffset, dataoffset; + static int rate; + static mpg123clr.mpg.channelcount channels; + static mpg123clr.mpg.enc enc; + static short bitspersample, wavformat; + + // write wav header + static void initwav() + { + uint tmp32 = 0; + ushort tmp16 = 0; + byte[] rifftxt = new byte[] { (byte)'R', (byte)'I', (byte)'F', (byte)'F' }; + byte[] wavetxt = new byte[] { (byte)'W', (byte)'A', (byte)'V', (byte)'E' }; + byte[] fmttxt = new byte[] { (byte)'f', (byte)'m', (byte)'t', (byte)' ' }; + byte[] datatxt = new byte[] { (byte)'d', (byte)'a', (byte)'t', (byte)'a' }; + + _out.Write(rifftxt); + totaloffset = _out.BaseStream.Position; + + _out.Write(tmp32); // total size + _out.Write(wavetxt); + _out.Write(fmttxt); + + tmp32 = 16; + _out.Write(tmp32); // format length + + tmp16 = (ushort)wavformat; + _out.Write(tmp16); // format + + tmp16 = (ushort)channels; + _out.Write(tmp16); // channels + + tmp32 = (uint)rate; + _out.Write(tmp32); // sample rate + + tmp32 = (uint) (rate * bitspersample / 8 * (int)channels); + _out.Write(tmp32); // bytes / second + + tmp16 = (ushort)(bitspersample / 8 * (int)channels); // float 16 or signed int 16 + _out.Write(tmp16); // block align + + tmp16 = (ushort)bitspersample; + _out.Write(tmp16); // bits per sample + + _out.Write(datatxt); + + tmp32 = 0; + dataoffset = _out.BaseStream.Position; + + _out.Write(tmp32); // data length + + } + + // rewrite wav header with final length infos + static void closewav() + { + uint tmp32 = 0; + // ushort tmp16 = 0; + + int total = (int)_out.BaseStream.Position; + + _out.Seek((int)totaloffset, SeekOrigin.Begin); + tmp32 = (uint)(total - (totaloffset + 4)); + + _out.Write(tmp32); + + _out.Seek((int)dataoffset, SeekOrigin.Begin); + + tmp32 = (uint)(total - (dataoffset + 4)); + + _out.Write(tmp32); + } + + // determine correct wav format and bits per sample + // from mpg123 enc value + static void initwavformat() + { + if ((enc & mpg123clr.mpg.enc.enc_float_64) != 0) + { + bitspersample = 64; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if ((enc & mpg123clr.mpg.enc.enc_float_32) != 0) + { + bitspersample = 32; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if ((enc & mpg123clr.mpg.enc.enc_16) != 0) + { + bitspersample = 16; + wavformat = WAVE_FORMAT_PCM; + } + else + { + bitspersample = 8; + wavformat = WAVE_FORMAT_PCM; + } + } + + static void Main(string[] args) + { + const long INBUFF = 16384 * 2 * 2; + + int ret; + mpg123clr.mpg.ErrorCode state; + long inoffset,inc = 0; + long outc = 0; + byte[] buf = new byte[INBUFF]; + + if (args.Length < 2) + { + Console.WriteLine("Please supply in and out filenames\n"); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + mpg123clr.mpg.ErrorCode err; + + err = mpg123.mpg123_init(); + + mpg123 mp = new mpg123(); + err = mp.mpg123_new(); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to create mpg123 handle: " + mpg123error.mpg123_plain_strerror(err)); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + mp.mpg123_param(mpg123clr.mpg.parms.verbose, 4, 0); + + err = mp.mpg123_param(mpg123clr.mpg.parms.flags, + (int) (mpg123clr.mpg.param_flags.fuzzy | + mpg123clr.mpg.param_flags.seekbuffer | + mpg123clr.mpg.param_flags.gapless), 0); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to set library options: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + // Let the seek index auto-grow and contain an entry for every frame + err = mp.mpg123_param(mpg123clr.mpg.parms.index_size, -1, 0); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to set index size: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + // Use float output formats only + err = mp.mpg123_format_none(); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to disable all output formats: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + int[] rates = mp.mpg123_rates(); + foreach (int rate in rates) + { + err = mp.mpg123_format(rate, mpg123clr.mpg.channelcount.both, mpg123clr.mpg.enc.enc_float_32); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to set float output formats: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + } + + err = mp.mpg123_open_feed(); + + if (err != mpg123clr.mpg.ErrorCode.ok) + { + Console.WriteLine("Unable to open feed: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + string filename = args[0]; + BinaryReader _in = new BinaryReader(File.Open(filename, FileMode.Open)); + + _out = new BinaryWriter(File.Open(args[1], FileMode.Create)); + + while ((ret = (int)(mp.mpg123_feedseek(95000, SeekOrigin.Begin, out inoffset))) == (int)mpg123clr.mpg.ErrorCode.need_more) // equiv to mpg123_feedseek + { + buf = _in.ReadBytes((int)INBUFF); + + if (buf.Length <= 0) break; + + inc += buf.Length; + + state = mp.mpg123_feed(buf, (uint)buf.Length); + + if (state == mpg123clr.mpg.ErrorCode.err) + { + Console.WriteLine("Feed error: " + mp.mpg123_strerror()); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + } + + _in.BaseStream.Seek(inoffset, SeekOrigin.Begin); + + while (true) + { + buf = _in.ReadBytes((int)INBUFF); + if (buf.Length <= 0) break; + + inc += buf.Length; + + err = mp.mpg123_feed(buf, (uint)buf.Length); + + int num; + uint bytes; + IntPtr audio; + + while (err != mpg123clr.mpg.ErrorCode.err && err != mpg123clr.mpg.ErrorCode.need_more) + { + err = mp.mpg123_decode_frame(out num, out audio, out bytes); + + if (err == mpg123clr.mpg.ErrorCode.new_format) + { + mp.mpg123_getformat(out rate, out channels, out enc); + + initwavformat(); + initwav(); + } + + // (Surprisingly?) even though it does a Marshal.Copy it's as efficient as the pointer example below!!! + if (bytes > 0) + { + byte[] outbuf = new byte[bytes]; + Marshal.Copy(audio, outbuf, 0, (int)bytes); + + _out.Write(outbuf, 0, (int)bytes); + } + + // Alternative example of direct usage of audio data via pointers - note it needs "unsafe" + // and I'm fairly sure pointers should be "fixed" first + // if (bytes > 0) + // unsafe{ + // byte* p = (byte*)audio; + // for (int ii = 0; ii < bytes; ii++) + // _out.Write(*p++); + // } + + outc += bytes; + } + + if (err == mpg123clr.mpg.ErrorCode.err) + { + Console.WriteLine("Error: " + mp.mpg123_strerror()); + break; + } + + } + + Console.WriteLine("Finished"); + + closewav(); + + _out.Close(); + _in.Close(); + + mp.mpg123_delete(); + mp.Dispose(); + + mpg123.mpg123_exit(); + + } + } +} diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3a54cdd --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("feedseekclr")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("feedseekclr")] +[assembly: AssemblyCopyright("© mpg123 project 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1fdb46e2-eb93-4e8f-8266-0d386215cc75")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj new file mode 100644 index 0000000..603c572 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/feedseekclr/feedseekclr.csproj @@ -0,0 +1,71 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {626B52AB-1E46-46FB-A259-03DCE3994BE6} + Exe + Properties + feedseekclr + feedseekclr + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + x86 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {99E8B20E-9C29-46BC-B766-A50F237D88BF} + mpg123clr + + + + + + if exist "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" copy /y "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" "$(TargetDir)" + + \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/scanclr/Program.cs b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/scanclr/Program.cs new file mode 100644 index 0000000..52ad856 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/scanclr/Program.cs @@ -0,0 +1,79 @@ +/* + scanclr: Estimate length (sample count) of a mpeg file and compare to length from exact scan. + + copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + CLR example initially written by Malcolm Boczek + Based on scan.c example initially written by Thomas Orgis +*/ + +/* Note the lack of error checking here. + While it would be nicer to inform the user about troubles, libmpg123 is designed _not_ to bite you on operations with invalid handles , etc. + You just jet invalid results on invalid operations... */ +/* Ditto for mpg123clr (MB) */ + +/* + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using mpg123clr; + +namespace scanclr +{ + class Program + { + static void Main(string[] args) + { + if (args.Length < 1) + { + Console.WriteLine("\nI will give you the estimated and exact sample lengths of MPEG audio files.\n"); + Console.WriteLine("\nUsage: scanclr \n\n"); + Console.WriteLine("Press any key to exit:"); + while (Console.Read() == 0) ; + + return; + } + + + mpg123clr.mpg.ErrorCode err; + + err = mpg123.mpg123_init(); + + mpg123 mp = new mpg123(); + err = mp.mpg123_new(); + + mp.mpg123_param(mpg123clr.mpg.parms.resync_limit, -1, 0); + + foreach (string name in args) + { + + err = mp.mpg123_open(name); + + long a, b; + + a = mp.mpg123_length(); + + mp.mpg123_scan(); + + b = mp.mpg123_length(); + + mp.mpg123_close(); + + Console.WriteLine(string.Format("File {0}: estimated {1} vs. scanned {2}", name, a, b)); + } + + Console.WriteLine("\nPress any key to exit:"); + while (Console.Read() == 0) ; + + mp.Dispose(); + + mpg123.mpg123_exit(); + } + } +} diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d915e84 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/scanclr/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("scanclr")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("scanclr")] +[assembly: AssemblyCopyright("© mpg123 project 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a22ea83e-2dba-4835-b0d8-cca3f0bc73a8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj new file mode 100644 index 0000000..ed2d537 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/examples/scanclr/scanclr.csproj @@ -0,0 +1,70 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {53664927-0A21-4056-A5D5-C6A1B4B1F839} + Exe + Properties + scanclr + scanclr + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + x86 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + x86 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {99E8B20E-9C29-46BC-B766-A50F237D88BF} + mpg123clr + + + + + + if exist "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" copy /y "$(SolutionDir)$(ConfigurationName)\libmpg123.dll" "$(TargetDir)" + + \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp new file mode 100644 index 0000000..e8547b6 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/AssemblyInfo.cpp @@ -0,0 +1,76 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +#include "stdafx.h" + +using namespace System::Reflection; +using namespace System::Runtime::CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly:AssemblyTitleAttribute("mpg123clr.dll")]; +[assembly:AssemblyDescriptionAttribute("mpg123clr Dynamic Link Library")]; +[assembly:AssemblyConfigurationAttribute("")]; +[assembly:AssemblyCompanyAttribute("mpg123 Project")]; +[assembly:AssemblyProductAttribute("mpg123clr.dll")]; +[assembly:AssemblyCopyrightAttribute(" 2009-2011 by the mpg123 project")]; +[assembly:AssemblyTrademarkAttribute("")]; +[assembly:AssemblyCultureAttribute("")]; + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the value or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly:AssemblyVersionAttribute("1.13.0.0")]; + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project directory. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly:AssemblyDelaySignAttribute(false)]; +[assembly:AssemblyKeyFileAttribute("")]; +[assembly:AssemblyKeyNameAttribute("")]; diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/ReadMe.txt b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/ReadMe.txt new file mode 100644 index 0000000..f6010d4 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/ReadMe.txt @@ -0,0 +1,165 @@ +======================================================================== + DYNAMIC LINK LIBRARY : mpg123clr Project Overview +======================================================================== + +Project Installation: + +The project is part of a Visual Studio 2008 Solution. + +The Visual Studio solution file is 2008clr.sln located in a folder/directory named 2008clr. + +This folder/directory should be located in the mpg123/ports/MSVC++ folder to maintain file relationships +with required mpg123 library files. i.e. at mpg123/ports/MSVC++/2008clr. + +The solution includes the following projects: + + mpg123clr The mpg123 CLR project. This creates the CLR compatible DLL file. + scanclr Demonstration project for comparison with scan.c example. + feedseekclr Demonstration project for comparison with feedseek.c example + replacereaderclr Demonstration project, how to implement ReplaceReader in CLR (proof of concept) + libmpg123 For convenience, ensures that libmpg123.lib is available for linking + +========================================================================= +Compiling: +Configuration Manager: + +mpg123clr requires linking to a libmpg123 static library, this library must be compiled prior to +compiling the clr projects. mpg123clr uses relative folder position during linking; therefore either:- + + ensure that the 2008clr solution is correctly located within the ports\msvc++ folder, or + change the "linker->input->additional dependencies" to suit your installation configuration + +NOTE: x64 Active Solution Platform configurations are not supplied with this solution but have been tested. +(Effectively all that is required is to change all "include" references to account for the "x64" output locations) + +NOTE: The "unsafe" context of the ReplaceReaderClr project is only required to allow the use of callbacks. +mpg123clr is written to avoid the use of "unsafe" for the majority of normal operations. + + +========================================================================== +Using mpg123clr: + +Mpg123clr is a CLR ready dll. Simply add a reference to the mpg123clr.dll file in your application project. + +You may also add a "using" directive in your program files. C# e.g. using mpg123clr; + +The mpg123clr project is configured to create an additional Intellisense documentation file (mpg123clr.xml) +to assist usage. If you manually relocate the .dll please also copy the .xml file to ensure correct Intellisense +operation. + +=========================================================================== +Common Errors: + +1) Problem: "Unhandled Exception - file not found" error when the application is executed. + Cause: Incorrect libmpg123 library build / missing libmpg123.dll. + Solution: Copy libmpg123.dll to the application output folder - possibly in a Post-Build Event (see scanclr for + an example). + Explanation: mpg123clr requires static library libmpg123.lib and NOT dynamic library libmpg123.dll. + If the libmpg123 library is built using an incorrect Project Context (such as Debug_Generic_Dll), mpg123clr + will attempt to load the libmpg123.dll at runtime even though this file is not required. + Alternatively: Use Configuration Manager and select a non-dll build context for the libmpg123 project. + (i.e. Debug_Generic not Debug_Generic_Dll) + +=========================================================================== +Developer Notes: + + 1) Documentation do not appear in CLR Intellisense environment (at time of writing). + So deferred in favour of within . + 2) During development "off_t" parameters conflicted with intellisense (although size_t worked just fine) + Since many CLR functions that refer to off_t features (e.g. positioners) actually expect 64bit long + (or long long in C++) parameters, I've implemented off_t as a long long - with one notable exception. + This fixed intellisense and accommodates the CLR 64bit long implementation positioners: And then intellisense + started working correctly and made this a moot point - at least as far as intellisense is concerned. + 3) off_t notable exception - SeekDelegate, SeekHandleDelegate + Usually 2008clr functions are called by the callee, long long (clr 64bit long) can be marshaled and passed + to libmpg123. The seek delegate is called directly by the libmpg123 seek functions - there isn't an opportunity + to marshal the offending parameters. A library compiled in 32 bit will expect the SeekDelegate to have a 32bit + position parameter but in 64bit compilation the same parameter will be 64bit. Therefore the need to be correct + overrides the need for consistency with CLR 64bit positioners. + SIDE NOTE: In early tests the SeekDelegate was defined with a long long parameter - libmpg123 called it oblivious + to the fact that the type was incorrect. The only impact was that the 32bit position and 32bit origin (whence) + were compacted to a single 64bit parameter. This is fixed, no longer an issue!!! +4) PosixSeek and PosixRead ARE ONLY INCLUDED AS PROOF OF CONCEPT - to prove that the callbacks into CLR would + function correctly with libmpg123 cdecl calls. It saved making a separate dll for the posix elements. + REPEAT AFTER ME: Not for normal consumption.... +5) The __clrcall decoration of mpg123clr functions is not strictly necessary for Visual Studio 2005 and later, + but has been left in for compatibility with earlier versions. See MS documentation of "double thunking" +6) Many functions use pin_ptr to pin the return variables prior to calling the libmpg123 function, this was + considered as an alternative to avoid the use of local variables with attendant overhead of + allocate/use/copy/destroy etc. In practice pin_ptr has significant overhead, empirical tests showed very + little performance difference between either method. +7) Set pin_ptr to NULL after use, to force early GC (recommended). Carried out performance trials and found + insignificant impact. Since most functions are likely to be used repeatedly decided to follow recommended usage. + If code analysis proves this to be redundant - can be removed... + (1.9.0.1 update) "insignificant" in Debug mode, quite significant if the debug overhead is removed, + i.e. Release mode. So try/finally blocks removed in favour of allocating temporary local return variable. +8) (1.12.0.0 update) Support for mpg123_open_handle warrants further description... here it is. + a) Pinning of delegates is not required. See Microsoft: C++, How to: Marshal Callbacks and Delegates Using C++ Interop + b) Pinning of objects is an entirely different matter, so why is the open_handle object not pinned? + Answer: Because it's an object. I allowed passing of any object not just handles. + i) a pin_ptr cannot be a field member for instance scope. + ii) cannot pin the object itself because there's no object.field to pin + iii) cannot pin the object target because the referenced object may be unblittable. + iv) GCHandle.Alloc(obj, GCHandleType.Pinned) doesn't work on unblittable objects (eg managed references like BinaryReader) + Since I don't restrict which objects may be passed I'm forced to exclude pinning. + c) The generated handle doesn't need to be pinned. GCHandle.Alloc(obj) creates a potentially GC relocatable object + containing a Handle to the object. The GCHandle.ToIntPtr(userObjectHandle) creates an integer representation of the + handle that is valid irrespective of any GC relocation of either the object or the GCHandle and can therefore be + passed through unmanaged code to CLR native methods that can re-reference the original object via GCHandle.FromIntPtr + and gch.Target. + All this seems relatively efficient, certainly there is little performance difference between the ReplaceReader + and ReplaceReaderHandle sample code. + +============================================================================= +Tested/Untested + +I haven't used mpg123clr in a production project yet, although one is about to start. Therefore EVERYTHING should +be treated as though unproven. UPDATE: the scanclr, feedseekclr and replacereaderclr examples have provided a basic +functional test. + +Largefile support totally untested... would appreciate a volunteer. + +The majority of functions have been tried in test projects with the following exceptions. + +64bit compilation. mpg123clr compiles correctly in 64bit x64 platform mode, but hasn't been tested. + +ICY(icy_meta); Never had genuine ICY data to test with. +Icy2Utf8(icy_text); Never tried. Please provide sample material. +enc_from_id3(encbyte); Works on libmpg123 enums, never had real world text samples. +store_utf8(...); Works with CLR generated text, not tried with real world text samples. +mpg123str.strlen(...) Not tested with utf8 text strings. Please provide sample material. + +============================================================================== +Documentation + +mpg123clr is 90% documentation, use intellisense as your reference. If in doubt refer back to the libmpg123 +documents. NOTE: You need to build the mpg123clr library to create the intellisense file. + +=============================================================================== +Error Trapping + +libmpg123 is an error agnostic library - it shouldn't generate errors, but neither does it trap them. + +mpg123clr is built on the same concept although some CLR generated errors have been trapped. My personal +preference is that exceptions should be avoided not relied on... + +THE CALLING APPLICATION IS RESPONSIBLE FOR ERROR DETECTION, TRAPPING AND CORRECTION. + +All projects are "as is" with no express or implied warranty. Demonstration projects are to demonstrate the +use of the library and are NOT considered examples of good coding practice. Use at own risk. + +=============================================================================== +Revision History + + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.9.0.0 30-Sep-09 Project config - if exists, copy libmpg123.dll to app output folder (mb) + 1.9.0.0 01-Oct-09 Technical cleanup - subst nullptr for NULL (mb) + 1.9.0.1 24-Nov-09 Performance update - removed try/finally (mb) + 1.12.0.0 14-Apr-10 Release match - added open_handle and framebyframe support (mb) + 1.13.0.0 13-Jan-11 Release match - added encsize and strlen support (mb) + +Constructive feedback preferred. + +Malcolm Boczek +mpg123clr original author. diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/advanced.cpp b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/advanced.cpp new file mode 100644 index 0000000..ef9ebdf --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/advanced.cpp @@ -0,0 +1,91 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.9.0.0 13-Oct-09 pin_ptr = nullptr on return (mb) + 1.9.0.1 24-Nov-09 performance update - removed try/finally (mb) +*/ + +#include "StdAfx.h" +#include "advanced.h" + +mpg123clr::advpars::advpars(int% error) +{ + pin_ptr err = &error; + mp = ::mpg123_new_pars(err); + + err = nullptr; +} + +mpg123clr::advpars::~advpars(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!advpars(); +} + +mpg123clr::advpars::!advpars(void) +{ + if (mp != NULL) + { + ::mpg123_delete_pars(mp); + mp = NULL; + } +} + +mpg123clr::mpg::ErrorCode mpg123clr::advpars::mpg123_fmt_none(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_fmt_none(mp); +} + +mpg123clr::mpg::ErrorCode mpg123clr::advpars::mpg123_fmt_all(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_fmt_all(mp); +} + +mpg123clr::mpg::ErrorCode mpg123clr::advpars::mpg123_fmt(int rate, mpg123clr::mpg::channelcount channels, int encodings) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_fmt(mp, rate, (int)channels, encodings); +} + +mpg123clr::mpg::channelcount mpg123clr::advpars::mpg123_fmt_support(int rate, int encodings) +{ + return (mpg123clr::mpg::channelcount) ::mpg123_fmt_support(mp, rate, encodings); +} + +mpg123clr::mpg::ErrorCode mpg123clr::advpars::mpg123_par(mpg123clr::mpg::parms type, int val, double fval) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_par(mp, (mpg123_parms) type, val, fval); +} + +mpg123clr::mpg::ErrorCode mpg123clr::advpars::mpg123_getpar(mpg123clr::mpg::parms type, [Out] int% val, [Out] double% fval) +{ + // Avoid need for local intermediary variables + pin_ptr _val = &val; + pin_ptr _fval = &fval; + + int ret = ::mpg123_getpar(mp, (mpg123_parms) type, (long*)_val, _fval); + + _fval = nullptr; + _val = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/advanced.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/advanced.h new file mode 100644 index 0000000..0bbd4a8 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/advanced.h @@ -0,0 +1,130 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include "enum.h" +#include "error.h" + +using namespace System; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see (Microsoft) Destructors and Finalizers in Visual C++] + // + // C++/CLI + // A myA; + // // use myA here + // + // Equivalent user code: + // + // A ^ myA = gcnew A; + // try { /* use myA here */ } finally { delete myA; } + // + // + // C# (from wikipedia) + // using(A myA = new A()) { /* Use myA here */ } + // Compiler calls myA.Dispose(), in a "finally" of a "try/finally" block + // + // Equivalent user code: + // + // A myA = new myA(); + // try { /* Use myA here */ } finally { myA.Dispose(); } + // + // Otherwise Finalizer will be nondeterministically called by GC + + + /// CLR wrapper for mpg123_pars object. + public ref class advpars + { + protected public: + mpg123_pars* mp; + + protected: + !advpars(void); + + public: + ///Constructor. + ///Returns MPG123_OK or mpg123 error code. + advpars([Out] int% error); + + ///Destructor. + ~advpars(void); + + ///Configure mpg123 parameters to accept no output formats. + ///Use to clear default parameters prior to applying specific settings. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_fmt_none(void); + + ///Configure mpg123 parameters to accept all formats including custom rate you may set - this is the default. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_fmt_all(void); + + ///Configure detailed output formats. + ///Returns MPG123 error codes. + /// + ///Sample rate (Hertz) + ///Combination of channelcount.stereo and channelcount.mono + ///Combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none) + ///MPG123 error codes. + /// VERSION CHECK: long as int for Intellisense + mpg123clr::mpg::ErrorCode __clrcall mpg123_fmt(int rate, mpg123clr::mpg::channelcount channels, int encodings); + + ///Get available support for supplied rate and encoding. + ///Returns 0 for no support (includes invalid parameters), or combination of channelcount.stereo and channelcount.mono. + /// + ///Sample rate (Hertz) + ///Combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none) + ///Returns 0 for no support (includes invalid parameters), or combination of channelcount.stereo and channelcount.mono. + /// VERSION CHECK: long as int for Intellisense + mpg123clr::mpg::channelcount __clrcall mpg123_fmt_support(int rate, int encoding); + + ///Set a specific advpars value. + ///Returns MPG123 error codes. + /// + ///Specifies the advpars parameter to be set. + ///The integer value to be applied. + ///The real value to be applied. + ///MPG123 error codes. + /// VERSION CHECK: long as int for Intellisense + mpg123clr::mpg::ErrorCode __clrcall mpg123_par(mpg123clr::mpg::parms type, int val, double fval); + + ///Get a specific advpars value. + ///Returns MPG123 error codes. + /// + ///Specifies the advpars parameter to be returned. + ///Returns the applicable integer value. + ///Returns the applicable real value. + ///MPG123 error codes. + /// VERSION CHECK: long as int for Intellisense + mpg123clr::mpg::ErrorCode __clrcall mpg123_getpar(mpg123clr::mpg::parms type, [Out] int% val, [Out] double% fval); + }; + +} \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/dllmain.cpp b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/dllmain.cpp new file mode 100644 index 0000000..8a4edd3 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/enum.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/enum.h new file mode 100644 index 0000000..a3c251a --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/enum.h @@ -0,0 +1,218 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.10.0.0 30-Nov-09 release match - added mpg123_feature (mb) + 1.13.0.0 13-Jan-11 release match (mb) +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + + +namespace mpg123clr +{ + ///Mpg123 enumerations. + namespace mpg + { + + ///Enumeration of the parameters types that it is possible to set/get. + public enum class parms + { + verbose = MPG123_VERBOSE, /// set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) + flags = MPG123_FLAGS, /// set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) + add_flags = MPG123_ADD_FLAGS, /// add some flags (integer) + force_rate = MPG123_FORCE_RATE, /// when value > 0, force output rate to that value (integer) + down_sample = MPG123_DOWN_SAMPLE, /// 0=native rate, 1=half rate, 2=quarter rate (integer) + rva = MPG123_RVA, /// one of the RVA choices above (integer) + downspeed = MPG123_DOWNSPEED, /// play a frame N times (integer) + upspeed = MPG123_UPSPEED, /// play every Nth frame (integer) + start_frame = MPG123_START_FRAME, /// start with this frame (skip frames before that, integer) + decode_frames = MPG123_DECODE_FRAMES, /// decode only this number of frames (integer) + icy_interval = MPG123_ICY_INTERVAL, /// stream contains ICY metadata with this interval (integer) + outscale = MPG123_OUTSCALE, /// the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) + timeout = MPG123_TIMEOUT, /// timeout for reading from a stream (not supported on win32, integer) + remove_flags = MPG123_REMOVE_FLAGS, /// remove some flags (inverse of MPG123_ADD_FLAGS, integer) + resync_limit = MPG123_RESYNC_LIMIT, /// Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). + index_size = MPG123_INDEX_SIZE, /// Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. + preframes = MPG123_PREFRAMES /// Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please. + + }; + + + ///Parameter flag bits. + ///Equivalent to MPG123_FLAGS, use the usual binary or ( | ) to combine. + public enum class param_flags + { + force_mono = MPG123_FORCE_MONO, /// 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. + mono_left = MPG123_MONO_LEFT, /// 0001 Force playback of left channel only. + mono_right = MPG123_MONO_RIGHT, /// 0010 Force playback of right channel only. + mono_mix = MPG123_MONO_MIX, /// 0100 Force playback of mixed mono. + force_stereo = MPG123_FORCE_STEREO, /// 1000 Force stereo output. + force_8bit = MPG123_FORCE_8BIT, /// 00010000 Force 8bit formats. + quiet = MPG123_QUIET, /// 00100000 Suppress any printouts (overrules verbose). + gapless = MPG123_GAPLESS, /// 01000000 Enable gapless decoding (default on if libmpg123 has support). + no_resync = MPG123_NO_RESYNC, /// 10000000 Disable resync stream after error. + seekbuffer = MPG123_SEEKBUFFER, /// 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). + fuzzy = MPG123_FUZZY, /// 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) + force_float = MPG123_FORCE_FLOAT, /// 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). + + ///Prevent ID3 text translation to UTF-8. + ///NOTE: Do not set if you intend to use CLR id3v2 objects. + /// + plain_id3text = MPG123_PLAIN_ID3TEXT, /// 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. + + ignore_streamlength = MPG123_IGNORE_STREAMLENGTH, /// 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag. + + // 1.13.0.0 + skip_id3v2 = MPG123_SKIP_ID3V2, /// 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. + }; + + ///RVA enumeration. + ///Equivalent to MPG123_RVA. + public enum class rva + { + rva_off = MPG123_RVA_OFF, /// RVA disabled (default). + rva_mix = MPG123_RVA_MIX, /// Use mix/track/radio gain. + rva_album = MPG123_RVA_ALBUM, /// Use album/audiophile gain + rva_max = MPG123_RVA_ALBUM, /// The maximum RVA code, may increase in future. + }; + + ///Feature set available for query with mpg123_feature. + ///Equivalent to MPG123_FEATURE_SET. + public enum class feature_set + { + feature_abi_utf8open = MPG123_FEATURE_ABI_UTF8OPEN, /// mpg123 expects path names to be given in UTF-8 encoding instead of plain native. + feature_output_8bit = MPG123_FEATURE_OUTPUT_8BIT, /// 8bit output + feature_output_16bit = MPG123_FEATURE_OUTPUT_16BIT, /// 16bit output + feature_output_32bit = MPG123_FEATURE_OUTPUT_32BIT, /// 32bit output + feature_index = MPG123_FEATURE_INDEX, /// support for building a frame index for accurate seeking + feature_parse_id3v2 = MPG123_FEATURE_PARSE_ID3V2, /// id3v2 parsing + feature_decode_layer1 = MPG123_FEATURE_DECODE_LAYER1, /// mpeg layer-1 decoder enabled + feature_decode_layer2 = MPG123_FEATURE_DECODE_LAYER2, /// mpeg layer-2 decoder enabled + feature_decode_layer3 = MPG123_FEATURE_DECODE_LAYER3, /// mpeg layer-3 decoder enabled + feature_decode_accurate = MPG123_FEATURE_DECODE_ACCURATE, /// accurate decoder rounding + feature_decode_downsample = MPG123_FEATURE_DECODE_DOWNSAMPLE, /// downsample (sample omit) + feature_decode_ntom = MPG123_FEATURE_DECODE_NTOM, /// flexible rate decoding + feature_parse_icy = MPG123_FEATURE_PARSE_ICY, /// ICY support + feature_timeout_read = MPG123_FEATURE_TIMEOUT_READ, /// Reader with timeout (network) + }; + + + + ///An enum over all sample types possibly known to mpg123. + ///The values are designed as bit flags to allow bitmasking for encoding families. + /// + ///Note that (your build of) libmpg123 does not necessarily support all these. + /// Usually, you can expect the 8bit encodings and signed 16 bit. + /// Also 32bit float will be usual beginning with mpg123-1.7.0 . + /// + ///What you should bear in mind is that (SSE, etc) optimized routines may be absent + /// for some formats. We do have SSE for 16, 32 bit and float, though. + /// 24 bit integer is done via postprocessing of 32 bit output -- just cutting + /// the last byte, no rounding, even. If you want better, do it yourself. + /// + ///All formats are in native byte order. On a little endian machine this should mean + /// that you can just feed the MPG123_ENC_SIGNED_32 data to common 24bit hardware that + /// ignores the lowest byte (or you could choose to do rounding with these lower bits). + /// + public enum class enc + { + enc_8 = MPG123_ENC_8, /// 0000 0000 1111 Some 8 bit integer encoding. + enc_16 = MPG123_ENC_16, /// 0000 0100 0000 Some 16 bit integer encoding. + enc_24 = MPG123_ENC_24, /// 0100 0000 0000 0000 Some 24 bit integer encoding. (r1.13) + enc_32 = MPG123_ENC_32, /// 0001 0000 0000 Some 32 bit integer encoding. + enc_signed = MPG123_ENC_SIGNED, /// 0000 1000 0000 Some signed integer encoding. + enc_float = MPG123_ENC_FLOAT, /// 1110 0000 0000 Some float encoding. + enc_signed_16 = MPG123_ENC_SIGNED_16, /// 1101 0000 signed 16 bit + enc_unsigned_16 = MPG123_ENC_UNSIGNED_16, /// 0110 0000 unsigned 16 bit + enc_unsigned_8 = MPG123_ENC_UNSIGNED_8, /// 0000 0001 unsigned 8 bit + enc_signed_8 = MPG123_ENC_SIGNED_8, /// 1000 0010 signed 8 bit + enc_ulaw_8 = MPG123_ENC_ULAW_8, /// 0000 0100 ulaw 8 bit + enc_alaw_8 = MPG123_ENC_ALAW_8, /// 0000 1000 alaw 8 bit + enc_signed_32 = MPG123_ENC_SIGNED_32, /// 0001 0001 1000 0000 signed 32 bit + enc_unsigned_32 = MPG123_ENC_UNSIGNED_32, /// 0010 0001 0000 0000 unsigned 32 bit + enc_signed_24 = MPG123_ENC_SIGNED_24, /// 0101 0000 1000 0000 signed 24 bit (r1.13) + enc_unsigned_24 = MPG123_ENC_UNSIGNED_24, /// 0110 0000 0000 0000 unsigned 24 bit (r1.13) + enc_float_32 = MPG123_ENC_FLOAT_32, /// 0010 0000 0000 32bit float + enc_float_64 = MPG123_ENC_FLOAT_64, /// 0100 0000 0000 64bit float + enc_any = MPG123_ENC_ANY, /// any encoding + }; + + + ///Channel count enumeration + ///clr added both + public enum class channelcount + { + mono = MPG123_MONO, + stereo = MPG123_STEREO, + both = MPG123_MONO | MPG123_STEREO, + }; + + ///Channel enumeration. + public enum class channels + { + left = MPG123_LEFT, /// The Left Channel. + right = MPG123_RIGHT, /// The Right Channel. + both = MPG123_LR, /// Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT + }; + + ///VBR enumeration. + public enum class mpeg_vbr + { + cbr = MPG123_CBR, /// Constant Bitrate Mode (default) + vbr = MPG123_VBR, /// Variable Bitrate Mode + abr = MPG123_ABR, /// Average Bitrate Mode + }; + + ///MPEG Version enumeration. + public enum class mpeg_version + { + mpeg_1_0 = MPG123_1_0, /// MPEG Version 1.0 + mpeg_2_0 = MPG123_2_0, /// MPEG Version 2.0 + mpeg_2_5 = MPG123_2_5, /// MPEG Version 2.5 + }; + + ///MPEG Mode enumeration. + public enum class mpeg_mode + { + m_stereo = MPG123_M_STEREO, /// Standard Stereo. + m_joint = MPG123_M_JOINT, /// Joint Stereo. + m_dual = MPG123_M_DUAL, /// Dual Channel. + m_mono = MPG123_M_MONO, /// Single Channel. + }; + + ///MPEG Flags enumeration. + public enum class mpeg_flags + { + CRC = MPG123_CRC, /// The bitstream is error protected using 16-bit CRC. + COPYRIGHT = MPG123_COPYRIGHT, /// The bitstream is copyrighted. + PRIVATE = MPG123_PRIVATE, /// The private bit has been set. + ORIGINAL = MPG123_ORIGINAL, /// The bitstream is an original, not a copy. + }; + + ///Positional state. + public enum class state + { + accurate = MPG123_ACCURATE /// Query if positons are currently accurate (integer value, 0 if false, 1 if true) + }; + + + } +} \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/error.cpp b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/error.cpp new file mode 100644 index 0000000..aeb964e --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/error.cpp @@ -0,0 +1,48 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) +*/ + +#include "StdAfx.h" +#include "error.h" + +mpg123clr::mpg123error::mpg123error(void) +{ +} + +// Destructor cleans up all resources +mpg123clr::mpg123error::~mpg123error(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!mpg123error(); +} + +// Finalizer cleans up unmanaged resources +mpg123clr::mpg123error::!mpg123error(void) +{ + // none! +} + +String^ mpg123clr::mpg123error::mpg123_plain_strerror(mpg123clr::mpg::ErrorCode errcode) +{ + return gcnew String(::mpg123_plain_strerror((int)errcode)); +} + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/error.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/error.h new file mode 100644 index 0000000..c20976f --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/error.h @@ -0,0 +1,134 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.12.0.0 14-Apr-10 Revision harmonization (catch-up) +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include "enum.h" + +using namespace System; + +namespace mpg123clr +{ + // defgroup mpg123_error mpg123 error handling + // + // Functions to get text version of the error numbers and an enumeration + // of the error codes returned by libmpg123. + // + // Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + // Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + // The positive range of return values is used for "useful" values when appropriate. + // + // + // + + + namespace mpg + { + ///Enumeration of the message and error codes as returned by libmpg123 functions. + public enum class ErrorCode + { + done = MPG123_DONE, /// Message: Track ended. + new_format = MPG123_NEW_FORMAT, /// Message: Output format will be different on next call. + need_more = MPG123_NEED_MORE, /// Message: For feed reader: "Feed me more!" + err = MPG123_ERR, /// Generic Error + ok = MPG123_OK, /// Success + bad_outformat = MPG123_BAD_OUTFORMAT, /// Unable to set up output format! + bad_channel = MPG123_BAD_CHANNEL, /// Invalid channel number specified. + bad_rate = MPG123_BAD_RATE, /// Invalid sample rate specified. + err_16to8table = MPG123_ERR_16TO8TABLE, /// Unable to allocate memory for 16 to 8 converter table! + bad_param = MPG123_BAD_PARAM, /// Bad parameter id! + bad_buffer = MPG123_BAD_BUFFER, /// Bad buffer given -- invalid pointer or too small size. + out_of_mem = MPG123_OUT_OF_MEM, /// Out of memory -- some malloc() failed. + not_initialized = MPG123_NOT_INITIALIZED, /// You didn't initialize the library! + bad_decoder = MPG123_BAD_DECODER, /// Invalid decoder choice. + bad_handle = MPG123_BAD_HANDLE, /// Invalid mpg123 handle. + no_buffers = MPG123_NO_BUFFERS, /// Unable to initialize frame buffers (out of memory?). + bad_rva = MPG123_BAD_RVA, /// Invalid RVA mode. + no_gapless = MPG123_NO_GAPLESS, /// This build doesn't support gapless decoding. + no_space = MPG123_NO_SPACE, /// Not enough buffer space. + bad_types = MPG123_BAD_TYPES, /// Incompatible numeric data types. + bad_band = MPG123_BAD_BAND, /// Bad equalizer band. + err_null = MPG123_ERR_NULL, /// Null pointer given where valid storage address needed. + err_reader = MPG123_ERR_READER, /// Error reading the stream. + no_seek_from_end = MPG123_NO_SEEK_FROM_END, /// Cannot seek from end (end is not known). + bad_whence = MPG123_BAD_WHENCE, /// Invalid 'whence' for seek function. + no_timeout = MPG123_NO_TIMEOUT, /// Build does not support stream timeouts. + bad_file = MPG123_BAD_FILE, /// File access error. + no_seek = MPG123_NO_SEEK, /// Seek not supported by stream. + no_reader = MPG123_NO_READER, /// No stream opened. + bad_pars = MPG123_BAD_PARS, /// Bad parameter handle. + bad_index_par = MPG123_BAD_INDEX_PAR, /// Bad parameters to mpg123_index() + out_of_sync = MPG123_OUT_OF_SYNC, /// Lost track in bytestream and did not try to resync. + resync_fail = MPG123_RESYNC_FAIL, /// Resync failed to find valid MPEG data. + no_8bit = MPG123_NO_8BIT, /// No 8bit encoding possible. + bad_align = MPG123_BAD_ALIGN, /// Stack aligmnent error + null_buffer = MPG123_NULL_BUFFER, /// NULL input buffer with non-zero size... + no_relseek = MPG123_NO_RELSEEK, /// Relative seek not possible (screwed up file offset) + null_pointer = MPG123_NULL_POINTER, /// You gave a null pointer somewhere where you shouldn't have. + bad_key = MPG123_BAD_KEY, /// Bad key value given. + no_index = MPG123_NO_INDEX, /// No frame index in this build. + index_fail = MPG123_INDEX_FAIL, /// Something with frame index went wrong. + bad_decoder_setup = MPG123_BAD_DECODER_SETUP, /// Something prevents a proper decoder setup + missing_feature = MPG123_MISSING_FEATURE, /// This feature has not been built into libmpg123. + /* 1.8.1 */ + bad_value = MPG123_BAD_VALUE, /// A bad value has been given, somewhere. + lseek_failed = MPG123_LSEEK_FAILED, /// Low-level seek failed. + /* 1.12.0 */ + bad_custom_io = MPG123_BAD_CUSTOM_IO, /// Custom I/O not prepared. + lfs_overflow = MPG123_LFS_OVERFLOW, /// Offset value overflow during translation of large file API calls, + /// - your client program cannot handle that large file. + + }; + } + + ///Wrapper for mpg123_errors + public ref class mpg123error + { + protected: + ///Finalizer. + ///Cleanly handles mpg123_delete of internal (unmanaged) handles. + /// Implementation of CLR Finalize(). + !mpg123error(void); + + public: + ///Constructor. + mpg123error(void); + + ///Destructor. Used for final object deletion. + ///Calls finalizer for clean disposal of internal (unmanaged) library handles. + /// + /// Implementation of CLR Dispose(). + /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + /// See Destructors and Finalizers in Visual C++ + ~mpg123error(void); + + ///Obtain a string description of the errcode meaning. + ///Returns a String description representing the error code. + /// + ///The error code to be described. + ///Returns a String description representing the error code. + static String^ __clrcall mpg123_plain_strerror(mpg123clr::mpg::ErrorCode errcode); + }; +} \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v1.cpp b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v1.cpp new file mode 100644 index 0000000..2b8bd87 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v1.cpp @@ -0,0 +1,92 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 01-Oct-09 Technical cleanup - subst nullptr for NULL (mb) +*/ + +#include "StdAfx.h" +#include "id3v1.h" + +mpg123clr::id3::mpg123id3v1::mpg123id3v1(void) +{ +} + +mpg123clr::id3::mpg123id3v1::mpg123id3v1(mpg123_id3v1* sb) +{ + this->sb = sb; +} + + +// Destructor +mpg123clr::id3::mpg123id3v1::~mpg123id3v1(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!mpg123id3v1(); +} + +// Finalizer +mpg123clr::id3::mpg123id3v1::!mpg123id3v1(void) +{ + // we do not create the underlying structure, so shouldn't dispose it either... +} + +String^ mpg123clr::id3::mpg123id3v1::tag::get() +{ + if (sb == nullptr || sb->tag == nullptr) return gcnew String(""); + + return Marshal::PtrToStringAnsi((IntPtr)sb->tag, (int)strnlen(sb->tag, 3)); +} + +String^ mpg123clr::id3::mpg123id3v1::title::get() +{ + if (sb == nullptr || sb->title == nullptr) return gcnew String(""); + + return Marshal::PtrToStringAnsi((IntPtr)sb->title, (int)strnlen(sb->title, 30)); +} + +String^ mpg123clr::id3::mpg123id3v1::artist::get() +{ + if (sb == nullptr || sb->artist == nullptr) return gcnew String(""); + + return Marshal::PtrToStringAnsi((IntPtr)sb->artist, (int)strnlen(sb->artist, 30)); +} + +String^ mpg123clr::id3::mpg123id3v1::album::get() +{ + if (sb == nullptr || sb->album == nullptr) return gcnew String(""); + + return Marshal::PtrToStringAnsi((IntPtr)sb->album, (int)strnlen(sb->album, 30)); +} + +String^ mpg123clr::id3::mpg123id3v1::comment::get() +{ + if (sb == nullptr || sb->comment == nullptr) return gcnew String(""); + + return Marshal::PtrToStringAnsi((IntPtr)sb->comment, (int)strnlen(sb->comment, 30)); +} + +int mpg123clr::id3::mpg123id3v1::genre::get() +{ + if (sb == nullptr) return 0; + + return sb->genre; +} + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v1.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v1.h new file mode 100644 index 0000000..b1ce75e --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v1.h @@ -0,0 +1,132 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include +#include + +#include +using namespace std; +using namespace System; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + namespace id3 + { + ///id3check enumeration. + public enum class id3check + { + none = 0, + id3 = 2, /**< 0010 There is some ID3 info. */ + upd_id3 = MPG123_ID3, /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */ + new_id3 = MPG123_NEW_ID3, /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */ + icy = 8, /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ + upd_icy = MPG123_ICY, /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/ + new_icy = MPG123_NEW_ICY, /**< 0100 There is ICY info that changed since last call to mpg123_icy. */ + }; + + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see Destructors and Finalizers in Visual C++] + // + // A ^ myA = gcnew A; + // try + // { + // use myA + // } + // finally + // { + // delete myA; + // } + + ///Wrapper for mpg123_id3v1. + [StructLayout(LayoutKind::Sequential)] + public ref struct mpg123id3v1 + { + private: + mpg123_id3v1* sb; + protected: + ///Finalizer. + ///Cleanly handles mpg123_delete of internal (unmanaged) mpg123 handle. + /// Implementation of CLR Finalize(). + !mpg123id3v1(void); + internal: + ///Working Constructor. + ///Maps to mpg123_id3v1 memory. + /// + mpg123id3v1(mpg123_id3v1* sb); + public: + ///Constructor. + ///Only creates object for use as "out" target in ID3 constructor. + /// + mpg123id3v1(void); + + ///Destructor. Used for final object deletion. + ///Calls finalizer for clean disposal of internal (unmanaged) library handles. + /// + /// Implementation of CLR Dispose(). + /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + /// See Destructors and Finalizers in Visual C++ + ~mpg123id3v1(void); + + ///Get the ID3v1 tag descriptor. + ///Property returns the ID3v1 tag (should always be "TAG"). + /// + ///The ID3v1 tag (should always be "TAG"). + property String^ tag{String^ __clrcall get();} + + ///Get the ID3v1 title text. + ///Property returns the ID3v1 title text. + /// + ///The ID3v1 title text. + property String^ title{String^ __clrcall get();} + + ///Get the ID3v1 artist text. + ///Property returns the ID3v1 artist text. + /// + ///The ID3v1 artist text. + property String^ artist{String^ __clrcall get();} + + ///Get the ID3v1 album text. + ///Property returns the ID3v1 album text. + /// + ///The ID3v1 album text. + property String^ album{String^ __clrcall get();} + + ///Get the ID3v1 comment text. + ///Property returns the ID3v1 comment text. + /// + ///The ID3v1 comment text. + property String^ comment{String^ __clrcall get();} + + ///Get the ID3v1 genre index. + ///Property returns the ID3v1 genre index. + /// + ///The ID3v1 genre index. + property int genre{int __clrcall get();} + + + }; + } +} \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v2.cpp b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v2.cpp new file mode 100644 index 0000000..a5ec9e3 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v2.cpp @@ -0,0 +1,138 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 01-Oct-09 Technical cleanup - subst nullptr for NULL (mb) + 1.10.0.0 30-Nov-09 Add test for null base (sb) - in addition to null string test (mb) + (required if v2 referenced prior to file scan) +*/ + +#include "StdAfx.h" +#include "id3v2.h" + +mpg123clr::id3::mpg123id3v2::mpg123id3v2(void) +{ +} + +mpg123clr::id3::mpg123id3v2::mpg123id3v2(mpg123_id3v2* sb) +{ + this->sb = sb; +} + + +// Destructor +mpg123clr::id3::mpg123id3v2::~mpg123id3v2(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!mpg123id3v2(); +} + +// Finalizer +mpg123clr::id3::mpg123id3v2::!mpg123id3v2(void) +{ + // we do not create the underlying structure, so shouldn't dispose it either... +} + +String^ mpg123clr::id3::mpg123id3v2::title::get() +{ + // updated: more efficient "union style" mpg123str + mpg123str^ str = (sb == nullptr || sb->title == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->title); + + // Deprecated remnant - uses "overlayed style" mpg123str - note inefficient PtrToStrucure... + // mpg123str^% str = gcnew mpg123str; + // Marshal::PtrToStructure((IntPtr)sb->title, str); + + return str->Text; +} + +String^ mpg123clr::id3::mpg123id3v2::artist::get() +{ + mpg123str^ str = (sb == nullptr || sb->artist == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->artist); + + return str->Text; +} + +String^ mpg123clr::id3::mpg123id3v2::album::get() +{ + mpg123str^ str = (sb == nullptr || sb->album == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->album); + + return str->Text; +} + +String^ mpg123clr::id3::mpg123id3v2::comment::get() +{ + mpg123str^ str = (sb == nullptr || sb->comment == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->comment); + + return str->Text; +} + +String^ mpg123clr::id3::mpg123id3v2::year::get() +{ + mpg123str^ str = (sb == nullptr || sb->year == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->year); + + return str->Text; +} + +String^ mpg123clr::id3::mpg123id3v2::genre::get() +{ + mpg123str^ str = (sb == nullptr || sb->genre == nullptr) ? gcnew mpg123str("") : gcnew mpg123str(sb->genre); + + return str->Text; +} + +int mpg123clr::id3::mpg123id3v2::version::get() +{ + return sb->version; +} + +array^ mpg123clr::id3::mpg123id3v2::MakeTextList(mpg123_text* ptr, size_t count) +{ + // WARN 4267 - clr limited to 32bit-length-size arrays!! + array^ ary = gcnew array((int)count); + + for (int ii = 0; ii < ary->Length; ii++) + { + // Remnant - for explicit layout + // mpg123text^% txt = gcnew mpg123text; + // Marshal::PtrToStructure((IntPtr)ptr++, txt); + + // New code - for "handle style" structure + mpg123text^% txt = gcnew mpg123text(ptr++); + + ary[ii] = txt; + } + + return ary; +} + +array^ mpg123clr::id3::mpg123id3v2::Comments::get() +{ + return MakeTextList(sb->comment_list, sb->comments); +} + +array^ mpg123clr::id3::mpg123id3v2::Texts::get() +{ + return MakeTextList(sb->text, sb->texts); +} + +array^ mpg123clr::id3::mpg123id3v2::Extras::get() +{ + return MakeTextList(sb->extra, sb->extras); +} + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v2.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v2.h new file mode 100644 index 0000000..8e4b046 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/id3v2.h @@ -0,0 +1,152 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include "string.h" +#include "text.h" + +#include +#include + +#include +using namespace std; +using namespace System; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + namespace id3 + { + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see Destructors and Finalizers in Visual C++] + // + // A ^ myA = gcnew A; + // try + // { + // use myA + // } + // finally + // { + // delete myA; + // } + + ///Wrapper for mpg123_id3v2. + [StructLayout(LayoutKind::Sequential)] + public ref struct mpg123id3v2 + { + private: + mpg123_id3v2* sb; + + array^ __clrcall MakeTextList(mpg123_text* ptr, size_t count); + + protected: + ///Finalizer. + ///Does nothing - wrapper points to underlying memory, this class doesn't allocate memory. + /// Implementation of CLR Finalize(). + !mpg123id3v2(void); + + internal: + ///Working Constructor. + ///Maps to mpg123_id3v2 memory. + /// + mpg123id3v2(mpg123_id3v2* sb); + + public: + ///Constructor. + ///Only creates object for use as "out" target in ID3 constructor. + /// + mpg123id3v2(void); + + ///Destructor. Used for final object deletion. + ///Calls finalizer for clean disposal of internal (unmanaged) library handles. + /// + /// Implementation of CLR Dispose(). + /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + /// See Destructors and Finalizers in Visual C++ + ~mpg123id3v2(void); + + ///Get the ID3v2 title text. + ///Property returns the last encountered ID3v2 title text. + /// + ///The last encountered ID3v2 title text. + property String^ title{String^ __clrcall get();} + + ///Get the ID3v2 artist text. + ///Property returns the last encountered ID3v2 artist text. + /// + ///The last encountered ID3v2 artist text. + property String^ artist{String^ __clrcall get();} + + ///Get the ID3v2 album text. + ///Property returns the last encountered ID3v2 album text. + /// + ///The last encountered ID3v2 album text. + property String^ album{String^ __clrcall get();} + + ///Get the ID3v2 comment text. + ///Property returns the last encountered ID3v2 comment text. + /// + ///The last encountered ID3v2 comment text. + property String^ comment{String^ __clrcall get();} + + ///Get the ID3v2 year text. + ///Property returns the last encountered ID3v2 year text. + /// + ///The last encountered ID3v2 year text. + property String^ year{String^ __clrcall get();} + + ///Get the ID3v2 genre text. + ///Property returns the last encountered ID3v2 genre text. + /// + ///The last encountered ID3v2 genre text. + property String^ genre{String^ __clrcall get();} + + ///Get the ID3v2 version. + ///Property returns the ID3v2 version. + /// + ///The ID3v2 version. + property int version{int __clrcall get();} + + + ///Get an array of Comments. + ///Property returns an array of Comments. + /// + ///An array of Comments. + property array^ Comments{array^ __clrcall get();}; + + ///Get an array of ID3v2 text fields (including USLT). + ///Property returns an array of ID3v2 text fields (including USLT). + /// + ///An array of ID3v2 text fields (including USLT). + property array^ Texts{array^ __clrcall get();}; + + ///Get an array of extra (TXXX) fields. + ///Property returns an array of extra (TXXX) fields. + /// + ///An array of extra (TXXX) fields. + property array^ Extras{array^ __clrcall get();}; + + }; + } +} diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp new file mode 100644 index 0000000..5ed0099 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.cpp @@ -0,0 +1,896 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009-2011 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.9.0.0 01-Oct-09 Technical cleanup - subst nullptr for NULL (mb) + 1.9.0.0 13-Oct-09 pin_ptr = nullptr on return (mb) + 1.9.0.1 24-Nov-09 performance update - removed try/finally (mb) + 1.10.0.0 30-Nov-09 release match - added mpg123_feature (mb) + 1.12.0.0 14-Apr-10 release match - added framebyframe and "handle" ReplaceReaders (mb) + 1.13.0.0 13-Jan-11 release match - added encsize (mb) +*/ + +// mpg123clr.cpp : Defines the exported functions for the DLL application. +// + +#include "stdafx.h" +#include "mpg123clr.h" + + +mpg123clr::mpg123::mpg123(void) +{ + mh = nullptr; + useHandleReplacement = false; + lastReplacementWasHandle = false; +} + +mpg123clr::mpg123::mpg123(mpg123_handle* mh) +{ + this->mh = mh; + useHandleReplacement = false; + lastReplacementWasHandle = false; +} + +// Destructor +mpg123clr::mpg123::~mpg123(void) +{ + // clean up code to release managed resources + + // call Finalizer to clean up unmanaged resources + this->!mpg123(); + + // CLI implements SuppressFinalize - therefore not required here... + //GC::SuppressFinalize(this); +} + +// Finalizer +mpg123clr::mpg123::!mpg123(void) +{ + // clean up unmanaged resources + if (mh != nullptr) + { + ::mpg123_delete(mh); + mh = nullptr; + } +} + +void mpg123clr::mpg123::mpg123_delete(void) +{ + if (mh != nullptr) + { + ::mpg123_delete(mh); + mh = nullptr; + } +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_init(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_init(); +} + +void mpg123clr::mpg123::mpg123_exit(void) +{ + ::mpg123_exit(); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_new(String ^ decoder) +{ + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(decoder)).ToPointer(); + + int err; + mh = ::mpg123_new(chars, &err); + + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return (mpg123clr::mpg::ErrorCode) err; +} +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_new(void) +{ + int err; + mh = ::mpg123_new(NULL, &err); + + return (mpg123clr::mpg::ErrorCode) err; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_parnew(mpg123clr::advpars^ par, String ^ decoder) +{ + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(decoder)).ToPointer(); + + int err; + mh = ::mpg123_parnew(par->mp, chars, &err); + + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return (mpg123clr::mpg::ErrorCode) err; +} +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_parnew(mpg123clr::advpars^ par) +{ + int err; + mh = ::mpg123_parnew(par->mp, NULL, &err); + + return (mpg123clr::mpg::ErrorCode) err; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_param(mpg123clr::mpg::parms type, int val, double fval) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_param(mh, (mpg123_parms)type, val, fval); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_getparam(mpg123clr::mpg::parms type, [Out] int% val, [Out] double% fval) +{ + // Avoid need for local intermediary variables + pin_ptr _val = &val; + pin_ptr _fval = &fval; + + int ret = ::mpg123_getparam(mh, (mpg123_parms)type, (long*) _val, _fval); + + _fval = nullptr; + _val = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +int mpg123clr::mpg123::mpg123_feature(mpg123clr::mpg::feature_set key) +{ + return ::mpg123_feature((mpg123_feature_set) key); +} + +String^ mpg123clr::mpg123::mpg123_strerror(void) +{ + return gcnew String(::mpg123_strerror(mh)); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_errcode(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_errcode(mh); +} + +array^ mpg123clr::mpg123::StringArrayFromPtr(const char** ptr) +{ + int count = 0; + + // count how many strings in array by walking up the array until NULL found + while (*(ptr++) != NULL){ ++count; } + + // create an array of the correct size + array ^ str = gcnew array(count); + + --ptr; // loop leaves ptr +2 beyond end of array - put ptr back to just after last index + + // walk back down the array, extracting the strings + while (count-- > 0){ str[count] = gcnew String(*(--ptr)); } + + return str; +} + +array^ mpg123clr::mpg123::mpg123_decoders(void) +{ + return StringArrayFromPtr(::mpg123_decoders()); +} + +array^ mpg123clr::mpg123::mpg123_supported_decoders(void) +{ + return StringArrayFromPtr(::mpg123_supported_decoders()); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_decoder(String^ name) +{ + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(name)).ToPointer(); + + int ret; + + // one of the few mpg123 places that fault with an exception... + try { ret = ::mpg123_decoder(mh, chars); } + catch(Exception^){ ret = MPG123_ERR; } + + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +String^ mpg123clr::mpg123::mpg123_current_decoder(void) +{ + return gcnew String(::mpg123_current_decoder(mh)); +} + +array^ mpg123clr::mpg123::mpg123_rates(void) +{ + size_t number; + const long* list; + + ::mpg123_rates(&list, &number); + + array^ rList = gcnew array((int)number); + + int index = 0; + + // walk the array, extracting the rates + while (index < (int)number){ rList[index++] = *(list++); } + + return rList; +} + +array^ mpg123clr::mpg123::mpg123_encodings(void) +{ + size_t number; + const int* list; + + ::mpg123_encodings(&list, &number); + + // WARN 4267 - assuming that the number of encodings will never exceed 32bits + array^ rList = gcnew array((int)number); + + int index = 0; + + // walk the array, extracting the rates + while (index < (int)number){ rList[index++] = (mpg123clr::mpg::enc) *(list++); } + + return rList; +} + +int mpg123clr::mpg123::mpg123_encsize(mpg123clr::mpg::enc encoding) +{ + return ::mpg123_encsize((int) encoding); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_format_none(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_format_none(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_format_all(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_format_all(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_format(int rate, mpg123clr::mpg::channelcount channels, mpg123clr::mpg::enc encodings) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_format(mh, rate, (int) channels, (int) encodings); +} + +mpg123clr::mpg::channelcount mpg123clr::mpg123::mpg123_format_support(int rate, mpg123clr::mpg::enc encodings) +{ + return (mpg123clr::mpg::channelcount) ::mpg123_format_support(mh, rate, (int) encodings); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_getformat([Out] int% rate, [Out] mpg123clr::mpg::channelcount% channels, [Out] mpg123clr::mpg::enc% encodings) +{ + // either:- + // + // long _rate; + // int _chan, _enc; + // int ret = mpg123_getformat(mh, &_rate, &_chan, &_enc); + // rate = _rate; + // channels = _chan; + // encodings = _enc; + // return (mpg123clr::mpg::ErrorCode) ret; + // + // or:- + // use pinned pointers instead + pin_ptr _rate = &rate; + pin_ptr _chan = &channels; + pin_ptr _enc = &encodings; + + int ret = ::mpg123_getformat(mh, (long*)_rate, (int*)_chan, (int*)_enc); + + _enc = nullptr; + _chan = nullptr; + _rate = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_open(String^ path) +{ + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(path)).ToPointer(); + + _ReplaceReader(); + + int ret = ::mpg123_open(mh, chars); + + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_open_fd(int filedescriptor) +{ + _ReplaceReader(); + + return (mpg123clr::mpg::ErrorCode) ::mpg123_open_fd(mh, filedescriptor); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_open_handle(System::Object^ obj) +{ + // NOTE: You must have configured callbacks using mpg123_replace_reader_handle + // before calling mpg123_open_handle! + + _ReplaceReader(); // activate callbacks + + // Make sure we free this in Close functions + userObjectHandle = GCHandle::Alloc(obj); + + // NOTE: This sends a HANDLE not an ADDRESS, no pinning required + return (mpg123clr::mpg::ErrorCode) ::mpg123_open_handle(mh, (void*)GCHandle::ToIntPtr(userObjectHandle).ToPointer()); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_open_feed(void) +{ + _ReplaceReader(); + + return (mpg123clr::mpg::ErrorCode) ::mpg123_open_feed(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_close(void) +{ + // Closes 'mh' and calls Cleanup delegate if provided + int ret = ::mpg123_close(mh); + + // See GCHandle.Free - caller must ensure Free called only once for a given handle. + if (userObjectHandle.IsAllocated) userObjectHandle.Free(); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_read(array^ buffer, [Out] size_t% count) +{ + pin_ptr _count = &count; + pin_ptr _ptr = &buffer[0]; + + int ret = ::mpg123_read(mh, _ptr, buffer->Length, _count); + + _ptr = nullptr; + _count = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_read(array^ buffer, size_t offset, size_t size, [Out] size_t% count) +{ + pin_ptr _count = &count; + // WARN 4267 - clr limited to 32bit-length-size arrays!! + pin_ptr _ptr = &buffer[(int)offset]; + + int ret = ::mpg123_read(mh, _ptr, size, _count); + + _ptr = nullptr; + _count = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_feed(array^ inbuffer, size_t size) +{ + pin_ptr _ptr = &inbuffer[0]; + + int ret = ::mpg123_feed(mh, _ptr, size); + + _ptr = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_decode(array^ inbuffer, size_t insize, array^ outbuffer, size_t outsize, [Out] size_t% count) +{ + pin_ptr _count = &count; + pin_ptr _inptr = &inbuffer[0]; + pin_ptr _outptr = &outbuffer[0]; + + int ret = ::mpg123_decode(mh, _inptr, insize, _outptr, outsize, _count); + + _outptr = nullptr; + _inptr = nullptr; + _count = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_decode_frame([Out] off_t% num, [Out] IntPtr% audio, [Out] size_t% count) +{ + pin_ptr _count = &count; + pin_ptr _num = # + pin_ptr _x = &audio; + + int ret = ::mpg123_decode_frame(mh, _num, (unsigned char**)_x, _count); + + _x = nullptr; + _num = nullptr; + _count = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_framebyframe_decode([Out] off_t% num, [Out] IntPtr% audio, [Out] size_t% count) +{ + // NOTE: must use framebyframe_next to obtain successive frames + + pin_ptr _count = &count; + pin_ptr _num = # + pin_ptr _x = &audio; + + int ret = ::mpg123_framebyframe_decode(mh, _num, (unsigned char**)_x, _count); + + _x = nullptr; + _num = nullptr; + _count = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_framebyframe_next() +{ + // mpg123lib has warning, Experimental API. Watch for updates!!! + // framebyframe_decode doesn't automatically move on to next frame, + // use framebyframe_next to move on to "Find, read and parse the next mp3 frame" + int ret = ::mpg123_framebyframe_next(mh); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +long long mpg123clr::mpg123::mpg123_tell(void) +{ + return ::mpg123_tell(mh); +} + +long long mpg123clr::mpg123::mpg123_tellframe(void) +{ + return ::mpg123_tellframe(mh); +} + +long long mpg123clr::mpg123::mpg123_tell_stream(void) +{ + return ::mpg123_tell_stream(mh); +} + +long long mpg123clr::mpg123::mpg123_seek(long long offset, SeekOrigin origin) +{ + return ::mpg123_seek(mh, (off_t)offset, (int)origin); +} + +long long mpg123clr::mpg123::mpg123_feedseek(long long offset, SeekOrigin origin, [Out] long long% input_offset) +{ + // NOTE: off_t fiddles... + // pin_ptr _input_offset = &input_offset; // type mismatch between 32 and 64 bit offsets. + + off_t _input_offset; // type accomodation + + off_t ret = ::mpg123_feedseek(mh, (off_t)offset, (int)origin, &_input_offset); // ok types + + input_offset = _input_offset; // type conversion + + return ret; +} + +long long mpg123clr::mpg123::mpg123_seek_frame(long long frameoffset, SeekOrigin origin) +{ + return ::mpg123_seek_frame(mh, (off_t)frameoffset, (int)origin); +} + +long long mpg123clr::mpg123::mpg123_timeframe(double seconds) +{ + return ::mpg123_timeframe(mh, seconds); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_index([Out] array^% index, [Out] long long% step) +{ + // remnant: only works if off_t, index and step are 32 bit - possible redo for 64 bit library + // pin_ptr _step = &step; + // int ret = mpg123_index(mh, &_list, (off_t*)_step, &_count); + // index = gcnew array((int)_count); + // Marshal::Copy((IntPtr)_list, index, 0, (int)_count); + + // alternate: works for 32 and 64 bit libraries - returns long long values + off_t* _list; + size_t _count; + off_t _step; // type accomodation + + int ret = ::mpg123_index(mh, &_list, &_step, &_count); + + step = _step; // type conversion + + // WARN 4267 - clr limited to 32bit-length-size arrays!! + index = gcnew array((int)_count); + + // walk the array, extracting the rates + int idx = 0; // array length limited to 32bit + while (idx < index->Length){ index[idx++] = *(_list++); } + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_index([Out] IntPtr% indexarr, [Out] long long% step, [Out] size_t% fill) +{ + pin_ptr _fill = &fill; + pin_ptr _x = &indexarr; // NOTE: untyped index pointer. + off_t _step; // type accomodation + + int ret = ::mpg123_index(mh, (off_t**)_x, &_step, _fill); + + step = _step; // type conversion + + _x = nullptr; + _fill = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_position( + long long frameoffset, long long bufferedbytes, [Out] long long% currentframe, [Out] long long% framesleft, + [Out] double% currentseconds, [Out] double% secondsleft) +{ + // NOTE: off_t fiddles + // pin_ptr _currentframe = ¤tframe; + // pin_ptr _framesleft = &framesleft; + pin_ptr _currentseconds = ¤tseconds; + pin_ptr _secondsleft = &secondsleft; + off_t _currentframe; // type accomodation + off_t _framesleft; // type accomodation + + int ret = ::mpg123_position(mh, (off_t)frameoffset, (off_t)bufferedbytes, &_currentframe, &_framesleft, _currentseconds, _secondsleft); + + currentframe = _currentframe; // type conversion + framesleft = _framesleft; // type conversion + + _secondsleft = nullptr; + _currentseconds = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +#pragma region Volume and Equalizer + + /// \defgroup mpg123_voleq mpg123 volume and equalizer + /// + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_eq(mpg123clr::mpg::channels channel, int band, double fval) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_eq(mh, (mpg123_channels)channel, band, fval); +} + +double mpg123clr::mpg123::mpg123_geteq(mpg123clr::mpg::channels channel, int band) +{ + return ::mpg123_geteq(mh, (mpg123_channels)channel, band); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_reset_eq(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_reset_eq(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_volume(double volume) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_volume(mh, volume); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_volume_change(double change) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_volume_change(mh, change); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_getvolume([Out] double% basevol, [Out] double% really, [Out] double% rva_db) +{ + pin_ptr _basevol = &basevol; + pin_ptr _really = &really; + pin_ptr _rva_db = &rva_db; + + int ret = ::mpg123_getvolume(mh, _basevol, _really, _rva_db); + + _rva_db = nullptr; + _really = nullptr; + _basevol = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +#pragma endregion -Volume and Equalizer +#pragma region Status and Information + + // \defgroup mpg123_status mpg123 status and information + // + // + // + +// The "proper" way to manage structs... +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_safeinfo([Out]mpeg_frameinfo^% finfo) +{ + // "out" our return reference and grab some memory + finfo = gcnew mpeg_frameinfo; + IntPtr pp = Marshal::AllocHGlobal(Marshal::SizeOf(finfo)); + + // get the info + + // could cast away... + // int ret = mpg123_info(mh, reinterpret_cast((int)pp)); + // int ret = mpg123_info(mh, static_cast((void*)pp)); + + // or let the compiler decide... + int ret = ::mpg123_info(mh, (mpg123_frameinfo*)(void*)pp); + + // marshal data into return object and free temporary memory + Marshal::PtrToStructure(pp, finfo); + Marshal::FreeHGlobal(pp); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +// The "efficient" way to manage structs... +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_info([Out]mpeg_frameinfo^% finfo) +{ + finfo = gcnew mpeg_frameinfo; + + pin_ptr _ptr = &finfo->version; + + // According to SizeOf... + // The unmanaged and managed sizes of an object can differ, this would imply + // that the memory layout for each would also be different, which would indicate + // that using a ptr, derived from a ptr-to-a-managed type, in unmanaged code could + // have unforseen results. + // + // In non-homogenous structs (like mpg123text) it can lead to corrupted CLR stack. + // In homogenous structs (like finfo) it appears to be "managable". + // + // However, until it fails it'll do... and it's much faster (see mpg123_safeinfo(...)). + + // WARNING: + // The epitome of "unsafe" as defined by CLR (using unmanaged pointers). + // If we start to get CLR stack corruptions - check here first! (see SafeInfo for "safe" managed version) + int ret = ::mpg123_info(mh, (mpg123_frameinfo*)_ptr); + + _ptr = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +size_t mpg123clr::mpg123::mpg123_safe_buffer(void) +{ + return ::mpg123_safe_buffer(); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_scan(void) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_scan(mh); +} + +long long mpg123clr::mpg123::mpg123_length(void) +{ + return ::mpg123_length(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_set_filesize(long long size) +{ + return (mpg123clr::mpg::ErrorCode) ::mpg123_set_filesize(mh, (off_t)size); +} + +double mpg123clr::mpg123::mpg123_tpf(void) +{ + return ::mpg123_tpf(mh); +} + +long mpg123clr::mpg123::mpg123_clip(void) +{ + return ::mpg123_clip(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_getstate(mpg123clr::mpg::state key, [Out] int% val, [Out] double% fval) +{ + pin_ptr _val = &val; + pin_ptr _fval = &fval; + + int ret = ::mpg123_getstate(mh, (mpg123_state)key, (long*) _val, _fval); + + _fval = nullptr; + _val = nullptr; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +#pragma endregion -Status and Information + +#pragma region Metadata Handling + + // \defgroup mpg123_metadata mpg123 metadata handling + // + // Functions to retrieve the metadata from MPEG Audio files and streams. + // Also includes string handling functions. + // + +mpg123clr::id3::id3check mpg123clr::mpg123::mpg123_meta_check(void) +{ + return (mpg123clr::id3::id3check ) ::mpg123_meta_check(mh); +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_id3([Out]id3::mpg123id3v1^% v1, [Out]id3::mpg123id3v2^% v2) +{ + mpg123_id3v1* pv1; + mpg123_id3v2* pv2; + + // doc says "pv1 and pv2 may be set to NULL when there is no corresponding data." + // they may also be set to point to empty structure... + int ret = ::mpg123_id3(mh, &pv1, &pv2); + + v1 = gcnew mpg123clr::id3::mpg123id3v1(pv1); + v2 = gcnew mpg123clr::id3::mpg123id3v2(pv2); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_icy([Out]IntPtr% icy_meta) +{ + char* _icy_meta; + + int ret = ::mpg123_icy(mh, &_icy_meta); + + icy_meta = (IntPtr) _icy_meta; + + return (mpg123clr::mpg::ErrorCode) ret; +} + +array^ mpg123clr::mpg123::mpg123_icy2utf8(IntPtr icy_text) +{ + // TODO: Do we really need this? + // char* putf8 = mpg123_icy2utf8(const_cast(reinterpret_cast(icy_text.ToPointer()))); + + // Or is this adequate? + char* putf8 = ::mpg123_icy2utf8((const char*)(void*) icy_text); + + // WARN 4267 - clr limited to 32bit-length-size arrays!! + array^ ary = gcnew array((int)strlen(putf8)); + + Marshal::Copy((IntPtr)putf8, ary, 0, ary->Length); + free(putf8); + + return ary; +} + +#pragma endregion -Metadata Handling + +#pragma region Low Level I/O + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_replace_buffer(IntPtr data, size_t size) +{ + // "data" buffer should be fixed BEFORE calling this function. + + // TODO: to cast or not to cast?? + // return (mpg123clr::mpg::ErrorCode) mpg123_replace_buffer(mh, reinterpret_cast(data.ToPointer()), size); + + return (mpg123clr::mpg::ErrorCode) ::mpg123_replace_buffer(mh, (unsigned char*)(void*) data, size); +} + +size_t mpg123clr::mpg123::mpg123_outblock(void) +{ + return ::mpg123_outblock(mh); +} + +void mpg123clr::mpg123::_ReplaceReader(void) +{ + if ((readDel == r_readDel) && (seekDel == r_seekDel) + && (readHDel == r_readHDel) && (seekDel == r_seekHDel) && (cleanHDel == r_cleanHDel)) return; + + // readDel and seekDel are "keep alive" fields that prevent GC of the delegates. + // the underlying function pointers no not require "pinning". + + // Note: most examples use GCHandle::Alloc to "pin" the delegate but this is usually to prevent GC + // outside of function scope and is not strictly necessary here since readDel and seekDel never go + // out of scope. + + // See MS: c++, How to: Marshal Callbacks and Delegates Using C++ Interop + // for more details. + + readDel = r_readDel; + seekDel = r_seekDel; + readHDel = r_readHDel; + seekHDel = r_seekHDel; + cleanHDel = r_cleanHDel; + + // just for clarity + typedef off_t (_cdecl* SEEKCB)(int, off_t, int); + typedef ssize_t (_cdecl* READCB)(int, void*, size_t); + typedef off_t (_cdecl* HSEEKCB)(void*, off_t, int); + typedef ssize_t (_cdecl* HREADCB)(void*, void*, size_t); + typedef void (_cdecl* HCLEANCB)(void*); + + // NOTE: GetFunctionPointerForDelegate doesn't like nullptr + // NOTE: I'm not suggesting that replace_reader and replace_reader_handle should be + // intermingled, just trying to maintain a clean stack + + if (!useHandleReplacement) + { + if (lastReplacementWasHandle) + ::mpg123_replace_reader_handle(mh, nullptr, nullptr, nullptr); + + ::mpg123_replace_reader( + mh, + (readDel != nullptr) ? (READCB)(Marshal::GetFunctionPointerForDelegate(readDel)).ToPointer() : nullptr, + (seekDel != nullptr) ? (SEEKCB)(Marshal::GetFunctionPointerForDelegate(seekDel)).ToPointer() : nullptr + ); + } + else + { + if (!lastReplacementWasHandle) // can give redundant call on first use - microscopically inefficient - not catastrophic + ::mpg123_replace_reader(mh, nullptr, nullptr); + + ::mpg123_replace_reader_handle( + mh, + (readHDel != nullptr) ? (HREADCB)(Marshal::GetFunctionPointerForDelegate(readHDel)).ToPointer() : nullptr, + (seekHDel != nullptr) ? (HSEEKCB)(Marshal::GetFunctionPointerForDelegate(seekHDel)).ToPointer() : nullptr, + (cleanHDel != nullptr) ? (HCLEANCB)(Marshal::GetFunctionPointerForDelegate(cleanHDel)).ToPointer() : nullptr + ); + } + lastReplacementWasHandle = useHandleReplacement; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_replace_reader(ReadDelegate^ r_read, SeekDelegate^ r_lseek) +{ + // save temporary delegates to be implemented at next 'Open' + r_readDel = r_read; + r_seekDel = r_lseek; + r_readHDel = nullptr; + r_seekHDel = nullptr; + r_cleanHDel = nullptr; + useHandleReplacement = false; + + return mpg123clr::mpg::ErrorCode::ok; + +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_replace_reader_handle(ReadHandleDelegate^ rh_read, SeekHandleDelegate^ rh_lseek, CleanupHandleDelegate^ rh_clean) +{ + // save temporary delegates to be implemented at next 'Open' + r_readHDel = rh_read; + r_seekHDel = rh_lseek; + r_cleanHDel = rh_clean; + r_readDel = nullptr; + r_seekDel = nullptr; + useHandleReplacement = true; + + return mpg123clr::mpg::ErrorCode::ok; + +} + +#pragma endregion -Low Level I/O + +#pragma region MS Unicode Extension + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_topen(String^ path) +{ + _ReplaceReader(); // mpg123_tOpen will replace its own reader, this is just for consistency + + const _TCHAR* chars = (const _TCHAR*)(Marshal::StringToHGlobalUni(path)).ToPointer(); + + int ret = ::mpg123_topen(mh, chars); + + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +mpg123clr::mpg::ErrorCode mpg123clr::mpg123::mpg123_tclose(void) +{ + // Not sure if t_close calls Cleanup (it shouldn't since t_open substitutes its own readers) + int ret = ::mpg123_tclose(mh); + + // Fairly sure replace_reader_handle, topen and tclose are incompatible, just for consistency + // See GCHandle.Free - caller must ensure Free called only once for a given handle. + if (userObjectHandle.IsAllocated) userObjectHandle.Free(); + + return (mpg123clr::mpg::ErrorCode) ret; +} + +#pragma endregion -MS Unicode Extension + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.h new file mode 100644 index 0000000..e4bc94a --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.h @@ -0,0 +1,953 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009-2011 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.10.0.0 30-Nov-09 release match - added mpg123_feature (mb) + 1.12.0.0 14-Apr-10 release match - added framebyframe and "handle" ReplaceReaders (mb) + 1.13.0.0 13-Jan-11 release match - added encsize (mb) +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include "enum.h" +#include "error.h" +#include "id3v1.h" +#include "id3v2.h" +#include "advanced.h" + +#include // for posix proof of concept only + +#include +#include +#include + +#include +using namespace std; +using namespace System; +using namespace System::IO; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + + + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see (Microsoft) Destructors and Finalizers in Visual C++] + // + // C++/CLI + // A myA; + // // use myA here + // + // Equivalent user code: + // + // A ^ myA = gcnew A; + // try { /* use myA here */ } finally { delete myA; } + // + // + // C# (from wikipedia) + // using(A myA = new A()) { /* Use myA here */ } + // Compiler calls myA.Dispose(), in a "finally" of a "try/finally" block + // + // Equivalent user code: + // + // A myA = new myA(); + // try { /* Use myA here */ } finally { myA.Dispose(); } + // + // Otherwise Finalizer will be nondeterministically called by GC + + + ///Wrapper for libmpg123. + public ref class mpg123 + { + +#pragma region Callback and Delegate + + // Functional callbacks for low-level I/O ReplaceReader + + public: + ///Seek Delegate. + ///Callback seek function to provide low-level stream access to posix-like seek operations. + /// Requires user supplied static callback fuction of form off_t fn(int fd, off_t offset, int origin). + ///Returns callee supplied resulting offset from start of file or -1 for error. + /// + ///Contains file descriptor. + ///Contains required offset value. + ///Contains relative origin value (whence) applied to offset. + ///Callee supplied resulting offset from start of file or -1 for error. + [UnmanagedFunctionPointer(CallingConvention::Cdecl)] + delegate off_t SeekDelegate(int fd, off_t offset, int origin); + + [UnmanagedFunctionPointer(CallingConvention::Cdecl)] + delegate off_t SeekHandleDelegate(void* handle, off_t offset, int origin); + + ///Read Delegate. + ///Callback read function to provide low-level stream access to posix-like read operations. + /// Requires user supplied static callback fuction of form ssize_t fn(int fd, void* buffer, size_t size). + ///Returns callee supplied resulting actual number of bytes read or -1 for error. + /// + ///Contains file descriptor. + ///Contains address of buffer. + ///Contains size of buffer. + ///Callee supplied resulting actual number of bytes read or -1 for error. + [UnmanagedFunctionPointer(CallingConvention::Cdecl)] + delegate ssize_t ReadDelegate(int fd, void* buffer, size_t size); + + [UnmanagedFunctionPointer(CallingConvention::Cdecl)] + delegate ssize_t ReadHandleDelegate(void* handle, void* buffer, size_t size); + + [UnmanagedFunctionPointer(CallingConvention::Cdecl)] + delegate void CleanupHandleDelegate(void* handle); + + private: + // Delegate "keep alive" fields to prevent GC of delegate. + SeekDelegate^ seekDel; + ReadDelegate^ readDel; + + SeekHandleDelegate^ seekHDel; + ReadHandleDelegate^ readHDel; + CleanupHandleDelegate^ cleanHDel; + + GCHandle userObjectHandle; + + // Temporary delegate store, replacereader action is defered until next stream 'open' action + SeekDelegate^ r_seekDel; + ReadDelegate^ r_readDel; + + SeekHandleDelegate^ r_seekHDel; + ReadHandleDelegate^ r_readHDel; + CleanupHandleDelegate^ r_cleanHDel; + + bool useHandleReplacement; + bool lastReplacementWasHandle; + +#pragma endregion -Callback and Delegate + + +#pragma region Library and Handle Setup + + // \defgroup mpg123_init mpg123 library and handle setup + // + // Functions to initialise and shutdown the mpg123 library and handles. + // The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-) + // Tip: Use a RVA setting... + // + + private: + mpg123_handle* mh; + + internal: + mpg123(mpg123_handle* mh); + + protected: + ///Finalizer. + ///Cleanly handles mpg123_delete of internal (unmanaged) mpg123 handle. + /// Implementation of CLR Finalize(). + !mpg123(void); + + public: + ///Constructor. + ///Only creates mpg123 object, you must call one of the New() methods to obtain a decoder library handle. + ///Recommended usage: using(mpg123 obj = new mpg123()){ use obj here } + mpg123(void); + + ///Destructor. Used for final object deletion. + ///Calls finalizer for clean disposal of internal (unmanaged) library handles. + /// + /// Implementation of CLR Dispose(). + /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + /// See Destructors and Finalizers in Visual C++ + ~mpg123(void); + + ///(mpg123_init) Function to initialise the mpg123 library. + ///This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + ///Returns MPG123_OK if successful, otherwise an error number. + ///Returns MPG123_OK if successful, otherwise an error number. + static mpg123clr::mpg::ErrorCode __clrcall mpg123_init(void); + + ///(mpg123_exit) Function to close down the mpg123 library. + ///This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. + static void __clrcall mpg123_exit(void); + + ///(mpg123_new) Obtain am mpg123 handle with designated decoder. + ///Returns MPG123_OK or applicable error code. + /// + ///Name of the decoder to attach. + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_new(String ^ decoder); + + ///Obtain an mpg123 handle with default decoder. + ///Returns MPG123_OK or applicable error code. + /// + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_new(void); + + ///Obtain am mpg123 handle with default decoder. + ///Allows use of common parms object for multiple connections. + ///Returns MPG123_OK or applicable error code. + /// + ///Supplied Advanced parameter object. + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_parnew(mpg123clr::advpars^ par); + + ///Obtain am mpg123 handle with designated decoder. + ///Allows use of common parms object for multiple connections. + ///Returns MPG123_OK or applicable error code. + /// + ///Supplied Advanced parameter object. + ///Name of the decoder to attach. + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_parnew(mpg123clr::advpars^ par, String^ decoder); + + ///(mpg123_delete) Delete internal mpg123 handle. + ///The framework will dispose of the object when it goes out of scope - you do not need to explicitly call Delete(). + /// However it is available to allow reuse of this object with successive handles - using New()/Delete() pairs. + /// + void __clrcall mpg123_delete(void); + + public: + + ///Set a specific parameter value. + ///Returns MPG123_OK or applicable error code. + /// + ///Define the parameter to be set. (parms enumeration) + ///Integer value to apply. + ///Real value to apply. + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_param(mpg123clr::mpg::parms type, int val, double fval); + + ///Get a specific parameter value. + ///Returns MPG123_OK or applicable error code. + /// + ///Define the parameter to get. (parms enumeration) + ///Returned integer value. + ///Returned real value. + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_getparam(mpg123clr::mpg::parms type, [Out] int% val, [Out] double% fval); + + ///Query libmpg123 feature. + ///Returns 1 for success, 0 for unimplemented feature. + /// + ///Define the feature to query. (feature_set enumeration) + ///1 for success, 0 for unimplemented feature. + static int __clrcall mpg123_feature(mpg123clr::mpg::feature_set key); + +#pragma endregion -Library and Handle Setup + +#pragma region Internal Helpers + + internal: + array^ StringArrayFromPtr(const char ** ptr); + +#pragma endregion -Internal Helpers + +#pragma region Error Handling + + // \defgroup mpg123_error mpg123 error handling + // + // Functions to get text version of the error numbers and an enumeration + // of the error codes returned by libmpg123. + // + // Most functions operating on a mpg123_handle simply return MPG123_OK on success and MPG123_ERR on failure (setting the internal error variable of the handle to the specific error code). + // Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + // The positive range of return values is used for "useful" values when appropriate. + // + + public: + + ///Get string describing what error has occured in the context of this object. + ///When a function operating on an mpg123 handle returns MPG123_ERR, you should use this function to check the actual reason. + ///This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE. + ///Returns text representation of last error (incl. None) encountered by this object. + /// + ///Text representation of last error (incl. None) encountered by this object. + String^ __clrcall mpg123_strerror(void); + + ///Get last error encountered in the context of this object. + ///When a function operating on an mpg123 handle returns MPG123_ERR, you should use this function to check the actual reason. + ///This function will catch internal handle == NULL and return MPG123_BAD_HANDLE. + ///Returns ErrorCode for last encountered error. + /// + ///The plain errcode intead of a string of last error (incl. None) encountered by this object. + mpg123clr::mpg::ErrorCode __clrcall mpg123_errcode(void); + +#pragma endregion -Error Handling + +#pragma region Decoder Selection + + // \defgroup mpg123_decoder mpg123 decoder selection + // + // Functions to list and select the available decoders. + // Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is). + // + + public: + + ///Obtain list of generally available decoder names (plain 8bit ASCII). + ///Retuns a string array of generally available decoder names (plain 8bit ASCII). + /// + ///A string array of generally available decoder names (plain 8bit ASCII). + array^ __clrcall mpg123_decoders(void); + + ///Obtain list of the decoders supported by the CPU (plain 8bit ASCII). + ///Returns a string array of the decoders supported by the CPU (plain 8bit ASCII). + /// + ///A string array of the decoders supported by the CPU (plain 8bit ASCII). + array^ __clrcall mpg123_supported_decoders(void); + + ///Select the decoder to use. + ///Returns MPG123_OK or applicable error code. + /// + ///Name of the required decoder. (should be in SupportedDecoders list) + ///MPG123_OK or applicable error code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_decoder(String^ name); + + ///Get the currently active decoder engine name. + ///The active decoder engine can vary depening on output constraints, mostly non-resampling, integer output is accelerated via 3DNow and Co. + /// but for other modes a fallback engine kicks in. + ///Note that this can return a decoder that is ony active in the hidden and not available as decoder choice from the outside. + ///Returns the decoder name or String.Empty on error. + /// + ///The decoder name or String.Empty on error. + String^ __clrcall mpg123_current_decoder(void); + +#pragma endregion -Decoder Selection + +#pragma region Output Audio Format + + // \defgroup mpg123_output mpg123 output audio format + // + // Functions to get and select the format of the decoded audio. + // + + public: + + ///Get an array of supported standard sample rates. + ///These are possible native sample rates of MPEG audio files. + /// You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings. + ///Returns array of sample rates. + /// + ///An array of sample rates. + array^ __clrcall mpg123_rates(void); + + ///An array of supported audio encodings. + ///An audio encoding is one of the fully qualified members of mpg.enc + ///Returns array of supported Encodings. + /// + ///An array of supported Encodings. + array^ __clrcall mpg123_encodings(void); + + ///Get the size (in bytes) of one mono sample of the named encoding. + ///Returns the positive size of encoding in bytes, 0 on invalid encoding. + /// + ///The encoding value to analyze. + ///The positive size of encoding in bytes, 0 on invalid encoding. + static int __clrcall mpg123_encsize(mpg123clr::mpg::enc encoding); + + ///Configure mpg123 to accept no output format at all. + ///Use to clear default parameters prior to applying specific settings. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_format_none(void); + + ///Configure mpg123 to accept all formats including any custom formats - this is the default. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_format_all(void); + + ///Configure detailed output formats. + ///Returns MPG123 error codes. + /// + ///Sample rate (Hertz) + ///Combination of channelcount.stereo and channelcount.mono + ///Combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none) + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_format(int rate, mpg123clr::mpg::channelcount channels, mpg123clr::mpg::enc encodings); + + ///Get available support for supplied rate and encoding. + ///Returns 0 for no support (includes invalid parameters), or combination of channelcount.stereo and channelcount.mono. + /// + ///Sample rate (Hertz) + ///Combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none) + ///Returns 0 for no support (includes invalid parameters), or combination of channelcount.stereo and channelcount.mono. + mpg123clr::mpg::channelcount __clrcall mpg123_format_support(int rate, mpg123clr::mpg::enc encoding); + + ///Get current output format. + ///Returns MPG123 error codes. + /// + ///Returns current sample rate (Hertz) + ///Returns combination of channelcount.stereo and channelcount.mono + ///Returns combination of accepted encodings for rate and channels e.g. enc.enc_signed16 | enc.enc_ulaw_8 (or 0 for none) + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_getformat([Out] int% rate, [Out] mpg123clr::mpg::channelcount% channels, [Out] mpg123clr::mpg::enc% encoding); + +#pragma endregion -Output Audio Format + +#pragma region File Input and Decoding + + // \defgroup mpg123_input mpg123 file input and decoding + // + // Functions for input bitstream and decoding operations. + // Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!). + // + + public: + + ///Open and prepare to decode the file specified by ANSI filename. + ///This does not open HTTP urls; the mpg library contains no networking code. + /// If you want to decode internet streams, use Open(fd) or Open(). + /// + ///Returns MPG123 error codes + /// + ///ANSI file path. Accepts ANSI path characters. For Unicode paths use tOpen. + /// NOTE: can be used in Unicode environment as long as wide-char codepages are avoided. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_open(String^ path); + + ///Use a previously obtained file descriptor as the bitstream input. + ///NOTE: Close() will NOT close a file opened with this method. + ///Returns MPG123 error codes. + /// + ///File Descriptor of pre required file. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_open_fd(int fd); + + ///Use an opaque handle as bitstream input. + ///This works only with the replaced I/O from mpg123_replace_reader_handle()! + ///mpg123_close() will call the cleanup callback for your handle (if you gave one). + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_open_handle(System::Object^ obj); + + ///Open a new bitstream and prepare for direct feeding. + ///This works together with Decode(); you are responsible for reading and feeding the input bitstream. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_open_feed(void); + + ///Closes the source, if the library opened it. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_close(void); + + ///Open and prepare to decode the file specified by UNICODE (wide-character) filename. + ///This does not open HTTP urls; the mpg library contains no networking code. + /// If you want to decode internet streams, use Open(fd) or Open(). + /// + ///Returns MPG123 error codes + /// + ///UNICODE wide-character file path. See also ANSI Open(path). + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_topen(String^ path); + + ///Closes the file opened with tOpen. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_tclose(void); + + ///Read from stream and decode. + ///Equivalent to mpg123_read(,,,) + ///Returns MPG123 error codes. (watch out for MPG123_DONE and friends!) + /// + ///Supplied buffer in which to return audio output data. + ///Returns number of actual audio output bytes returned. + ///MPG123 error codes. (watch out for MPG123_DONE and friends!) + mpg123clr::mpg::ErrorCode __clrcall mpg123_read(array^ buffer, [Out] size_t% count); + + ///Read from stream and decode. + ///Equivalent to mpg123_read(,,,) but modified to better support CLR Stream.Read + ///Returns MPG123 error codes. (watch out for MPG123_DONE and friends!) + /// + ///Supplied buffer in which to return audio output data. + ///Offset in buffer at which to begin storing data. + ///Maximum number of bytes to return. + ///Returns number of actual audio output bytes returned. + ///MPG123 error codes. (watch out for MPG123_DONE and friends!) + mpg123clr::mpg::ErrorCode __clrcall mpg123_read(array^ buffer, size_t offset, size_t size, [Out] size_t% count); + + ///Feed data for a stream that has been opened with Open() - (mpg123_open_feed). + ///Equivalent to mpg123_feed(...), it's give and take: You provide the bytestream, mpg123 gives you the decoded samples. + ///Returns MPG123 error codes. + /// + ///Input buffer. + ///Number of input bytes. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_feed(array^ inbuffer, size_t size); + + ///Decode MPEG Audio from inmemory to outmemory. + ///This is very close to a drop-in replacement for old mpglib. + ///When you give zero-sized output buffer the input will be parsed until + /// decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) + /// without taking decoded data. + ///Think of this function being the union of Read() and Feed() (which it actually is, sort of;-). + /// You can actually always decide if you want those specialized functions in separate steps or one call this one here. + ///Returns MPG123 error codes. (watch out especially for MPG123_NEED_MORE) + /// + ///Input buffer. + ///Number of input bytes. + ///Supplied buffer in which to return audio output data. + ///Size in bytes of buffer. + ///Returns number of actual audio output bytes returned. + ///MPG123 error codes. (watch out especially for MPG123_NEED_MORE) + mpg123clr::mpg::ErrorCode __clrcall mpg123_decode(array^ inbuffer, size_t insize, array^ outbuffer, size_t outsize, [Out] size_t% count); + + ///Decode next MPEG frame to internal buffer or read a frame and return after setting a new format. + ///Returns MPG123 error codes. (watch out for MPG123_NEW_FORMAT) + /// + ///Returns current frame offset. + ///Returns pointer to internal buffer to read the decoded audio from. (Can be NULL for NEW_FORMAT) + ///Returns number of actual audio output bytes ready in the buffer. + ///MPG123 error codes. (watch out for MPG123_NEW_FORMAT) + mpg123clr::mpg::ErrorCode __clrcall mpg123_decode_frame([Out] off_t% num, [Out] IntPtr% audio, [Out] size_t% count); + + ///Decode current MPEG frame to internal buffer. + ///Use with mpg123_framebyframe_next to progress through data. + ///Warning: This is experimental API that might change in future releases! + /// Please watch mpg123 development closely when using it. + ///Returns MPG123 error codes. + /// + ///Returns current frame offset. + ///Returns pointer to internal buffer to read the decoded audio from. (Can be NULL for NEW_FORMAT) + ///Returns number of actual audio output bytes ready in the buffer. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_framebyframe_decode([Out] off_t% num, [Out] IntPtr% audio, [Out] size_t% bytes); + + ///Find, read and parse the next mp3 frame. + ///Use with mpg123_framebyframe_decode to obtain frame data. + ///Warning: This is experimental API that might change in future releases! + /// Please watch mpg123 development closely when using it. + ///Returns MPG123 error codes. (watch out for MPG123_NEW_FORMAT) + /// + ///MPG123 error codes. (watch out for MPG123_NEW_FORMAT) + mpg123clr::mpg::ErrorCode __clrcall mpg123_framebyframe_next(void); + +#pragma endregion -File Input and Decoding + +#pragma region Position and Seeking + + // \defgroup mpg123_seek mpg123 position and seeking + // + // Functions querying and manipulating position in the decoded audio bitstream. + // The position is measured in decoded audio samples, or MPEG frame offset for the specific functions. + // If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-) + // The general usage is modelled after stdlib's ftell() and fseek(). + // Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: + // - SEEK_SET: set position to (or near to) specified offset + // - SEEK_CUR: change position by offset from now + // - SEEK_END: set position to offset from end + // + // Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise. + // Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)! + // Short: When you care about the sample position, don't mess with those parameters;-) + // Also, seeking is not guaranteed to work for all streams (underlying stream may not support it). + // + + public: + + ///Get the current position in samples. On the next read, you'd get that sample. + ///Returns the current sample position. + /// + ///The current sample position. + long long __clrcall mpg123_tell(); + + ///Get the frame number that the next read will give you data from. + ///Returns the current frame number position. + /// + ///The current frame number position. + long long __clrcall mpg123_tellframe(); + + ///Get the current byte offset in the input stream. + ///Returns the current byte offset. + /// + ///The current byte offset. + long long __clrcall mpg123_tell_stream(); + + ///Seek to a desired sample offset. + ///Returns the resulting offset >= 0 or error/message code. + /// + ///The distance to move. + ///(whence) The relative location to move from.(SeekOrigin.Begin, SeekOrigin.Current, SeekOrigin.End) + ///Returns the resulting offset >= 0 or error/message code. + long long __clrcall mpg123_seek(long long offset, SeekOrigin origin); + + ///Seek to a desired sample offset in data feeding mode. + ///This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position. + ///Returns the resulting offset >= 0 or error/message code. + /// + ///The distance to move. + ///(whence) The relative location to move from.(SeekOrigin.Begin, SeekOrigin.Current, SeekOrigin.End) + ///Returns the position it expects to be at the next time data is fed to Decode(). + ///Returns the resulting offset >= 0 or error/message code. + long long __clrcall mpg123_feedseek(long long offset, SeekOrigin origin, [Out] long long% input_offset); + + ///Seek to a desired MPEG frame index. + ///Returns the resulting offset >= 0 or error/message code. + /// + ///The numberof frames to move. + ///(whence) The relative location to move from.(SEEK_SET, SEEK_CUR or SEEK_END) + ///Returns the resulting offset >= 0 or error/message code. + long long __clrcall mpg123_seek_frame(long long frameoffset, SeekOrigin origin); + + ///Seek to an absolute MPEG frame offset corresponding to an offset in seconds. + ///This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only. + ///Returns the resulting offset >= 0 or error/message code. + /// + ///The absolute time offset required. + ///Returns the resulting offset >= 0 or error/message code. + long long __clrcall mpg123_timeframe(double seconds); + + ///Get a copy of the frame index table. Somewhat equivalent to mpg123_index(,,). + ///The library requests not to modify table values. Since this is a copy, modification is meaningless - it has no effect on library routines. + ///NOTE: The returned index table value types are Int64 independant of library build. + ///Returns MPG123 error codes. + /// + ///Returns array of source file position offsets (not output samples). Length of array is equivalent to mpg123_index "fill" parameter. + ///Returns number of MPEG frames per index entry. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_index([Out] array^% index, [Out] long long% step); + + ///Get a pointer to the frame index table. Equivalent to mpg123_index(,,). + ///Do not modify table values unless you really know what you are doing! + ///NOTE: The returned index table value types may be Int32 or Int64 depending on library build. + ///Returns MPG123 error codes. + /// + ///Returns pointer to source file position offset index array (not output samples). + ///Returns number of MPEG frames per index entry. + ///Returns number of recorded index offsets; size of the array. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_index([Out] IntPtr% indexarr, [Out] long long% step, [Out] size_t% fill); + + ///Get information about current and remaining frames/seconds. Equivalent to mpg123_position(,,,,,,). + ///WARNING: This function is there because of special usage by standalone mpg123 and may be removed in the final version of libmpg123! + ///You provide an offset (in frames) from now and a number of output bytes + /// served by libmpg123 but not yet played. You get the projected current frame + /// and seconds, as well as the remaining frames/seconds. This does _not_ care + /// about skipped samples due to gapless playback. + ///Returns MPG123 error codes. + /// + ///Offset (in frames) from now. + ///Number of output bytes served by library but not yet played. + ///Returns projected current frame. + ///Returns projected frames remaining. + ///Returns projected current seconds. + ///Returns projected seconds remaining. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_position(long long frameoffset, long long bufferedbytes, + [Out] long long% currentframe, [Out] long long% framesleft, + [Out] double% currentseconds, [Out] double% secondsleft); + +#pragma endregion -Position and Seeking + +#pragma region Volume and Equalizer + + // \defgroup mpg123_voleq mpg123 volume and equalizer + // + + public: + + ///Set the 32 Band Audio Equalizer settings. + ///Returns MPG123 error codes. + /// + ///Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both. (enum mpg.channels) + ///The equaliser band to change (from 0 to 31) + ///The (linear) adjustment factor to be applied. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_eq(mpg123clr::mpg::channels channel, int band, double fval); + + ///Get the 32 Band Audio Equalizer settings. + ///Rreturns the (linear) adjustment factor. + /// + ///Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both. (enum mpg.channels) + ///The equaliser band to get (from 0 to 31) + ///The (linear) adjustment factor. + double __clrcall mpg123_geteq(mpg123clr::mpg::channels channel, int band); + + ///Reset the 32 Band Audio Equalizer settings to flat. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_reset_eq(); + + ///Set the absolute output volume including the RVA setting. + ///Returns MPG123 error codes. + /// + ///The (linear) adjustment factor to be applied, volume < 0 just applies (a possibly changed) RVA setting. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_volume(double volume); + + ///Adjust output volume including the RVA setting. + ///Returns MPG123 error codes. + /// + ///The (linear) adjustment factor to be applied. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_volume_change(double change); + + ///Get the current volume setting, the actual value due to RVA, and the RVA adjustment itself. + ///Returns MPG123 error codes. + /// + ///Returns the current linear volume factor. (not percent) + ///Returns the actual linear volume factor due to RVA. (not percent) + ///Returns the RVA adjustment in decibels. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_getvolume([Out] double% basevol, [Out] double% really, [Out] double% rva_db); + +#pragma endregion -Volume and Equalizer + +#pragma region Status and Information + + // \defgroup mpg123_status mpg123 status and information + // + // + // + + [StructLayout(LayoutKind::Sequential, CharSet=CharSet::Ansi, Pack=1)] + ref struct mpeg_frameinfo + { + mpg123clr::mpg::mpeg_version version; // The MPEG version (1.0/2.0/2.5). + int layer; // The MPEG Audio Layer (MP1/MP2/MP3). + long rate; // The sampling rate in Hz. + mpg123clr::mpg::mpeg_mode mode; // The audio mode (Mono, Stereo, Joint-stero, Dual Channel). + int mode_ext; // The mode extension bit flag. + int framesize; // The size of the frame (in bytes). + mpg123clr::mpg::mpeg_flags flags; // MPEG Audio flag bits. + int emphasis; // The emphasis type. + int bitrate; // Bitrate of the frame (kbps). + int abr_rate; // The target average bitrate. + mpg123clr::mpg::mpeg_vbr vbr; // The VBR mode. + }; + + ///Get the frame information about the MPEG audio bitstream. + ///Returns MPG123 error codes. + /// + ///Returns the frame information. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_info([Out]mpeg_frameinfo^% finfo); + + ///Get the frame information about the MPEG audio bitstream. + ///SafeInfo uses "safe" managed structures but is somewhat slower than Info(). + /// Recommend using Info() unless it gives specific problems. + ///Returns MPG123 error codes. + /// + ///Returns the frame information. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_safeinfo([Out]mpeg_frameinfo^% finfo); + + ///Get the safe output buffer size for all cases (when you want to replace the internal buffer). + ///Returns safe buffer size. + /// + ///Safe buffer size. + static size_t __clrcall mpg123_safe_buffer(void); + + ///Make a full parsing scan of each frame in the file. + ///ID3 tags are found. An accurate length value is stored. Seek index will be filled. + /// A seek back to current position is performed. + ///This function refuses work when stream is not seekable. + ///Returns MPG123 error codes. + /// + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_scan(void); + + ///Return, if possible, the full (expected) length of current track in samples. + ///Returns length (>= 0) or MPG123_ERR if there is no length guess possible. (Multiply by BlockAlign for byte-count) + /// + ///Length (>= 0) or MPG123_ERR if there is no length guess possible. (Multiply by BlockAlign for byte-count) + long long __clrcall mpg123_length(void); + + ///Override the value for file size in bytes. + ///Useful for getting sensible track length values in feed mode or for HTTP streams. + ///Returns MPG123 error codes. + /// + ///Size to set. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_set_filesize(long long size); + + ///Time Per Frame (seconds). + ///Returns time per frame in seconds ( < 0 is error ). + /// + ///Time per frame in seconds ( < 0 is error ). + double __clrcall mpg123_tpf(void); + + ///Get and reset the clip count. + ///Returns the number of previously encountered clips. + /// + ///The number of previously encountered clips. + long __clrcall mpg123_clip(); + + ///Get various current decoder/stream state information. + ///Returns MPG123 error codes. + /// + ///The key to identify the information to get (enum mpg.state). + ///Returns integer values. + ///Returns real values. + ///MPG123 error codes. + mpg123clr::mpg::ErrorCode __clrcall mpg123_getstate(mpg123clr::mpg::state key, [Out] int% val, [Out] double% fval); + +#pragma endregion -Status and Information + +#pragma region Metadata Handling + + // \defgroup mpg123_metadata mpg123 metadata handling + // + // Functions to retrieve the metadata from MPEG Audio files and streams. + // Also includes string handling functions. + // + + // clr - much of the metadata has been relocated to class files for maintainability + // see string.h, text.h, id3v1.h and id3v2.h + // + + ///Query if there is (new) meta info, be it ID3 or ICY (or something new in future). + ///Returns a combination of flags. (enum id3.id3check) + /// + ///Returns a combination of flags. (enum id3.id3check) + mpg123clr::id3::id3check __clrcall mpg123_meta_check(void); /* On error (no valid handle) just 0 is returned. */ + + ///Get ID3 data. Data structures may change on any (next) read/decode function call. + ///v1 and/or v2 may be Empty if no corresponding data exists. + ///Returns MPG123_OK or MPG123_ERR. + /// + ///Returns mpg123id3v1 data structure containing ID3v1 data (usually from end of file). + ///Returns mpg123id3v2 data structure containing ID3v2 data (usually - but not restricted to - from beginning of file). + ///Returns MPG123_OK or MPG123_ERR. + mpg123clr::mpg::ErrorCode __clrcall mpg123_id3([Out]id3::mpg123id3v1^% v1, [Out]id3::mpg123id3v2^% v2); + + ///Get ICY meta data. Data structure may change on any (next) read/decode function call. + ///Icy_meta may be null if no corresponding data exists. + ///Returns MPG123_OK or MPG123_ERR. + /// + ///Returns ICY meta data (windows-1252 encoded). + ///Returns MPG123_OK or MPG123_ERR. + mpg123clr::mpg::ErrorCode __clrcall mpg123_icy([Out]IntPtr% icy_meta); /* same for ICY meta string */ + + ///Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. + ///Returns byte array of utf8 encoded data. + /// + ///ICY meta data in ICY encoding. + ///Returns byte array of utf8 encoded data. + static array^ __clrcall mpg123_icy2utf8(IntPtr icy_text); + +#pragma endregion -Metadata Handling + +#pragma region Advanced Parameter API + + // \defgroup mpg123_advpar mpg123 advanced parameter API + // + // Direct access to a parameter set without full handle around it. + // Possible uses: + // - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE). + // - Use one set of parameters for multiple handles. + // + // The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() + // family) directly return a fully qualified mpg123 error code, the ones + // operating on full handles normally MPG123_OK or MPG123_ERR, storing the + // specific error code itself inside the handle. + // + + // see advanced.h + +#pragma endregion -Advanced Parameter API + +#pragma region Low Level I/O + + // \defgroup mpg123_lowio mpg123 low level I/O + // You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket... + // + + ///Replace default internal buffer with user-supplied buffer. + ///Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio. + ///The data buffer should be pinned before calling this function. + ///Returns MPG123_OK or MPG123 error code. + /// + ///Pointer to supplied buffer. + ///Size of supplied buffer. + ///MPG123_OK or MPG123_ERR code. + mpg123clr::mpg::ErrorCode __clrcall mpg123_replace_buffer(IntPtr data, size_t size); + + ///The max size of one frame's decoded output with current settings. + ///Use that to determine an appropriate minimum buffer size for decoding one frame. + ///Returns size of required buffer. + /// + ///Size of required buffer. + size_t __clrcall mpg123_outblock(void); + + ///Replace low-level stream access functions; read and lseek as known in POSIX. + ///You can use this to make any fancy file opening/closing yourself, + /// using mpg123_open_fd() to set the file descriptor for your read/lseek (doesn't need to be a 'real' file descriptor...). + ///Setting a function to NULL means that the default internal function is used (active from next Open call onward). + ///////////////////////// + ///Always returns MPG123_OK. + /// + ///Delegate for read function, null for default. + ///Delegate for lseek function, null for default. + ///Always MPG123_OK. + mpg123clr::mpg::ErrorCode __clrcall mpg123_replace_reader(ReadDelegate^ r_read, SeekDelegate^ r_lseek); + + /////////////////////////////////////// + mpg123clr::mpg::ErrorCode __clrcall mpg123_replace_reader_handle(ReadHandleDelegate^ rh_read, SeekHandleDelegate^ rh_lseek, CleanupHandleDelegate^ rh_clean); + + private: + + // Defered internal implementation of ReplaceReader - action is defered until next 'Open' operation. + void __clrcall _ReplaceReader(void); + + public: + + // These functions are not part of the mpg123clr wrapper but are included as proof of concept + // of how to implement callback functions. + + ///Proof of concept posix-like lseek function. + ///This routine should not normally be called from your callback routine, it is a sample function + /// showing how such a callback could be implemented. + /// + ///File descriptor. + ///Required position. + ///Whence. + ///Resultant position. + static long PosixSeek(int fd, long offset, int origin) + { + long ret = _lseek(fd, offset, origin); + return ret; + } + + ///Proof of concept posix-like read function. + ///This routine should not normally be called from your callback routine, it is a sample function + /// showing how such a callback could be implemented. + /// + ///File descriptor. + ///Buffer address. + ///Size of buffer. + ///Actual bytes read. + static int PosixRead(int fd, void*buf, unsigned int count) + { + int ret = _read(fd, buf, count); + return ret; + } + +#pragma endregion -Low Level I/O + + }; + +} \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc new file mode 100644 index 0000000..be9f220 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.rc @@ -0,0 +1,102 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,13,0,0 + PRODUCTVERSION 1,13,0,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "mpg123 Project" + VALUE "FileDescription", "mpg123clr Dynamic Link Library" + VALUE "FileVersion", "1, 13, 0, 0" + VALUE "InternalName", "mpg123clr" + VALUE "LegalCopyright", "2009-2011 - the mpg123 project" + VALUE "OriginalFilename", "mpg123clr.dll" + VALUE "ProductName", "mpg123 Common Language Runtime Dynamic Link Library" + VALUE "ProductVersion", "1, 13, 0, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj new file mode 100644 index 0000000..8c1f2bf --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/mpg123clr.vcproj @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/resource.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/resource.h new file mode 100644 index 0000000..250c6a2 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by mpg123clr.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/stdafx.cpp b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/stdafx.cpp new file mode 100644 index 0000000..42146a7 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// mpg123clr.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/stdafx.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/stdafx.h new file mode 100644 index 0000000..8a4c94f --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/stdafx.h @@ -0,0 +1,38 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here + +struct mpg123_pars_struct{}; +struct mpg123_handle_struct{}; \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/string.cpp b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/string.cpp new file mode 100644 index 0000000..cc27096 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/string.cpp @@ -0,0 +1,166 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009-2011 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.9.0.0 01-Oct-09 Technical cleanup - subst nullptr for NULL (mb) + 1.13.0.0 13-Jan-11 release match - added strlen (mb) +*/ + +#include "StdAfx.h" +#include "string.h" + +// Constructor for overlaid instance (instanced) +mpg123clr::mpg123str::mpg123str(void) +{ + instanced = true; + sb = new ::mpg123_string; + mpg123_init_string(); + +} + +// Constructor for mpg123_string handle instance (referenced) +mpg123clr::mpg123str::mpg123str(mpg123_string* sb) +{ + instanced = false; + this->sb = sb; +} + +mpg123clr::mpg123str::mpg123str(const char* str) +{ + instanced = true; + sb = new ::mpg123_string; + mpg123_init_string(); + + ::mpg123_set_string(sb, str); +} + +// Destructor cleans up all resources +mpg123clr::mpg123str::~mpg123str(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!mpg123str(); +} + +// Finalizer cleans up unmanaged resources +mpg123clr::mpg123str::!mpg123str(void) +{ + if (instanced && (sb != nullptr)) mpg123_free_string(); +} + +int mpg123clr::mpg123str::mpg123_add_string(String ^ s) +{ + return mpg123_add_substring(s, 0, s->Length); +} + +int mpg123clr::mpg123str::mpg123_add_substring(String ^ s, int from, int count) +{ + // convert CLR string to CLI string + using namespace Runtime::InteropServices; + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(s->Substring(from, count))).ToPointer(); + + // add mpg123_string info + int ret = ::mpg123_add_string(sb, chars); + + // free temporary memory + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return ret; +} + +int mpg123clr::mpg123str::mpg123_copy_string(mpg123str^ to) +{ + return ::mpg123_copy_string(sb, to->sb); +} + +void mpg123clr::mpg123str::mpg123_free_string() +{ + ::mpg123_free_string(sb); +} + +int mpg123clr::mpg123str::mpg123_grow_string(int newSize) +{ + return ::mpg123_grow_string(sb, newSize); +} + +int mpg123clr::mpg123str::mpg123_resize_string(int newSize) +{ + return ::mpg123_resize_string(sb, newSize); +} + +void mpg123clr::mpg123str::mpg123_init_string() +{ + ::mpg123_init_string(sb); +} + +int mpg123clr::mpg123str::mpg123_set_string(String ^ s) +{ + return mpg123_set_substring(s, 0, s->Length); +} + +int mpg123clr::mpg123str::mpg123_set_substring(String ^ s, int from, int count) +{ + // convert CLR string to CLI string + using namespace Runtime::InteropServices; + const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(s->Substring(from, count))).ToPointer(); + + // set mpg123_string info + int ret = ::mpg123_set_string(sb, chars); + + // free temporary memory + Marshal::FreeHGlobal(IntPtr((void*)chars)); + + return ret; +} + +long long mpg123clr::mpg123str::mpg123_strlen(bool utf8) +{ + // TODO: determine use for utf8 vs ansi + return ::mpg123_strlen(sb, utf8); +} + +int mpg123clr::mpg123str::Fill::get() +{ + // WARN 4267 - clr limited to 32bit-length-size strings by PtrToStringAnsi + return (int)sb->fill; +} + +int mpg123clr::mpg123str::Size::get() +{ + // WARN 4267 - clr limited to 32bit-length-size strings by PtrToStringAnsi + return (int)sb->size; +} + +String^ mpg123clr::mpg123str::Text::get() +{ + if (sb->fill == 0) return gcnew String(""); + + // WARN 4267 - clr limited to 32bit-length-size strings by PtrToStringAnsi + return Marshal::PtrToStringAnsi((IntPtr)sb->p, (int)strnlen(sb->p, sb->fill)); +} + +mpg123clr::mpg123str::text_encoding mpg123clr::mpg123str::mpg123_enc_from_id3(unsigned char id3_enc_byte) +{ + return (mpg123clr::mpg123str::text_encoding) ::mpg123_enc_from_id3(id3_enc_byte); +} + +int mpg123clr::mpg123str::mpg123_store_utf8(text_encoding enc, const unsigned char *source, size_t source_size) +{ + return ::mpg123_store_utf8(sb, (mpg123_text_encoding)enc, source, source_size); +} diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/string.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/string.h new file mode 100644 index 0000000..19bb862 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/string.h @@ -0,0 +1,265 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009-2011 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. + 1.9.0.0 16-Sep-09 1.9.0 Update - add enc_from_id3, store_utf8 + 1.9.0.0 24-Sep-09 Function names harmonized with libmpg123 (mb) + 1.13.0.0 13-Jan-11 release match - added strlen (mb) +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include +#include + +#include +using namespace std; +using namespace System; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see Destructors and Finalizers in Visual C++] + // + // A ^ myA = gcnew A; + // try + // { + // use myA + // } + // finally + // { + // delete myA; + // } + + + ///Wrapper for mpg123_string. + ///mpg123str can be used as both (publicly) an instance object and (privately) a reference object. + /// Construction and Finalizer operations perform differently depending on the instance type... + /// + ///Instanced: i.e. new mpg123str(); + /// Normal operation of any object. Construction initializes memory and Destruction frees memory. + /// + ///Referenced: i.e. new mpg123str(sb); + /// Construction and Destruction have no effect on the referenced object, mpg123str objects may be freely + /// made and deleted without affecting the referenced object. + /// + ///However! + /// + ///All methods operate on the referenced object (and NOT a copy of the object), the underlying mpg123_string + /// is directly modified in situ. Therefore the referenced object can be initialized and disposed by + /// explicitly calling Init() and Free(). + ///The length of strings is limited to a 32bit value due to limitations of the CLI marshaler. + /// + /// + [StructLayout(LayoutKind::Sequential, CharSet=CharSet::Ansi)] + public ref struct mpg123str + { + + public: + + ///text_encoding enumeration. + enum class text_encoding + { + text_unknown = mpg123_text_unknown, /// Unkown encoding... mpg123_id3_encoding can return that on invalid codes. + text_utf8 = mpg123_text_utf8, /// UTF-8 + text_latin1 = mpg123_text_latin1, /// ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. + text_icy = mpg123_text_icy, /// ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. + text_cp1252 = mpg123_text_cp1252, /// Really CP-1252 without any guessing. + text_utf16 = mpg123_text_utf16, /// Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules. + /// When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when + /// you don't mess with the reserved code points. If you want to decode little endian data + /// without BOM you need to prepend 0xff 0xfe yourself. + text_utf16bom = mpg123_text_utf16bom, /// Just an alias for UTF-16, ID3v2 has this as distinct code. + text_utf16be = mpg123_text_utf16be, /// Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality, + /// BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123 + /// One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16 + /// types (we expect a BOM before real data there), not so for utf16be! + text_max = mpg123_text_max /// Placeholder for the maximum encoding value. + }; + + ///id3_enc enumeration. + enum class id3_enc + { + id3_latin1 = mpg123_id3_latin1, /// Note: This sometimes can mean anything in practice... + id3_utf16bom = mpg123_id3_utf16bom, /// UTF16, UCS-2 ... it's all the same for practical purposes. + id3_utf16be = mpg123_id3_utf16be, /// Big-endian UTF-16, BOM see note for mpg123_text_utf16be. + id3_utf8 = mpg123_id3_utf8, /// Our lovely overly ASCII-compatible 8 byte encoding for the world. + id3_enc_max = mpg123_id3_enc_max /// Placeholder to check valid range of encoding byte. + }; + + + private: + mpg123_string* sb; + bool instanced; + + internal: + ///Reference Constructor. Does nothing to referenced mpg123_string structure. + ///Reference objects may be freely created and deleted without affecting the underlying mpg123_string object. + /// However, operations on the referenced object do modify the object in-situ (i.e. 'this' is not a 'copy'), and + /// the referenced object may be explicitly initialized and disposed by calling the appropriate methods. (Init() and Free()) + ///Recommended usage: using(mpg123str obj = new mpg123str(sb)){ use obj here } + /// + mpg123str(mpg123_string* sb); + + ///Internal Constructor. + ///Only used on empty fields. + /// + mpg123str(const char* str); + + protected: + ///Finalizer. + ///Cleanly handles mpg123_free_string of instanced mpg123_string object. + ///Does not dispose referenced mpg123_string object. Referenced objects may be explicitly disposed by using Free(). + /// + /// Implementation of CLR Finalize(). + !mpg123str(void); + + public: + ///Constructor, also initializes underlying mpg123_string structure. + ///Instanced objects automatically dispose of underlying mpg123_string object. + ///Recommended usage: using(mpg123str obj = new mpg123str(sb)){ use obj here } + /// + mpg123str(void); + + ///Destructor. Used for final object deletion. + ///Instance objects call the finalizer for clean disposal of internal mpg123_string object. + ///Reference objects may be freely deleted without affecting the underlying mpg123_string object. + /// However, the referenced object may be explicitly disposed by calling Free() + /// + // Implementation of CLR Dispose(). + // ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + // See Destructors and Finalizers in Visual C++ + ~mpg123str(void); + + ///Append a C# string to this mpg123str. + ///Returns 0 on error, 1 on success. + /// + ///String to be appended. + ///0 on error, 1 on success. + int __clrcall mpg123_add_string(String ^ s); + + ///Append a C# substring to this mpg123str. + ///Returns 0 on error, 1 on success. + /// + ///String to be appended. + ///String offset to copy from. + ///Number of characters to copy. (a null byte is always appended) + ///0 on error, 1 on success. + int __clrcall mpg123_add_substring(String ^ s, int from, int count); + + ///Copy the contents of this string to another. + ///Returns 0 on error, 1 on success. + /// + ///Where to copy this string to. + ///0 on error, 1 on success. + int __clrcall mpg123_copy_string(mpg123str^ to); + + ///Free-up mempory for an existing mpg123_string. + /// + void __clrcall mpg123_free_string(void); + + ///Increase size of a mpg123_string if necessary (it may stay larger). + ///Returns 0 on error, 1 on success. + /// + ///Required size. + ///0 on error, 1 on success. + int __clrcall mpg123_grow_string(int newSize); + + ///Change the size of a mpg123_string. + ///Returns 0 on error, 1 on success. + /// + ///Required size. + ///0 on error, 1 on success. + int __clrcall mpg123_resize_string(int newSize); + + ///Create and allocate memory for a new mpg123_string. + /// + void __clrcall mpg123_init_string(void); + + ///Set the contents to a C# string. + ///Returns 0 on error, 1 on success. + /// + ///String to be applied. + ///0 on error, 1 on success. + int __clrcall mpg123_set_string(String ^ s); + + ///Set the contents to a C# substring. + ///Returns 0 on error, 1 on success. + /// + ///String to be applied. + ///String offset to copy from. + ///Number of characters to copy. (a null byte is always appended) + ///0 on error, 1 on success. + int __clrcall mpg123_set_substring(String ^ s, int from, int count); + + ///Count characters in a mpg123 string (non-null bytes or UTF-8 characters). + ///Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes. + ///Returns the character count. + /// + ///Flag to tell if the string is in utf8 encoding. + ///Character count. + long long __clrcall mpg123_strlen(bool utf8); + + ///Get the number of used bytes. (including closing zero byte). + ///Property returns the number of used bytes. + /// + ///The number of used bytes. + property int Fill{int __clrcall get();} // property + + ///Get the number of bytes allocated. + ///Property returns the number of bytes allocated. + /// + ///The number of bytes allocated. + property int Size{int __clrcall get();} // property + + ///Get a C# string representation of the mpg123str. + ///Property returns C# string text. + /// + ///C# string text. + property String^ Text{String^ __clrcall get();} + +// 1.9.0.0 +add + + ///Convert ID3 encoding byte to mpg123 encoding index. + ///Returns the text_encoding enum of the converted value. + /// + ///The ID3 encoding byte to be converted. + ///The text_encoding enum of the converted value. + static text_encoding __clrcall mpg123_enc_from_id3(unsigned char id3_enc_byte); + + ///Store text data in string, after converting to UTF-8 from indicated encoding. + ///A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). + /// Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that). + ///CLR - e.g. UnicodeEncoding(true, true) works with utf16be. + ///Returns 0 on error, 1 on success (on error, mpg123_free_string is called on sb). + /// + ///Mpg123 text encoding value. + ///Source buffer with plain unsigned bytes. + ///Number of bytes in the source buffer. + ///0 on error, 1 on success (on error, mpg123_free_string is called on sb). + int __clrcall mpg123_store_utf8(text_encoding enc, const unsigned char *source, size_t source_size); + +// 1.9.0.0 -add + + }; + +} diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/targetver.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/targetver.h new file mode 100644 index 0000000..f583181 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/targetver.h @@ -0,0 +1,24 @@ +#pragma once + +// The following macros define the minimum required platform. The minimum required platform +// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run +// your application. The macros work by enabling all features available on platform versions up to and +// including the version specified. + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Specifies that the minimum required platform is Windows Vista. +#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. +#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0. +#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE. +#endif diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/text.cpp b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/text.cpp new file mode 100644 index 0000000..e07ffd8 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/text.cpp @@ -0,0 +1,67 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +#include "StdAfx.h" +#include "text.h" + +mpg123clr::mpg123text::mpg123text(void) +{ +} + +mpg123clr::mpg123text::mpg123text(mpg123_text* sb) +{ + this->sb = sb; +} + +// Destructor +mpg123clr::mpg123text::~mpg123text(void) +{ + // clean up code to release managed resources + // ... + + // call Finalizer to clean up unmanaged resources + this->!mpg123text(); +} + +// Finalizer +mpg123clr::mpg123text::!mpg123text(void) +{ +} + +String^ mpg123clr::mpg123text::lang::get() +{ + return Marshal::PtrToStringAnsi((IntPtr)sb->lang, (int)strnlen(sb->lang, 3)); +} + +String^ mpg123clr::mpg123text::id::get() +{ + return Marshal::PtrToStringAnsi((IntPtr)sb->id, (int)strnlen(sb->id, 4)); +} + +String^ mpg123clr::mpg123text::description::get() +{ + mpg123str^ str = gcnew mpg123str(&sb->description); + return str->Text; +} + +String^ mpg123clr::mpg123text::text::get() +{ + mpg123str^ str = gcnew mpg123str(&sb->text); + return str->Text; +} diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/text.h b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/text.h new file mode 100644 index 0000000..32160cd --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2008clr/mpg123clr/text.h @@ -0,0 +1,111 @@ +/* + mpg123clr: MPEG Audio Decoder library Common Language Runtime version. + + copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1 + mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply. + + All rights to this work freely assigned to the mpg123 project. +*/ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ +/* + 1.8.1.0 04-Aug-09 Initial release. +*/ + +#pragma once + +#pragma warning(disable : 4635) +#include "mpg123.h" +#pragma warning(default : 4635) + +#include "string.h" + +#include +#include + +#include +using namespace std; +using namespace System; +using namespace System::Runtime::InteropServices; + +namespace mpg123clr +{ + // Recommended usage when creating reference type on the managed heap (not using stack semantics + // for reference types...) [see Destructors and Finalizers in Visual C++] + // + // A ^ myA = gcnew A; + // try + // { + // use myA + // } + // finally + // { + // delete myA; + // } + + + ///Wrapper for mpg123_text. + [StructLayout(LayoutKind::Sequential, CharSet=CharSet::Ansi)] + public ref struct mpg123text + { + private: + mpg123_text* sb; + + internal: + ///Constructor. + ///Recommended usage: only as tracking marker to existing mpg123_text objects. + mpg123text(void); + + ///Reference Constructor. + ///Recommended usage: only as tracking marker to existing mpg123_text objects. + mpg123text(mpg123_text* sb); + + protected: + ///Finalizer. + ///Does nothing. mpg123text can only be instanced as a reference to an existing mpg123_text object (which is responsible for its own disposal. + /// Implementation of CLR Finalize(). + !mpg123text(void); + + public: + ///Destructor. Used for final object deletion. + ///Calls finalizer. + /// + /// Implementation of CLR Dispose(). + /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize(). + /// See Destructors and Finalizers in Visual C++ + ~mpg123text(void); + + ///Get a string representation of the 3-letter language code. + ///Only COMM and USLT have a language element. + ///Property returns string representation of the 3-letter language code. + /// + ///String representation of the 3-letter language code. + property String^ lang{String^ __clrcall get();} + + ///Get a string representation of the ID3v2 field id. (i.e. TALB, TPE2 etc.) + ///Property returns string representation of the ID3v2 field id. (i.e. TALB, TPE2 etc.) + /// + ///String representation of the ID3v2 field id. (i.e. TALB, TPE2 etc.) + property String^ id{String^ __clrcall get();} + + ///Get a string representation of the description field. + ///Only COMM and TXXX have a description element. + ///Property returns string representation of the description field. + /// + ///String representation of the description field. + property String^ description{String^ __clrcall get();} + + ///Get a string representation of the ID3 tag text. + ///This is for COMM, TXXX and all the other text fields. + ///Property returns string representation of the ID3 tag text. + /// + ///String representation of the ID3 tag text. + property String^ text{String^ __clrcall get();} + + }; +} diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj new file mode 100644 index 0000000..6e4a036 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj @@ -0,0 +1,90 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {3C75D302-5DA2-49DD-A27A-5EB199D6933B} + Win32Proj + dump_seekindex + + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + true + $(ProjectDir)$(Configuration)\ + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + + + false + $(ProjectDir)$(Configuration)\ + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + + + {67caa87b-7cf1-4f93-bb67-21c513f40803} + + + + + + \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj.filters b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj.filters new file mode 100644 index 0000000..72e22ea --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/dump_seekindex/dump_seekindex.vcxproj.filters @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2010/feedseek/feedseek.vcxproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/feedseek/feedseek.vcxproj new file mode 100644 index 0000000..60f0fb2 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/feedseek/feedseek.vcxproj @@ -0,0 +1,95 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + {67caa87b-7cf1-4f93-bb67-21c513f40803} + + + + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15} + Win32Proj + feedseek + + + + Application + Unicode + + + Application + true + Unicode + + + + + + + + + + + + + true + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + $(ProjectDir)$(Configuration)\ + + + false + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + $(ProjectDir)$(Configuration)\ + + + + + + Level3 + true + EditAndContinue + Disabled + EnableFastChecks + MultiThreadedDebugDLL + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + + + ProgramDatabase + MaxSpeed + MultiThreadedDLL + true + true + WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2010/feedseek/feedseek.vcxproj.filters b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/feedseek/feedseek.vcxproj.filters new file mode 100644 index 0000000..569f255 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/feedseek/feedseek.vcxproj.filters @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2010/libmpg123/libmpg123.vcxproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/libmpg123/libmpg123.vcxproj new file mode 100644 index 0000000..f42b38d --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/libmpg123/libmpg123.vcxproj @@ -0,0 +1,960 @@ + + + + + Debug_Generic_Dll + Win32 + + + Debug_Generic + Win32 + + + Debug_x86_Dll_Minimal + Win32 + + + Debug_x86_Dll + Win32 + + + Debug_x86 + Win32 + + + Release_Generic_Dll + Win32 + + + Release_Generic + Win32 + + + Release_x86_Dll_Minimal + Win32 + + + Release_x86_Dll + Win32 + + + Release_x86 + Win32 + + + + {67CAA87B-7CF1-4F93-BB67-21C513F40803} + libmpg123 + + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.21006.1 + $(ProjectDir)Debug\ + Debug\ + $(ProjectDir)Release\ + Release\ + $(ProjectDir)Debug\ + Debug\ + $(ProjectDir)Release\ + Release\ + $(ProjectDir)Debug\ + Debug\ + $(ProjectDir)Release\ + Release\ + $(ProjectDir)Debug\ + Debug\ + $(ProjectDir)Release\ + Release\ + false + $(ProjectDir)Debug\ + Debug\ + $(ProjectDir)Release\ + Release\ + false + + + + Disabled + ../..;../../../../src/libmpg123;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;%(PreprocessorDefinitions) + false + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + $(ProjectDir)Debug\$(ProjectName).lib + + + + + MaxSpeed + AnySuitable + true + Speed + true + ../..;../../../../src/libmpg123;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + StreamingSIMDExtensions + Precise + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + $(ProjectDir)Release\$(ProjectName).lib + + + + + Disabled + ../..;../../../../src/libmpg123;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;BUILD_MPG123_DLL;ACCURATE_ROUNDING;IEEE_FLOAT;%(PreprocessorDefinitions) + false + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + $(ProjectDir)Debug\$(ProjectName).dll + $(ProjectDir)\Debug;%(AdditionalLibraryDirectories) + true + true + 0x63000000 + false + true + + + + + MaxSpeed + AnySuitable + true + Speed + true + ../..;../../../../src/libmpg123;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;BUILD_MPG123_DLL;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + StreamingSIMDExtensions + Precise + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + $(ProjectDir)Release\$(ProjectName).dll + true + 0x63000000 + false + true + + + + + Disabled + ../..;../../../../src/libmpg123;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions) + false + + + EnableFastChecks + MultiThreadedDebugDLL + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm" + + + + dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + $(ProjectDir)Debug\$(ProjectName).lib + $(ProjectDir)\Debug;%(AdditionalLibraryDirectories) + + + + + MaxSpeed + AnySuitable + true + Speed + true + ../..;../../../../src/libmpg123;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + StreamingSIMDExtensions + Precise + false + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm" + + + + dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + $(ProjectDir)Release\$(ProjectName).lib + $(ProjectDir)\Release;%(AdditionalLibraryDirectories) + + + + + Disabled + ../..;../../../../src/libmpg123;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions) + false + + + EnableFastChecks + MultiThreadedDebugDLL + Precise + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm" + + + + dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + $(ProjectDir)Debug\$(ProjectName).dll + $(ProjectDir)\Debug;%(AdditionalLibraryDirectories) + true + true + 0x63000000 + true + false + + + + + + + + + MaxSpeed + AnySuitable + true + Speed + true + ../..;../../../../src/libmpg123;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + StreamingSIMDExtensions + Precise + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm" + + + + dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + $(ProjectDir)Release\$(ProjectName).dll + $(ProjectDir)\Release;%(AdditionalLibraryDirectories) + true + 0x63000000 + false + true + + + + + + + + + Disabled + ../..;../../../../src/libmpg123;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;NO_STRING;NO_ID3V2;NO_ICY;NO_DOWNSAMPLE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions) + false + + + EnableFastChecks + MultiThreadedDebugDLL + Precise + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm" + + + + dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + $(ProjectDir)Debug\$(ProjectName).dll + $(ProjectDir)\Debug;%(AdditionalLibraryDirectories) + true + true + 0x63000000 + true + false + + + + + + + + + MaxSpeed + AnySuitable + true + Speed + true + ../..;../../../../src/libmpg123;%(AdditionalIncludeDirectories) + WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;NO_STRING;NO_ID3V2;NO_ICY;NO_DOWNSAMPLE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions) + + + MultiThreadedDLL + false + false + StreamingSIMDExtensions + Precise + false + Level3 + false + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm" + +cl /I "..\.." /EP /TC "$(ProjectDir)..\..\..\..\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm" +yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm" + + + + dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) + $(ProjectDir)Release\$(ProjectName).dll + $(ProjectDir)\Release;%(AdditionalLibraryDirectories) + true + 0x63000000 + false + true + + + + + + + + + + + true + true + true + true + + + true + true + true + true + true + true + true + true + true + true + + + + + + + true + true + + + + + + + + + + + + + + + + + + true + true + true + true + true + true + true + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2010/mpg123.sln b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/mpg123.sln new file mode 100644 index 0000000..cce053f --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/mpg123.sln @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "feedseek", "feedseek\feedseek.vcxproj", "{AE56D9D0-ECBA-44CD-943A-E530F6C46E15}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpg123", "libmpg123\libmpg123.vcxproj", "{67CAA87B-7CF1-4F93-BB67-21C513F40803}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scan", "scan\scan.vcxproj", "{1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_seekindex", "dump_seekindex\dump_seekindex.vcxproj", "{3C75D302-5DA2-49DD-A27A-5EB199D6933B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Debug|Win32.Build.0 = Debug|Win32 + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Release|Win32.ActiveCfg = Release|Win32 + {AE56D9D0-ECBA-44CD-943A-E530F6C46E15}.Release|Win32.Build.0 = Release|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Win32.ActiveCfg = Debug_x86|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Debug|Win32.Build.0 = Debug_x86|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Win32.ActiveCfg = Release_x86|Win32 + {67CAA87B-7CF1-4F93-BB67-21C513F40803}.Release|Win32.Build.0 = Release_x86|Win32 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Debug|Win32.ActiveCfg = Debug|Win32 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Debug|Win32.Build.0 = Debug|Win32 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Release|Win32.ActiveCfg = Release|Win32 + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508}.Release|Win32.Build.0 = Release|Win32 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Debug|Win32.Build.0 = Debug|Win32 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Release|Win32.ActiveCfg = Release|Win32 + {3C75D302-5DA2-49DD-A27A-5EB199D6933B}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2010/scan/scan.vcxproj b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/scan/scan.vcxproj new file mode 100644 index 0000000..6fc5f91 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/scan/scan.vcxproj @@ -0,0 +1,93 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + {67caa87b-7cf1-4f93-bb67-21c513f40803} + + + + {1B03F4FD-A10A-4F99-A476-BE7FFD1CB508} + Win32Proj + scan + + + + Application + Unicode + + + Application + true + Unicode + + + + + + + + + + + + + true + $(ProjectDir)$(Configuration)\ + ..\..\..\MSVC++;..\..\..\..\src\libmpg123;$(IncludePath) + + + false + $(ProjectDir)$(Configuration)\ + + + + NotUsing + Level3 + true + EditAndContinue + Disabled + EnableFastChecks + MultiThreadedDebugDLL + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(IntDir) + + + Console + true + + + + + Level3 + NotUsing + ProgramDatabase + MaxSpeed + MultiThreadedDLL + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/2010/scan/scan.vcxproj.filters b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/scan/scan.vcxproj.filters new file mode 100644 index 0000000..aa03bdf --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/2010/scan/scan.vcxproj.filters @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H new file mode 100644 index 0000000..9a569bb --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/CORE/CORE_FileIn.H @@ -0,0 +1,15 @@ +// ------------------------------------------------------------------------------------------------ + +#pragma once + +// ------------------------------------------------------------------------------------------------ + +protected: + +::FILE *m_pFile; + +PBYTE m_pucMemData; +DWORD m_dwLength; +DWORD m_dwReadPos; + +// ------------------------------------------------------------------------------------------------ diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H new file mode 100644 index 0000000..c9471a8 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/CORE/SourceFilter_MP3.H @@ -0,0 +1,139 @@ +// ------------------------------------------------------------------------------------------------ + +#pragma once + +// ------------------------------------------------------------------------------------------------ + +#ifdef _DEBUG +#pragma comment(lib, "libMPG123_d.lib") +#else +#pragma comment(lib, "libMPG123.lib") +#endif + +// ------------------------------------------------------------------------------------------------ + +#include "../DShowBase/streams.h" + +#include +#include + +#include "../../libMPG123/MPG123.H" + +#include + +// ------------------------------------------------------------------------------------------------ + +#define WAVE_HEADER_LENGTH 44 + +// ------------------------------------------------------------------------------------------------ + +#define MP3_DECODE_LEN 0x4000 + +#define MP3_DECODE_BUF_LEN 0x8000 + +// ------------------------------------------------------------------------------------------------ + +namespace IIEP +{ + class CMP3Stream : public CAsyncStream + { + public: + + CMP3Stream(void); + ~CMP3Stream(void); + + void SetSeekFlag(void); + + bool Open(const WORD *pcwsFileName, CMediaType &coMT, DWORD dwKBPerSec = INFINITE); + void Close(void); + + HRESULT SetPointer(LONGLONG llPos); + HRESULT Read(PBYTE pucBuffer, + DWORD dwBytesToRead, + BOOL bAlign, + LPDWORD pdwBytesRead); + + LONGLONG Size(LONGLONG *pSizeAvailable); + + DWORD Alignment(void); + + void Lock (void); + void Unlock(void); + + bool DecodeFrame(void); + + // + + bool OpenFile(const WORD *pcwsFileName); + + DWORD ReadFile(PVOID pBuf , DWORD dwLen ); + long SeekFile(long nOffset, int iOrigin); + + // + + private: + + CCritSec m_csLock; + + DWORD m_dwKBPerSec; + DWORD m_dwTimeStart; + + mpg123_handle *m_pcoMH; + + DWORD m_dwTotalBlocks; + DWORD m_dwAlignment; + + DWORD m_dwLength; + DWORD m_dwPosition; + + BYTE m_ucHeader[WAVE_HEADER_LENGTH]; + + // + + DWORD m_dwDataBufPos; + DWORD m_dwDataBufLen; + BYTE m_ucDataBuffer[MP3_DECODE_BUF_LEN]; + + // + + bool m_bSeekFlag; + + // + + IIEP::CFileIn m_coFileIn; + long m_nDataBegin; + long m_nDataTotal; + }; + + // ---------------------------------------------------------------------------------------------- + + class CMP3Reader : public CAsyncReader + { + public: + + // We're not going to be CoCreate'd so we don't need registration stuff etc + + STDMETHODIMP Register(void) + { + return S_OK; + } + + STDMETHODIMP Unregister(void) + { + return S_OK; + } + + CMP3Reader(CMP3Stream *pcoStream, + CMediaType *pcoMT, + HRESULT *phr) : + CAsyncReader(NAME("MP3 Reader\0"), + NULL, + pcoStream, + phr) + { + m_coMT = *pcoMT; + } + }; +} + +// ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H new file mode 100644 index 0000000..07a853d --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_Def.H @@ -0,0 +1,206 @@ +// +// __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ +// /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ +// \_/_//_/\\_\/ \_/_//_/\\_\//_/\\_\\_\\_\//_/\\_\\_/_/\/ +// /_//_/\/ /_//_/\/ /_/\/ __ /_/\/ __ /_/\/ +// /_//_/\/ /_//_/\/ /_//_//_/\ /_//_//_//_/\/ +// /_//_/\/ /_//_/\/ /_/\\_\\_\/ /_/\\_\\_\\_\/ +// __ /_//_/\/ __ /_//_/\/ /_/\/ __ __ /_/\/ +// /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ /_/\/ +// \_\\_\\_\\_\/ \_\\_\\_\\_\/ \_\\_\\_\\_\/ \_\/ +// +// +// ..:: Interactive Internet Entertainment Platform ::.. +// +// (C) 2000-2006, FAN YI PENG. ALL RIGHTS RESERVED +// +// ________________________________________________________________________________________________ +// +/// @file IIEP_Def.H +/// @brief +// ________________________________________________________________________________________________ +// +// +// _____________________________________ +// | | +// | DATA | +// _____________________________|_____________________________________|____________________________ +// +// __________ +// __________________________________________| CONFIG |__________________________________________ + +#pragma once + +#ifdef _DEBUG + #pragma comment(lib, "IIEP_DBG.LIB") +#else + #pragma comment(lib, "IIEP.LIB") +#endif + +// ____________________________________________ CONFIG ____________________________________________ +// +// __________ +// __________________________________________| DEFINE |__________________________________________ +// +// _____________ +// ____/ Data Type \_____________________________________________________________________________ + +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef unsigned long DWORD; +typedef __int64 QWORD; + +typedef BYTE *PBYTE; +typedef WORD *PWORD; +typedef DWORD *PDWORD; +typedef QWORD *PQWORD; + +typedef void *PVOID; + +// ______ Data Type _______________________________________________________________________________ +// +// ___________ +// ____/ Release \_______________________________________________________________________________ + +#define SAFE_DELETE(p) if (p) { delete (p); (p) = 0; } +#define SAFE_DELETE_ARRAY(p) if (p) { delete[] (p); (p) = 0; } +#define SAFE_RELEASE(p) if (p) { (p) -> Release(); (p) = 0; } + +// ______ Release _________________________________________________________________________________ +// +// __________ +// ____/ Assert \________________________________________________________________________________ + +#ifndef ASSERT + #ifdef _DEBUG + namespace IIEP { bool AssertFunction(bool, long, const char *, const char *); } + #define ASSERT(expression) \ + if (IIEP::AssertFunction((bool) (expression), __LINE__, __FILE__, __FUNCTION__)) {_asm {int 3}} + #else + #define ASSERT(expression) + #endif +#endif + +// ______ Assert __________________________________________________________________________________ +// +// _______ +// ____/ LOG \___________________________________________________________________________________ + +namespace IIEP +{ + void DebugLog(const char *pcszFormat, ...); + void DebugLog(const WORD *pcwsFormat, ...); + + void WriteLog(const char *pcszFormat, ...); + void WriteLog(const WORD *pcwsFormat, ...); +} + +// ______ LOG _____________________________________________________________________________________ +// +// ________ +// ____/ TODO \__________________________________________________________________________________ + +#ifdef _DEBUG + #define TODO \ + IIEP::DebugLog("\n[TODO] %d: \"%s\"- %s()\n~~~~~~\n", __LINE__, __FILE__, __FUNCTION__); + #define ToDo(x) \ + IIEP::DebugLog("\n[TODO] %d: \"%s\"- %s(): %s\n~~~~~~\n", __LINE__, __FILE__, __FUNCTION__, (x)); +#else + #define TODO + #define ToDo(x) +#endif + +// ______ TODO ____________________________________________________________________________________ +// +// ________ +// ____/ Path \__________________________________________________________________________________ + +namespace IIEP +{ + void ResetToExePath(void); +} + +// ______ Path ____________________________________________________________________________________ +// +// __________ +// ____/ CMutex \________________________________________________________________________________ + +namespace IIEP +{ + class CMutex + { + public: + + CMutex(void) { m_bLocked = false; } + ~CMutex(void) {} + + void Lock(void); + void Unlock(void) { m_bLocked = false; } + void Set(void) { m_bLocked = true; } + void Wait(void); + + bool IsLock(void) const { return m_bLocked; } + + private: + + volatile bool m_bLocked; + }; +} + +// ______ CMutex __________________________________________________________________________________ +// +// _________ +// ____/ SRect \_________________________________________________________________________________ + +namespace IIEP +{ + /// @brief νṹ + + struct SRect + { + SRect(void) {} + + SRect(long nX, long nY, long nWidth, long nHeight) + { + m_nX = nX; + m_nY = nY; + m_nWidth = nWidth; + m_nHeight = nHeight; + } + + // ------------------------------------------------------------------------------------------- + + void Set(long nX, long nY, long nWidth, long nHeight) + { + m_nX = nX; + m_nY = nY; + m_nWidth = nWidth; + m_nHeight = nHeight; + } + + // ------------------------------------------------------------------------------------------- + + long m_nX; ///< Ͻ X + long m_nY; ///< Ͻ Y + long m_nWidth; ///< ο + long m_nHeight; ///< θ߶ + }; +} + +// ______ SRect ___________________________________________________________________________________ +// +// ___________________________ +// ____/ Sample Grabber CallBack \_______________________________________________________________ + +namespace IIEP +{ + typedef void (*CALLBACK_SampleGrabberBuffer) (PVOID, DWORD); +} + +// ______ Sample Grabber CallBack _________________________________________________________________ +// +// ____________________________________________ DEFINE ____________________________________________ +// +// ____________________________________________________________________________________ DATA ______ +// +// ___________________________________________ FILE END ___________________________________________ \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H new file mode 100644 index 0000000..73fb5b4 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/INCLUDE/IIEP_FileIn.H @@ -0,0 +1,167 @@ +// +// __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ +// /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ +// \_/_//_/\\_\/ \_/_//_/\\_\//_/\\_\\_\\_\//_/\\_\\_/_/\/ +// /_//_/\/ /_//_/\/ /_/\/ __ /_/\/ __ /_/\/ +// /_//_/\/ /_//_/\/ /_//_//_/\ /_//_//_//_/\/ +// /_//_/\/ /_//_/\/ /_/\\_\\_\/ /_/\\_\\_\\_\/ +// __ /_//_/\/ __ /_//_/\/ /_/\/ __ __ /_/\/ +// /_//_//_//_/\ /_//_//_//_/\ /_//_//_//_/\ /_/\/ +// \_\\_\\_\\_\/ \_\\_\\_\\_\/ \_\\_\\_\\_\/ \_\/ +// +// +// ..:: Interactive Internet Entertainment Platform ::.. +// +// (C) 2000-2005, FAN YI PENG. ALL RIGHTS RESERVED +// +// ________________________________________________________________________________________________ +// +/// @file IIEP_FileIn.H +/// @brief ļӿ +// ________________________________________________________________________________________________ +// +// +// _____________________________________ +// | | +// | DATA | +// _____________________________|_____________________________________|____________________________ +// +// __________ +// __________________________________________| CONFIG |__________________________________________ + +#pragma once + +// ____________________________________________ CONFIG ____________________________________________ +// +// __________ +// __________________________________________| HEADER |__________________________________________ + +#include +#include + +#include + +// ____________________________________________ HEADER ____________________________________________ +// +// __________ +// __________________________________________| DEFINE |__________________________________________ +// +// ___________ +// ____/ CFileIn \_______________________________________________________________________________ + +namespace IIEP +{ + /// @brief ļӿ + + class CFileIn + { + public: + + CFileIn(void); + ~CFileIn(void); + + bool Open(const char *pcszFileName); + bool Open(const WORD *pcwsFileName); + + void Close(void); + + DWORD GetFileSize(void) const; + DWORD GetReadPosition(void) const; + + bool Seek(long nOffset, long nOrigin = 0); // SEEK_SET = 0 SEEK_CUR = 1 SEEK_END = 2 + + bool Skip(long nOffset) { return Seek(nOffset, 1); } + + DWORD Read(PVOID pDataBuffer, DWORD dwReadSize); + + bool ReadB(BYTE &ucData) + { + return (1 == Read(&ucData, 1)); + } + + bool ReadW(WORD &wData) + { + return (2 == Read(&wData, 2)); + } + + bool ReadDW(DWORD &dwData) + { + return (4 == Read(&dwData, 4)); + } + + bool ReadInverseW(WORD &wData) + { + if (2 == Read(&wData, 2)) + { + _asm + { + MOV ECX, wData + MOV AX, [ECX] + XCHG AH, AL + MOV [ECX], AX + } + + return true; + } + + return false; + } + + bool ReadInverseDW(DWORD &dwData) + { + if (4 == Read(&dwData, 4)) + { + _asm + { + MOV ECX, dwData + MOV EAX, [ECX] + BSWAP EAX + MOV [ECX], EAX + } + + return true; + } + + return false; + } + + // -------------------------------------------------------------------------------------------- + + bool ReadAnsiLine(std::string &strLine); + bool ReadUnicodeLine(std::wstring &wstrLine, bool bBigEndian); + + bool ReadAnsiString (char *pszBuffer, DWORD dwBufferLength); + bool ReadUnicodeString(WORD *pwzBuffer, DWORD dwBufferLength); + + // -------------------------------------------------------------------------------------------- + + private: + + CFileIn(const CFileIn &); // forbidden + CFileIn & operator = (const CFileIn &); // forbidden + + #include + }; +} + +// ______ CFileIn _________________________________________________________________________________ +// +// _______________ +// ____/ Memory File \___________________________________________________________________________ + +namespace IIEP +{ + bool CreateMemoryFile(PVOID pMemory, DWORD dwLength, const char *pcszFileName); + bool CreateMemoryFile(PVOID pMemory, DWORD dwLength, const WORD *pcwsFileName); + bool RemoveMemoryFile(const char *pcszFileName); + bool RemoveMemoryFile(const WORD *pcwsFileName); + void RemoveMemoryFile(void); +} + +// ______ Memory File _____________________________________________________________________________ +// +// ____________________________________________ DEFINE ____________________________________________ +// +// ____________________________________________________________________________________ DATA ______ +// +// ___________________________________________ FILE END ___________________________________________ \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/README b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/README new file mode 100644 index 0000000..df7a9aa --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/README @@ -0,0 +1,4 @@ +This is a MS Visual C++ project plus wrapper class for libmpg123, contributed by "Gates Fan" . +You need to copy the stuff from mgp123-x.y.z/src/libmpg123 to the libMPG123 directory and also ensure that you produce a valid mpg123.h from the mpg123.h.in (replace the @BLABLA@ with the appropriate #includes). + +Thomas. diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP new file mode 100644 index 0000000..4fb1a02 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_FileIn.CPP @@ -0,0 +1,462 @@ +// ------------------------------------------------------------------------------------------------ + +#include + +#include +#include + +#include +#include +#include + +// ------------------------------------------------------------------------------------------------ + +struct MEM_FILE_IDX +{ + MEM_FILE_IDX(void) + { + m_dwID = 0; + m_dwLength = 0; + m_pucData = 0; + } + + DWORD m_dwID; // hash ID of filename + DWORD m_dwLength; // file length + PBYTE m_pucData; // memory pointer +}; + +static std::vector s_vecMemFile; + +// ------------------------------------------------------------------------------------------------ +// name: SearchMemFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +static std::vector :: iterator SearchMemFile(PCWSTR pcwsFileName) +{ + DWORD dwID = IIEP::HashFNV_1a(pcwsFileName); + + std::vector ::iterator it; + + for (it = s_vecMemFile.begin(); it < s_vecMemFile.end(); it ++) + { + if (it -> m_dwID == dwID) return it; + } + + return s_vecMemFile.end(); +} + +// ------------------------------------------------------------------------------------------------ + +static std::vector :: iterator SearchMemFile(const char *pcszFileName) +{ + WORD wzNameBuffer[0x1000]; + + wzNameBuffer[0] = 0; + + IIEP::StringFromANSI(pcszFileName, wzNameBuffer, 0x1000); + + return SearchMemFile(wzNameBuffer); +} + +// ------------------------------------------------------------------------------------------------ +// name: CreateMemoryFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CreateMemoryFile(PVOID pMemory, DWORD dwLength, PCWSTR pcwsFileName) +{ + if (0 == pcwsFileName || 0 == *pcwsFileName) return false; + + RemoveMemoryFile(pcwsFileName); + + DWORD dwID = IIEP::HashFNV_1a(pcwsFileName); + + MEM_FILE_IDX soIDX; + + soIDX.m_dwID = dwID; + soIDX.m_dwLength = dwLength; + soIDX.m_pucData = (PBYTE) pMemory; + + s_vecMemFile.push_back(soIDX); + + return true; +} + +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CreateMemoryFile(PVOID pMemory, DWORD dwLength, const char *pcszFileName) +{ + WORD wzNameBuffer[0x1000]; + + wzNameBuffer[0] = 0; + + StringFromANSI(pcszFileName, wzNameBuffer, 0x1000); + + return CreateMemoryFile(pMemory, dwLength, wzNameBuffer); +} + +// ------------------------------------------------------------------------------------------------ +// name: RemoveMemoryFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::RemoveMemoryFile(PCWSTR pcwsFileName) +{ + if (0 == pcwsFileName || 0 == *pcwsFileName) return false; + + std::vector ::iterator it = SearchMemFile(pcwsFileName); + + if (it == s_vecMemFile.end()) return false; + + s_vecMemFile.erase(it); + + return true; +} + +// ------------------------------------------------------------------------------------------------ + +bool IIEP::RemoveMemoryFile(const char *pcszFileName) +{ + WORD wzNameBuffer[0x1000]; + + wzNameBuffer[0] = 0; + + StringFromANSI(pcszFileName, wzNameBuffer, 0x1000); + + return RemoveMemoryFile(wzNameBuffer); +} + +// ------------------------------------------------------------------------------------------------ + +void IIEP::RemoveMemoryFile(void) +{ + s_vecMemFile.clear(); +} + +// ------------------------------------------------------------------------------------------------ +// name: CFileIn() +// desc: +// ------------------------------------------------------------------------------------------------ + +IIEP::CFileIn::CFileIn(void) +{ + m_pFile = 0; + m_pucMemData = 0; + m_dwLength = 0; + m_dwReadPos = 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: ~CFileIn() +// desc: +// ------------------------------------------------------------------------------------------------ + +IIEP::CFileIn::~CFileIn(void) +{ + Close(); +} + +// ------------------------------------------------------------------------------------------------ +// name: Open() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::Open(const char *pcszFileName) +{ + WORD wzNameBuffer[0x1000]; + + wzNameBuffer[0] = 0; + + StringFromANSI(pcszFileName, wzNameBuffer, 0x1000); + + return Open(wzNameBuffer); +} + +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::Open(const WORD *pcwsFileName) +{ + Close(); + + if (0 == pcwsFileName || 0 == *pcwsFileName) return false; + + std::vector ::iterator it = SearchMemFile(pcwsFileName); + + if (it == s_vecMemFile.end()) // not found in memory + { + m_pFile = _wfopen(pcwsFileName, L"rb"); + + if (m_pFile) + { + return true; // found DOS file + } + + return false; + } + + if (s_vecMemFile.empty()) return false; + + m_pucMemData = it -> m_pucData; + m_dwLength = it -> m_dwLength; + + return true; +} + +// ------------------------------------------------------------------------------------------------ +// name: Close() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CFileIn::Close(void) +{ + if (m_pFile) + { + fclose(m_pFile); + + m_pFile = 0; + } + + m_pucMemData = 0; + m_dwLength = 0; + m_dwReadPos = 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: GetFileSize() +// desc: +// ------------------------------------------------------------------------------------------------ + +DWORD IIEP::CFileIn::GetFileSize(void) const +{ + if (m_pFile) + { + DWORD dwPostion = ftell(m_pFile); + + fseek(m_pFile, 0, SEEK_END); + + DWORD dwFileSize = ftell(m_pFile); + + fseek(m_pFile, dwPostion, SEEK_SET); + + return dwFileSize; + } + + return m_dwLength; +} + +// ------------------------------------------------------------------------------------------------ +// name: GetReadPosition() +// desc: +// ------------------------------------------------------------------------------------------------ + +DWORD IIEP::CFileIn::GetReadPosition(void) const +{ + if (m_pFile) + { + return ftell(m_pFile); + } + + return m_dwReadPos; +} + +// ------------------------------------------------------------------------------------------------ +// name: Seek() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::Seek(long nOffset, long nOrigin) +{ + if (m_pFile) + { + return (0 == fseek(m_pFile, nOffset, nOrigin)); + } + + if (m_pucMemData) + { + switch (nOrigin) + { + case SEEK_SET: + if (nOffset < 0 || nOffset >= (long) m_dwLength) return false; + m_dwReadPos = nOffset; + return true; + + case SEEK_CUR: + nOffset += m_dwReadPos; + if (nOffset < 0 || nOffset >= (long) m_dwLength) return false; + m_dwReadPos = nOffset; + return true; + + case SEEK_END: + ASSERT(nOffset <= 0); // Ǹ + nOffset = m_dwLength - 1 + nOffset; + if (nOffset < 0 || nOffset >= (long) m_dwLength) return false; + m_dwReadPos = nOffset; + return true; + } + } + + return false; +} + +// ------------------------------------------------------------------------------------------------ +// name: Read() +// desc: +// ------------------------------------------------------------------------------------------------ + +DWORD IIEP::CFileIn::Read(PVOID pDataBuffer, DWORD dwReadSize) +{ + if (m_pFile) + { + return (DWORD) fread(pDataBuffer, 1, dwReadSize, m_pFile); + } + + if (m_pucMemData) + { + if (m_dwReadPos + dwReadSize > m_dwLength) dwReadSize = m_dwLength - m_dwReadPos; + + memcpy(pDataBuffer, m_pucMemData + m_dwReadPos, dwReadSize); + + m_dwReadPos += dwReadSize; + + return dwReadSize; + } + + return 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: ReadAnsiLine() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::ReadAnsiLine(std::string &strLine) +{ + BYTE ucChar = 0; + + strLine.clear(); + + while (ReadB(ucChar)) + { + if (0x0D == ucChar) + { + } + else + if (0x0A == ucChar) + { + return true; + } + else + { + strLine.push_back(ucChar); + } + } + + if (strLine.empty()) return false; + + return true; +} + +// ------------------------------------------------------------------------------------------------ +// name: ReadUnicodeLine() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::ReadUnicodeLine(std::wstring &wstrLine, bool bBigEndian) +{ + WORD wChar = 0; + + wstrLine.clear(); + + while (bBigEndian ? ReadInverseW(wChar) : ReadW(wChar)) + { + if (0x000D == wChar) + { + } + else + if (0x000A == wChar) + { + return true; + } + else + { + wstrLine.push_back(wChar); + } + } + + if (wstrLine.empty()) return false; + + return true; +} + +// ------------------------------------------------------------------------------------------------ +// name: ReadAnsiString() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::ReadAnsiString(char *pszBuffer, DWORD dwBufferLength) +{ + DWORD dwIndex = 0; + BYTE ucChar; + + while (ReadB(ucChar)) + { + if (dwIndex >= dwBufferLength) return true; + + pszBuffer[dwIndex ++] = ucChar; + + if (0 == ucChar) + { + return true; + } + } + + return false; +} + +// ------------------------------------------------------------------------------------------------ +// name: ReadUnicodeString() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CFileIn::ReadUnicodeString(WORD *pwzBuffer, DWORD dwBufferLength) +{ + DWORD dwIndex = 0; + WORD wChar; + + ReadInverseW(wChar); + + if (wChar == 0xFFFE) // Unicode + { + while (ReadW(wChar)) + { + if (dwIndex >= dwBufferLength) return true; + + pwzBuffer[dwIndex ++] = wChar; + + if (0 == wChar) + { + return true; + } + } + } + else + if (wChar == 0xFEFF) // Unicode big endian + { + while (ReadInverseW(wChar)) + { + if (dwIndex >= dwBufferLength) return true; + + pwzBuffer[dwIndex ++] = wChar; + + if (0 == wChar) + { + return true; + } + } + } + + return false; +} + +// ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP new file mode 100644 index 0000000..ab67713 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_Log.CPP @@ -0,0 +1,122 @@ +// ------------------------------------------------------------------------------------------------ + +#include +#include + +#include + +#include + +// ------------------------------------------------------------------------------------------------ + +static bool s_bLogFileOpened = false; + +// ------------------------------------------------------------------------------------------------ +// name: DebugLog() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::DebugLog(const char *pcszFormat, ...) +{ +#ifdef _DEBUG + char cBuffer[0x8000]; + + va_list pcArg; + + va_start(pcArg, pcszFormat); + _vsnprintf(cBuffer, 0x8000, pcszFormat, pcArg); + va_end(pcArg); + + ::OutputDebugStringA(cBuffer); +#endif +} + +// ------------------------------------------------------------------------------------------------ + +void IIEP::DebugLog(const WORD *pcwsFormat, ...) +{ +#ifdef _DEBUG + WCHAR wcBuffer[0x8000]; + + va_list pcArg; + + va_start(pcArg, pcwsFormat); + _vsnwprintf(wcBuffer, 0x8000, pcwsFormat, pcArg); + va_end(pcArg); + + ::OutputDebugStringW(wcBuffer); +#endif +} + +// ------------------------------------------------------------------------------------------------ +// name: WriteLog() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::WriteLog(const char *pcszFormat, ...) +{ + char cBuffer[0x8000]; + + va_list pcArg; + + va_start(pcArg, pcszFormat); + _vsnprintf(cBuffer, 0x8000, pcszFormat, pcArg); + va_end(pcArg); + + FILE *phFile; + + #define LOG_FILE "C:\\IIEP.LOG" + + if (s_bLogFileOpened) + { + phFile = fopen(LOG_FILE, "a+"); + } + else + { + phFile = fopen(LOG_FILE, "w"); + + s_bLogFileOpened = true; + } + + if (phFile) + { + fprintf(phFile, cBuffer); + fclose(phFile); + } +} + +// ------------------------------------------------------------------------------------------------ + +void IIEP::WriteLog(const WORD *pcwsFormat, ...) +{ + WCHAR wcBuffer[0x8000]; + + va_list pcArg; + + va_start(pcArg, pcwsFormat); + _vsnwprintf(wcBuffer, 0x8000, pcwsFormat, pcArg); + va_end(pcArg); + + FILE *phFile; + + #define LOG_FILE "C:\\IIEP.LOG" + + if (s_bLogFileOpened) + { + phFile = fopen(LOG_FILE, "a"); + } + else + { + phFile = fopen(LOG_FILE, "w"); + + s_bLogFileOpened = true; + } + + if (phFile) + { + fwprintf(phFile, wcBuffer); + fclose(phFile); + } +} + +// ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP new file mode 100644 index 0000000..5566f35 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/CORE_Mutex.CPP @@ -0,0 +1,35 @@ +// ------------------------------------------------------------------------------------------------ + +#include + +#include + +// ------------------------------------------------------------------------------------------------ +// name: Lock() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMutex::Lock(void) +{ + while (m_bLocked) + { + ::Sleep(1); + } + + m_bLocked = true; +} + +// ------------------------------------------------------------------------------------------------ +// name: Wait() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMutex::Wait(void) +{ + while (m_bLocked) + { + ::Sleep(1); + } +} + +// ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP new file mode 100644 index 0000000..658b000 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/SOURCE/SourceFilter_MP3Stream.CPP @@ -0,0 +1,586 @@ +// ------------------------------------------------------------------------------------------------ + +#include + +#include + +// ------------------------------------------------------------------------------------------------ + +extern BYTE g_ucWaveHeader[WAVE_HEADER_LENGTH]; + +// ------------------------------------------------------------------------------------------------ +// name: CMP3Stream() +// desc: +// ------------------------------------------------------------------------------------------------ + +static size_t read_sub(int fd, void *pBuf, size_t nSize) +{ + if (fd) + { + IIEP::CMP3Stream *pcoStream = (IIEP::CMP3Stream *) fd; + + return pcoStream -> ReadFile(pBuf, nSize); + } + + return 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: CMP3Stream() +// desc: +// ------------------------------------------------------------------------------------------------ + +static off_t seek_sub(int fd, off_t nOffset, int iOrigin) +{ + if (fd) + { + IIEP::CMP3Stream *pcoStream = (IIEP::CMP3Stream *) fd; + + return pcoStream -> SeekFile(nOffset, iOrigin); + } + + return 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: CMP3Stream() +// desc: +// ------------------------------------------------------------------------------------------------ + +IIEP::CMP3Stream::CMP3Stream(void) +{ + m_dwKBPerSec = INFINITE; + m_dwTimeStart = 0; + + m_pcoMH = 0; + + m_dwTotalBlocks = 0; + m_dwAlignment = 4; + + m_dwLength = 0; + m_dwPosition = 0; + + memcpy(m_ucHeader, g_ucWaveHeader, WAVE_HEADER_LENGTH); + + m_dwDataBufPos = 0; + m_dwDataBufLen = 0; + + m_bSeekFlag = false; +} + +// ------------------------------------------------------------------------------------------------ +// name: ~CMP3Stream() +// desc: +// ------------------------------------------------------------------------------------------------ + +IIEP::CMP3Stream::~CMP3Stream(void) +{ + Close(); +} + +// ------------------------------------------------------------------------------------------------ +// name: SetSeekFlag() +// desc: called by IIEP::CPlayer::SetMediaPosition(QWORD qwPosition) +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMP3Stream::SetSeekFlag(void) +{ + m_bSeekFlag = true; +} + +// ------------------------------------------------------------------------------------------------ +// name: Open() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CMP3Stream::Open(const WORD *pcwsFileName, CMediaType &coMT, DWORD dwKBPerSec) +{ + Close(); + + // + + if (MPG123_OK != mpg123_init()) + { + goto OPEN_FAIL; + } + + m_pcoMH = mpg123_new(NULL, NULL); + + if (0 == m_pcoMH) + { + goto OPEN_FAIL; + } + + if (false == OpenFile(pcwsFileName)) + { + goto OPEN_FAIL; + } + + if (MPG123_OK != mpg123_replace_reader(m_pcoMH, read_sub, seek_sub)) + { + goto OPEN_FAIL; + } + + if (MPG123_OK != mpg123_open_fd(m_pcoMH, (int) this)) + { + goto OPEN_FAIL; + } + + long nRate; + int iChannels; + int iEncoding; + + if (MPG123_OK != mpg123_getformat(m_pcoMH, &nRate, &iChannels, &iEncoding)) + { + goto OPEN_FAIL; + } + + // Ensure that this output format will not change (it could, when we allow it) + + mpg123_format_none(m_pcoMH); + mpg123_format(m_pcoMH, nRate, iChannels, iEncoding); + + // scan & get total samples + + mpg123_scan(m_pcoMH); + + off_t nOff = mpg123_length(m_pcoMH); + + if (nOff < 0) + { + goto OPEN_FAIL; + } + + m_dwTotalBlocks = (DWORD) nOff; + + // set other format + + m_dwAlignment = iChannels * 2; + + if (0 == m_dwAlignment) + { + m_dwAlignment = 4; + } + + m_dwLength = m_dwTotalBlocks * m_dwAlignment + WAVE_HEADER_LENGTH; + + WORD wChannels = (WORD ) iChannels; + DWORD dwSamplesPerSec = (DWORD) nRate; + DWORD dwAvgBytesPerSec = m_dwAlignment * dwSamplesPerSec; + WORD wBlockAlign = (WORD ) m_dwAlignment; + WORD wBitsPerSample = 16; + + PWORD pwData; + PDWORD pdwData; + + pdwData = (PDWORD) &m_ucHeader[0x04]; + *pdwData = m_dwTotalBlocks * m_dwAlignment + WAVE_HEADER_LENGTH - 8; + + pwData = (PWORD) &m_ucHeader[0x16]; + *pwData = wChannels; + + pdwData = (PDWORD) &m_ucHeader[0x18]; + *pdwData = dwSamplesPerSec; + + pdwData = (PDWORD) &m_ucHeader[0x1C]; + *pdwData = dwAvgBytesPerSec; + + pwData = (PWORD) &m_ucHeader[0x20]; + *pwData = wBlockAlign; + + pwData = (PWORD) &m_ucHeader[0x22]; + *pwData = wBitsPerSample; + + pdwData = (PDWORD) &m_ucHeader[0x28]; + *pdwData = m_dwTotalBlocks * m_dwAlignment; + + coMT.majortype = MEDIATYPE_Stream; + coMT.subtype = MEDIASUBTYPE_WAVE; + + SetPointer(0); + + m_dwTimeStart = ::timeGetTime(); + + return true; + +OPEN_FAIL: + + Close(); + + return false; +} + +// ------------------------------------------------------------------------------------------------ +// name: Close() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMP3Stream::Close(void) +{ + m_coFileIn.Close(); + + if (m_pcoMH) + { + mpg123_close (m_pcoMH); + mpg123_delete(m_pcoMH); + + m_pcoMH = 0; + } + + mpg123_exit(); + + m_dwTimeStart = 0; + m_dwTotalBlocks = 0; + + m_dwLength = 0; + m_dwPosition = 0; + + m_bSeekFlag = false; + + m_nDataBegin = 0; + m_nDataTotal = 0; +} + +// ------------------------------------------------------------------------------------------------ +// name: SetPointer() +// desc: +// ------------------------------------------------------------------------------------------------ + +HRESULT IIEP::CMP3Stream::SetPointer(LONGLONG llPos) +{ + if (llPos < 0 || llPos > (LONGLONG) m_dwLength) + { + return S_FALSE; + } + + m_dwPosition = (DWORD) llPos; + + if (llPos < WAVE_HEADER_LENGTH) + { + mpg123_seek(m_pcoMH, 0, SEEK_SET); + + m_dwDataBufLen = 0; + } + else + { + if (m_bSeekFlag && m_dwAlignment > 0) + { + m_bSeekFlag = false; + + mpg123_seek(m_pcoMH, (long) (m_dwPosition - WAVE_HEADER_LENGTH) / m_dwAlignment, SEEK_SET); + + m_dwDataBufLen = 0; + } + } + + return S_OK; +} + +// ------------------------------------------------------------------------------------------------ +// name: Read() +// desc: +// ------------------------------------------------------------------------------------------------ + +HRESULT IIEP::CMP3Stream::Read(PBYTE pucBuffer, + DWORD dwBytesToRead, + BOOL bAlign, + LPDWORD pdwBytesRead) +{ + if (0 == m_pcoMH) return S_FALSE; + + CAutoLock lck(&m_csLock); + + DWORD dwReadLength; + + // wait until the bytes are here + + DWORD dwTime = ::timeGetTime(); + + if (m_dwPosition + dwBytesToRead > m_dwLength) + { + dwReadLength = m_dwLength - m_dwPosition; + } + else + { + dwReadLength = dwBytesToRead; + } + + DWORD dwTimeToArrive = (m_dwPosition + dwReadLength) / m_dwKBPerSec; + + if (dwTime - m_dwTimeStart < dwTimeToArrive) + { + ::Sleep(dwTimeToArrive - dwTime + m_dwTimeStart); + } + + // read data + + DWORD dwRead = 0; + + if (m_dwPosition < WAVE_HEADER_LENGTH) + { + DWORD dwPatchLen = WAVE_HEADER_LENGTH - m_dwPosition; + + if (dwReadLength < dwPatchLen) + { + dwPatchLen = dwReadLength; + } + + memcpy(pucBuffer, m_ucHeader + m_dwPosition, dwPatchLen); + + m_dwPosition += dwPatchLen; + dwReadLength -= dwPatchLen; + + pucBuffer += dwPatchLen; + dwRead += dwPatchLen; + } + + if (dwReadLength > 0) + { + while (m_dwDataBufLen < dwReadLength) + { + if (m_dwDataBufLen > 0) + { + memcpy(pucBuffer, m_ucDataBuffer + m_dwDataBufPos, m_dwDataBufLen); + + dwRead += m_dwDataBufLen; + + dwReadLength -= m_dwDataBufLen; + + pucBuffer += m_dwDataBufLen; + m_dwDataBufPos += m_dwDataBufLen; + m_dwDataBufLen = 0; + } + + if (DecodeFrame() == false) break; + } + + if (dwReadLength > 0) + { + if (m_dwDataBufLen >= dwReadLength) + { + memcpy(pucBuffer, m_ucDataBuffer + m_dwDataBufPos, dwReadLength); + + dwRead += dwReadLength; + + m_dwDataBufPos += dwReadLength; + m_dwDataBufLen -= dwReadLength; + } + } + } + + m_dwPosition += dwRead; + *pdwBytesRead = dwRead; + + return S_OK; +} + +// ------------------------------------------------------------------------------------------------ +// name: Size() +// desc: +// ------------------------------------------------------------------------------------------------ + +LONGLONG IIEP::CMP3Stream::Size(LONGLONG *pSizeAvailable) +{ +// LONGLONG llCurrentAvailable = Int32x32To64((::timeGetTime() - m_dwTimeStart), m_dwKBPerSec); + LONGLONG llLength = (LONGLONG) m_dwTotalBlocks * m_dwAlignment + WAVE_HEADER_LENGTH; + + if (pSizeAvailable) + { +// *pSizeAvailable = min(llLength, llCurrentAvailable); + *pSizeAvailable = llLength; + } + + return llLength; +} + +// ------------------------------------------------------------------------------------------------ +// name: Alignment() +// desc: +// ------------------------------------------------------------------------------------------------ + +DWORD IIEP::CMP3Stream::Alignment(void) +{ + return m_dwAlignment; +} + +// ------------------------------------------------------------------------------------------------ +// name: Lock() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMP3Stream::Lock(void) +{ + m_csLock.Lock(); +} + +// ------------------------------------------------------------------------------------------------ +// name: Unlock() +// desc: +// ------------------------------------------------------------------------------------------------ + +void IIEP::CMP3Stream::Unlock(void) +{ + m_csLock.Unlock(); +} + +// ------------------------------------------------------------------------------------------------ +// name: DecodeFrame() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CMP3Stream::DecodeFrame(void) +{ + if (0 == m_dwDataBufLen) + { + m_dwDataBufPos = 0; + } + + if (m_dwDataBufPos + m_dwDataBufLen + MP3_DECODE_LEN > MP3_DECODE_BUF_LEN) + { + return true; + } + + size_t nBytesRead = 0; + + mpg123_read(m_pcoMH, m_ucDataBuffer + m_dwDataBufPos + m_dwDataBufLen, MP3_DECODE_LEN, &nBytesRead); + + m_dwDataBufLen += (DWORD) nBytesRead; + + return (m_dwDataBufLen > 0); +} + +// ------------------------------------------------------------------------------------------------ +// name: OpenFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +bool IIEP::CMP3Stream::OpenFile(const WORD *pcwsFileName) +{ + if (m_coFileIn.Open(pcwsFileName)) + { + m_nDataBegin = 0; + m_nDataTotal = m_coFileIn.GetFileSize(); + + // check ID3 Tag V2.x + + BYTE ucBuffer[8]; + bool bFound; + +TRY_ID3_AGAIN: + + bFound = false; + + if (6 == m_coFileIn.Read(ucBuffer, 6)) + { + if (ucBuffer[0] == 'I' && + ucBuffer[1] == 'D' && + ucBuffer[2] == '3') + { + bFound = true; + + DWORD dwHeaderSize; + + if (m_coFileIn.ReadInverseDW(dwHeaderSize)) + { + dwHeaderSize = ((dwHeaderSize & 0x7F000000) >> 3) + + ((dwHeaderSize & 0x007F0000) >> 2) + + ((dwHeaderSize & 0x00007F00) >> 1) + + ((dwHeaderSize & 0x0000007F) ); + + dwHeaderSize += 10; + + m_nDataBegin += dwHeaderSize; + m_nDataTotal -= dwHeaderSize; + + if (ucBuffer[3] >= 0x03) // ID3 Tag version >= 2.3 + { + if (ucBuffer[5] & 0x40) // has extended header + { + if (m_coFileIn.ReadInverseDW(dwHeaderSize)) + { + dwHeaderSize = ((dwHeaderSize & 0x7F000000) >> 3) + + ((dwHeaderSize & 0x007F0000) >> 2) + + ((dwHeaderSize & 0x00007F00) >> 1) + + ((dwHeaderSize & 0x0000007F) ); + + dwHeaderSize += 4; + + m_nDataBegin += dwHeaderSize; + m_nDataTotal -= dwHeaderSize; + } + } + } + } + } + } + + SeekFile(0, SEEK_SET); + + if (bFound) + { + goto TRY_ID3_AGAIN; + } +/* + m_coFileIn.Read(ucBuffer, 2); + + if (ucBuffer[0] != 0xFF || ucBuffer[1] < 0xF0) + { + m_nDataBegin ++; + m_nDataTotal --; + + SeekFile(0, SEEK_SET); + + goto TRY_ID3_AGAIN; + } + + SeekFile(0, SEEK_SET); +*/ + return true; + } + + return false; +} + +// ------------------------------------------------------------------------------------------------ +// name: ReadFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +DWORD IIEP::CMP3Stream::ReadFile(PVOID pBuf, DWORD dwLen) +{ + return m_coFileIn.Read(pBuf, dwLen); +} + +// ------------------------------------------------------------------------------------------------ +// name: SeekFile() +// desc: +// ------------------------------------------------------------------------------------------------ + +long IIEP::CMP3Stream::SeekFile(long nOffset, int iOrigin) +{ + switch (iOrigin) + { + case SEEK_SET: + if (nOffset < 0 || nOffset >= m_nDataTotal) return -1; + break; + + case SEEK_CUR: + nOffset += (m_coFileIn.GetReadPosition() - m_nDataBegin); + if (nOffset < 0 || nOffset >= m_nDataTotal) return -1; + break; + + case SEEK_END: + nOffset = m_nDataTotal - 1 + nOffset; + if (nOffset < 0 || nOffset >= m_nDataTotal) return -1; + break; + } + + if (m_coFileIn.Seek(nOffset + m_nDataBegin, SEEK_SET)) + { + return nOffset; + } + + return -1; +} + +// ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/libMPG123/PLACE_LIBMPG123_SOURCES_HERE new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj new file mode 100644 index 0000000..6c68b6e --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/CMP3Stream/libMPG123/libMPG123.vcproj @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/config.h b/node_modules/lame/deps/mpg123/ports/MSVC++/config.h new file mode 100644 index 0000000..4658c7d --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/config.h @@ -0,0 +1,35 @@ +#define strcasecmp _strcmpi +#define strncasecmp _strnicmp +#define strdup _strdup + +#define HAVE_STRERROR 1 +#define HAVE_SYS_TYPES_H 1 + +#define HAVE_STRDUP +#define HAVE_STDLIB_H +#define HAVE_STRING_H + +/* We want some frame index, eh? */ +#define FRAME_INDEX 1 +#define INDEX_SIZE 1000 + +/* also gapless playback! */ +#define GAPLESS 1 +/* #ifdef GAPLESS +#undef GAPLESS +#endif */ + +/* #define DEBUG +#define EXTRA_DEBUG */ + +#define REAL_IS_FLOAT + +#define inline __inline + +/* we are on win32 */ +#define HAVE_WINDOWS_H + +/* use the unicode support within libmpg123 */ +#ifdef UNICODE + #define WANT_WIN32_UNICODE +#endif diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/examples/feedseek.c b/node_modules/lame/deps/mpg123/ports/MSVC++/examples/feedseek.c new file mode 100644 index 0000000..d62337e --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/examples/feedseek.c @@ -0,0 +1,240 @@ +/* + feedseek: test program for libmpg123, showing how to use fuzzy seeking in feeder mode + copyright 2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org +*/ + +#include +#include +#include +#include + +#define INBUFF 16384 * 2 * 2 +#define WAVE_FORMAT_PCM 0x0001 +#define WAVE_FORMAT_IEEE_FLOAT 0x0003 + +FILE *out; +size_t totaloffset, dataoffset; +long rate; +int channels, enc; +unsigned short bitspersample, wavformat; + +// write wav header +void initwav() +{ + unsigned int tmp32 = 0; + unsigned short tmp16 = 0; + + fwrite("RIFF", 1, 4, out); + totaloffset = ftell(out); + + fwrite(&tmp32, 1, 4, out); // total size + fwrite("WAVE", 1, 4, out); + fwrite("fmt ", 1, 4, out); + tmp32 = 16; + fwrite(&tmp32, 1, 4, out); // format length + tmp16 = wavformat; + fwrite(&tmp16, 1, 2, out); // format + tmp16 = channels; + fwrite(&tmp16, 1, 2, out); // channels + tmp32 = rate; + fwrite(&tmp32, 1, 4, out); // sample rate + tmp32 = rate * bitspersample/8 * channels; + fwrite(&tmp32, 1, 4, out); // bytes / second + tmp16 = bitspersample/8 * channels; // float 16 or signed int 16 + fwrite(&tmp16, 1, 2, out); // block align + tmp16 = bitspersample; + fwrite(&tmp16, 1, 2, out); // bits per sample + fwrite("data ", 1, 4, out); + tmp32 = 0; + dataoffset = ftell(out); + fwrite(&tmp32, 1, 4, out); // data length +} + +// rewrite wav header with final length infos +void closewav() +{ + unsigned int tmp32 = 0; + unsigned short tmp16 = 0; + + long total = ftell(out); + fseek(out, totaloffset, SEEK_SET); + tmp32 = total - (totaloffset + 4); + fwrite(&tmp32, 1, 4, out); + fseek(out, dataoffset, SEEK_SET); + tmp32 = total - (dataoffset + 4); + + fwrite(&tmp32, 1, 4, out); +} + +// determine correct wav format and bits per sample +// from mpg123 enc value +void initwavformat() +{ + if(enc & MPG123_ENC_FLOAT_64) + { + bitspersample = 64; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if(enc & MPG123_ENC_FLOAT_32) + { + bitspersample = 32; + wavformat = WAVE_FORMAT_IEEE_FLOAT; + } + else if(enc & MPG123_ENC_16) + { + bitspersample = 16; + wavformat = WAVE_FORMAT_PCM; + } + else + { + bitspersample = 8; + wavformat = WAVE_FORMAT_PCM; + } +} + +int _tmain(int argc, TCHAR **argv) +{ + unsigned char buf[INBUFF]; + unsigned char *audio; + FILE *in; + mpg123_handle *m; + int ret, state; + size_t inc, outc; + off_t len, num; + size_t bytes; + off_t inoffset; + size_t nrates; + const long *rates; + size_t i; + inc = outc = 0; + nrates = 0; + rates = NULL; + + if(argc < 3) + { + fprintf(stderr,"Please supply in and out filenames\n"); + return -1; + } + + mpg123_init(); + + m = mpg123_new(NULL, &ret); + if(m == NULL) + { + fprintf(stderr,"Unable to create mpg123 handle: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + mpg123_param(m, MPG123_VERBOSE, 4, 0); + + ret = mpg123_param(m, MPG123_FLAGS, MPG123_FUZZY | MPG123_SEEKBUFFER | MPG123_GAPLESS, 0); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to set library options: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + // Let the seek index auto-grow and contain an entry for every frame + ret = mpg123_param(m, MPG123_INDEX_SIZE, -1, 0); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to set index size: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + // Use float output formats only + ret = mpg123_format_none(m); + if(ret != MPG123_OK) + { + fprintf(stderr,"Unable to disable all output formats: %s\n", mpg123_plain_strerror(ret)); + return -1; + } + + mpg123_rates(&rates, &nrates); + for(i=0; i +#include + +int _tmain(int argc, _TCHAR* argv[]) +{ + mpg123_handle *m; + int i; + if(argc < 2) + { + fprintf(stderr, "\nI will give you the estimated and exact sample lengths of MPEG audio files.\n"); + fprintf(stderr, "\nUsage: %s \n\n", argv[0]); + return -1; + } + mpg123_init(); + m = mpg123_new(NULL, NULL); + mpg123_param(m, MPG123_RESYNC_LIMIT, -1, 0); /* New in library version 0.0.1 . */ + for(i = 1; i < argc; ++i) + { + off_t a, b; + + mpg123_topen(m, argv[i]); + + a = mpg123_length(m); + mpg123_scan(m); + b = mpg123_length(m); + + mpg123_tclose(m); + + printf("File %i: estimated %li vs. scanned %li\n", i, (long)a, (long)b); + } + + mpg123_delete(m); + mpg123_exit(); + return 0; +} diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/mpg123.h b/node_modules/lame/deps/mpg123/ports/MSVC++/mpg123.h new file mode 100644 index 0000000..6b8ead3 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/mpg123.h @@ -0,0 +1,46 @@ +/* + mpg123_msvc: MPEG Audio Decoder library wrapper header for MS VC++ 2005 + + copyright 2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + initially written by Patrick Dehne and Thomas Orgis. +*/ +#ifndef MPG123_MSVC_H +#define MPG123_MSVC_H + +#include +#include +#include + +typedef long ssize_t; + +// Needed for Visual Studio versions before VS 2010. +#if (_MSC_VER < 1600) +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +#else +#include +#endif + +#define PRIiMAX "I64i" +typedef __int64 intmax_t; +// ftell returns long, _ftelli64 returns __int64 +// off_t is long, not __int64, use ftell +#define ftello ftell + +#define MPG123_NO_CONFIGURE +#include "mpg123.h.in" /* Yes, .h.in; we include the configure template! */ + +#ifdef __cplusplus +extern "C" { +#endif + + // Wrapper around mpg123_open that supports path names with unicode + // characters + EXPORT int mpg123_topen(mpg123_handle *fr, const _TCHAR *path); + EXPORT int mpg123_tclose(mpg123_handle *fr); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/ports/MSVC++/msvc.c b/node_modules/lame/deps/mpg123/ports/MSVC++/msvc.c new file mode 100644 index 0000000..97b0eec --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/MSVC++/msvc.c @@ -0,0 +1,59 @@ +/* + msvc: libmpg123 add-ons for MSVC++ + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + originally written by Patrick Dehne (inspired by libmpg123/readers.c) + +*/ + +#include "mpg123lib_intern.h" + +#include +#include +#include + +#include "debug.h" + +int mpg123_topen(mpg123_handle *fr, const _TCHAR *path) +{ + int ret; + int filept; /* descriptor of opened file/stream */ + + ret = mpg123_replace_reader(fr, _read, _lseek); + if(ret != MPG123_OK) + { + return ret; + } + + if((filept = _topen(path, O_RDONLY|O_BINARY)) < 0) + { + /* Will not work with unicode path name + if(NOQUIET) error2("Cannot open file %s: %s", path, strerror(errno)); */ + + if(NOQUIET) error1("Cannot open file: %s", strerror(errno)); + fr->err = MPG123_BAD_FILE; + return filept; /* error... */ + } + + if(mpg123_open_fd(fr, filept) == MPG123_OK) { + return MPG123_OK; + } + else + { + _close(filept); + return MPG123_ERR; + } +} + +int mpg123_tclose(mpg123_handle *fr) +{ + int ret, filept; + + filept = fr->rdat.filept; + ret = mpg123_close(fr); + _close(filept); + + return ret; +} diff --git a/node_modules/lame/deps/mpg123/ports/README b/node_modules/lame/deps/mpg123/ports/README new file mode 100644 index 0000000..f83b0cb --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/README @@ -0,0 +1,26 @@ +This directory contains some (contributed) works covering usage and/or building of mpg123/libmpg123 from different programming environments. +Note that those may be a bit outdated (especially when a file is added/removed in libmpg123 sources); as the team lacks resource to test everything. But in any case, the ports can provide a good starting point on the respective platform, to get it to work with minimal fuzz. + +- Delphi: mpg123_.pas + Unit for linking against libmpg123 (Win32, DLL). + ...by Arthur Pires +- Sony PSP: Sony_PSP/; building libmpg123 for the PSP (used for the MODO player). + ...by Bastian Pflieger +- MSVC++: Microsoft Windows / Visual C++ builds + - MSVC++/CMP3Stream: + project for building libmpg123 with interface class. + ...by "Gates Fan" + - MSVC++/mpg123.h + A wrapper header over mpg123.h.in (yes, the template file in ../src/libmpg123) to use in MSVC++ projects that link to libmpg123. + - MSVC++/2005 and MSVC++/2008 contain project files for building and using libmpg123 with the corresponding versions of Microsoft Visual C++. + To use it add the project to your solution. Then add a reference to libmpg123 from the project that wants to use it. + Also add ports/MSVC++ and src/libmpg123 to the include path. + If you want to use the asm build you will need yasm (http://www.tortall.net/projects/yasm/). + Please put yasm.exe into a directory where MSVC++ can find it. Finally switch the libmpg123 project to the + Release_MMX_Dll build using the Visual Studio Configuration Manager. + - Xcode contains the project file for building and using libmpg123 with + Xcode for Mac and iOS (arm and simulator builds). Please add the + ports/Xcode folder to the header search path of your project so that + Xcode can find the right mpg123.h and config.h. Then drag the mpg123 + Xcode project into your own project. Finally in your build target, build + phases, add mpg123-ios or mpg123-mac to the libraries to link. diff --git a/node_modules/lame/deps/mpg123/ports/Sony_PSP/Makefile.psp b/node_modules/lame/deps/mpg123/ports/Sony_PSP/Makefile.psp new file mode 100644 index 0000000..12d8664 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/Sony_PSP/Makefile.psp @@ -0,0 +1,38 @@ +PSPSDK = $(shell psp-config --pspsdk-path) +PSPDIR = $(shell psp-config --psp-prefix) + +#DEFINES := PSP OPT_GENERIC REAL_IS_FIXED HAVE_CONFIG_H +DEFINES := PSP OPT_GENERIC REAL_IS_FLOAT HAVE_CONFIG_H +#DEFINES := PSP OPT_GENERIC FLOATOUT REAL_IS_FLOAT HAVE_CONFIG_H +DEFINEFLAGS := $(addprefix -D,$(DEFINES)) +INCDIR := ../. +CFLAGS = -g -O2 -Wall -fomit-frame-pointer -funroll-all-loops -finline-functions -ffast-math $(DEFINEFLAGS) + +MPG123_OBJS = compat.o parse.o frame.o format.o index.o synth.o synth_8bit.o \ + ntom.o icy2utf8.o synth_real.o synth_s32.o\ + equalizer.o icy.o id3.o layer1.o layer2.o layer3.o optimize.o readers.o tabinit.o stringbuf.o libmpg123.o dct64.o + +MPG123_LIB_FILE = ./libmpg123.a + +OBJS = $(MPG123_OBJS) +TARGET_LIB = $(MPG123_LIB_FILE) + +include $(PSPSDK)/lib/build.mak + + + +#################### +## Makefile rules ## +#################### + +install: $(MPG123_LIB_FILE) + @echo "" + @echo "**********************************************************************" + @echo "Installing libstsound into $(PSPDIR)" + @mkdir -p $(PSPDIR)/include $(PSPDIR)/lib + @cp -v mpg123.h $(PSPDIR)/include + @cp -v libmpg123.a $(PSPDIR)/lib + @echo "Done" + @echo "**********************************************************************" + @echo "" + diff --git a/node_modules/lame/deps/mpg123/ports/Sony_PSP/README b/node_modules/lame/deps/mpg123/ports/Sony_PSP/README new file mode 100644 index 0000000..ce9b45c --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/Sony_PSP/README @@ -0,0 +1,11 @@ +Hi + +* Place Makefile.psp in the directory src/libmpg123. +* Patch readers.c (present in src/libmpg123) using readers.c.patch +* Place Config.h in directory src/ +* cd to src/libmpg123 and do "make -f Makefile.psp install" + +Tested on mpg123 1.4.x and psptoolchain rev. 2398 + +Regards +Bastian diff --git a/node_modules/lame/deps/mpg123/ports/Sony_PSP/config.h b/node_modules/lame/deps/mpg123/ports/Sony_PSP/config.h new file mode 100644 index 0000000..957c5e9 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/Sony_PSP/config.h @@ -0,0 +1,368 @@ +/* src/config.h. Generated from config.h.in by configure. */ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It's for 32bit x86... */ +#define ABI_ALIGN_FUN 1 + +/* Define to use proper rounding. */ +/* #undef ACCURATE_ROUNDING */ + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +/* #undef ASMALIGN_EXP */ + +/* Define if __attribute__((aligned(16))) shall be used */ +/* #undef CCALIGN */ + +/* Define if checking of stack alignment is wanted. */ +#define CHECK_ALIGN 1 + +/* Define if debugging is enabled. */ +/* #undef DEBUG */ + +/* The default audio output module(s) to use */ +#define DEFAULT_OUTPUT_MODULE "alsa,oss,esd,sdl,nas,arts" + +/* Define if building with dynamcally linked libmpg123 */ +#define DYNAMIC_BUILD 1 + +/* Define if FIFO support is enabled. */ +#define FIFO 1 + +/* Define if frame index should be used. */ +#define FRAME_INDEX 1 + +/* Define if gapless is enabled. */ +#define GAPLESS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ALIB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ASM_AUDIOIO_H */ + +/* Define to 1 if you have the `atoll' function. */ +#define HAVE_ATOLL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AUDIOS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CULIB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `mx' library (-lmx). */ +/* #undef HAVE_LIBMX */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_SOUNDCARD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if libltdl is available */ +#define HAVE_LTDL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkfifo' function. */ +#define HAVE_MKFIFO 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OS2ME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OS2_H */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#define HAVE_SCHED_SETSCHEDULER 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setpriority' function. */ +#define HAVE_SETPRIORITY 1 + +/* Define to 1 if you have the `setuid' function. */ +#define HAVE_SETUID 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SNDIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SUN_AUDIOIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_AUDIOIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_AUDIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SIGNAL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOUNDCARD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define this if you have the POSIX termios library */ +#define HAVE_TERMIOS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to indicate that float storage follows IEEE754. */ +#define IEEE_FLOAT 1 + +/* size of the frame index seek table */ +#define INDEX_SIZE 1000 + +/* Define if IPV6 support is enabled. */ +#define IPV6 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define if network support is enabled. */ +/* #define NETWORK 1 */ + +/* Define to disable 16 bit integer output. */ +/* #undef NO_16BIT */ + +/* Define to disable 32 bit integer output. */ +/* define NO_32BIT 1 */ + +/* Define to disable 8 bit integer output. */ +/* #undef NO_8BIT */ + +/* Define to disable downsampled decoding. */ +/* #undef NO_DOWNSAMPLE */ + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +/* #undef NO_ERETURN */ + +/* Define to disable error messages. */ +/* #undef NO_ERRORMSG */ + +/* Define to disable feeder and buffered readers. */ +/* #undef NO_FEEDER */ + +/* Define to disable ICY handling. */ +/* #undef NO_ICY */ + +/* Define to disable ID3v2 parsing. */ +/* #undef NO_ID3V2 */ + +/* Define to disable layer I. */ +/* #undef NO_LAYER1 */ + +/* Define to disable layer II. */ +/* #undef NO_LAYER2 */ + +/* Define to disable layer III. */ +/* #undef NO_LAYER3 */ + +/* Define to disable ntom resampling. */ +/* #undef NO_NTOM */ + +/* Define to disable real output. */ +/* define NO_REAL 1 */ + +/* Define to disable string functions. */ +/* #undef NO_STRING */ + +/* Define to disable warning messages. */ +/* #undef NO_WARNING */ + +/* Name of package */ +#define PACKAGE "mpg123" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "mpg123" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "mpg123 1.8rc5" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mpg123" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.8rc5" + +/* Define if portaudio v18 API is wanted. */ +/* #undef PORTAUDIO18 */ + +/* The size of `int32_t', as computed by sizeof. */ +#define SIZEOF_INT32_T 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 4 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if modules are enabled */ +#define USE_MODULES 1 + +/* Version number of package */ +#define VERSION "1.8rc5" + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if does not define. */ +/* #undef int16_t */ + +/* Define to `int' if does not define. */ +/* #undef int32_t */ + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +/* Define to `unsigned long' if does not define. */ +/* #undef size_t */ + +/* Define to `long' if does not define. */ +/* #undef ssize_t */ + +/* Define to `unsigned short' if does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef uint32_t */ diff --git a/node_modules/lame/deps/mpg123/ports/Sony_PSP/readers.c.patch b/node_modules/lame/deps/mpg123/ports/Sony_PSP/readers.c.patch new file mode 100644 index 0000000..73bbb26 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/Sony_PSP/readers.c.patch @@ -0,0 +1,2 @@ +14a15 +> #include diff --git a/node_modules/lame/deps/mpg123/ports/Xcode/config.h b/node_modules/lame/deps/mpg123/ports/Xcode/config.h new file mode 100644 index 0000000..651b521 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/Xcode/config.h @@ -0,0 +1,197 @@ +#include "TargetConditionals.h" + +#if TARGET_IPHONE_SIMULATOR + #define DEFAULT_OUTPUT_MODULE "dummy" + /* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + /* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + /* #undef HAVE_CORESERVICES_CORESERVICES_H */ + /* #undef HAVE_OPENAL_ALC_H */ + /* #undef HAVE_OPENAL_AL_H */ + #define ABI_ALIGN_FUN 1 + #define HAVE_GAI_ADDRCONFIG 1 + #define LFS_ALIAS_BITS 32 + /* #undef HAVE_LIBMX */ + #define HAVE_MMAP 1 + #define IEEE_FLOAT 1 + #define SIZEOF_INT32_T 4 + #define SIZEOF_LONG 4 + #define SIZEOF_OFF_T 8 + #define SIZEOF_SIZE_T 4 + #define SIZEOF_SSIZE_T 4 + #define OPT_GENERIC +#elif TARGET_OS_IPHONE + #define DEFAULT_OUTPUT_MODULE "dummy" + /* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */ + /* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */ + /* #undef HAVE_CORESERVICES_CORESERVICES_H */ + /* #undef HAVE_OPENAL_ALC_H */ + /* #undef HAVE_OPENAL_AL_H */ + /* #undef ABI_ALIGN_FUN */ + /* #undef HAVE_GAI_ADDRCONFIG */ + #define LFS_ALIAS_BITS 32 + /* #undef HAVE_LIBMX */ + /* #undef HAVE_MMAP */ + /* #undef IEEE_FLOAT */ + #define SIZEOF_INT32_T 4 + #define SIZEOF_LONG 4 + #define SIZEOF_OFF_T 8 + #define SIZEOF_SIZE_T 4 + #define SIZEOF_SSIZE_T 4 + #define OPT_NEON +#elif TARGET_OS_MAC + #define DEFAULT_OUTPUT_MODULE "coreaudio" + #define HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H 1 + #define HAVE_AUDIOUNIT_AUDIOUNIT_H 1 + #define HAVE_CORESERVICES_CORESERVICES_H 1 + #define HAVE_OPENAL_ALC_H 1 + #define HAVE_OPENAL_AL_H 1 + /* #undef ABI_ALIGN_FUN */ + #define HAVE_GAI_ADDRCONFIG 1 + #define LFS_ALIAS_BITS 64 + #define HAVE_LIBMX 1 + #define HAVE_MMAP 1 + #define IEEE_FLOAT 1 + #define SIZEOF_INT32_T 4 + #define SIZEOF_LONG 8 + #define SIZEOF_OFF_T 8 + #define SIZEOF_SIZE_T 8 + #define SIZEOF_SIZE_T 8 + #define SIZEOF_SSIZE_T 8 + #define OPT_GENERIC +#else + #error "Unknown target." +#endif + +/* #undef ACCURATE_ROUNDING */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ +#define ASMALIGN_EXP 1 +#define CCALIGN 1 +/* #undef DEBUG */ +/* #undef DYNAMIC_BUILD */ +#define FIFO 1 +#define FRAME_INDEX 1 +#define GAPLESS 1 +/* #undef HAVE_ALC_H */ +/* #undef HAVE_ALIB_H */ +/* #undef HAVE_AL_ALC_H */ +/* #undef HAVE_AL_AL_H */ +/* #undef HAVE_AL_H */ +#define HAVE_ARPA_INET_H 1 +/* #undef HAVE_ASM_AUDIOIO_H */ +#define HAVE_ATOLL 1 +/* #undef HAVE_AUDIOS_H */ +/* #undef HAVE_CULIB_H */ +#define HAVE_DLFCN_H 1 +#define HAVE_GETADDRINFO 1 +#define HAVE_GETPAGESIZE 1 +#define HAVE_GETUID 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LANGINFO_H 1 +#define HAVE_LIBM 1 +#define HAVE_LIMITS_H 1 +/* #undef HAVE_LINUX_SOUNDCARD_H */ +#define HAVE_LOCALE_H 1 +/* #undef HAVE_LTDL */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ +#define HAVE_MEMORY_H 1 +#define HAVE_MKFIFO 1 +#define HAVE_NETDB_H 1 +#define HAVE_NETINET_IN_H 1 +/* #undef HAVE_NETINET_TCP_H */ +#define HAVE_NL_LANGINFO 1 +/* #undef HAVE_OS2ME_H */ +/* #undef HAVE_OS2_H */ +#define HAVE_RANDOM 1 +#define HAVE_SCHED_H 1 +/* #undef HAVE_SCHED_SETSCHEDULER */ +#define HAVE_SETLOCALE 1 +#define HAVE_SETPRIORITY 1 +#define HAVE_SETUID 1 +#define HAVE_SIGNAL_H 1 +/* #undef HAVE_SNDIO_H */ +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRDUP 1 +#define HAVE_STRERROR 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +/* #undef HAVE_SUN_AUDIOIO_H */ +/* #undef HAVE_SYS_AUDIOIO_H */ +/* #undef HAVE_SYS_AUDIO_H */ +#define HAVE_SYS_IOCTL_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_RESOURCE_H 1 +#define HAVE_SYS_SIGNAL_H 1 +#define HAVE_SYS_SOCKET_H 1 +/* #undef HAVE_SYS_SOUNDCARD_H */ +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_WAIT_H 1 +#define HAVE_TERMIOS 1 +#define HAVE_UNISTD_H 1 +/* #undef HAVE_WINDOWS_H */ +/* #undef HAVE_WS2TCPIP_H */ +#define INDEX_SIZE 1000 +#define IPV6 1 +#define LT_OBJDIR ".libs/" +#define MODULE_FILE_SUFFIX ".la" +#define NETWORK 1 +/* #undef NO_16BIT */ +/* #undef NO_32BIT */ +/* #undef NO_8BIT */ +/* #undef NO_DOWNSAMPLE */ +/* #undef NO_ERETURN */ +/* #undef NO_ERRORMSG */ +/* #undef NO_FEEDER */ +/* #undef NO_ICY */ +/* #undef NO_ID3V2 */ +/* #undef NO_LAYER1 */ +/* #undef NO_LAYER2 */ +/* #undef NO_LAYER3 */ +/* #undef NO_NTOM */ +/* #undef NO_REAL */ +/* #undef NO_STRING */ +/* #undef NO_WARNING */ +#define PACKAGE "mpg123" +#define PACKAGE_BUGREPORT "mpg123-devel@lists.sourceforge.net" +#define PACKAGE_NAME "mpg123" +#define PACKAGE_STRING "mpg123 1.14.0" +#define PACKAGE_TARNAME "mpg123" +#define PACKAGE_URL "" +#define PACKAGE_VERSION "1.14.0" +/* #undef PORTAUDIO18 */ +#define STDC_HEADERS 1 +/* #undef USE_MODULES */ +#define VERSION "1.14.0" +/* #undef WANT_WIN32_FIFO */ +/* #undef WANT_WIN32_SOCKETS */ +/* #undef WANT_WIN32_UNICODE */ +/* #undef WINVER */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif +/* #undef _FILE_OFFSET_BITS */ +/* #undef _LARGE_FILES */ +/* #undef _WIN32_WINNT */ +/* #undef const */ +#ifndef __cplusplus +/* #undef inline */ +#endif +/* #undef int16_t */ +/* #undef int32_t */ +/* #undef off_t */ +/* #undef size_t */ +/* #undef ssize_t */ +/* #undef uint16_t */ +/* #undef uint32_t */ +/* #undef uintptr_t */ + +#define REAL_IS_FLOAT diff --git a/node_modules/lame/deps/mpg123/ports/Xcode/mpg123.h b/node_modules/lame/deps/mpg123/ports/Xcode/mpg123.h new file mode 100644 index 0000000..9771180 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/Xcode/mpg123.h @@ -0,0 +1,17 @@ +/* + mpg123.h: MPEG Audio Decoder library wrapper header for Xcode + + copyright 2012 by the mpg123 project - free software under the terms of the LGPL 2.1 + initially written by Patrick Dehne. +*/ + +#ifndef MPG123_XCODE_H +#define MPG123_XCODE_H + +#include +#include + +#define MPG123_NO_CONFIGURE +#include "../../src/libmpg123/mpg123.h.in" /* Yes, .h.in; we include the configure template! */ + +#endif diff --git a/node_modules/lame/deps/mpg123/ports/Xcode/mpg123.xcodeproj/project.pbxproj b/node_modules/lame/deps/mpg123/ports/Xcode/mpg123.xcodeproj/project.pbxproj new file mode 100644 index 0000000..30cb5c2 --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/Xcode/mpg123.xcodeproj/project.pbxproj @@ -0,0 +1,670 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + CD132C23152A4B8000B4F5A8 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C21152A4B8000B4F5A8 /* config.h */; }; + CD132C24152A4B8000B4F5A8 /* mpg123.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C22152A4B8000B4F5A8 /* mpg123.h */; }; + CD132C7E152A4D7E00B4F5A8 /* compat.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C62152A4D7E00B4F5A8 /* compat.h */; }; + CD132C7F152A4D7E00B4F5A8 /* decode.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C63152A4D7E00B4F5A8 /* decode.h */; }; + CD132C80152A4D7E00B4F5A8 /* dither.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C64152A4D7E00B4F5A8 /* dither.h */; }; + CD132C81152A4D7E00B4F5A8 /* frame.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C65152A4D7E00B4F5A8 /* frame.h */; }; + CD132C82152A4D7E00B4F5A8 /* getbits.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C66152A4D7E00B4F5A8 /* getbits.h */; }; + CD132C83152A4D7E00B4F5A8 /* getcpuflags.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C67152A4D7E00B4F5A8 /* getcpuflags.h */; }; + CD132C84152A4D7E00B4F5A8 /* huffman.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C68152A4D7E00B4F5A8 /* huffman.h */; }; + CD132C85152A4D7E00B4F5A8 /* icy.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C69152A4D7E00B4F5A8 /* icy.h */; }; + CD132C86152A4D7E00B4F5A8 /* icy2utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6A152A4D7E00B4F5A8 /* icy2utf8.h */; }; + CD132C87152A4D7E00B4F5A8 /* id3.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6B152A4D7E00B4F5A8 /* id3.h */; }; + CD132C88152A4D7E00B4F5A8 /* index.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6C152A4D7E00B4F5A8 /* index.h */; }; + CD132C89152A4D7E00B4F5A8 /* intsym.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6D152A4D7E00B4F5A8 /* intsym.h */; }; + CD132C8A152A4D7E00B4F5A8 /* l2tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6E152A4D7E00B4F5A8 /* l2tables.h */; }; + CD132C8B152A4D7E00B4F5A8 /* l3_integer_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6F152A4D7E00B4F5A8 /* l3_integer_tables.h */; }; + CD132C8C152A4D7E00B4F5A8 /* l12_integer_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C70152A4D7E00B4F5A8 /* l12_integer_tables.h */; }; + CD132C8D152A4D7E00B4F5A8 /* mangle.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C71152A4D7E00B4F5A8 /* mangle.h */; }; + CD132C8E152A4D7E00B4F5A8 /* mpg123lib_intern.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C73152A4D7E00B4F5A8 /* mpg123lib_intern.h */; }; + CD132C8F152A4D7E00B4F5A8 /* optimize.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C74152A4D7E00B4F5A8 /* optimize.h */; }; + CD132C90152A4D7E00B4F5A8 /* parse.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C75152A4D7E00B4F5A8 /* parse.h */; }; + CD132C91152A4D7E00B4F5A8 /* reader.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C76152A4D7E00B4F5A8 /* reader.h */; }; + CD132C92152A4D7E00B4F5A8 /* sample.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C77152A4D7E00B4F5A8 /* sample.h */; }; + CD132C93152A4D7E00B4F5A8 /* synth_8bit.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C78152A4D7E00B4F5A8 /* synth_8bit.h */; }; + CD132C94152A4D7E00B4F5A8 /* synth_mono.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C79152A4D7E00B4F5A8 /* synth_mono.h */; }; + CD132C95152A4D7E00B4F5A8 /* synth_ntom.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7A152A4D7E00B4F5A8 /* synth_ntom.h */; }; + CD132C96152A4D7E00B4F5A8 /* synth.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7B152A4D7E00B4F5A8 /* synth.h */; }; + CD132C97152A4D7E00B4F5A8 /* synths.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7C152A4D7E00B4F5A8 /* synths.h */; }; + CD132C98152A4D7E00B4F5A8 /* true.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7D152A4D7E00B4F5A8 /* true.h */; }; + CD132CB3152A4E7000B4F5A8 /* compat.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C99152A4E7000B4F5A8 /* compat.c */; }; + CD132CB4152A4E7000B4F5A8 /* dct64.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9A152A4E7000B4F5A8 /* dct64.c */; }; + CD132CB5152A4E7000B4F5A8 /* dither.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9B152A4E7000B4F5A8 /* dither.c */; }; + CD132CB6152A4E7000B4F5A8 /* equalizer.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9C152A4E7000B4F5A8 /* equalizer.c */; }; + CD132CB7152A4E7000B4F5A8 /* feature.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9D152A4E7000B4F5A8 /* feature.c */; }; + CD132CB8152A4E7000B4F5A8 /* format.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9E152A4E7000B4F5A8 /* format.c */; }; + CD132CB9152A4E7000B4F5A8 /* frame.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9F152A4E7000B4F5A8 /* frame.c */; }; + CD132CBA152A4E7000B4F5A8 /* icy.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA0152A4E7000B4F5A8 /* icy.c */; }; + CD132CBB152A4E7000B4F5A8 /* icy2utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA1152A4E7000B4F5A8 /* icy2utf8.c */; }; + CD132CBC152A4E7000B4F5A8 /* id3.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA2152A4E7000B4F5A8 /* id3.c */; }; + CD132CBD152A4E7000B4F5A8 /* index.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA3152A4E7000B4F5A8 /* index.c */; }; + CD132CBE152A4E7000B4F5A8 /* layer1.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA4152A4E7000B4F5A8 /* layer1.c */; }; + CD132CBF152A4E7000B4F5A8 /* layer2.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA5152A4E7000B4F5A8 /* layer2.c */; }; + CD132CC0152A4E7000B4F5A8 /* layer3.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA6152A4E7000B4F5A8 /* layer3.c */; }; + CD132CC1152A4E7000B4F5A8 /* lfs_alias.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA7152A4E7000B4F5A8 /* lfs_alias.c */; }; + CD132CC2152A4E7000B4F5A8 /* libmpg123.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA8152A4E7000B4F5A8 /* libmpg123.c */; }; + CD132CC3152A4E7000B4F5A8 /* ntom.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA9152A4E7000B4F5A8 /* ntom.c */; }; + CD132CC4152A4E7000B4F5A8 /* optimize.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAA152A4E7000B4F5A8 /* optimize.c */; }; + CD132CC5152A4E7000B4F5A8 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAB152A4E7000B4F5A8 /* parse.c */; }; + CD132CC6152A4E7000B4F5A8 /* readers.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAC152A4E7000B4F5A8 /* readers.c */; }; + CD132CC7152A4E7000B4F5A8 /* stringbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAD152A4E7000B4F5A8 /* stringbuf.c */; }; + CD132CC8152A4E7000B4F5A8 /* synth_8bit.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAE152A4E7000B4F5A8 /* synth_8bit.c */; }; + CD132CC9152A4E7000B4F5A8 /* synth_real.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAF152A4E7000B4F5A8 /* synth_real.c */; }; + CD132CCA152A4E7000B4F5A8 /* synth_s32.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB0152A4E7000B4F5A8 /* synth_s32.c */; }; + CD132CCB152A4E7000B4F5A8 /* synth.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB1152A4E7000B4F5A8 /* synth.c */; }; + CD132CCC152A4E7000B4F5A8 /* tabinit.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB2152A4E7000B4F5A8 /* tabinit.c */; }; + CD132CD6152A511C00B4F5A8 /* dct64_neon_float.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CCD152A511800B4F5A8 /* dct64_neon_float.S */; }; + CD132CD7152A511C00B4F5A8 /* dct64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CCE152A511900B4F5A8 /* dct64_neon.S */; }; + CD132CD9152A511C00B4F5A8 /* synth_neon_float.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD0152A511A00B4F5A8 /* synth_neon_float.S */; }; + CD132CDA152A511C00B4F5A8 /* synth_neon_s32.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD1152A511A00B4F5A8 /* synth_neon_s32.S */; }; + CD132CDB152A511C00B4F5A8 /* synth_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD2152A511A00B4F5A8 /* synth_neon.S */; }; + CD132CDC152A511C00B4F5A8 /* synth_stereo_neon_float.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD3152A511B00B4F5A8 /* synth_stereo_neon_float.S */; }; + CD132CDD152A511C00B4F5A8 /* synth_stereo_neon_s32.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD4152A511B00B4F5A8 /* synth_stereo_neon_s32.S */; }; + CD132CDE152A511C00B4F5A8 /* synth_stereo_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = CD132CD5152A511C00B4F5A8 /* synth_stereo_neon.S */; }; + CDB0288C152B760700B01410 /* compat.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C99152A4E7000B4F5A8 /* compat.c */; }; + CDB0288D152B760700B01410 /* compat.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C62152A4D7E00B4F5A8 /* compat.h */; }; + CDB0288E152B760700B01410 /* dct64.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9A152A4E7000B4F5A8 /* dct64.c */; }; + CDB02890152B760D00B01410 /* decode.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C63152A4D7E00B4F5A8 /* decode.h */; }; + CDB02891152B760D00B01410 /* dither.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C64152A4D7E00B4F5A8 /* dither.h */; }; + CDB02892152B760D00B01410 /* dither.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9B152A4E7000B4F5A8 /* dither.c */; }; + CDB02893152B760D00B01410 /* equalizer.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9C152A4E7000B4F5A8 /* equalizer.c */; }; + CDB02894152B760D00B01410 /* feature.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9D152A4E7000B4F5A8 /* feature.c */; }; + CDB02895152B760D00B01410 /* format.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9E152A4E7000B4F5A8 /* format.c */; }; + CDB02896152B761300B01410 /* frame.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C65152A4D7E00B4F5A8 /* frame.h */; }; + CDB02897152B761300B01410 /* frame.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132C9F152A4E7000B4F5A8 /* frame.c */; }; + CDB02898152B761300B01410 /* getbits.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C66152A4D7E00B4F5A8 /* getbits.h */; }; + CDB02899152B761300B01410 /* getcpuflags.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C67152A4D7E00B4F5A8 /* getcpuflags.h */; }; + CDB0289A152B761300B01410 /* huffman.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C68152A4D7E00B4F5A8 /* huffman.h */; }; + CDB0289B152B761300B01410 /* icy.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C69152A4D7E00B4F5A8 /* icy.h */; }; + CDB0289C152B761300B01410 /* icy.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA0152A4E7000B4F5A8 /* icy.c */; }; + CDB0289D152B761300B01410 /* icy2utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6A152A4D7E00B4F5A8 /* icy2utf8.h */; }; + CDB0289E152B761300B01410 /* icy2utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA1152A4E7000B4F5A8 /* icy2utf8.c */; }; + CDB0289F152B761C00B01410 /* id3.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6B152A4D7E00B4F5A8 /* id3.h */; }; + CDB028A0152B761C00B01410 /* id3.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA2152A4E7000B4F5A8 /* id3.c */; }; + CDB028A1152B761C00B01410 /* index.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6C152A4D7E00B4F5A8 /* index.h */; }; + CDB028A2152B761C00B01410 /* index.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA3152A4E7000B4F5A8 /* index.c */; }; + CDB028A3152B761C00B01410 /* intsym.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6D152A4D7E00B4F5A8 /* intsym.h */; }; + CDB028A4152B761C00B01410 /* l2tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6E152A4D7E00B4F5A8 /* l2tables.h */; }; + CDB028A5152B761C00B01410 /* l3_integer_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C6F152A4D7E00B4F5A8 /* l3_integer_tables.h */; }; + CDB028A6152B761C00B01410 /* l12_integer_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C70152A4D7E00B4F5A8 /* l12_integer_tables.h */; }; + CDB028A7152B761C00B01410 /* layer1.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA4152A4E7000B4F5A8 /* layer1.c */; }; + CDB028A8152B762E00B01410 /* layer2.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA5152A4E7000B4F5A8 /* layer2.c */; }; + CDB028A9152B763500B01410 /* layer3.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA6152A4E7000B4F5A8 /* layer3.c */; }; + CDB028AA152B763500B01410 /* lfs_alias.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA7152A4E7000B4F5A8 /* lfs_alias.c */; }; + CDB028AB152B763500B01410 /* libmpg123.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA8152A4E7000B4F5A8 /* libmpg123.c */; }; + CDB028AC152B763500B01410 /* mangle.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C71152A4D7E00B4F5A8 /* mangle.h */; }; + CDB028AD152B764100B01410 /* mpg123lib_intern.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C73152A4D7E00B4F5A8 /* mpg123lib_intern.h */; }; + CDB028AE152B764100B01410 /* ntom.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CA9152A4E7000B4F5A8 /* ntom.c */; }; + CDB028AF152B764100B01410 /* optimize.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C74152A4D7E00B4F5A8 /* optimize.h */; }; + CDB028B0152B764100B01410 /* optimize.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAA152A4E7000B4F5A8 /* optimize.c */; }; + CDB028B1152B764100B01410 /* parse.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C75152A4D7E00B4F5A8 /* parse.h */; }; + CDB028B2152B764100B01410 /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAB152A4E7000B4F5A8 /* parse.c */; }; + CDB028B3152B764100B01410 /* reader.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C76152A4D7E00B4F5A8 /* reader.h */; }; + CDB028B4152B764100B01410 /* readers.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAC152A4E7000B4F5A8 /* readers.c */; }; + CDB028B5152B764900B01410 /* sample.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C77152A4D7E00B4F5A8 /* sample.h */; }; + CDB028B6152B764900B01410 /* stringbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAD152A4E7000B4F5A8 /* stringbuf.c */; }; + CDB028B7152B764900B01410 /* synth.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB1152A4E7000B4F5A8 /* synth.c */; }; + CDB028B8152B764900B01410 /* synth_8bit.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C78152A4D7E00B4F5A8 /* synth_8bit.h */; }; + CDB028B9152B764900B01410 /* synth_8bit.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAE152A4E7000B4F5A8 /* synth_8bit.c */; }; + CDB028BA152B764900B01410 /* synth_mono.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C79152A4D7E00B4F5A8 /* synth_mono.h */; }; + CDB028BB152B764900B01410 /* synth_ntom.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7A152A4D7E00B4F5A8 /* synth_ntom.h */; }; + CDB028BC152B764900B01410 /* synth_real.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CAF152A4E7000B4F5A8 /* synth_real.c */; }; + CDB028BD152B764900B01410 /* synth_s32.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB0152A4E7000B4F5A8 /* synth_s32.c */; }; + CDB028BE152B765000B01410 /* synth.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7B152A4D7E00B4F5A8 /* synth.h */; }; + CDB028BF152B765000B01410 /* synths.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7C152A4D7E00B4F5A8 /* synths.h */; }; + CDB028C0152B765000B01410 /* tabinit.c in Sources */ = {isa = PBXBuildFile; fileRef = CD132CB2152A4E7000B4F5A8 /* tabinit.c */; }; + CDB028C1152B765000B01410 /* true.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C7D152A4D7E00B4F5A8 /* true.h */; }; + CDB028C2152B765900B01410 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C21152A4B8000B4F5A8 /* config.h */; }; + CDB028C3152B765900B01410 /* mpg123.h in Headers */ = {isa = PBXBuildFile; fileRef = CD132C22152A4B8000B4F5A8 /* mpg123.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + CD132C0E152A48C200B4F5A8 /* libmpg123-ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libmpg123-ios.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + CD132C21152A4B8000B4F5A8 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = SOURCE_ROOT; }; + CD132C22152A4B8000B4F5A8 /* mpg123.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpg123.h; sourceTree = SOURCE_ROOT; }; + CD132C62152A4D7E00B4F5A8 /* compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compat.h; sourceTree = ""; }; + CD132C63152A4D7E00B4F5A8 /* decode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decode.h; sourceTree = ""; }; + CD132C64152A4D7E00B4F5A8 /* dither.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dither.h; sourceTree = ""; }; + CD132C65152A4D7E00B4F5A8 /* frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frame.h; sourceTree = ""; }; + CD132C66152A4D7E00B4F5A8 /* getbits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getbits.h; sourceTree = ""; }; + CD132C67152A4D7E00B4F5A8 /* getcpuflags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getcpuflags.h; sourceTree = ""; }; + CD132C68152A4D7E00B4F5A8 /* huffman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = huffman.h; sourceTree = ""; }; + CD132C69152A4D7E00B4F5A8 /* icy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icy.h; sourceTree = ""; }; + CD132C6A152A4D7E00B4F5A8 /* icy2utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icy2utf8.h; sourceTree = ""; }; + CD132C6B152A4D7E00B4F5A8 /* id3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = id3.h; sourceTree = ""; }; + CD132C6C152A4D7E00B4F5A8 /* index.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = index.h; sourceTree = ""; }; + CD132C6D152A4D7E00B4F5A8 /* intsym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = intsym.h; sourceTree = ""; }; + CD132C6E152A4D7E00B4F5A8 /* l2tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l2tables.h; sourceTree = ""; }; + CD132C6F152A4D7E00B4F5A8 /* l3_integer_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l3_integer_tables.h; sourceTree = ""; }; + CD132C70152A4D7E00B4F5A8 /* l12_integer_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = l12_integer_tables.h; sourceTree = ""; }; + CD132C71152A4D7E00B4F5A8 /* mangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mangle.h; sourceTree = ""; }; + CD132C72152A4D7E00B4F5A8 /* mpg123.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mpg123.h.in; sourceTree = ""; }; + CD132C73152A4D7E00B4F5A8 /* mpg123lib_intern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpg123lib_intern.h; sourceTree = ""; }; + CD132C74152A4D7E00B4F5A8 /* optimize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = optimize.h; sourceTree = ""; }; + CD132C75152A4D7E00B4F5A8 /* parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse.h; sourceTree = ""; }; + CD132C76152A4D7E00B4F5A8 /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = ""; }; + CD132C77152A4D7E00B4F5A8 /* sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sample.h; sourceTree = ""; }; + CD132C78152A4D7E00B4F5A8 /* synth_8bit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_8bit.h; sourceTree = ""; }; + CD132C79152A4D7E00B4F5A8 /* synth_mono.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_mono.h; sourceTree = ""; }; + CD132C7A152A4D7E00B4F5A8 /* synth_ntom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth_ntom.h; sourceTree = ""; }; + CD132C7B152A4D7E00B4F5A8 /* synth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synth.h; sourceTree = ""; }; + CD132C7C152A4D7E00B4F5A8 /* synths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = synths.h; sourceTree = ""; }; + CD132C7D152A4D7E00B4F5A8 /* true.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = true.h; sourceTree = ""; }; + CD132C99152A4E7000B4F5A8 /* compat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = compat.c; sourceTree = ""; }; + CD132C9A152A4E7000B4F5A8 /* dct64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dct64.c; sourceTree = ""; }; + CD132C9B152A4E7000B4F5A8 /* dither.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dither.c; sourceTree = ""; }; + CD132C9C152A4E7000B4F5A8 /* equalizer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = equalizer.c; sourceTree = ""; }; + CD132C9D152A4E7000B4F5A8 /* feature.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = feature.c; sourceTree = ""; }; + CD132C9E152A4E7000B4F5A8 /* format.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = format.c; sourceTree = ""; }; + CD132C9F152A4E7000B4F5A8 /* frame.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = frame.c; sourceTree = ""; }; + CD132CA0152A4E7000B4F5A8 /* icy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = icy.c; sourceTree = ""; }; + CD132CA1152A4E7000B4F5A8 /* icy2utf8.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = icy2utf8.c; sourceTree = ""; }; + CD132CA2152A4E7000B4F5A8 /* id3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = id3.c; sourceTree = ""; }; + CD132CA3152A4E7000B4F5A8 /* index.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = index.c; sourceTree = ""; }; + CD132CA4152A4E7000B4F5A8 /* layer1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layer1.c; sourceTree = ""; }; + CD132CA5152A4E7000B4F5A8 /* layer2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layer2.c; sourceTree = ""; }; + CD132CA6152A4E7000B4F5A8 /* layer3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layer3.c; sourceTree = ""; }; + CD132CA7152A4E7000B4F5A8 /* lfs_alias.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lfs_alias.c; sourceTree = ""; }; + CD132CA8152A4E7000B4F5A8 /* libmpg123.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = libmpg123.c; sourceTree = ""; }; + CD132CA9152A4E7000B4F5A8 /* ntom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ntom.c; sourceTree = ""; }; + CD132CAA152A4E7000B4F5A8 /* optimize.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = optimize.c; sourceTree = ""; }; + CD132CAB152A4E7000B4F5A8 /* parse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parse.c; sourceTree = ""; }; + CD132CAC152A4E7000B4F5A8 /* readers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = readers.c; sourceTree = ""; }; + CD132CAD152A4E7000B4F5A8 /* stringbuf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stringbuf.c; sourceTree = ""; }; + CD132CAE152A4E7000B4F5A8 /* synth_8bit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth_8bit.c; sourceTree = ""; }; + CD132CAF152A4E7000B4F5A8 /* synth_real.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth_real.c; sourceTree = ""; }; + CD132CB0152A4E7000B4F5A8 /* synth_s32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth_s32.c; sourceTree = ""; }; + CD132CB1152A4E7000B4F5A8 /* synth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = synth.c; sourceTree = ""; }; + CD132CB2152A4E7000B4F5A8 /* tabinit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tabinit.c; sourceTree = ""; }; + CD132CCD152A511800B4F5A8 /* dct64_neon_float.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = dct64_neon_float.S; sourceTree = ""; }; + CD132CCE152A511900B4F5A8 /* dct64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = dct64_neon.S; sourceTree = ""; }; + CD132CD0152A511A00B4F5A8 /* synth_neon_float.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_neon_float.S; sourceTree = ""; }; + CD132CD1152A511A00B4F5A8 /* synth_neon_s32.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_neon_s32.S; sourceTree = ""; }; + CD132CD2152A511A00B4F5A8 /* synth_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_neon.S; sourceTree = ""; }; + CD132CD3152A511B00B4F5A8 /* synth_stereo_neon_float.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_stereo_neon_float.S; sourceTree = ""; }; + CD132CD4152A511B00B4F5A8 /* synth_stereo_neon_s32.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_stereo_neon_s32.S; sourceTree = ""; }; + CD132CD5152A511C00B4F5A8 /* synth_stereo_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = synth_stereo_neon.S; sourceTree = ""; }; + CD6D72D1152B748200CF4285 /* libmpg123-mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libmpg123-mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CD132C0B152A48C200B4F5A8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD6D72CE152B748200CF4285 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + CD132C03152A48C100B4F5A8 = { + isa = PBXGroup; + children = ( + CD132C60152A4C9A00B4F5A8 /* src */, + CD132C13152A48C200B4F5A8 /* Xcode */, + CD132C0F152A48C200B4F5A8 /* Products */, + ); + sourceTree = ""; + }; + CD132C0F152A48C200B4F5A8 /* Products */ = { + isa = PBXGroup; + children = ( + CD132C0E152A48C200B4F5A8 /* libmpg123-ios.a */, + CD6D72D1152B748200CF4285 /* libmpg123-mac.a */, + ); + name = Products; + sourceTree = ""; + }; + CD132C13152A48C200B4F5A8 /* Xcode */ = { + isa = PBXGroup; + children = ( + CD132C21152A4B8000B4F5A8 /* config.h */, + CD132C22152A4B8000B4F5A8 /* mpg123.h */, + ); + name = Xcode; + sourceTree = ""; + }; + CD132C60152A4C9A00B4F5A8 /* src */ = { + isa = PBXGroup; + children = ( + CD132C61152A4CA400B4F5A8 /* libmpg123 */, + ); + name = src; + path = ../../src; + sourceTree = SOURCE_ROOT; + }; + CD132C61152A4CA400B4F5A8 /* libmpg123 */ = { + isa = PBXGroup; + children = ( + CD132C99152A4E7000B4F5A8 /* compat.c */, + CD132C62152A4D7E00B4F5A8 /* compat.h */, + CD132C9A152A4E7000B4F5A8 /* dct64.c */, + CD132CCD152A511800B4F5A8 /* dct64_neon_float.S */, + CD132CCE152A511900B4F5A8 /* dct64_neon.S */, + CD132C63152A4D7E00B4F5A8 /* decode.h */, + CD132C64152A4D7E00B4F5A8 /* dither.h */, + CD132C9B152A4E7000B4F5A8 /* dither.c */, + CD132C9C152A4E7000B4F5A8 /* equalizer.c */, + CD132C9D152A4E7000B4F5A8 /* feature.c */, + CD132C9E152A4E7000B4F5A8 /* format.c */, + CD132C65152A4D7E00B4F5A8 /* frame.h */, + CD132C9F152A4E7000B4F5A8 /* frame.c */, + CD132C66152A4D7E00B4F5A8 /* getbits.h */, + CD132C67152A4D7E00B4F5A8 /* getcpuflags.h */, + CD132C68152A4D7E00B4F5A8 /* huffman.h */, + CD132C69152A4D7E00B4F5A8 /* icy.h */, + CD132CA0152A4E7000B4F5A8 /* icy.c */, + CD132C6A152A4D7E00B4F5A8 /* icy2utf8.h */, + CD132CA1152A4E7000B4F5A8 /* icy2utf8.c */, + CD132C6B152A4D7E00B4F5A8 /* id3.h */, + CD132CA2152A4E7000B4F5A8 /* id3.c */, + CD132C6C152A4D7E00B4F5A8 /* index.h */, + CD132CA3152A4E7000B4F5A8 /* index.c */, + CD132C6D152A4D7E00B4F5A8 /* intsym.h */, + CD132C6E152A4D7E00B4F5A8 /* l2tables.h */, + CD132C6F152A4D7E00B4F5A8 /* l3_integer_tables.h */, + CD132C70152A4D7E00B4F5A8 /* l12_integer_tables.h */, + CD132CA4152A4E7000B4F5A8 /* layer1.c */, + CD132CA5152A4E7000B4F5A8 /* layer2.c */, + CD132CA6152A4E7000B4F5A8 /* layer3.c */, + CD132CA7152A4E7000B4F5A8 /* lfs_alias.c */, + CD132CA8152A4E7000B4F5A8 /* libmpg123.c */, + CD132C71152A4D7E00B4F5A8 /* mangle.h */, + CD132C72152A4D7E00B4F5A8 /* mpg123.h.in */, + CD132C73152A4D7E00B4F5A8 /* mpg123lib_intern.h */, + CD132CA9152A4E7000B4F5A8 /* ntom.c */, + CD132C74152A4D7E00B4F5A8 /* optimize.h */, + CD132CAA152A4E7000B4F5A8 /* optimize.c */, + CD132C75152A4D7E00B4F5A8 /* parse.h */, + CD132CAB152A4E7000B4F5A8 /* parse.c */, + CD132C76152A4D7E00B4F5A8 /* reader.h */, + CD132CAC152A4E7000B4F5A8 /* readers.c */, + CD132C77152A4D7E00B4F5A8 /* sample.h */, + CD132CAD152A4E7000B4F5A8 /* stringbuf.c */, + CD132CB1152A4E7000B4F5A8 /* synth.c */, + CD132C78152A4D7E00B4F5A8 /* synth_8bit.h */, + CD132CAE152A4E7000B4F5A8 /* synth_8bit.c */, + CD132C79152A4D7E00B4F5A8 /* synth_mono.h */, + CD132C7A152A4D7E00B4F5A8 /* synth_ntom.h */, + CD132CAF152A4E7000B4F5A8 /* synth_real.c */, + CD132CB0152A4E7000B4F5A8 /* synth_s32.c */, + CD132CD0152A511A00B4F5A8 /* synth_neon_float.S */, + CD132CD1152A511A00B4F5A8 /* synth_neon_s32.S */, + CD132CD2152A511A00B4F5A8 /* synth_neon.S */, + CD132CD3152A511B00B4F5A8 /* synth_stereo_neon_float.S */, + CD132CD4152A511B00B4F5A8 /* synth_stereo_neon_s32.S */, + CD132CD5152A511C00B4F5A8 /* synth_stereo_neon.S */, + CD132C7B152A4D7E00B4F5A8 /* synth.h */, + CD132C7C152A4D7E00B4F5A8 /* synths.h */, + CD132CB2152A4E7000B4F5A8 /* tabinit.c */, + CD132C7D152A4D7E00B4F5A8 /* true.h */, + ); + path = libmpg123; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + CD132C0C152A48C200B4F5A8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CD132C23152A4B8000B4F5A8 /* config.h in Headers */, + CD132C24152A4B8000B4F5A8 /* mpg123.h in Headers */, + CD132C7E152A4D7E00B4F5A8 /* compat.h in Headers */, + CD132C7F152A4D7E00B4F5A8 /* decode.h in Headers */, + CD132C80152A4D7E00B4F5A8 /* dither.h in Headers */, + CD132C81152A4D7E00B4F5A8 /* frame.h in Headers */, + CD132C82152A4D7E00B4F5A8 /* getbits.h in Headers */, + CD132C83152A4D7E00B4F5A8 /* getcpuflags.h in Headers */, + CD132C84152A4D7E00B4F5A8 /* huffman.h in Headers */, + CD132C85152A4D7E00B4F5A8 /* icy.h in Headers */, + CD132C86152A4D7E00B4F5A8 /* icy2utf8.h in Headers */, + CD132C87152A4D7E00B4F5A8 /* id3.h in Headers */, + CD132C88152A4D7E00B4F5A8 /* index.h in Headers */, + CD132C89152A4D7E00B4F5A8 /* intsym.h in Headers */, + CD132C8A152A4D7E00B4F5A8 /* l2tables.h in Headers */, + CD132C8B152A4D7E00B4F5A8 /* l3_integer_tables.h in Headers */, + CD132C8C152A4D7E00B4F5A8 /* l12_integer_tables.h in Headers */, + CD132C8D152A4D7E00B4F5A8 /* mangle.h in Headers */, + CD132C8E152A4D7E00B4F5A8 /* mpg123lib_intern.h in Headers */, + CD132C8F152A4D7E00B4F5A8 /* optimize.h in Headers */, + CD132C90152A4D7E00B4F5A8 /* parse.h in Headers */, + CD132C91152A4D7E00B4F5A8 /* reader.h in Headers */, + CD132C92152A4D7E00B4F5A8 /* sample.h in Headers */, + CD132C93152A4D7E00B4F5A8 /* synth_8bit.h in Headers */, + CD132C94152A4D7E00B4F5A8 /* synth_mono.h in Headers */, + CD132C95152A4D7E00B4F5A8 /* synth_ntom.h in Headers */, + CD132C96152A4D7E00B4F5A8 /* synth.h in Headers */, + CD132C97152A4D7E00B4F5A8 /* synths.h in Headers */, + CD132C98152A4D7E00B4F5A8 /* true.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD6D72CF152B748200CF4285 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CDB0288D152B760700B01410 /* compat.h in Headers */, + CDB02890152B760D00B01410 /* decode.h in Headers */, + CDB02891152B760D00B01410 /* dither.h in Headers */, + CDB02896152B761300B01410 /* frame.h in Headers */, + CDB02898152B761300B01410 /* getbits.h in Headers */, + CDB02899152B761300B01410 /* getcpuflags.h in Headers */, + CDB0289A152B761300B01410 /* huffman.h in Headers */, + CDB0289B152B761300B01410 /* icy.h in Headers */, + CDB0289D152B761300B01410 /* icy2utf8.h in Headers */, + CDB0289F152B761C00B01410 /* id3.h in Headers */, + CDB028A1152B761C00B01410 /* index.h in Headers */, + CDB028A3152B761C00B01410 /* intsym.h in Headers */, + CDB028A4152B761C00B01410 /* l2tables.h in Headers */, + CDB028A5152B761C00B01410 /* l3_integer_tables.h in Headers */, + CDB028A6152B761C00B01410 /* l12_integer_tables.h in Headers */, + CDB028AC152B763500B01410 /* mangle.h in Headers */, + CDB028AD152B764100B01410 /* mpg123lib_intern.h in Headers */, + CDB028AF152B764100B01410 /* optimize.h in Headers */, + CDB028B1152B764100B01410 /* parse.h in Headers */, + CDB028B3152B764100B01410 /* reader.h in Headers */, + CDB028B5152B764900B01410 /* sample.h in Headers */, + CDB028B8152B764900B01410 /* synth_8bit.h in Headers */, + CDB028BA152B764900B01410 /* synth_mono.h in Headers */, + CDB028BB152B764900B01410 /* synth_ntom.h in Headers */, + CDB028BE152B765000B01410 /* synth.h in Headers */, + CDB028BF152B765000B01410 /* synths.h in Headers */, + CDB028C1152B765000B01410 /* true.h in Headers */, + CDB028C2152B765900B01410 /* config.h in Headers */, + CDB028C3152B765900B01410 /* mpg123.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + CD132C0D152A48C200B4F5A8 /* mpg123-ios */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD132C1B152A48C200B4F5A8 /* Build configuration list for PBXNativeTarget "mpg123-ios" */; + buildPhases = ( + CD132C0A152A48C200B4F5A8 /* Sources */, + CD132C0B152A48C200B4F5A8 /* Frameworks */, + CD132C0C152A48C200B4F5A8 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "mpg123-ios"; + productName = libmpg123; + productReference = CD132C0E152A48C200B4F5A8 /* libmpg123-ios.a */; + productType = "com.apple.product-type.library.static"; + }; + CD6D72D0152B748200CF4285 /* mpg123-mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = CD6D72D4152B748200CF4285 /* Build configuration list for PBXNativeTarget "mpg123-mac" */; + buildPhases = ( + CD6D72CD152B748200CF4285 /* Sources */, + CD6D72CE152B748200CF4285 /* Frameworks */, + CD6D72CF152B748200CF4285 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "mpg123-mac"; + productName = "mpg123-mac"; + productReference = CD6D72D1152B748200CF4285 /* libmpg123-mac.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + CD132C05152A48C100B4F5A8 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0430; + }; + buildConfigurationList = CD132C08152A48C100B4F5A8 /* Build configuration list for PBXProject "mpg123" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CD132C03152A48C100B4F5A8; + productRefGroup = CD132C0F152A48C200B4F5A8 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + CD132C0D152A48C200B4F5A8 /* mpg123-ios */, + CD6D72D0152B748200CF4285 /* mpg123-mac */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + CD132C0A152A48C200B4F5A8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD132CB3152A4E7000B4F5A8 /* compat.c in Sources */, + CD132CB4152A4E7000B4F5A8 /* dct64.c in Sources */, + CD132CB5152A4E7000B4F5A8 /* dither.c in Sources */, + CD132CB6152A4E7000B4F5A8 /* equalizer.c in Sources */, + CD132CB7152A4E7000B4F5A8 /* feature.c in Sources */, + CD132CB8152A4E7000B4F5A8 /* format.c in Sources */, + CD132CB9152A4E7000B4F5A8 /* frame.c in Sources */, + CD132CBA152A4E7000B4F5A8 /* icy.c in Sources */, + CD132CBB152A4E7000B4F5A8 /* icy2utf8.c in Sources */, + CD132CBC152A4E7000B4F5A8 /* id3.c in Sources */, + CD132CBD152A4E7000B4F5A8 /* index.c in Sources */, + CD132CBE152A4E7000B4F5A8 /* layer1.c in Sources */, + CD132CBF152A4E7000B4F5A8 /* layer2.c in Sources */, + CD132CC0152A4E7000B4F5A8 /* layer3.c in Sources */, + CD132CC1152A4E7000B4F5A8 /* lfs_alias.c in Sources */, + CD132CC2152A4E7000B4F5A8 /* libmpg123.c in Sources */, + CD132CC3152A4E7000B4F5A8 /* ntom.c in Sources */, + CD132CC4152A4E7000B4F5A8 /* optimize.c in Sources */, + CD132CC5152A4E7000B4F5A8 /* parse.c in Sources */, + CD132CC6152A4E7000B4F5A8 /* readers.c in Sources */, + CD132CC7152A4E7000B4F5A8 /* stringbuf.c in Sources */, + CD132CC8152A4E7000B4F5A8 /* synth_8bit.c in Sources */, + CD132CC9152A4E7000B4F5A8 /* synth_real.c in Sources */, + CD132CCA152A4E7000B4F5A8 /* synth_s32.c in Sources */, + CD132CCB152A4E7000B4F5A8 /* synth.c in Sources */, + CD132CCC152A4E7000B4F5A8 /* tabinit.c in Sources */, + CD132CD6152A511C00B4F5A8 /* dct64_neon_float.S in Sources */, + CD132CD7152A511C00B4F5A8 /* dct64_neon.S in Sources */, + CD132CD9152A511C00B4F5A8 /* synth_neon_float.S in Sources */, + CD132CDA152A511C00B4F5A8 /* synth_neon_s32.S in Sources */, + CD132CDB152A511C00B4F5A8 /* synth_neon.S in Sources */, + CD132CDC152A511C00B4F5A8 /* synth_stereo_neon_float.S in Sources */, + CD132CDD152A511C00B4F5A8 /* synth_stereo_neon_s32.S in Sources */, + CD132CDE152A511C00B4F5A8 /* synth_stereo_neon.S in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CD6D72CD152B748200CF4285 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CDB0288C152B760700B01410 /* compat.c in Sources */, + CDB0288E152B760700B01410 /* dct64.c in Sources */, + CDB02892152B760D00B01410 /* dither.c in Sources */, + CDB02893152B760D00B01410 /* equalizer.c in Sources */, + CDB02894152B760D00B01410 /* feature.c in Sources */, + CDB02895152B760D00B01410 /* format.c in Sources */, + CDB02897152B761300B01410 /* frame.c in Sources */, + CDB0289C152B761300B01410 /* icy.c in Sources */, + CDB0289E152B761300B01410 /* icy2utf8.c in Sources */, + CDB028A0152B761C00B01410 /* id3.c in Sources */, + CDB028A2152B761C00B01410 /* index.c in Sources */, + CDB028A7152B761C00B01410 /* layer1.c in Sources */, + CDB028A8152B762E00B01410 /* layer2.c in Sources */, + CDB028A9152B763500B01410 /* layer3.c in Sources */, + CDB028AA152B763500B01410 /* lfs_alias.c in Sources */, + CDB028AB152B763500B01410 /* libmpg123.c in Sources */, + CDB028AE152B764100B01410 /* ntom.c in Sources */, + CDB028B0152B764100B01410 /* optimize.c in Sources */, + CDB028B2152B764100B01410 /* parse.c in Sources */, + CDB028B4152B764100B01410 /* readers.c in Sources */, + CDB028B6152B764900B01410 /* stringbuf.c in Sources */, + CDB028B7152B764900B01410 /* synth.c in Sources */, + CDB028B9152B764900B01410 /* synth_8bit.c in Sources */, + CDB028BC152B764900B01410 /* synth_real.c in Sources */, + CDB028BD152B764900B01410 /* synth_s32.c in Sources */, + CDB028C0152B765000B01410 /* tabinit.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + CD132C19152A48C200B4F5A8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = NO; + EXCLUDED_SOURCE_FILE_NAMES = ""; + "EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator*]" = ( + "synth_neon*", + "synth_stereo_neon*", + "dct64_neon*", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; + SDKROOT = iphoneos; + }; + name = Debug; + }; + CD132C1A152A48C200B4F5A8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = YES; + EXCLUDED_SOURCE_FILE_NAMES = ""; + "EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator*]" = ( + "synth_neon*", + "synth_stereo_neon*", + "dct64_neon*", + ); + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + CD132C1C152A48C200B4F5A8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/libmpg123.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + CD132C1D152A48C200B4F5A8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DSTROOT = /tmp/libmpg123.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + CD6D72D2152B748200CF4285 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + EXECUTABLE_PREFIX = lib; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + CD6D72D3152B748200CF4285 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + EXECUTABLE_PREFIX = lib; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + CD132C08152A48C100B4F5A8 /* Build configuration list for PBXProject "mpg123" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD132C19152A48C200B4F5A8 /* Debug */, + CD132C1A152A48C200B4F5A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD132C1B152A48C200B4F5A8 /* Build configuration list for PBXNativeTarget "mpg123-ios" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD132C1C152A48C200B4F5A8 /* Debug */, + CD132C1D152A48C200B4F5A8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + CD6D72D4152B748200CF4285 /* Build configuration list for PBXNativeTarget "mpg123-mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CD6D72D2152B748200CF4285 /* Debug */, + CD6D72D3152B748200CF4285 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = CD132C05152A48C100B4F5A8 /* Project object */; +} diff --git a/node_modules/lame/deps/mpg123/ports/mpg123_.pas b/node_modules/lame/deps/mpg123/ports/mpg123_.pas new file mode 100644 index 0000000..5eea80b --- /dev/null +++ b/node_modules/lame/deps/mpg123/ports/mpg123_.pas @@ -0,0 +1,478 @@ +unit mpg123_; +interface + +uses + Windows, + SysUtils; + + // INITIAL CONVERSION BY ARTHUR 17/02/2008 + // USE http://www.mpg123.de/api/ FOR DOCUMENTATION SINCE I STRIPED ALL THE COMMENTS FROM THE UNIT + +type + PDWord = ^DWORD; + PPbyte = ^PByte; + PPchar = ^PChar; + Pdouble = ^double; + PPlongint = ^Plongint; + off_t = Longint; + Poff_t = ^off_t; + PPoff_T = ^Poff_t; + size_t = Cardinal; + Psize_t = ^size_t; + +type + Pmpg123_handle_struct = ^Tmpg123_handle_struct; + Tmpg123_handle_struct = packed record + {undefined structure} + end; + + Tmpg123_handle = Tmpg123_handle_struct; + Pmpg123_handle = ^Tmpg123_handle; + +var + mpg123_init: function: Longint; cdecl; + + mpg123_exit: procedure; cdecl; + + mpg123_new: function(decoder: PChar; Error: Plongint): Pmpg123_handle; cdecl; + + mpg123_delete: procedure(mh: Pmpg123_handle); cdecl; + +type + Tmpg123_parms = Longint; +const + MPG123_VERBOSE = 0; + MPG123_FLAGS = 1; + MPG123_ADD_FLAGS = 2; + MPG123_FORCE_RATE = 3; + MPG123_DOWN_SAMPLE = 4; + MPG123_RVA = 5; + MPG123_DOWNSPEED = 6; + MPG123_UPSPEED = 7; + MPG123_START_FRAME = 8; + MPG123_DECODE_FRAMES = 9; + MPG123_ICY_INTERVAL = 10; + MPG123_OUTSCALE = 11; + MPG123_TIMEOUT = 12; + MPG123_REMOVE_FLAGS = 13; + MPG123_RESYNC_LIMIT = 14; + +type + Tmpg123_param_flags = Longint; +const + MPG123_FORCE_MONO = $7; + MPG123_MONO_LEFT = $1; + MPG123_MONO_RIGHT = $2; + MPG123_MONO_MIX = $4; + MPG123_FORCE_STEREO = $8; + MPG123_FORCE_8BIT = $10; + MPG123_QUIET = $20; + MPG123_GAPLESS = $40; + MPG123_NO_RESYNC = $80; + +type + Tmpg123_param_rva = Longint; +const + MPG123_RVA_OFF = 0; + MPG123_RVA_MIX = 1; + MPG123_RVA_ALBUM = 2; + MPG123_RVA_MAX = MPG123_RVA_ALBUM; + +var + mpg123_param: function(mh: Pmpg123_handle; _type: Tmpg123_parms; value: Longint; fvalue: double): Longint; cdecl; + + mpg123_getparam: function(mh: Pmpg123_handle; _type: Tmpg123_parms; val: Plongint; fval: Pdouble): Longint; cdecl; + +type + Tmpg123_errors = Longint; +const + MPG123_DONE = -(12); + MPG123_NEW_FORMAT = -(11); + MPG123_NEED_MORE = -(10); + MPG123_ERR = -(1); + MPG123_OK = 0; + MPG123_BAD_OUTFORMAT = 1; + MPG123_BAD_CHANNEL = 2; + MPG123_BAD_RATE = 3; + MPG123_ERR_16TO8TABLE = 4; + MPG123_BAD_PARAM = 5; + MPG123_BAD_BUFFER = 6; + MPG123_OUT_OF_MEM = 7; + MPG123_NOT_INITIALIZED = 8; + MPG123_BAD_DECODER = 9; + MPG123_BAD_HANDLE = 10; + MPG123_NO_BUFFERS = 11; + MPG123_BAD_RVA = 12; + MPG123_NO_GAPLESS = 13; + MPG123_NO_SPACE = 14; + MPG123_BAD_TYPES = 15; + MPG123_BAD_BAND = 16; + MPG123_ERR_NULL = 17; + MPG123_ERR_READER = 18; + MPG123_NO_SEEK_FROM_END = 19; + MPG123_BAD_WHENCE = 20; + MPG123_NO_TIMEOUT = 21; + MPG123_BAD_FILE = 22; + MPG123_NO_SEEK = 23; + MPG123_NO_READER = 24; + MPG123_BAD_PARS = 25; + MPG123_BAD_INDEX_PAR = 26; + MPG123_OUT_OF_SYNC = 27; + MPG123_RESYNC_FAIL = 28; + +var + mpg123_plain_strerror: function(errcode: Longint): PChar; cdecl; + + mpg123_strerror: function(mh: Pmpg123_handle): PChar; cdecl; + + mpg123_errcode: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_decoders: function: PPchar; cdecl; + + mpg123_supported_decoders: function: PPchar; cdecl; + + mpg123_decoder: function(mh: Pmpg123_handle; decoder_name: PChar): Longint; cdecl; + +type + Tmpg123_enc_enum = Longint; +const + MPG123_ENC_16 = $40; + MPG123_ENC_SIGNED = $80; + MPG123_ENC_8 = $0F; + MPG123_ENC_SIGNED_16 = (MPG123_ENC_16 or MPG123_ENC_SIGNED) or $10; + MPG123_ENC_UNSIGNED_16 = MPG123_ENC_16 or $20; + MPG123_ENC_UNSIGNED_8 = $01; + MPG123_ENC_SIGNED_8 = MPG123_ENC_SIGNED or $02; + MPG123_ENC_ULAW_8 = $04; + MPG123_ENC_ALAW_8 = $08; + MPG123_ENC_ANY = ((((MPG123_ENC_SIGNED_16 or MPG123_ENC_UNSIGNED_16) or MPG123_ENC_UNSIGNED_8) or MPG123_ENC_SIGNED_8) or MPG123_ENC_ULAW_8) or MPG123_ENC_ALAW_8; + +type + Tmpg123_channelcount = Longint; +const + MPG123_MONO = 1; + MPG123_STEREO = 2; + +var + mpg123_rates: procedure(list: PPlongint; number: Psize_t); cdecl; + + mpg123_encodings: procedure(list: PPlongint; number: Psize_t); cdecl; + + mpg123_format_none: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_format_all: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_format: function(mh: Pmpg123_handle; rate: Longint; channels: Longint; encodings: Longint): Longint; cdecl; + + mpg123_format_support: function(mh: Pmpg123_handle; rate: Longint; encoding: Longint): Longint; cdecl; + + mpg123_getformat: function(mh: Pmpg123_handle; rate: Plongint; channels: Plongint; encoding: Plongint): Longint; cdecl; + + mpg123_open: function(mh: Pmpg123_handle; path: PChar): Longint; cdecl; + + mpg123_open_fd: function(mh: Pmpg123_handle; fd: Longint): Longint; cdecl; + + mpg123_open_feed: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_close: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_read: function(mh: Pmpg123_handle; outmemory: PByte; outmemsize: size_t; done: Psize_t): Longint; cdecl; + + mpg123_decode: function(mh: Pmpg123_handle; inmemory: PByte; inmemsize: size_t; outmemory: PByte; outmemsize: size_t; + done: Psize_t): Longint; cdecl; + + mpg123_decode_frame: function(mh: Pmpg123_handle; num: Poff_t; audio: PPbyte; bytes: Psize_t): Longint; cdecl; + + mpg123_tell: function(mh: Pmpg123_handle): off_t; cdecl; + + mpg123_tellframe: function(mh: Pmpg123_handle): off_t; cdecl; + + mpg123_seek: function(mh: Pmpg123_handle; sampleoff: off_t; whence: Longint): off_t; cdecl; + + mpg123_feedseek: function(mh: Pmpg123_handle; sampleoff: off_t; whence: Longint; input_offset: Poff_t): off_t; cdecl; + + mpg123_seek_frame: function(mh: Pmpg123_handle; frameoff: off_t; whence: Longint): off_t; cdecl; + + mpg123_timeframe: function(mh: Pmpg123_handle; sec: double): off_t; cdecl; + + mpg123_index: function(mh: Pmpg123_handle; offsets: PPoff_t; step: Poff_t; fill: Psize_t): Longint; cdecl; + + mpg123_position: function(mh: Pmpg123_handle; frame_offset: off_t; buffered_bytes: off_t; current_frame: Poff_t; frames_left: Poff_t; + current_seconds: Pdouble; seconds_left: Pdouble): Longint; cdecl; + +type + Tmpg123_channels = Longint; +const + MPG123_LEFT = $1; + MPG123_RIGHT = $2; + +var + mpg123_eq: function(mh: Pmpg123_handle; channel: Tmpg123_channels; band: Longint; val: double): Longint; cdecl; + + mpg123_reset_eq: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_volume: function(mh: Pmpg123_handle; vol: double): Longint; cdecl; + + mpg123_volume_change: function(mh: Pmpg123_handle; change: double): Longint; cdecl; + + mpg123_getvolume: function(mh: Pmpg123_handle; base: Pdouble; really: Pdouble; rva_db: Pdouble): Longint; cdecl; + +type + Tmpg123_vbr = Longint; +const + MPG123_CBR = 0; + MPG123_VBR = 1; + MPG123_ABR = 2; + +type + Tmpg123_version = Longint; +const + MPG123_1_0 = 0; + MPG123_2_0 = 1; + MPG123_2_5 = 2; + +type + Tmpg123_mode = Longint; +const + MPG123_M_STEREO = 0; + MPG123_M_JOINT = 1; + MPG123_M_DUAL = 2; + MPG123_M_MONO = 3; + +type + Tmpg123_flags = Longint; +const + MPG123_CRC = $1; + MPG123_COPYRIGHT = $2; + MPG123_PRIVATE = $4; + MPG123_ORIGINAL = $8; + +type + Pmpg123_frameinfo = ^Tmpg123_frameinfo; + Tmpg123_frameinfo = packed record + version: Tmpg123_version; + layer: Longint; + rate: Longint; + mode: Tmpg123_mode; + mode_ext: Longint; + framesize: Longint; + Flags: Tmpg123_flags; + emphasis: Longint; + bitrate: Longint; + abr_rate: Longint; + vbr: Tmpg123_vbr; + end; + +var + mpg123_info: function(mh: Pmpg123_handle; mi: Pmpg123_frameinfo): Longint; cdecl; + + mpg123_safe_buffer: function: size_t; cdecl; + + mpg123_scan: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_length: function(mh: Pmpg123_handle): off_t; cdecl; + + mpg123_tpf: function(mh: Pmpg123_handle): double; cdecl; + + mpg123_clip: function(mh: Pmpg123_handle): Longint; cdecl; + +type + + Pmpg123_string = ^Tmpg123_string; + Tmpg123_string = packed record + p: PChar; + Size: size_t; + fill: size_t; + end; + +var + mpg123_init_string: procedure(sb: Pmpg123_string); cdecl; + + mpg123_free_string: procedure(sb: Pmpg123_string); cdecl; + + mpg123_resize_string: function(sb: Pmpg123_string; news: size_t): Longint; cdecl; + + mpg123_copy_string: function(from: Pmpg123_string; _to: Pmpg123_string): Longint; cdecl; + + mpg123_add_string: function(sb: Pmpg123_string; stuff: PChar): Longint; cdecl; + + mpg123_set_string: function(sb: Pmpg123_string; stuff: PChar): Longint; cdecl; + +type + + Pmpg123_text = ^Tmpg123_text; + Tmpg123_text = packed record + lang: array[0..2] of Char; + id: array[0..3] of Char; + description: Tmpg123_string; + Text: Tmpg123_string; + end; + + PPmpg123_id3v2 = ^Pmpg123_id3v2; + Pmpg123_id3v2 = ^Tmpg123_id3v2; + Tmpg123_id3v2 = packed record + version: Byte; + title: Pmpg123_string; + artist: Pmpg123_string; + album: Pmpg123_string; + year: Pmpg123_string; + genre: Pmpg123_string; + comment: Pmpg123_string; + comment_list: Pmpg123_text; + comments: size_t; + Text: Pmpg123_text; + texts: size_t; + extra: Pmpg123_text; + extras: size_t; + end; + + PPmpg123_id3v1 = ^Pmpg123_id3v1; + Pmpg123_id3v1 = ^Tmpg123_id3v1; + Tmpg123_id3v1 = packed record + tag: array[0..2] of Char; + title: array[0..29] of Char; + artist: array[0..29] of Char; + album: array[0..29] of Char; + year: array[0..3] of Char; + comment: array[0..29] of Char; + genre: Byte; + end; + +const + MPG123_ID3 = $3; + + MPG123_NEW_ID3 = $1; + + MPG123_ICY = $C; + + MPG123_NEW_ICY = $4; + +var + mpg123_meta_check: function(mh: Pmpg123_handle): Longint; cdecl; + + mpg123_id3_: function(mh: Pmpg123_handle; var v1: Pmpg123_id3v1; var v2: Pmpg123_id3v2): Longint; cdecl; + + mpg123_icy_: function(mh: Pmpg123_handle; icy_meta: PPchar): Longint; cdecl; + +type + Pmpg123_pars_struct = ^Tmpg123_pars_struct; + Tmpg123_pars_struct = packed record + {undefined structure} + end; + + Tmpg123_pars = Tmpg123_pars_struct; + Pmpg123_pars = ^Tmpg123_pars; + +var + mpg123_parnew: function(mp: Pmpg123_pars; decoder: PChar; Error: Plongint): Pmpg123_handle; cdecl; + + mpg123_new_pars: function(Error: Plongint): Pmpg123_pars; cdecl; + + mpg123_delete_pars: procedure(mp: Pmpg123_pars); cdecl; + + mpg123_fmt_none: function(mp: Pmpg123_pars): Longint; cdecl; + + mpg123_fmt_all: function(mp: Pmpg123_pars): Longint; cdecl; + + mpg123_fmt: function(mh: Pmpg123_pars; rate: Longint; channels: Longint; encodings: Longint): Longint; cdecl; + + mpg123_fmt_support: function(mh: Pmpg123_pars; rate: Longint; encoding: Longint): Longint; cdecl; + + mpg123_par: function(mp: Pmpg123_pars; _type: Tmpg123_parms; value: Longint; fvalue: double): Longint; cdecl; + + mpg123_getpar: function(mp: Pmpg123_pars; _type: Tmpg123_parms; val: Plongint; fval: Pdouble): Longint; cdecl; + + mpg123_replace_buffer: function(mh: Pmpg123_handle; data: PByte; Size: size_t): Longint; cdecl; + + mpg123_outblock: function(mh: Pmpg123_handle): size_t; cdecl; + + //mpg123_replace_reader : function(mh:Pmpg123_handle; r_read:function (_para1:longint; _para2:pointer; _para3:size_t):Tssize_t; r_lseek:function (_para1:longint; _para2:off_t; _para3:longint):off_t):longint; + +implementation + +var + hlib: THandle; + +procedure Freempg123; +begin + FreeLibrary(hlib); +end; + +procedure Loadmpg123(lib: PChar); +begin + hlib := LoadLibrary(lib); + mpg123_init := GetProcAddress(hlib, 'mpg123_init'); + mpg123_exit := GetProcAddress(hlib, 'mpg123_exit'); + mpg123_new := GetProcAddress(hlib, 'mpg123_new'); + mpg123_delete := GetProcAddress(hlib, 'mpg123_delete'); + mpg123_param := GetProcAddress(hlib, 'mpg123_param'); + mpg123_getparam := GetProcAddress(hlib, 'mpg123_getparam'); + mpg123_plain_strerror := GetProcAddress(hlib, 'mpg123_plain_strerror'); + mpg123_strerror := GetProcAddress(hlib, 'mpg123_strerror'); + mpg123_errcode := GetProcAddress(hlib, 'mpg123_errcode'); + mpg123_decoders := GetProcAddress(hlib, 'mpg123_decoders'); + mpg123_supported_decoders := GetProcAddress(hlib, 'mpg123_supported_decoders'); + mpg123_decoder := GetProcAddress(hlib, 'mpg123_decoder'); + mpg123_rates := GetProcAddress(hlib, 'mpg123_rates'); + mpg123_encodings := GetProcAddress(hlib, 'mpg123_encodings'); + mpg123_format_none := GetProcAddress(hlib, 'mpg123_format_none'); + mpg123_format_all := GetProcAddress(hlib, 'mpg123_format_all'); + mpg123_format := GetProcAddress(hlib, 'mpg123_format'); + mpg123_format_support := GetProcAddress(hlib, 'mpg123_format_support'); + mpg123_getformat := GetProcAddress(hlib, 'mpg123_getformat'); + mpg123_open := GetProcAddress(hlib, 'mpg123_open'); + mpg123_open_fd := GetProcAddress(hlib, 'mpg123_open_fd'); + mpg123_open_feed := GetProcAddress(hlib, 'mpg123_open_feed'); + mpg123_close := GetProcAddress(hlib, 'mpg123_close'); + mpg123_read := GetProcAddress(hlib, 'mpg123_read'); + mpg123_decode := GetProcAddress(hlib, 'mpg123_decode'); + mpg123_decode_frame := GetProcAddress(hlib, 'mpg123_decode_frame'); + mpg123_tell := GetProcAddress(hlib, 'mpg123_tell'); + mpg123_tellframe := GetProcAddress(hlib, 'mpg123_tellframe'); + mpg123_seek := GetProcAddress(hlib, 'mpg123_seek'); + mpg123_feedseek := GetProcAddress(hlib, 'mpg123_feedseek'); + mpg123_seek_frame := GetProcAddress(hlib, 'mpg123_seek_frame'); + mpg123_timeframe := GetProcAddress(hlib, 'mpg123_timeframe'); + mpg123_index := GetProcAddress(hlib, 'mpg123_index'); + mpg123_position := GetProcAddress(hlib, 'mpg123_position'); + mpg123_eq := GetProcAddress(hlib, 'mpg123_eq'); + mpg123_reset_eq := GetProcAddress(hlib, 'mpg123_reset_eq'); + mpg123_volume := GetProcAddress(hlib, 'mpg123_volume'); + mpg123_volume_change := GetProcAddress(hlib, 'mpg123_volume_change'); + mpg123_getvolume := GetProcAddress(hlib, 'mpg123_getvolume'); + mpg123_info := GetProcAddress(hlib, 'mpg123_info'); + mpg123_safe_buffer := GetProcAddress(hlib, 'mpg123_safe_buffer'); + mpg123_scan := GetProcAddress(hlib, 'mpg123_scan'); + mpg123_length := GetProcAddress(hlib, 'mpg123_length'); + mpg123_tpf := GetProcAddress(hlib, 'mpg123_tpf'); + mpg123_clip := GetProcAddress(hlib, 'mpg123_clip'); + mpg123_init_string := GetProcAddress(hlib, 'mpg123_init_string'); + mpg123_free_string := GetProcAddress(hlib, 'mpg123_free_string'); + mpg123_resize_string := GetProcAddress(hlib, 'mpg123_resize_string'); + mpg123_copy_string := GetProcAddress(hlib, 'mpg123_copy_string'); + mpg123_add_string := GetProcAddress(hlib, 'mpg123_add_string'); + mpg123_set_string := GetProcAddress(hlib, 'mpg123_set_string'); + mpg123_meta_check := GetProcAddress(hlib, 'mpg123_meta_check'); + mpg123_id3_ := GetProcAddress(hlib, 'mpg123_id3'); + mpg123_icy_ := GetProcAddress(hlib, 'mpg123_icy'); + mpg123_parnew := GetProcAddress(hlib, 'mpg123_parnew'); + mpg123_new_pars := GetProcAddress(hlib, 'mpg123_new_pars'); + mpg123_delete_pars := GetProcAddress(hlib, 'mpg123_delete_pars'); + mpg123_fmt_none := GetProcAddress(hlib, 'mpg123_fmt_none'); + mpg123_fmt_all := GetProcAddress(hlib, 'mpg123_fmt_all'); + mpg123_fmt := GetProcAddress(hlib, 'mpg123_fmt'); + mpg123_fmt_support := GetProcAddress(hlib, 'mpg123_fmt_support'); + mpg123_par := GetProcAddress(hlib, 'mpg123_par'); + mpg123_getpar := GetProcAddress(hlib, 'mpg123_getpar'); + mpg123_replace_buffer := GetProcAddress(hlib, 'mpg123_replace_buffer'); + mpg123_outblock := GetProcAddress(hlib, 'mpg123_outblock'); + //mpg123_replace_reader := GetProcAddress(hlib,'mpg123_replace_reader'); +end; + +initialization + Loadmpg123('libmpg123-0.dll'); +finalization + Freempg123; + +end. + diff --git a/node_modules/lame/deps/mpg123/scripts/benchmark-cpu.pl b/node_modules/lame/deps/mpg123/scripts/benchmark-cpu.pl new file mode 100755 index 0000000..b9d3e04 --- /dev/null +++ b/node_modules/lame/deps/mpg123/scripts/benchmark-cpu.pl @@ -0,0 +1,56 @@ +#!/usr/bin/perl +# +# benchmark-cpu.pl: benchmark CPU optimizations of mpg123 +# +# initially written by Nicholas J Humfrey , placed in the public domain +# + +use strict; +#use Time::HiRes qw/time/; + +my $MPG123_CMD = shift @ARGV; +my @TEST_FILES = @ARGV; + +die "Please specify full path to mpg123 >= 1.7.0 and a test MP3 file to decode" if (scalar(@ARGV) < 1); +die "mpg123 command does not exist" unless (-e $MPG123_CMD); +die "mpg123 command is not executable" unless (-x $MPG123_CMD); +for(@TEST_FILES) +{ + die "test MP3 file does not exist" unless (-e $_); +} + +# Force unbuffed output on STDOUT +#$|=1; # why? + +# Check the CPUs available +my $cpulist = `$MPG123_CMD --test-cpu`; +chomp( $cpulist ); +die "Failed to get list of available CPU optimizations" unless ($cpulist =~ s/^Supported decoders: //); + +my @cpus = split( / /, $cpulist ); +my @encs = qw(s16 f32); + +printf STDERR ("Found %d CPU optimizations to test...\n\n", scalar(@cpus) ); + +print "#mpg123 benchmark (user CPU time in seconds for decoding)\n"; +print "#decoder"; +for(@encs){ print " t_$_/s"; } +print "\n"; + +foreach my $cpu (@cpus) +{ + print "$cpu"; + foreach my $e (@encs) + { + # using user CPU time + my @start_time = times(); + system($MPG123_CMD, '-q', '--cpu', $cpu, '-e', $e, '-t', @TEST_FILES ); + my @end_time = times(); + + # third entry is child user time + printf(" %4.2f", $end_time[2] - $start_time[2]); + } + print("\n"); +} + + diff --git a/node_modules/lame/deps/mpg123/scripts/tag_lyrics.py b/node_modules/lame/deps/mpg123/scripts/tag_lyrics.py new file mode 100644 index 0000000..1feb081 --- /dev/null +++ b/node_modules/lame/deps/mpg123/scripts/tag_lyrics.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# needs mutagen +# grabbed from: http://code.activestate.com/recipes/577138-embed-lyrics-into-mp3-files-using-mutagen-uslt-tag/ +# simplified to only work on one file and get lyrics from stdin +# I suspect this is public domain code. Just a usage example of the mutagen lib. + +import os +import sys +import codecs +from mutagen.mp3 import MP3 +from mutagen.id3 import ID3NoHeaderError +from mutagen.id3 import ID3, USLT + +TEXT_ENCODING = 'utf8' +TEXT_LANG = 'XXX' +TEXT_DESC = '' + +# get workdir from first arg or use current dir +if (len(sys.argv) > 1): + fname = sys.argv[1] + print "fname=" + fname +else: + print 'Give me at least a file name to work on, plus the lyrics from stdin' + print 'Optionally, you can provide the language (3 lowercase letters) of the lyrics and a description' + sys.exit() + +if (len(sys.argv) > 2): + TEXT_LANG = sys.argv[2] + +if (len(sys.argv) > 3): + TEXT_DESC = sys.argv[3] + +print "reading lyrics from standard input ..." + +lyrics = sys.stdin.read().strip() + +# try to find the right encoding +for enc in ('utf8','iso-8859-1','iso-8859-15','cp1252','cp1251','latin1'): + try: + lyrics = lyrics.decode(enc) + TEXT_DESC = TEXT_DESC.decode(enc) + print enc, + break + except: + pass + +print "Adding lyrics to " + fname +print "Language: " + TEXT_LANG +print "Description: " + TEXT_DESC + +# create ID3 tag if not exists +try: + tags = ID3(fname) +except ID3NoHeaderError: + print "Adding ID3 header;", + tags = ID3() + +# remove old unsychronized lyrics +if len(tags.getall(u"USLT::'"+TEXT_LANG+"'")) != 0: + print "Removing Lyrics." + tags.delall(u"USLT::'"+TEXT_LANG+"'") + #tags.save(fname) # hm, why? + +#tags.add(USLT(encoding=3, lang=u'eng', desc=u'desc', text=lyrics)) +# apparently the description is important when more than one +# USLT frames are present +#tags[u"USLT::'eng'"] = (USLT(encoding=3, lang=u'eng', desc=u'desc', text=lyrics)) +tags[u"USLT::'"+TEXT_LANG+"'"] = (USLT(encoding=3, lang=TEXT_LANG, desc=TEXT_DESC, text=lyrics)) +print 'Added USLT frame to', fname + +tags.save(fname) + +print 'Done' + diff --git a/node_modules/lame/deps/mpg123/src/Makefile.am b/node_modules/lame/deps/mpg123/src/Makefile.am new file mode 100644 index 0000000..242a9f0 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/Makefile.am @@ -0,0 +1,186 @@ +## Makefile.am: produce Makefile.in from this + +## copyright by the mpg123 project - free software under the terms of the LGPL 2.1 +## see COPYING and AUTHORS files in distribution or http://mpg123.org +## initially written by Nicholas J. Humfrey + +AM_CPPFLAGS = -DPKGLIBDIR="\"$(pkglibdir)\"" +mpg123_LDADD = $(LIBLTDL) libmpg123/libmpg123.la @MODULE_OBJ@ @OUTPUT_OBJ@ @OUTPUT_LIBS@ +mpg123_LDFLAGS = @EXEC_LT_LDFLAGS@ @OUTPUT_LDFLAGS@ +# Just mpg123_INCLUDES has no effect on build! Trying that before reverting to AM_CPPFLAGS. +INCLUDES = $(LTDLINCL) -I$(top_builddir)/src/libmpg123 -I$(top_srcdir)/src/libmpg123 +# libltdl is not mentioned here... it's not that trivial +mpg123_DEPENDENCIES = @OUTPUT_OBJ@ @MODULE_OBJ@ libmpg123/libmpg123.la + +SUBDIRS = output libmpg123 +EXTRA_DIST = legacy_module.c module.c sfifo.c sfifo.h + + +CLEANFILES = *.a + +bin_PROGRAMS = mpg123 + +EXTRA_PROGRAMS = tests/seek_accuracy tests/seek_whence tests/noise tests/text tests/plain_id3 + +mpg123_SOURCES = \ + audio.c \ + audio.h \ + buffer.c \ + buffer.h \ + common.c \ + common.h \ + libmpg123/compat.c \ + libmpg123/compat.h \ + control_generic.c \ + equalizer.c \ + getlopt.c \ + getlopt.h \ + httpget.c \ + httpget.h \ + resolver.c \ + resolver.h \ + genre.h \ + genre.c \ + module.h \ + mpg123.c \ + mpg123app.h \ + metaprint.c \ + metaprint.h \ + local.h \ + local.c \ + playlist.c \ + playlist.h \ + streamdump.h \ + streamdump.c \ + term.c \ + term.h \ + wav.c \ + win32_support.h \ + wavhead.h \ + xfermem.c \ + xfermem.h + +if WIN32_CODES +mpg123_SOURCES += \ + win32_support.c \ + win32_net.c +endif + +# That is not nice... but it is how I manage to get the dependency on output/alsa.o without error about .deps/output/alsa.Tpo . +# Did I mention that recursive make sucks? +# `%'-style pattern rules are a GNU make extension +#find output/ -name '*.c' | perl -ne 'chomp; $mod=$_; $mod=~s/\.c$/.\$(OBJEXT)/; +#print "$mod: $_ audio.h module.h\n"; +#print "\tcd output && \$(MAKE)\n\n";' + +output/coreaudio.$(OBJEXT): output/coreaudio.c audio.h module.h + cd output && $(MAKE) + +output/win32.$(OBJEXT): output/win32.c audio.h module.h + cd output && $(MAKE) + +output/alsa05.$(OBJEXT): output/alsa05.c audio.h module.h + cd output && $(MAKE) + +output/sdl.$(OBJEXT): output/sdl.c audio.h module.h + cd output && $(MAKE) + +output/dummy.$(OBJEXT): output/dummy.c audio.h module.h + cd output && $(MAKE) + +output/alib.$(OBJEXT): output/alib.c audio.h module.h + cd output && $(MAKE) + +output/libao.$(OBJEXT): output/libao.c audio.h module.h + cd output && $(MAKE) + +output/sun.$(OBJEXT): output/sun.c audio.h module.h + cd output && $(MAKE) + +output/aix.$(OBJEXT): output/aix.c audio.h module.h + cd output && $(MAKE) + +output/oss.$(OBJEXT): output/oss.c audio.h module.h + cd output && $(MAKE) + +output/mint.$(OBJEXT): output/mint.c audio.h module.h + cd output && $(MAKE) + +output/pulse.$(OBJEXT): output/pulse.c audio.h module.h + cd output && $(MAKE) + +output/jack.$(OBJEXT): output/jack.c audio.h module.h + cd output && $(MAKE) + +output/os2.$(OBJEXT): output/os2.c audio.h module.h + cd output && $(MAKE) + +output/nas.$(OBJEXT): output/nas.c audio.h module.h + cd output && $(MAKE) + +output/sgi.$(OBJEXT): output/sgi.c audio.h module.h + cd output && $(MAKE) + +output/portaudio.$(OBJEXT): output/portaudio.c audio.h module.h + cd output && $(MAKE) + +output/arts.$(OBJEXT): output/arts.c audio.h module.h + cd output && $(MAKE) + +output/esd.$(OBJEXT): output/esd.c audio.h module.h + cd output && $(MAKE) + +output/alsa.$(OBJEXT): output/alsa.c audio.h module.h + cd output && $(MAKE) + +output/hp.$(OBJEXT): output/hp.c audio.h module.h + cd output && $(MAKE) + +output/sndio.$(OBJEXT): output/sndio.c audio.h module.h + cd output && $(MAKE) + + +# Would have to mention _all_ source files... Dammit, that's what the libmpg123/Makefile.am does! +# But again, the a make $something here needs that stupid rule... WHY??? +libmpg123/libmpg123.la: config.h libmpg123/mpg123.h + cd libmpg123 && $(MAKE) + +tests_seek_accuracy_SOURCES = \ +tests/seek_accuracy.c \ +libmpg123/compat.h \ +libmpg123/compat.c + +tests_seek_accuracy_DEPENDENCIES = libmpg123/libmpg123.la +tests_seek_accuracy_LDADD = libmpg123/libmpg123.la + +tests_seek_whence_SOURCES = \ +tests/seek_whence.c \ +libmpg123/compat.h \ +libmpg123/compat.c + +tests_seek_whence_DEPENDENCIES = libmpg123/libmpg123.la +tests_seek_whence_LDADD = libmpg123/libmpg123.la + +tests_noise_SOURCES = \ +tests/noise.c \ +libmpg123/compat.h \ +libmpg123/compat.c \ +libmpg123/dither.h \ +libmpg123/dither.c + +tests_text_SOURCES = \ +tests/text.c \ +tests/testtext.h \ +libmpg123/compat.h \ +libmpg123/compat.c + +tests_text_DEPENDENCIES = libmpg123/libmpg123.la +tests_text_LDADD = libmpg123/libmpg123.la + +tests_plain_id3_SOURCES = \ +tests/plain_id3.c \ +libmpg123/compat.h \ +libmpg123/compat.c + +tests_plain_id3_DEPENDENCIES = libmpg123/libmpg123.la +tests_plain_id3_LDADD = libmpg123/libmpg123.la diff --git a/node_modules/lame/deps/mpg123/src/Makefile.in b/node_modules/lame/deps/mpg123/src/Makefile.in new file mode 100644 index 0000000..1ea7495 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/Makefile.in @@ -0,0 +1,1097 @@ +# Makefile.in generated by automake 1.12.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = mpg123$(EXEEXT) +EXTRA_PROGRAMS = tests/seek_accuracy$(EXEEXT) \ + tests/seek_whence$(EXEEXT) tests/noise$(EXEEXT) \ + tests/text$(EXEEXT) tests/plain_id3$(EXEEXT) +@WIN32_CODES_TRUE@am__append_1 = \ +@WIN32_CODES_TRUE@ win32_support.c \ +@WIN32_CODES_TRUE@ win32_net.c + +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(top_srcdir)/build/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/addrconfig.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am__mpg123_SOURCES_DIST = audio.c audio.h buffer.c buffer.h common.c \ + common.h libmpg123/compat.c libmpg123/compat.h \ + control_generic.c equalizer.c getlopt.c getlopt.h httpget.c \ + httpget.h resolver.c resolver.h genre.h genre.c module.h \ + mpg123.c mpg123app.h metaprint.c metaprint.h local.h local.c \ + playlist.c playlist.h streamdump.h streamdump.c term.c term.h \ + wav.c win32_support.h wavhead.h xfermem.c xfermem.h \ + win32_support.c win32_net.c +@WIN32_CODES_TRUE@am__objects_1 = win32_support.$(OBJEXT) \ +@WIN32_CODES_TRUE@ win32_net.$(OBJEXT) +am_mpg123_OBJECTS = audio.$(OBJEXT) buffer.$(OBJEXT) common.$(OBJEXT) \ + compat.$(OBJEXT) control_generic.$(OBJEXT) equalizer.$(OBJEXT) \ + getlopt.$(OBJEXT) httpget.$(OBJEXT) resolver.$(OBJEXT) \ + genre.$(OBJEXT) mpg123.$(OBJEXT) metaprint.$(OBJEXT) \ + local.$(OBJEXT) playlist.$(OBJEXT) streamdump.$(OBJEXT) \ + term.$(OBJEXT) wav.$(OBJEXT) xfermem.$(OBJEXT) \ + $(am__objects_1) +mpg123_OBJECTS = $(am_mpg123_OBJECTS) +mpg123_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(mpg123_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_tests_noise_OBJECTS = noise.$(OBJEXT) compat.$(OBJEXT) \ + dither.$(OBJEXT) +tests_noise_OBJECTS = $(am_tests_noise_OBJECTS) +tests_noise_LDADD = $(LDADD) +am__dirstamp = $(am__leading_dot)dirstamp +am_tests_plain_id3_OBJECTS = plain_id3.$(OBJEXT) compat.$(OBJEXT) +tests_plain_id3_OBJECTS = $(am_tests_plain_id3_OBJECTS) +am_tests_seek_accuracy_OBJECTS = seek_accuracy.$(OBJEXT) \ + compat.$(OBJEXT) +tests_seek_accuracy_OBJECTS = $(am_tests_seek_accuracy_OBJECTS) +am_tests_seek_whence_OBJECTS = seek_whence.$(OBJEXT) compat.$(OBJEXT) +tests_seek_whence_OBJECTS = $(am_tests_seek_whence_OBJECTS) +am_tests_text_OBJECTS = text.$(OBJEXT) compat.$(OBJEXT) +tests_text_OBJECTS = $(am_tests_text_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/build/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(mpg123_SOURCES) $(tests_noise_SOURCES) \ + $(tests_plain_id3_SOURCES) $(tests_seek_accuracy_SOURCES) \ + $(tests_seek_whence_SOURCES) $(tests_text_SOURCES) +DIST_SOURCES = $(am__mpg123_SOURCES_DIST) $(tests_noise_SOURCES) \ + $(tests_plain_id3_SOURCES) $(tests_seek_accuracy_SOURCES) \ + $(tests_seek_whence_SOURCES) $(tests_text_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AIX_CFLAGS = @AIX_CFLAGS@ +AIX_LDFLAGS = @AIX_LDFLAGS@ +AIX_LIBS = @AIX_LIBS@ +ALIB_CFLAGS = @ALIB_CFLAGS@ +ALIB_LDFLAGS = @ALIB_LDFLAGS@ +ALIB_LIBS = @ALIB_LIBS@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LDFLAGS = @ALSA_LDFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMTAR = @AMTAR@ +API_VERSION = @API_VERSION@ +AR = @AR@ +ARTS_CFLAGS = @ARTS_CFLAGS@ +ARTS_LDFLAGS = @ARTS_LDFLAGS@ +ARTS_LIBS = @ARTS_LIBS@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COREAUDIO_CFLAGS = @COREAUDIO_CFLAGS@ +COREAUDIO_LDFLAGS = @COREAUDIO_LDFLAGS@ +COREAUDIO_LIBS = @COREAUDIO_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DECODER_LOBJ = @DECODER_LOBJ@ +DECODER_OBJ = @DECODER_OBJ@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMMY_CFLAGS = @DUMMY_CFLAGS@ +DUMMY_LDFLAGS = @DUMMY_LDFLAGS@ +DUMMY_LIBS = @DUMMY_LIBS@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_LDFLAGS = @ESD_LDFLAGS@ +ESD_LIBS = @ESD_LIBS@ +EXEC_LT_LDFLAGS = @EXEC_LT_LDFLAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HP_CFLAGS = @HP_CFLAGS@ +HP_LDFLAGS = @HP_LDFLAGS@ +HP_LIBS = @HP_LIBS@ +INCLUDE_STDIO_H = @INCLUDE_STDIO_H@ +INCLUDE_STDLIB_H = @INCLUDE_STDLIB_H@ +INCLUDE_SYS_TYPE_H = @INCLUDE_SYS_TYPE_H@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBS = @JACK_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LFS_LOBJ = @LFS_LOBJ@ +LIBMPG123_VERSION = @LIBMPG123_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_LDFLAGS = @LT_LDFLAGS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MINT_CFLAGS = @MINT_CFLAGS@ +MINT_LDFLAGS = @MINT_LDFLAGS@ +MINT_LIBS = @MINT_LIBS@ +MKDIR_P = @MKDIR_P@ +MODULE_OBJ = @MODULE_OBJ@ +NAS_CFLAGS = @NAS_CFLAGS@ +NAS_LDFLAGS = @NAS_LDFLAGS@ +NAS_LIBS = @NAS_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENAL_CFLAGS = @OPENAL_CFLAGS@ +OPENAL_LDFLAGS = @OPENAL_LDFLAGS@ +OPENAL_LIBS = @OPENAL_LIBS@ +OS2_CFLAGS = @OS2_CFLAGS@ +OS2_LDFLAGS = @OS2_LDFLAGS@ +OS2_LIBS = @OS2_LIBS@ +OSS_CFLAGS = @OSS_CFLAGS@ +OSS_LDFLAGS = @OSS_LDFLAGS@ +OSS_LIBS = @OSS_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +OUTPUT_CFLAGS = @OUTPUT_CFLAGS@ +OUTPUT_LDFLAGS = @OUTPUT_LDFLAGS@ +OUTPUT_LIBS = @OUTPUT_LIBS@ +OUTPUT_MOD = @OUTPUT_MOD@ +OUTPUT_OBJ = @OUTPUT_OBJ@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PORTAUDIO_CFLAGS = @PORTAUDIO_CFLAGS@ +PORTAUDIO_LDFLAGS = @PORTAUDIO_LDFLAGS@ +PORTAUDIO_LIBS = @PORTAUDIO_LIBS@ +PULSE_CFLAGS = @PULSE_CFLAGS@ +PULSE_LDFLAGS = @PULSE_LDFLAGS@ +PULSE_LIBS = @PULSE_LIBS@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LDFLAGS = @SDL_LDFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SGI_CFLAGS = @SGI_CFLAGS@ +SGI_LDFLAGS = @SGI_LDFLAGS@ +SGI_LIBS = @SGI_LIBS@ +SHELL = @SHELL@ +SNDIO_CFLAGS = @SNDIO_CFLAGS@ +SNDIO_LDFLAGS = @SNDIO_LDFLAGS@ +SNDIO_LIBS = @SNDIO_LIBS@ +STRIP = @STRIP@ +SUN_CFLAGS = @SUN_CFLAGS@ +SUN_LDFLAGS = @SUN_LDFLAGS@ +SUN_LIBS = @SUN_LIBS@ +VERSION = @VERSION@ +WIN32_CFLAGS = @WIN32_CFLAGS@ +WIN32_LDFLAGS = @WIN32_LDFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = -DPKGLIBDIR="\"$(pkglibdir)\"" +mpg123_LDADD = $(LIBLTDL) libmpg123/libmpg123.la @MODULE_OBJ@ @OUTPUT_OBJ@ @OUTPUT_LIBS@ +mpg123_LDFLAGS = @EXEC_LT_LDFLAGS@ @OUTPUT_LDFLAGS@ +# Just mpg123_INCLUDES has no effect on build! Trying that before reverting to AM_CPPFLAGS. +INCLUDES = $(LTDLINCL) -I$(top_builddir)/src/libmpg123 -I$(top_srcdir)/src/libmpg123 +# libltdl is not mentioned here... it's not that trivial +mpg123_DEPENDENCIES = @OUTPUT_OBJ@ @MODULE_OBJ@ libmpg123/libmpg123.la +SUBDIRS = output libmpg123 +EXTRA_DIST = legacy_module.c module.c sfifo.c sfifo.h +CLEANFILES = *.a +mpg123_SOURCES = audio.c audio.h buffer.c buffer.h common.c common.h \ + libmpg123/compat.c libmpg123/compat.h control_generic.c \ + equalizer.c getlopt.c getlopt.h httpget.c httpget.h resolver.c \ + resolver.h genre.h genre.c module.h mpg123.c mpg123app.h \ + metaprint.c metaprint.h local.h local.c playlist.c playlist.h \ + streamdump.h streamdump.c term.c term.h wav.c win32_support.h \ + wavhead.h xfermem.c xfermem.h $(am__append_1) +tests_seek_accuracy_SOURCES = \ +tests/seek_accuracy.c \ +libmpg123/compat.h \ +libmpg123/compat.c + +tests_seek_accuracy_DEPENDENCIES = libmpg123/libmpg123.la +tests_seek_accuracy_LDADD = libmpg123/libmpg123.la +tests_seek_whence_SOURCES = \ +tests/seek_whence.c \ +libmpg123/compat.h \ +libmpg123/compat.c + +tests_seek_whence_DEPENDENCIES = libmpg123/libmpg123.la +tests_seek_whence_LDADD = libmpg123/libmpg123.la +tests_noise_SOURCES = \ +tests/noise.c \ +libmpg123/compat.h \ +libmpg123/compat.c \ +libmpg123/dither.h \ +libmpg123/dither.c + +tests_text_SOURCES = \ +tests/text.c \ +tests/testtext.h \ +libmpg123/compat.h \ +libmpg123/compat.c + +tests_text_DEPENDENCIES = libmpg123/libmpg123.la +tests_text_LDADD = libmpg123/libmpg123.la +tests_plain_id3_SOURCES = \ +tests/plain_id3.c \ +libmpg123/compat.h \ +libmpg123/compat.c + +tests_plain_id3_DEPENDENCIES = libmpg123/libmpg123.la +tests_plain_id3_LDADD = libmpg123/libmpg123.la +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status src/config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +mpg123$(EXEEXT): $(mpg123_OBJECTS) $(mpg123_DEPENDENCIES) $(EXTRA_mpg123_DEPENDENCIES) + @rm -f mpg123$(EXEEXT) + $(mpg123_LINK) $(mpg123_OBJECTS) $(mpg123_LDADD) $(LIBS) +tests/$(am__dirstamp): + @$(MKDIR_P) tests + @: > tests/$(am__dirstamp) +tests/noise$(EXEEXT): $(tests_noise_OBJECTS) $(tests_noise_DEPENDENCIES) $(EXTRA_tests_noise_DEPENDENCIES) tests/$(am__dirstamp) + @rm -f tests/noise$(EXEEXT) + $(LINK) $(tests_noise_OBJECTS) $(tests_noise_LDADD) $(LIBS) +tests/plain_id3$(EXEEXT): $(tests_plain_id3_OBJECTS) $(tests_plain_id3_DEPENDENCIES) $(EXTRA_tests_plain_id3_DEPENDENCIES) tests/$(am__dirstamp) + @rm -f tests/plain_id3$(EXEEXT) + $(LINK) $(tests_plain_id3_OBJECTS) $(tests_plain_id3_LDADD) $(LIBS) +tests/seek_accuracy$(EXEEXT): $(tests_seek_accuracy_OBJECTS) $(tests_seek_accuracy_DEPENDENCIES) $(EXTRA_tests_seek_accuracy_DEPENDENCIES) tests/$(am__dirstamp) + @rm -f tests/seek_accuracy$(EXEEXT) + $(LINK) $(tests_seek_accuracy_OBJECTS) $(tests_seek_accuracy_LDADD) $(LIBS) +tests/seek_whence$(EXEEXT): $(tests_seek_whence_OBJECTS) $(tests_seek_whence_DEPENDENCIES) $(EXTRA_tests_seek_whence_DEPENDENCIES) tests/$(am__dirstamp) + @rm -f tests/seek_whence$(EXEEXT) + $(LINK) $(tests_seek_whence_OBJECTS) $(tests_seek_whence_LDADD) $(LIBS) +tests/text$(EXEEXT): $(tests_text_OBJECTS) $(tests_text_DEPENDENCIES) $(EXTRA_tests_text_DEPENDENCIES) tests/$(am__dirstamp) + @rm -f tests/text$(EXEEXT) + $(LINK) $(tests_text_OBJECTS) $(tests_text_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/control_generic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/equalizer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genre.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getlopt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httpget.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metaprint.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpg123.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/noise.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plain_id3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/playlist.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolver.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_accuracy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_whence.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/streamdump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/term.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wav.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32_net.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32_support.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfermem.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +compat.o: libmpg123/compat.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compat.o -MD -MP -MF $(DEPDIR)/compat.Tpo -c -o compat.o `test -f 'libmpg123/compat.c' || echo '$(srcdir)/'`libmpg123/compat.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/compat.Tpo $(DEPDIR)/compat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libmpg123/compat.c' object='compat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat.o `test -f 'libmpg123/compat.c' || echo '$(srcdir)/'`libmpg123/compat.c + +compat.obj: libmpg123/compat.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compat.obj -MD -MP -MF $(DEPDIR)/compat.Tpo -c -o compat.obj `if test -f 'libmpg123/compat.c'; then $(CYGPATH_W) 'libmpg123/compat.c'; else $(CYGPATH_W) '$(srcdir)/libmpg123/compat.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/compat.Tpo $(DEPDIR)/compat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libmpg123/compat.c' object='compat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat.obj `if test -f 'libmpg123/compat.c'; then $(CYGPATH_W) 'libmpg123/compat.c'; else $(CYGPATH_W) '$(srcdir)/libmpg123/compat.c'; fi` + +noise.o: tests/noise.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT noise.o -MD -MP -MF $(DEPDIR)/noise.Tpo -c -o noise.o `test -f 'tests/noise.c' || echo '$(srcdir)/'`tests/noise.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/noise.Tpo $(DEPDIR)/noise.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/noise.c' object='noise.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o noise.o `test -f 'tests/noise.c' || echo '$(srcdir)/'`tests/noise.c + +noise.obj: tests/noise.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT noise.obj -MD -MP -MF $(DEPDIR)/noise.Tpo -c -o noise.obj `if test -f 'tests/noise.c'; then $(CYGPATH_W) 'tests/noise.c'; else $(CYGPATH_W) '$(srcdir)/tests/noise.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/noise.Tpo $(DEPDIR)/noise.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/noise.c' object='noise.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o noise.obj `if test -f 'tests/noise.c'; then $(CYGPATH_W) 'tests/noise.c'; else $(CYGPATH_W) '$(srcdir)/tests/noise.c'; fi` + +dither.o: libmpg123/dither.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dither.o -MD -MP -MF $(DEPDIR)/dither.Tpo -c -o dither.o `test -f 'libmpg123/dither.c' || echo '$(srcdir)/'`libmpg123/dither.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dither.Tpo $(DEPDIR)/dither.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libmpg123/dither.c' object='dither.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dither.o `test -f 'libmpg123/dither.c' || echo '$(srcdir)/'`libmpg123/dither.c + +dither.obj: libmpg123/dither.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dither.obj -MD -MP -MF $(DEPDIR)/dither.Tpo -c -o dither.obj `if test -f 'libmpg123/dither.c'; then $(CYGPATH_W) 'libmpg123/dither.c'; else $(CYGPATH_W) '$(srcdir)/libmpg123/dither.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dither.Tpo $(DEPDIR)/dither.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libmpg123/dither.c' object='dither.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dither.obj `if test -f 'libmpg123/dither.c'; then $(CYGPATH_W) 'libmpg123/dither.c'; else $(CYGPATH_W) '$(srcdir)/libmpg123/dither.c'; fi` + +plain_id3.o: tests/plain_id3.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT plain_id3.o -MD -MP -MF $(DEPDIR)/plain_id3.Tpo -c -o plain_id3.o `test -f 'tests/plain_id3.c' || echo '$(srcdir)/'`tests/plain_id3.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/plain_id3.Tpo $(DEPDIR)/plain_id3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/plain_id3.c' object='plain_id3.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o plain_id3.o `test -f 'tests/plain_id3.c' || echo '$(srcdir)/'`tests/plain_id3.c + +plain_id3.obj: tests/plain_id3.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT plain_id3.obj -MD -MP -MF $(DEPDIR)/plain_id3.Tpo -c -o plain_id3.obj `if test -f 'tests/plain_id3.c'; then $(CYGPATH_W) 'tests/plain_id3.c'; else $(CYGPATH_W) '$(srcdir)/tests/plain_id3.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/plain_id3.Tpo $(DEPDIR)/plain_id3.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/plain_id3.c' object='plain_id3.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o plain_id3.obj `if test -f 'tests/plain_id3.c'; then $(CYGPATH_W) 'tests/plain_id3.c'; else $(CYGPATH_W) '$(srcdir)/tests/plain_id3.c'; fi` + +seek_accuracy.o: tests/seek_accuracy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT seek_accuracy.o -MD -MP -MF $(DEPDIR)/seek_accuracy.Tpo -c -o seek_accuracy.o `test -f 'tests/seek_accuracy.c' || echo '$(srcdir)/'`tests/seek_accuracy.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/seek_accuracy.Tpo $(DEPDIR)/seek_accuracy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/seek_accuracy.c' object='seek_accuracy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o seek_accuracy.o `test -f 'tests/seek_accuracy.c' || echo '$(srcdir)/'`tests/seek_accuracy.c + +seek_accuracy.obj: tests/seek_accuracy.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT seek_accuracy.obj -MD -MP -MF $(DEPDIR)/seek_accuracy.Tpo -c -o seek_accuracy.obj `if test -f 'tests/seek_accuracy.c'; then $(CYGPATH_W) 'tests/seek_accuracy.c'; else $(CYGPATH_W) '$(srcdir)/tests/seek_accuracy.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/seek_accuracy.Tpo $(DEPDIR)/seek_accuracy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/seek_accuracy.c' object='seek_accuracy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o seek_accuracy.obj `if test -f 'tests/seek_accuracy.c'; then $(CYGPATH_W) 'tests/seek_accuracy.c'; else $(CYGPATH_W) '$(srcdir)/tests/seek_accuracy.c'; fi` + +seek_whence.o: tests/seek_whence.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT seek_whence.o -MD -MP -MF $(DEPDIR)/seek_whence.Tpo -c -o seek_whence.o `test -f 'tests/seek_whence.c' || echo '$(srcdir)/'`tests/seek_whence.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/seek_whence.Tpo $(DEPDIR)/seek_whence.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/seek_whence.c' object='seek_whence.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o seek_whence.o `test -f 'tests/seek_whence.c' || echo '$(srcdir)/'`tests/seek_whence.c + +seek_whence.obj: tests/seek_whence.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT seek_whence.obj -MD -MP -MF $(DEPDIR)/seek_whence.Tpo -c -o seek_whence.obj `if test -f 'tests/seek_whence.c'; then $(CYGPATH_W) 'tests/seek_whence.c'; else $(CYGPATH_W) '$(srcdir)/tests/seek_whence.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/seek_whence.Tpo $(DEPDIR)/seek_whence.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/seek_whence.c' object='seek_whence.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o seek_whence.obj `if test -f 'tests/seek_whence.c'; then $(CYGPATH_W) 'tests/seek_whence.c'; else $(CYGPATH_W) '$(srcdir)/tests/seek_whence.c'; fi` + +text.o: tests/text.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT text.o -MD -MP -MF $(DEPDIR)/text.Tpo -c -o text.o `test -f 'tests/text.c' || echo '$(srcdir)/'`tests/text.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/text.Tpo $(DEPDIR)/text.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/text.c' object='text.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o text.o `test -f 'tests/text.c' || echo '$(srcdir)/'`tests/text.c + +text.obj: tests/text.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT text.obj -MD -MP -MF $(DEPDIR)/text.Tpo -c -o text.obj `if test -f 'tests/text.c'; then $(CYGPATH_W) 'tests/text.c'; else $(CYGPATH_W) '$(srcdir)/tests/text.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/text.Tpo $(DEPDIR)/text.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tests/text.c' object='text.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o text.obj `if test -f 'tests/text.c'; then $(CYGPATH_W) 'tests/text.c'; else $(CYGPATH_W) '$(srcdir)/tests/text.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf tests/.libs tests/_libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(PROGRAMS) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f tests/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool cscopelist cscopelist-recursive \ + ctags ctags-recursive distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-binPROGRAMS + + +# That is not nice... but it is how I manage to get the dependency on output/alsa.o without error about .deps/output/alsa.Tpo . +# Did I mention that recursive make sucks? +# `%'-style pattern rules are a GNU make extension +#find output/ -name '*.c' | perl -ne 'chomp; $mod=$_; $mod=~s/\.c$/.\$(OBJEXT)/; +#print "$mod: $_ audio.h module.h\n"; +#print "\tcd output && \$(MAKE)\n\n";' + +output/coreaudio.$(OBJEXT): output/coreaudio.c audio.h module.h + cd output && $(MAKE) + +output/win32.$(OBJEXT): output/win32.c audio.h module.h + cd output && $(MAKE) + +output/alsa05.$(OBJEXT): output/alsa05.c audio.h module.h + cd output && $(MAKE) + +output/sdl.$(OBJEXT): output/sdl.c audio.h module.h + cd output && $(MAKE) + +output/dummy.$(OBJEXT): output/dummy.c audio.h module.h + cd output && $(MAKE) + +output/alib.$(OBJEXT): output/alib.c audio.h module.h + cd output && $(MAKE) + +output/libao.$(OBJEXT): output/libao.c audio.h module.h + cd output && $(MAKE) + +output/sun.$(OBJEXT): output/sun.c audio.h module.h + cd output && $(MAKE) + +output/aix.$(OBJEXT): output/aix.c audio.h module.h + cd output && $(MAKE) + +output/oss.$(OBJEXT): output/oss.c audio.h module.h + cd output && $(MAKE) + +output/mint.$(OBJEXT): output/mint.c audio.h module.h + cd output && $(MAKE) + +output/pulse.$(OBJEXT): output/pulse.c audio.h module.h + cd output && $(MAKE) + +output/jack.$(OBJEXT): output/jack.c audio.h module.h + cd output && $(MAKE) + +output/os2.$(OBJEXT): output/os2.c audio.h module.h + cd output && $(MAKE) + +output/nas.$(OBJEXT): output/nas.c audio.h module.h + cd output && $(MAKE) + +output/sgi.$(OBJEXT): output/sgi.c audio.h module.h + cd output && $(MAKE) + +output/portaudio.$(OBJEXT): output/portaudio.c audio.h module.h + cd output && $(MAKE) + +output/arts.$(OBJEXT): output/arts.c audio.h module.h + cd output && $(MAKE) + +output/esd.$(OBJEXT): output/esd.c audio.h module.h + cd output && $(MAKE) + +output/alsa.$(OBJEXT): output/alsa.c audio.h module.h + cd output && $(MAKE) + +output/hp.$(OBJEXT): output/hp.c audio.h module.h + cd output && $(MAKE) + +output/sndio.$(OBJEXT): output/sndio.c audio.h module.h + cd output && $(MAKE) + +# Would have to mention _all_ source files... Dammit, that's what the libmpg123/Makefile.am does! +# But again, the a make $something here needs that stupid rule... WHY??? +libmpg123/libmpg123.la: config.h libmpg123/mpg123.h + cd libmpg123 && $(MAKE) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/mpg123/src/audio.c b/node_modules/lame/deps/mpg123/src/audio.c new file mode 100644 index 0000000..9a3369e --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/audio.c @@ -0,0 +1,725 @@ +/* + audio: audio output interface + + copyright ?-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +#include +#include "mpg123app.h" +#include "common.h" +#include "buffer.h" + +#ifdef HAVE_SYS_WAIT_H +#include +#endif + +#include "debug.h" + +static int file_write(struct audio_output_struct* ao, unsigned char *bytes, int count) +{ + return (int)write(ao->fn, bytes, count); +} +static int wave_write(struct audio_output_struct* ao, unsigned char *bytes, int count) +{ + return wav_write(bytes, count); +} +static int builtin_get_formats(struct audio_output_struct *ao) +{ + if(param.outmode == DECODE_CDR) + { + if(ao->rate == 44100 && ao->channels == 2) + return MPG123_ENC_SIGNED_16; + else + return 0; + } + else if(param.outmode == DECODE_AU) return MPG123_ENC_SIGNED_16|MPG123_ENC_UNSIGNED_8|MPG123_ENC_ULAW_8; + else if(param.outmode == DECODE_WAV) return MPG123_ENC_SIGNED_16|MPG123_ENC_UNSIGNED_8|MPG123_ENC_FLOAT_32|MPG123_ENC_SIGNED_24|MPG123_ENC_SIGNED_32; + else return MPG123_ENC_ANY; +} +static int builtin_close(struct audio_output_struct *ao) +{ + switch(param.outmode) + { + case DECODE_WAV: + return wav_close(); + break; + case DECODE_AU: + return au_close(); + break; + case DECODE_CDR: + return cdr_close(); + break; + } + return -1; +} +static int builtin_nothingint(struct audio_output_struct *ao){ return 0; } +static void builtin_nothing(struct audio_output_struct *ao){} + +audio_output_t* open_fake_module(void) +{ + audio_output_t *ao = NULL; + ao = alloc_audio_output(); + if(ao == NULL) + { + error("Cannot allocate memory for audio output data."); + return NULL; + } + ao->module = NULL; + ao->open = builtin_nothingint; + ao->flush = builtin_nothing; + ao->get_formats = builtin_get_formats; + ao->write = wave_write; + ao->close = builtin_close; + ao->device = param.filename; + ao->is_open = FALSE; + switch(param.outmode) + { + case DECODE_FILE: + ao->fn = OutputDescriptor; + ao->write = file_write; + break; + case DECODE_WAV: + ao->open = wav_open; + break; + case DECODE_CDR: + ao->open = cdr_open; + break; + case DECODE_AU: + ao->open = au_open; + break; + case DECODE_TEST: + break; + } + + return ao; +} + +/* Open an audio output module, trying modules in list (comma-separated). */ +audio_output_t* open_output_module( const char* names ) +{ + mpg123_module_t *module = NULL; + audio_output_t *ao = NULL; + int result = 0; + char *curname, *modnames; + + if(param.usebuffer || names==NULL) return NULL; + + /* Use internal code. */ + if(param.outmode != DECODE_AUDIO) return open_fake_module(); + + modnames = strdup(names); + if(modnames == NULL) + { + error("Error allocating memory for module names."); + return NULL; + } + /* Now loop over the list of possible modules to find one that works. */ + curname = strtok(modnames, ","); + while(curname != NULL) + { + char* name = curname; + curname = strtok(NULL, ","); + if(param.verbose > 1) fprintf(stderr, "Trying output module %s.\n", name); + /* Open the module, initial check for availability+libraries. */ + module = open_module( "output", name ); + if(module == NULL) continue; + /* Check if module supports output */ + if(module->init_output == NULL) + { + error1("Module '%s' does not support audio output.", name); + close_module(module); + continue; /* Try next one. */ + } + /* Allocation+initialization of memory for audio output type. */ + ao = alloc_audio_output(); + if(ao==NULL) + { + error("Failed to allocate audio output structure."); + close_module(module); + break; /* This is fatal. */ + } + + /* Call the init function */ + ao->device = param.output_device; + ao->flags = param.output_flags; + /* Should I do funny stuff with stderr file descriptor instead? */ + if(curname == NULL) + { + if(param.verbose > 1) + fprintf(stderr, "Note: %s is the last output option... showing you any error messages now.\n", name); + } + else ao->auxflags |= MPG123_OUT_QUIET; /* Probing, so don't spill stderr with errors. */ + ao->is_open = FALSE; + ao->module = module; /* Need that to close module later. */ + result = module->init_output(ao); + if(result == 0) + { /* Try to open the device. I'm only interested in actually working modules. */ + result = open_output(ao); + close_output(ao); + } + else error2("Module '%s' init failed: %i", name, result); + + if(result!=0) + { /* Try next one... */ + close_module(module); + free(ao); + ao = NULL; + } + else + { /* All good, leave the loop. */ + if(param.verbose > 1) fprintf(stderr, "Output module '%s' chosen.\n", name); + + ao->auxflags &= ~MPG123_OUT_QUIET; + break; + } + } + + free(modnames); + if(ao==NULL) error1("Unable to find a working output module in this list: %s", names); + + return ao; +} + + + +/* Close the audio output and close the module */ +void close_output_module( audio_output_t* ao ) +{ + if (!ao) return; /* That covers buffer mode, too (ao == NULL there). */ + + debug("closing output module"); + /* Close the audio output */ + if(ao->is_open && ao->close != NULL) ao->close(ao); + + /* Deinitialise the audio output */ + if (ao->deinit) ao->deinit( ao ); + + /* Unload the module */ + if (ao->module) close_module( ao->module ); + + /* Free up memory */ + free( ao ); +} + + + +/* allocate and initialise memory */ +audio_output_t* alloc_audio_output() +{ + audio_output_t* ao = malloc( sizeof( audio_output_t ) ); + if (ao==NULL) error( "Failed to allocate memory for audio_output_t." ); + + /* Initialise variables */ + ao->fn = -1; + ao->rate = -1; + ao->gain = param.gain; + ao->userptr = NULL; + ao->device = NULL; + ao->channels = -1; + ao->format = -1; + ao->flags = 0; + ao->auxflags = 0; + + /*ao->module = NULL;*/ + + /* Set the callbacks to NULL */ + ao->open = NULL; + ao->get_formats = NULL; + ao->write = NULL; + ao->flush = NULL; + ao->close = NULL; + ao->deinit = NULL; + + return ao; +} + +/* +static void audio_output_dump(audio_output_t *ao) +{ + fprintf(stderr, "ao->fn=%d\n", ao->fn); + fprintf(stderr, "ao->userptr=%p\n", ao->userptr); + fprintf(stderr, "ao->rate=%ld\n", ao->rate); + fprintf(stderr, "ao->gain=%ld\n", ao->gain); + fprintf(stderr, "ao->device='%s'\n", ao->device); + fprintf(stderr, "ao->channels=%d\n", ao->channels); + fprintf(stderr, "ao->format=%d\n", ao->format); +} +*/ + +struct enc_desc +{ + int code; /* MPG123_ENC_SOMETHING */ + const char *longname; /* signed bla bla */ + const char *name; /* sXX, short name */ + const unsigned char nlen; /* significant characters in short name */ +}; + +static const struct enc_desc encdesc[] = +{ + { MPG123_ENC_SIGNED_16, "signed 16 bit", "s16 ", 3 }, + { MPG123_ENC_UNSIGNED_16, "unsigned 16 bit", "u16 ", 3 }, + { MPG123_ENC_UNSIGNED_8, "unsigned 8 bit", "u8 ", 2 }, + { MPG123_ENC_SIGNED_8, "signed 8 bit", "s8 ", 2 }, + { MPG123_ENC_ULAW_8, "mu-law (8 bit)", "ulaw ", 4 }, + { MPG123_ENC_ALAW_8, "a-law (8 bit)", "alaw ", 4 }, + { MPG123_ENC_FLOAT_32, "float (32 bit)", "f32 ", 3 }, + { MPG123_ENC_SIGNED_32, "signed 32 bit", "s32 ", 3 }, + { MPG123_ENC_UNSIGNED_32, "unsigned 32 bit", "u32 ", 3 }, + { MPG123_ENC_SIGNED_24, "signed 24 bit", "s24 ", 3 }, + { MPG123_ENC_UNSIGNED_24, "unsigned 24 bit", "u24 ", 3 } +}; +#define KNOWN_ENCS (sizeof(encdesc)/sizeof(struct enc_desc)) + +void audio_enclist(char** list) +{ + size_t length = 0; + int i; + *list = NULL; + for(i=0;i0) (*list)[off++] = ' '; + memcpy(*list+off, encdesc[i].name, encdesc[i].nlen); + off += encdesc[i].nlen; + } + } +} + +/* Safer as function... */ +const char* audio_encoding_name(const int encoding, const int longer) +{ + const char *name = longer ? "unknown" : "???"; + int i; + for(i=0;imodule ? ao->module->name : "file/raw/test"; + if(ao->device != NULL) dev = ao->device; + } + mpg123_rates(&rates, &num_rates); + mpg123_encodings(&encs, &num_encs); + fprintf(stderr,"\nAudio driver: %s\nAudio device: %s\nAudio capabilities:\n(matrix of [S]tereo or [M]ono support for sample format and rate in Hz)\n |", name, dev); + for(e=0;e 2) fprintf(stderr, "Note: forcing encoding code 0x%x\n", force_fmt); + } + rlimit = param.force_rate > 0 ? num_rates+1 : num_rates; + for(channels=1; channels<=2; channels++) + for(ri = 0;ri 2) fprintf(stderr, "Note: checking support for %liHz/%ich.\n", rate, channels); +#ifndef NOXFERMEM + if(param.usebuffer) + { /* Ask the buffer process. It is waiting for this. */ + buffermem->rate = rate; + buffermem->channels = channels; + buffermem->format = 0; /* Just have it initialized safely. */ + debug2("asking for formats for %liHz/%ich", rate, channels); + xfermem_putcmd(buffermem->fd[XF_WRITER], XF_CMD_AUDIOCAP); + xfermem_getcmd(buffermem->fd[XF_WRITER], TRUE); + fmts = buffermem->format; + } + else +#endif + { /* Check myself. */ + ao->rate = rate; + ao->channels = channels; + fmts = ao->get_formats(ao); + } + if(param.verbose > 2) fprintf(stderr, "Note: result 0x%x\n", fmts); + if(force_fmt) + { /* Filter for forced encoding. */ + if((fmts & force_fmt) == force_fmt) fmts = force_fmt; + else fmts = 0; /* Nothing else! */ + + if(param.verbose > 2) fprintf(stderr, "Note: after forcing 0x%x\n", fmts); + } + + if(fmts < 0) continue; + else mpg123_format(mh, decode_rate, channels, fmts); + } + +#ifndef NOXFERMEM + /* Buffer loop shall start normal operation now. */ + if(param.usebuffer) + { + xfermem_putcmd(buffermem->fd[XF_WRITER], XF_CMD_WAKEUP); + xfermem_getcmd(buffermem->fd[XF_WRITER], TRUE); + } +#endif + + if(param.verbose > 1) print_capabilities(ao, mh); +} + +#if !defined(WIN32) && !defined(GENERIC) +#ifndef NOXFERMEM +static void catch_child(void) +{ + while (waitpid(-1, NULL, WNOHANG) > 0); +} +#endif +#endif + + +/* FIXME: Old output initialization code that needs updating */ + +int init_output(audio_output_t **ao) +{ + static int init_done = FALSE; + + if (init_done) return 1; + init_done = TRUE; + +#ifndef NOXFERMEM + if (param.usebuffer) + { + unsigned int bufferbytes; + sigset_t newsigset, oldsigset; + bufferbytes = (param.usebuffer * 1024); + if (bufferbytes < bufferblock) + { + bufferbytes = 2*bufferblock; + if(!param.quiet) fprintf(stderr, "Note: raising buffer to minimal size %liKiB\n", (unsigned long) bufferbytes>>10); + } + bufferbytes -= bufferbytes % bufferblock; + /* No +1024 for NtoM rounding problems anymore! */ + xfermem_init (&buffermem, bufferbytes ,0,0); + sigemptyset (&newsigset); + /* ThOr: I'm not quite sure why we need to block that signal here. */ + sigaddset (&newsigset, SIGUSR1); + sigprocmask (SIG_BLOCK, &newsigset, &oldsigset); +#if !defined(WIN32) && !defined(GENERIC) + catchsignal (SIGCHLD, catch_child); +#endif + switch ((buffer_pid = fork())) + { + case -1: /* error */ + error("cannot fork!"); + return -1; + case 0: /* child */ + { + /* Buffer process handles all audio stuff itself. */ + audio_output_t *bao = NULL; /* To be clear: That's the buffer's pointer. */ + param.usebuffer = 0; /* The buffer doesn't use the buffer. */ + /* Open audio output module */ + bao = open_output_module(param.output_module); + if(!bao) + { + error("Failed to open audio output module."); + exit(1); /* communicate failure? */ + } + if(open_output(bao) < 0) + { + error("Unable to open audio output."); + close_output_module(bao); + exit(2); + } + xfermem_init_reader (buffermem); + buffer_loop(bao, &oldsigset); /* Here the work happens. */ + xfermem_done_reader (buffermem); + xfermem_done (buffermem); + close_output(bao); + close_output_module(bao); + exit(0); + } + default: /* parent */ + xfermem_init_writer (buffermem); + } + /* ThOr: I want that USR1 signal back for control. */ + sigprocmask(SIG_UNBLOCK, &newsigset, NULL); + } +#else + if(param.usebuffer) + { + error("Buffer not available in this build!"); + return -1; + } +#endif + if(!param.usebuffer) + { /* Only if I handle audio device output: Get that module. */ + *ao = open_output_module(param.output_module); + if(!(*ao)) + { + error("Failed to open audio output module"); + return -1; + } + } + else *ao = NULL; /* That ensures we won't try to free it later... */ +#ifndef NOXFERMEM + if(param.usebuffer) + { /* Check if buffer is alive. */ + int res = xfermem_getcmd(buffermem->fd[XF_WRITER], TRUE); + if(res < 0) + { + error("Buffer process didn't initialize!"); + return -1; + } + } +#endif + /* This has internal protection for buffer mode. */ + if(open_output(*ao) < 0) return -1; + + return 0; +} + +void exit_output(audio_output_t *ao, int rude) +{ + debug("exit output"); +#ifndef NOXFERMEM + if (param.usebuffer) + { + debug("ending buffer"); + buffer_stop(); /* Puts buffer into waiting-for-command mode. */ + buffer_end(rude); /* Gives command to end operation. */ + xfermem_done_writer(buffermem); + waitpid (buffer_pid, NULL, 0); + xfermem_done (buffermem); + } +#endif + /* Close the output... doesn't matter if buffer handled it, that's taken care of. */ + close_output(ao); + close_output_module(ao); +} + +void output_pause(audio_output_t *ao) +{ + if(param.usebuffer) buffer_stop(); + else ao->flush(ao); +} + +void output_unpause(audio_output_t *ao) +{ + if(param.usebuffer) buffer_start(); +} + +int flush_output(audio_output_t *ao, unsigned char *bytes, size_t count) +{ + if(count) + { + /* Error checks? */ +#ifndef NOXFERMEM + if(param.usebuffer){ if(xfermem_write(buffermem, bytes, count)) return -1; } + else +#endif + if(param.outmode != DECODE_TEST) + { + int sum = 0; + int written; + do + { /* Be in a loop for SIGSTOP/CONT */ + written = ao->write(ao, bytes, (int)count); + if(written >= 0){ sum+=written; count -= written; } + else error1("Error in writing audio (%s?)!", strerror(errno)); + } while(count>0 && written>=0); + return sum; + } + } + return (int)count; /* That is for DECODE_TEST */ +} + +int open_output(audio_output_t *ao) +{ + if(param.usebuffer) return 0; + + if(ao == NULL) + { + error("ao should not be NULL here!"); + exit(110); + } + + switch(param.outmode) + { + case DECODE_AUDIO: + case DECODE_WAV: + case DECODE_AU: + case DECODE_CDR: + case DECODE_FILE: + debug("opening normal audio/file"); + ao->is_open = ao->open(ao) < 0 ? FALSE : TRUE; + if(!ao->is_open) + { + if(!AOQUIET) error("failed to open audio device"); + return -1; + } + else return 0; + break; + case DECODE_TEST: + debug("decoding to nowhere"); + return 0; + break; + } + debug("nothing"); + return -1; /* That's an error ... unknown outmode? */ +} + +/* is this used? */ +void close_output(audio_output_t *ao) +{ + if(param.usebuffer) return; + + debug("closing output"); + switch(param.outmode) + { + case DECODE_AUDIO: + case DECODE_WAV: + case DECODE_AU: + case DECODE_CDR: + /* Guard that close call; could be nasty. */ + if(ao->is_open) + { + ao->is_open = FALSE; + if(ao->close != NULL) ao->close(ao); + } + break; + } +} + +/* Also for WAV decoding? */ +int reset_output(audio_output_t *ao) +{ + if(!param.usebuffer) + { + close_output(ao); + return open_output(ao); + } + else return 0; +} + +int set_pitch(mpg123_handle *fr, audio_output_t *ao, double new_pitch) +{ + int ret = 1; + double old_pitch = param.pitch; + long rate; + int channels, format; + int smode = 0; + + /* Be safe, check support. */ + if(mpg123_getformat(fr, &rate, &channels, &format) != MPG123_OK) + { + /* We might just not have a track handy. */ + error("There is no current audio format, cannot apply pitch. This might get fixed in future."); + return 0; + } + + if(param.usebuffer) + { + error("No runtime pitch change with output buffer, sorry."); + return 0; + } + + param.pitch = new_pitch; + if(param.pitch < -0.99) param.pitch = -0.99; + + if(channels == 1) smode = MPG123_MONO; + if(channels == 2) smode = MPG123_STEREO; + + output_pause(ao); + /* Remember: This takes param.pitch into account. */ + audio_capabilities(ao, fr); + if(!(mpg123_format_support(fr, rate, format) & smode)) + { + /* Note: When using --pitch command line parameter, you can go higher + because a lower decoder sample rate is automagically chosen. + Here, we'd need to switch decoder rate during track... good? */ + error("Reached a hardware limit there with pitch!"); + param.pitch = old_pitch; + audio_capabilities(ao, fr); + ret = 0; + } + ao->format = format; + ao->channels = channels; + ao->rate = pitch_rate(rate); + reset_output(ao); + output_unpause(ao); + return ret; +} + diff --git a/node_modules/lame/deps/mpg123/src/audio.h b/node_modules/lame/deps/mpg123/src/audio.h new file mode 100644 index 0000000..6fff8cd --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/audio.h @@ -0,0 +1,106 @@ +/* + audio: audio output interface + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +/* + * Audio 'LIB' defines + */ + + +#ifndef _MPG123_AUDIO_H_ +#define _MPG123_AUDIO_H_ + +#include "compat.h" +#include "mpg123.h" +#include "module.h" + +#define AUDIO_OUT_HEADPHONES 0x01 +#define AUDIO_OUT_INTERNAL_SPEAKER 0x02 +#define AUDIO_OUT_LINE_OUT 0x04 + +enum { + DECODE_TEST, + DECODE_AUDIO, + DECODE_FILE, + DECODE_BUFFER, + DECODE_WAV, + DECODE_AU, + DECODE_CDR, + DECODE_AUDIOFILE +}; + +/* 3% rate tolerance */ +#define AUDIO_RATE_TOLERANCE 3 + +typedef struct audio_output_struct +{ + int fn; /* filenumber */ + void *userptr; /* driver specific pointer */ + + /* Callbacks */ + int (*open)(struct audio_output_struct *); + int (*get_formats)(struct audio_output_struct *); + int (*write)(struct audio_output_struct *, unsigned char *,int); + void (*flush)(struct audio_output_struct *); + int (*close)(struct audio_output_struct *); + int (*deinit)(struct audio_output_struct *); + + /* the module this belongs to */ + mpg123_module_t *module; + + char *device; /* device name */ + int flags; /* some bits; namely headphone/speaker/line */ + long rate; /* sample rate */ + long gain; /* output gain */ + int channels; /* number of channels */ + int format; /* format flags */ + int is_open; /* something opened? */ +#define MPG123_OUT_QUIET 1 + int auxflags; /* For now just one: quiet mode (for probing). */ +} audio_output_t; + +/* Lazy. */ +#define AOQUIET (ao->auxflags & MPG123_OUT_QUIET) + +struct audio_format_name { + int val; + char *name; + char *sname; +}; + +#define pitch_rate(rate) (param.pitch == 0 ? (rate) : (long) ((param.pitch+1.0)*(rate))) + +/* ------ Declarations from "audio.c" ------ */ + +audio_output_t* open_output_module( const char* name ); +void close_output_module( audio_output_t* ao ); +audio_output_t* alloc_audio_output(); +void audio_capabilities(audio_output_t *ao, mpg123_handle *mh); +int audio_fit_capabilities(audio_output_t *ao,int c,int r); +const char* audio_encoding_name(const int encoding, const int longer); +void print_capabilities(audio_output_t *ao, mpg123_handle *mh); + +int init_output(audio_output_t **ao); +void exit_output(audio_output_t *ao, int rude); +int flush_output(audio_output_t *ao, unsigned char *bytes, size_t count); +int open_output(audio_output_t *ao); +void close_output(audio_output_t *ao ); +int reset_output(audio_output_t *ao); +void output_pause(audio_output_t *ao); /* Prepare output for inactivity. */ +void output_unpause(audio_output_t *ao); /* Reactivate output (buffer process). */ + +void audio_enclist(char** list); /* Make a string of encoding names. */ + +/* + Twiddle audio output rate to yield speedup/down (pitch) effect. + The actually achieved pitch value is stored in param.pitch. + Returns 1 if pitch setting succeeded, 0 otherwise. +*/ +int set_pitch(mpg123_handle *fr, audio_output_t *ao, double new_pitch); + +#endif + diff --git a/node_modules/lame/deps/mpg123/src/buffer.c b/node_modules/lame/deps/mpg123/src/buffer.c new file mode 100644 index 0000000..7a12281 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/buffer.c @@ -0,0 +1,312 @@ +/* + buffer.c: output buffer + + copyright 1997-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Oliver Fromme + + I (ThOr) am reviewing this file at about the same daytime as Oliver's timestamp here: + Mon Apr 14 03:53:18 MET DST 1997 + - dammed night coders;-) +*/ + +#include "mpg123app.h" + +#ifndef NOXFERMEM + +#include "common.h" +#include +#include "debug.h" + +int outburst = 32768; + +static int intflag = FALSE; +static int usr1flag = FALSE; + +static void catch_interrupt (void) +{ + intflag = TRUE; +} + +static void catch_usr1 (void) +{ + usr1flag = TRUE; +} + +/* Interfaces to writer process */ + +extern void buffer_sig(int signal, int block); + +void real_buffer_ignore_lowmem(void) +{ + if (!buffermem) + return; + if(buffermem->wakeme[XF_READER]) + xfermem_putcmd(buffermem->fd[XF_WRITER], XF_CMD_WAKEUP); +} + +void real_buffer_end(int rude) +{ + if (!buffermem) + return; + xfermem_putcmd(buffermem->fd[XF_WRITER], rude ? XF_CMD_ABORT : XF_CMD_TERMINATE); +} + +void real_buffer_resync(void) +{ + if(buffermem->justwait) + { + buffermem->wakeme[XF_WRITER] = TRUE; + xfermem_putcmd(buffermem->fd[XF_WRITER], XF_CMD_RESYNC); + xfermem_getcmd(buffermem->fd[XF_WRITER], TRUE); + } + else buffer_sig(SIGINT, TRUE); +} + +void real_plain_buffer_resync(void) +{ + buffer_sig(SIGINT, FALSE); +} + +void real_buffer_reset(void) +{ + buffer_sig(SIGUSR1, TRUE); +} + +void real_buffer_start(void) +{ + if(buffermem->justwait) + { + debug("ending buffer's waiting"); + buffermem->justwait = FALSE; + xfermem_putcmd(buffermem->fd[XF_WRITER], XF_CMD_WAKEUP); + } +} + +void real_buffer_stop() +{ + buffermem->justwait = TRUE; + buffer_sig(SIGINT, TRUE); +} + +extern int buffer_pid; + +void buffer_sig(int signal, int block) +{ + if (!buffermem) return; + + if (!block) + { /* Just signal, do not wait for anything. */ + kill(buffer_pid, signal); + return; + } + + /* kill() and the waiting needs to be taken care of properly for parallel execution. + Nobody reported issues so far, but I want to be sure. */ + if(xfermem_sigblock(XF_WRITER, buffermem, buffer_pid, signal) != XF_CMD_WAKEUP) + perror("Could not resync/reset buffers"); + return; +} + +void buffer_loop(audio_output_t *ao, sigset_t *oldsigset) +{ + int bytes, outbytes; + int my_fd = buffermem->fd[XF_READER]; + txfermem *xf = buffermem; + int done = FALSE; + int preload; + + catchsignal (SIGINT, catch_interrupt); + catchsignal (SIGUSR1, catch_usr1); + sigprocmask (SIG_SETMASK, oldsigset, NULL); + + xfermem_putcmd(my_fd, XF_CMD_WAKEUP); + + debug("audio output: waiting for cap requests"); + /* wait for audio setup queries */ + while(1) + { + int cmd; + cmd = xfermem_block(XF_READER, xf); + if(cmd == XF_CMD_AUDIOCAP) + { + ao->rate = xf->rate; + ao->channels = xf->channels; + ao->format = ao->get_formats(ao); + debug3("formats for %liHz/%ich: 0x%x", ao->rate, ao->channels, ao->format); + xf->format = ao->format; + xfermem_putcmd(my_fd, XF_CMD_AUDIOCAP); + } + else if(cmd == XF_CMD_WAKEUP) + { + debug("got wakeup... leaving config mode"); + xfermem_putcmd(buffermem->fd[XF_READER], XF_CMD_WAKEUP); + break; + } + else + { + error1("unexpected command %i", cmd); + return; + } + } + + /* Fill complete buffer on first run before starting to play. + * Live mp3 streams constantly approach buffer underrun otherwise. [dk] + */ + preload = (int)(param.preload*xf->size); + if(preload > xf->size) preload = xf->size; + if(preload < 0) preload = 0; + + for (;;) { + if (intflag) { + debug("handle intflag... flushing"); + intflag = FALSE; + ao->flush(ao); + /* Either prepare for waiting or empty buffer now. */ + if(!xf->justwait) xf->readindex = xf->freeindex; + else + { + int cmd; + debug("Prepare for waiting; draining command queue. (There's a lot of wakeup commands pending, usually.)"); + do + { + cmd = xfermem_getcmd(my_fd, FALSE); + /* debug1("drain: %i", cmd); */ + } while(cmd > 0); + } + if(xf->wakeme[XF_WRITER]) xfermem_putcmd(my_fd, XF_CMD_WAKEUP); + } + if (usr1flag) { + debug("handling usr1flag"); + usr1flag = FALSE; + /* close and re-open in order to flush + * the device's internal buffer before + * changing the sample rate. [OF] + */ + /* writer must block when sending SIGUSR1 + * or we will lose all data processed + * in the meantime! [dk] + */ + xf->readindex = xf->freeindex; + /* We've nailed down the new starting location - + * writer is now safe to go on. [dk] + */ + if (xf->wakeme[XF_WRITER]) + xfermem_putcmd(my_fd, XF_CMD_WAKEUP); + ao->rate = xf->rate; + ao->channels = xf->channels; + ao->format = xf->format; + if (reset_output(ao) < 0) { + error1("failed to reset audio: %s", strerror(errno)); + exit(1); + } + } + if ( (bytes = xfermem_get_usedspace(xf)) < outburst ) { + /* if we got a buffer underrun we first + * fill 1/8 of the buffer before continue/start + * playing */ + if (preload < xf->size>>3) + preload = xf->size>>3; + if(preload < outburst) + preload = outburst; + } + debug1("bytes: %i", bytes); + if(xf->justwait || bytes < preload) { + int cmd; + if (done && !bytes) { + break; + } + + if(xf->justwait || !done) { + + /* Don't spill into errno check below. */ + errno = 0; + cmd = xfermem_block(XF_READER, xf); + debug1("got %i", cmd); + switch(cmd) { + + /* More input pending. */ + case XF_CMD_WAKEUP_INFO: + continue; + /* Yes, we know buffer is low but + * know we don't care. + */ + case XF_CMD_WAKEUP: + break; /* Proceed playing. */ + case XF_CMD_ABORT: /* Immediate end, discard buffer contents. */ + return; /* Cleanup happens outside of buffer_loop()*/ + case XF_CMD_TERMINATE: /* Graceful end, playing stuff in buffer and then return. */ + debug("going to terminate"); + done = TRUE; + break; + case XF_CMD_RESYNC: + debug("ordered resync"); + if (param.outmode == DECODE_AUDIO) ao->flush(ao); + + xf->readindex = xf->freeindex; + if (xf->wakeme[XF_WRITER]) xfermem_putcmd(my_fd, XF_CMD_WAKEUP); + continue; + break; + case -1: + if(intflag || usr1flag) /* Got signal, handle it at top of loop... */ + { + debug("buffer interrupted"); + continue; + } + if(errno) + error1("Yuck! Error in buffer handling... or somewhere unexpected: %s", strerror(errno)); + done = TRUE; + xf->readindex = xf->freeindex; + xfermem_putcmd(xf->fd[XF_READER], XF_CMD_TERMINATE); + break; + default: + fprintf(stderr, "\nEh!? Received unknown command 0x%x in buffer process.\n", cmd); + } + } + } + /* Hack! The writer issues XF_CMD_WAKEUP when first adjust + * audio settings. We do not want to lower the preload mark + * just yet! + */ + if (xf->justwait || !bytes) + continue; + preload = outburst; /* set preload to lower mark */ + if (bytes > xf->size - xf->readindex) + bytes = xf->size - xf->readindex; + if (bytes > outburst) + bytes = outburst; + + debug("write"); + outbytes = flush_output(ao, (unsigned char*) xf->data + xf->readindex, bytes); + + if(outbytes < bytes) + { + if(outbytes < 0) outbytes = 0; + if(!intflag && !usr1flag) { + error1("Ouch ... error while writing audio data: %s", strerror(errno)); + /* + * done==TRUE tells writer process to stop + * sending data. There might be some latency + * involved when resetting readindex to + * freeindex so we might need more than one + * cycle to terminate. (The number of cycles + * should be finite unless I managed to mess + * up something. ;-) [dk] + */ + done = TRUE; + xf->readindex = xf->freeindex; + xfermem_putcmd(xf->fd[XF_READER], XF_CMD_TERMINATE); + } + else debug("buffer interrupted"); + } + bytes = outbytes; + + xf->readindex = (xf->readindex + bytes) % xf->size; + if (xf->wakeme[XF_WRITER]) + xfermem_putcmd(my_fd, XF_CMD_WAKEUP); + } +} + +#endif + +/* EOF */ diff --git a/node_modules/lame/deps/mpg123/src/buffer.h b/node_modules/lame/deps/mpg123/src/buffer.h new file mode 100644 index 0000000..f0d6ffe --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/buffer.h @@ -0,0 +1,45 @@ +/* + buffer.h: output buffer + + copyright 1999-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Daniel Kobras / Oliver Fromme +*/ + +/* + * Application specific interaction between main and buffer + * process. This is much less generic than the functions in + * xfermem so I chose to put it in buffer.[hc]. + * 01/28/99 [dk] + */ + +#ifndef _MPG123_BUFFER_H_ +#define _MPG123_BUFFER_H_ + +#ifndef NOXFERMEM +void real_buffer_ignore_lowmem(void); +void real_buffer_end(int rude); +void real_buffer_resync(void); +void real_plain_buffer_resync(void); +void real_buffer_reset(void); +void real_buffer_start(void); +void real_buffer_stop(void); +/* Hm, that's funny preprocessor weirdness. */ +#define buffer_start() (param.usebuffer ? real_buffer_start(),0 : 0) +#define buffer_stop() (param.usebuffer ? real_buffer_stop(),0 : 0) +#define buffer_reset() (param.usebuffer ? real_buffer_reset(),0 : 0) +#define buffer_resync() (param.usebuffer ? real_buffer_resync(),0 : 0) +#define plain_buffer_resync() (param.usebuffer ? real_plain_buffer_resync(),0 : 0) +#define buffer_end(a) (param.usebuffer ? real_buffer_end(a),0 : 0) +#define buffer_ignore_lowmem() (param.usebuffer ? real_buffer_ignore_lowmem(),0 : 0) +#else +#define buffer_start() +#define buffer_stop() +#define buffer_reset() +#define buffer_resync() +#define plain_buffer_resync() +#define buffer_end() +#define buffer_ignore_lowmem() +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/src/common.c b/node_modules/lame/deps/mpg123/src/common.c new file mode 100644 index 0000000..9856202 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/common.c @@ -0,0 +1,240 @@ +/* + common: misc stuff... audio flush, status display... + + copyright ?-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +#include "mpg123app.h" +#include +#include +#include "common.h" + +#include "debug.h" + +const char* rva_name[3] = { "off", "mix", "album" }; +static const char *modes[5] = {"Stereo", "Joint-Stereo", "Dual-Channel", "Single-Channel", "Invalid" }; +static const char *smodes[5] = { "stereo", "joint-stereo", "dual-channel", "mono", "invalid" }; +static const char *layers[4] = { "Unknown" , "I", "II", "III" }; +static const char *versions[4] = {"1.0", "2.0", "2.5", "x.x" }; +static const int samples_per_frame[4][4] = +{ + { -1,384,1152,1152 }, /* MPEG 1 */ + { -1,384,1152,576 }, /* MPEG 2 */ + { -1,384,1152,576 }, /* MPEG 2.5 */ + { -1,-1,-1,-1 }, /* Unknown */ +}; + + +#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H) +void (*catchsignal(int signum, void(*handler)()))() +{ + struct sigaction new_sa; + struct sigaction old_sa; + +#ifdef DONT_CATCH_SIGNALS + fprintf (stderr, "Not catching any signals.\n"); + return ((void (*)()) -1); +#endif + + new_sa.sa_handler = handler; + sigemptyset(&new_sa.sa_mask); + new_sa.sa_flags = 0; + if (sigaction(signum, &new_sa, &old_sa) == -1) + return ((void (*)()) -1); + return (old_sa.sa_handler); +} +#endif + +/* concurring to print_rheader... here for control_generic */ +const char* remote_header_help = "S "; +void print_remote_header(mpg123_handle *mh) +{ + struct mpg123_frameinfo i; + mpg123_info(mh, &i); + if(i.mode >= 4 || i.mode < 0) i.mode = 4; + if(i.version >= 3 || i.version < 0) i.version = 3; + generic_sendmsg("S %s %d %ld %s %d %d %d %d %d %d %d %d %d", + versions[i.version], + i.layer, + i.rate, + modes[i.mode], + i.mode_ext, + i.framesize, + i.mode == MPG123_M_MONO ? 1 : 2, + i.flags & MPG123_COPYRIGHT ? 1 : 0, + i.flags & MPG123_CRC ? 1 : 0, + i.emphasis, + i.bitrate, + i.flags & MPG123_PRIVATE ? 1 : 0, + i.vbr); +} + +void print_header(mpg123_handle *mh) +{ + struct mpg123_frameinfo i; + mpg123_info(mh, &i); + if(i.mode > 4 || i.mode < 0) i.mode = 4; + if(i.version > 3 || i.version < 0) i.version = 3; + if(i.layer > 3 || i.layer < 0) i.layer = 0; + fprintf(stderr,"MPEG %s, Layer: %s, Freq: %ld, mode: %s, modext: %d, BPF : %d\n", + versions[i.version], + layers[i.layer], i.rate, + modes[i.mode],i.mode_ext,i.framesize); + fprintf(stderr,"Channels: %d, copyright: %s, original: %s, CRC: %s, emphasis: %d.\n", + i.mode == MPG123_M_MONO ? 1 : 2,i.flags & MPG123_COPYRIGHT ? "Yes" : "No", + i.flags & MPG123_ORIGINAL ? "Yes" : "No", i.flags & MPG123_CRC ? "Yes" : "No", + i.emphasis); + fprintf(stderr,"Bitrate: "); + switch(i.vbr) + { + case MPG123_CBR: + if(i.bitrate) fprintf(stderr, "%d kbit/s", i.bitrate); + else fprintf(stderr, "%d kbit/s (free format)", (int)((double)(i.framesize+4)*8*i.rate*0.001/samples_per_frame[i.version][i.layer]+0.5)); + break; + case MPG123_VBR: fprintf(stderr, "VBR"); break; + case MPG123_ABR: fprintf(stderr, "%d kbit/s ABR", i.abr_rate); break; + default: fprintf(stderr, "???"); + } + fprintf(stderr, " Extension value: %d\n", i.flags & MPG123_PRIVATE ? 1 : 0); +} + +void print_header_compact(mpg123_handle *mh) +{ + struct mpg123_frameinfo i; + mpg123_info(mh, &i); + if(i.mode > 4 || i.mode < 0) i.mode = 4; + if(i.version > 3 || i.version < 0) i.version = 3; + if(i.layer > 3 || i.layer < 0) i.layer = 0; + + fprintf(stderr,"MPEG %s layer %s, ", versions[i.version], layers[i.layer]); + switch(i.vbr) + { + case MPG123_CBR: + if(i.bitrate) fprintf(stderr, "%d kbit/s", i.bitrate); + else fprintf(stderr, "%d kbit/s (free format)", (int)((double)i.framesize*8*i.rate*0.001/samples_per_frame[i.version][i.layer]+0.5)); + break; + case MPG123_VBR: fprintf(stderr, "VBR"); break; + case MPG123_ABR: fprintf(stderr, "%d kbit/s ABR", i.abr_rate); break; + default: fprintf(stderr, "???"); + } + fprintf(stderr,", %ld Hz %s\n", i.rate, smodes[i.mode]); +} + +#if 0 +/* removed the strndup for better portability */ +/* + * Allocate space for a new string containing the first + * "num" characters of "src". The resulting string is + * always zero-terminated. Returns NULL if malloc fails. + */ +char *strndup (const char *src, int num) +{ + char *dst; + + if (!(dst = (char *) malloc(num+1))) + return (NULL); + dst[num] = '\0'; + return (strncpy(dst, src, num)); +} +#endif + +/* + * Split "path" into directory and filename components. + * + * Return value is 0 if no directory was specified (i.e. + * "path" does not contain a '/'), OR if the directory + * is the same as on the previous call to this function. + * + * Return value is 1 if a directory was specified AND it + * is different from the previous one (if any). + */ + +int split_dir_file (const char *path, char **dname, char **fname) +{ + static char *lastdir = NULL; + char *slashpos; + + if ((slashpos = strrchr(path, '/'))) { + *fname = slashpos + 1; + *dname = strdup(path); /* , 1 + slashpos - path); */ + if(!(*dname)) { + perror("failed to allocate memory for dir name"); + return 0; + } + (*dname)[1 + slashpos - path] = 0; + if (lastdir && !strcmp(lastdir, *dname)) { + /*** same as previous directory ***/ + free (*dname); + *dname = lastdir; + return 0; + } + else { + /*** different directory ***/ + if (lastdir) + free (lastdir); + lastdir = *dname; + return 1; + } + } + else { + /*** no directory specified ***/ + if (lastdir) { + free (lastdir); + lastdir = NULL; + }; + *dname = NULL; + *fname = (char *)path; + return 0; + } +} + +unsigned int roundui(double val) +{ + double base = floor(val); + return (unsigned int) ((val-base) < 0.5 ? base : base + 1 ); +} + +void print_stat(mpg123_handle *fr, long offset, long buffsize) +{ + double tim1,tim2; + off_t rno, no; + double basevol, realvol; + char *icy; +#ifndef WIN32 +#ifndef GENERIC +/* Only generate new stat line when stderr is ready... don't overfill... */ + { + struct timeval t; + fd_set serr; + int n,errfd = fileno(stderr); + + t.tv_sec=t.tv_usec=0; + + FD_ZERO(&serr); + FD_SET(errfd,&serr); + n = select(errfd+1,NULL,&serr,NULL,&t); + if(n <= 0) return; + } +#endif +#endif + if( MPG123_OK == mpg123_position(fr, offset, buffsize, &no, &rno, &tim1, &tim2) + && MPG123_OK == mpg123_getvolume(fr, &basevol, &realvol, NULL) ) + { + fprintf(stderr, "\rFrame# %5"OFF_P" [%5"OFF_P"], Time: %02lu:%02u.%02u [%02u:%02u.%02u], RVA:%6s, Vol: %3u(%3u)", + (off_p)no, (off_p)rno, + (unsigned long) tim1/60, (unsigned int)tim1%60, (unsigned int)(tim1*100)%100, + (unsigned int)tim2/60, (unsigned int)tim2%60, (unsigned int)(tim2*100)%100, + rva_name[param.rva], roundui(basevol*100), roundui(realvol*100) ); + if(param.usebuffer) fprintf(stderr,", [%8ld] ",(long)buffsize); + } + /* Check for changed tags here too? */ + if( mpg123_meta_check(fr) & MPG123_NEW_ICY && MPG123_OK == mpg123_icy(fr, &icy) ) + fprintf(stderr, "\nICY-META: %s\n", icy); +} + +void clear_stat() +{ + fprintf(stderr, "\r \r"); +} diff --git a/node_modules/lame/deps/mpg123/src/common.h b/node_modules/lame/deps/mpg123/src/common.h new file mode 100644 index 0000000..3f1fba9 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/common.h @@ -0,0 +1,29 @@ +/* + common: anything can happen here... frame reading, output, messages + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +#ifndef _MPG123_COMMON_H_ +#define _MPG123_COMMON_H_ + +#include "mpg123app.h" + +void (*catchsignal(int signum, void(*handler)()))(); + +void print_header(mpg123_handle *); +void print_header_compact(mpg123_handle *); +void print_stat(mpg123_handle *fr, long offset, long buffsize); +void clear_stat(); +/* for control_generic */ +extern const char* remote_header_help; +void print_remote_header(mpg123_handle *mh); +void generic_sendmsg (const char *fmt, ...); + +int split_dir_file(const char *path, char **dname, char **fname); + +extern const char* rva_name[3]; +#endif + diff --git a/node_modules/lame/deps/mpg123/src/config.h.in b/node_modules/lame/deps/mpg123/src/config.h.in new file mode 100644 index 0000000..249fe27 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/config.h.in @@ -0,0 +1,436 @@ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if your architecture wants/needs/can use attribute_align_arg and + alignment checks. It is for 32bit x86... */ +#undef ABI_ALIGN_FUN + +/* Define to use proper rounding. */ +#undef ACCURATE_ROUNDING + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */ +#undef ASMALIGN_EXP + +/* Define if __attribute__((aligned(16))) shall be used */ +#undef CCALIGN + +/* Define if debugging is enabled. */ +#undef DEBUG + +/* The default audio output module(s) to use */ +#undef DEFAULT_OUTPUT_MODULE + +/* Define if building with dynamcally linked libmpg123 */ +#undef DYNAMIC_BUILD + +/* Define if FIFO support is enabled. */ +#undef FIFO + +/* Define if frame index should be used. */ +#undef FRAME_INDEX + +/* Define if gapless is enabled. */ +#undef GAPLESS + +/* Define to 1 if you have the header file. */ +#undef HAVE_ALC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ALIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AL_ALC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AL_AL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASM_AUDIOIO_H + +/* Define to 1 if you have the `atoll' function. */ +#undef HAVE_ATOLL + +/* Define to 1 if you have the header file. */ +#undef HAVE_AUDIOS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_AUDIOUNIT_AUDIOUNIT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CORESERVICES_CORESERVICES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CULIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */ +#undef HAVE_GAI_ADDRCONFIG + +/* Define to 1 if you have the `getaddrinfo' function. */ +#undef HAVE_GETADDRINFO + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the `getuid' function. */ +#undef HAVE_GETUID + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LANGINFO_H + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the `mx' library (-lmx). */ +#undef HAVE_LIBMX + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_SOUNDCARD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define if libltdl is available */ +#undef HAVE_LTDL + +/* Define to 1 if you have the header file. */ +#undef HAVE_MACHINE_SOUNDCARD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mkfifo' function. */ +#undef HAVE_MKFIFO + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_TCP_H + +/* Define to 1 if you have the `nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENAL_ALC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENAL_AL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OS2ME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OS2_H + +/* Define to 1 if you have the `random' function. */ +#undef HAVE_RANDOM + +/* Define to 1 if you have the header file. */ +#undef HAVE_SCHED_H + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#undef HAVE_SCHED_SETSCHEDULER + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the `setpriority' function. */ +#undef HAVE_SETPRIORITY + +/* Define to 1 if you have the `setuid' function. */ +#undef HAVE_SETUID + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SNDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SUN_AUDIOIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_AUDIOIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_AUDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SIGNAL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOUNDCARD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define this if you have the POSIX termios library */ +#undef HAVE_TERMIOS + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WINDOWS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WS2TCPIP_H + +/* Define to indicate that float storage follows IEEE754. */ +#undef IEEE_FLOAT + +/* size of the frame index seek table */ +#undef INDEX_SIZE + +/* Define if IPV6 support is enabled. */ +#undef IPV6 + +/* Define this to the size of long type in bits, used for LFS small/native + alias functions. */ +#undef LFS_ALIAS_BITS + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* The suffix for module files. */ +#undef MODULE_FILE_SUFFIX + +/* Define if network support is enabled. */ +#undef NETWORK + +/* Define to disable 16 bit integer output. */ +#undef NO_16BIT + +/* Define to disable 32 bit and 24 bit integer output. */ +#undef NO_32BIT + +/* Define to disable 8 bit integer output. */ +#undef NO_8BIT + +/* Define to disable downsampled decoding. */ +#undef NO_DOWNSAMPLE + +/* Define to disable error messages in combination with a return value (the + return is left intact). */ +#undef NO_ERETURN + +/* Define to disable error messages. */ +#undef NO_ERRORMSG + +/* Define to disable feeder and buffered readers. */ +#undef NO_FEEDER + +/* Define to disable ICY handling. */ +#undef NO_ICY + +/* Define to disable ID3v2 parsing. */ +#undef NO_ID3V2 + +/* Define to disable layer I. */ +#undef NO_LAYER1 + +/* Define to disable layer II. */ +#undef NO_LAYER2 + +/* Define to disable layer III. */ +#undef NO_LAYER3 + +/* Define to disable ntom resampling. */ +#undef NO_NTOM + +/* Define to disable real output. */ +#undef NO_REAL + +/* Define to disable string functions. */ +#undef NO_STRING + +/* Define to disable warning messages. */ +#undef NO_WARNING + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define if portaudio v18 API is wanted. */ +#undef PORTAUDIO18 + +/* The size of `int32_t', as computed by sizeof. */ +#undef SIZEOF_INT32_T + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of `off_t', as computed by sizeof. */ +#undef SIZEOF_OFF_T + +/* The size of `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + +/* The size of `ssize_t', as computed by sizeof. */ +#undef SIZEOF_SSIZE_T + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if modules are enabled */ +#undef USE_MODULES + +/* Version number of package */ +#undef VERSION + +/* Define to use Win32 named pipes */ +#undef WANT_WIN32_FIFO + +/* Define to use Win32 sockets */ +#undef WANT_WIN32_SOCKETS + +/* Define to use Unicode for Windows */ +#undef WANT_WIN32_UNICODE + +/* WinXP and above for ipv6 */ +#undef WINVER + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* WinXP and above for ipv6 */ +#undef _WIN32_WINNT + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `short' if does not define. */ +#undef int16_t + +/* Define to `int' if does not define. */ +#undef int32_t + +/* Define to `long int' if does not define. */ +#undef off_t + +/* Define to `unsigned long' if does not define. */ +#undef size_t + +/* Define to `long' if does not define. */ +#undef ssize_t + +/* Define to `unsigned short' if does not define. */ +#undef uint16_t + +/* Define to `unsigned int' if does not define. */ +#undef uint32_t + +/* Define to `unsigned long' if does not define. */ +#undef uintptr_t diff --git a/node_modules/lame/deps/mpg123/src/control_generic.c b/node_modules/lame/deps/mpg123/src/control_generic.c new file mode 100644 index 0000000..3620840 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/control_generic.c @@ -0,0 +1,809 @@ +/* + control_generic.c: control interface for frontends and real console warriors + + copyright 1997-99,2004-8 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Andreas Neuhaus and Michael Hipp + reworked by Thomas Orgis - it was the entry point for eventually becoming maintainer... +*/ + +#include "mpg123app.h" +#include +#include +#if !defined (WIN32) || defined (__CYGWIN__) +#include +#include +#endif +#include +#include +#include + +#include "common.h" +#include "buffer.h" +#include "genre.h" +#include "playlist.h" +#define MODE_STOPPED 0 +#define MODE_PLAYING 1 +#define MODE_PAUSED 2 + +extern int buffer_pid; +extern audio_output_t *ao; + +#ifdef FIFO +#include +int control_file = STDIN_FILENO; +#else +#define control_file STDIN_FILENO +#ifdef WANT_WIN32_FIFO +#error Control interface does not work on win32 stdin +#endif /* WANT_WIN32_FIFO */ +#endif +FILE *outstream; +static int mode = MODE_STOPPED; +static int init = 0; + +#include "debug.h" + +void generic_sendmsg (const char *fmt, ...) +{ + va_list ap; + fprintf(outstream, "@"); + va_start(ap, fmt); + vfprintf(outstream, fmt, ap); + va_end(ap); + fprintf(outstream, "\n"); +} + +/* Split up a number of lines separated by \n, \r, both or just zero byte + and print out each line with specified prefix. */ +static void generic_send_lines(const char* fmt, mpg123_string *inlines) +{ + size_t i; + int hadcr = 0, hadlf = 0; + char *lines = NULL; + char *line = NULL; + size_t len = 0; + + if(inlines != NULL && inlines->fill) + { + lines = inlines->p; + len = inlines->fill; + } + else return; + + line = lines; + for(i=0; ititle, 30); + memcpy(info+30, v1->artist, 30); + memcpy(info+60, v1->album, 30); + memcpy(info+90, v1->year, 4); + memcpy(info+94, v1->comment, 30); + + for(i=0;i<124; ++i) if(info[i] == 0) info[i] = ' '; + info[i] = 0; + generic_sendmsg("%s ID3:%s%s", prefix, info, (v1->genre<=genre_count) ? genre_table[v1->genre] : "Unknown"); + generic_sendmsg("%s ID3.genre:%i", prefix, v1->genre); + if(v1->comment[28] == 0 && v1->comment[29] != 0) + generic_sendmsg("%s ID3.track:%i", prefix, (unsigned char)v1->comment[29]); +} + +static void generic_sendinfoid3(mpg123_handle *mh) +{ + mpg123_id3v1 *v1; + mpg123_id3v2 *v2; + if(MPG123_OK != mpg123_id3(mh, &v1, &v2)) + { + error1("Cannot get ID3 data: %s", mpg123_strerror(mh)); + return; + } + if(v1 != NULL) + { + generic_sendv1(v1, "I"); + } + if(v2 != NULL) + { + generic_send_lines("I ID3v2.title:%s", v2->title); + generic_send_lines("I ID3v2.artist:%s", v2->artist); + generic_send_lines("I ID3v2.album:%s", v2->album); + generic_send_lines("I ID3v2.year:%s", v2->year); + generic_send_lines("I ID3v2.comment:%s", v2->comment); + generic_send_lines("I ID3v2.genre:%s", v2->genre); + } +} + +void generic_sendalltag(mpg123_handle *mh) +{ + mpg123_id3v1 *v1; + mpg123_id3v2 *v2; + generic_sendmsg("T {"); + if(MPG123_OK != mpg123_id3(mh, &v1, &v2)) + { + error1("Cannot get ID3 data: %s", mpg123_strerror(mh)); + v2 = NULL; + v1 = NULL; + } + if(v1 != NULL) generic_sendv1(v1, "T"); + + if(v2 != NULL) + { + size_t i; + for(i=0; itexts; ++i) + { + char id[5]; + memcpy(id, v2->text[i].id, 4); + id[4] = 0; + generic_sendmsg("T ID3v2.%s:", id); + generic_send_lines("T =%s", &v2->text[i].text); + } + for(i=0; iextras; ++i) + { + char id[5]; + memcpy(id, v2->extra[i].id, 4); + id[4] = 0; + generic_sendmsg("T ID3v2.%s desc(%s):", + id, + v2->extra[i].description.fill ? v2->extra[i].description.p : "" ); + generic_send_lines("T =%s", &v2->extra[i].text); + } + for(i=0; icomments; ++i) + { + char id[5]; + char lang[4]; + memcpy(id, v2->comment_list[i].id, 4); + id[4] = 0; + memcpy(lang, v2->comment_list[i].lang, 3); + lang[3] = 0; + generic_sendmsg("T ID3v2.%s lang(%s) desc(%s):", + id, lang, + v2->comment_list[i].description.fill ? v2->comment_list[i].description.p : ""); + generic_send_lines("T =%s", &v2->comment_list[i].text); + } + } + generic_sendmsg("T }"); +} + +void generic_sendinfo (char *filename) +{ + char *s, *t; + s = strrchr(filename, '/'); + if (!s) + s = filename; + else + s++; + t = strrchr(s, '.'); + if (t) + *t = 0; + generic_sendmsg("I %s", s); +} + +static void generic_load(mpg123_handle *fr, char *arg, int state) +{ + if(param.usebuffer) + { + buffer_resync(); + if(mode == MODE_PAUSED && state != MODE_PAUSED) buffer_start(); + } + if(mode != MODE_STOPPED) + { + close_track(); + mode = MODE_STOPPED; + } + if(!open_track(arg)) + { + generic_sendmsg("E Error opening stream: %s", arg); + generic_sendmsg("P 0"); + return; + } + mpg123_seek(fr, 0, SEEK_SET); /* This finds ID3v2 at beginning. */ + if(mpg123_meta_check(fr) & MPG123_NEW_ID3) + { + generic_sendinfoid3(fr); + mpg123_meta_free(fr); + } + else generic_sendinfo(arg); + + if(htd.icy_name.fill) generic_sendmsg("I ICY-NAME: %s", htd.icy_name.p); + if(htd.icy_url.fill) generic_sendmsg("I ICY-URL: %s", htd.icy_url.p); + + mode = state; + init = 1; + generic_sendmsg(mode == MODE_PAUSED ? "P 1" : "P 2"); +} + +static void generic_loadlist(mpg123_handle *fr, char *arg) +{ + /* arguments are two: first the index to play, then the URL */ + long entry; + long i = 0; + char *file = NULL; + char *thefile = NULL; + + /* I feel retarted with string parsing outside Perl. */ + while(*arg && isspace(*arg)) ++arg; + entry = atol(arg); + while(*arg && !isspace(*arg)) ++arg; + while(*arg && isspace(*arg)) ++arg; + if(!*arg) + { + generic_sendmsg("E empty list name"); + return; + } + + /* Now got the plain playlist path in arg. On to evil manupulation of mpg123's playlist code. */ + param.listname = arg; + param.listentry = 0; /* The playlist shall not filter. */ + prepare_playlist(0, NULL); + while((file = get_next_file())) + { + ++i; + /* semantics: 0 brings you to the last track */ + if(entry == 0 || entry == i) thefile = file; + + generic_sendmsg("I LISTENTRY %li: %s", i, file); + } + if(!i) generic_sendmsg("I LIST EMPTY"); + + /* If we have something to play, play it. */ + if(thefile) generic_load(fr, thefile, MODE_PLAYING); + + free_playlist(); /* Free memory after it is not needed anymore. */ +} + +int control_generic (mpg123_handle *fr) +{ + struct timeval tv; + fd_set fds; + int n; + + /* ThOr */ + char alive = 1; + char silent = 0; + + /* responses to stderr for frontends needing audio data from stdout */ + if (param.remote_err) + outstream = stderr; + else + outstream = stdout; + +#ifndef WIN32 + setlinebuf(outstream); +#else /* perhaps just use setvbuf as it's C89 */ + /* + fprintf(outstream, "You are on Win32 and want to use the control interface... tough luck: We need a replacement for select on STDIN first.\n"); + return 0; + setvbuf(outstream, (char*)NULL, _IOLBF, 0); + */ +#endif + /* the command behaviour is different, so is the ID */ + /* now also with version for command availability */ + fprintf(outstream, "@R MPG123 (ThOr) v7\n"); +#ifdef FIFO + if(param.fifo) + { + if(param.fifo[0] == 0) + { + error("You wanted an empty FIFO name??"); + return 1; + } +#ifndef WANT_WIN32_FIFO + unlink(param.fifo); + if(mkfifo(param.fifo, 0666) == -1) + { + error2("Failed to create FIFO at %s (%s)", param.fifo, strerror(errno)); + return 1; + } + debug("going to open named pipe ... blocking until someone gives command"); +#endif /* WANT_WIN32_FIFO */ +#ifdef WANT_WIN32_FIFO + control_file = win32_fifo_mkfifo(param.fifo); +#else + control_file = open(param.fifo,O_RDONLY); +#endif /* WANT_WIN32_FIFO */ + debug("opened"); + } +#endif + + while (alive) + { + tv.tv_sec = 0; + tv.tv_usec = 0; + FD_ZERO(&fds); + FD_SET(control_file, &fds); + /* play frame if no command needs to be processed */ + if (mode == MODE_PLAYING) { +#ifdef WANT_WIN32_FIFO + n = win32_fifo_read_peek(&tv); +#else + n = select(32, &fds, NULL, NULL, &tv); +#endif + if (n == 0) { + if (!play_frame()) + { + /* When the track ended, user may want to keep it open (to seek back), + so there is a decision between stopping and pausing at the end. */ + if(param.keep_open) + { + mode = MODE_PAUSED; + /* Hm, buffer should be stopped already, shouldn't it? */ + if(param.usebuffer) buffer_stop(); + generic_sendmsg("P 1"); + } + else + { + mode = MODE_STOPPED; + close_track(); + generic_sendmsg("P 0"); + } + continue; + } + if (init) { + print_remote_header(fr); + init = 0; + } + if(silent == 0) + { + generic_sendstat(fr); + if(mpg123_meta_check(fr) & MPG123_NEW_ICY) + { + char *meta; + if(mpg123_icy(fr, &meta) == MPG123_OK) + generic_sendmsg("I ICY-META: %s", meta != NULL ? meta : ""); + } + } + } + } + else { + /* wait for command */ + while (1) { +#ifdef WANT_WIN32_FIFO + n = win32_fifo_read_peek(NULL); +#else + n = select(32, &fds, NULL, NULL, NULL); +#endif + if (n > 0) + break; + } + } + + /* on error */ + if (n < 0) { + fprintf(stderr, "Error waiting for command: %s\n", strerror(errno)); + return 1; + } + + /* read & process commands */ + if (n > 0) + { + short int len = 1; /* length of buffer */ + char *cmd, *arg; /* variables for parsing, */ + char *comstr = NULL; /* gcc thinks that this could be used uninitialited... */ + char buf[REMOTE_BUFFER_SIZE]; + short int counter; + char *next_comstr = buf; /* have it initialized for first command */ + + /* read as much as possible, maybe multiple commands */ + /* When there is nothing to read (EOF) or even an error, it is the end */ +#ifdef WANT_WIN32_FIFO + len = win32_fifo_read(buf,REMOTE_BUFFER_SIZE); +#else + len = read(control_file, buf, REMOTE_BUFFER_SIZE); +#endif + if(len < 1) + { +#ifdef FIFO + if(len == 0 && param.fifo) + { + debug("fifo ended... reopening"); +#ifdef WANT_WIN32_FIFO + win32_fifo_mkfifo(param.fifo); +#else + close(control_file); + control_file = open(param.fifo,O_RDONLY|O_NONBLOCK); +#endif + if(control_file < 0){ error1("open of fifo failed... %s", strerror(errno)); break; } + continue; + } +#endif + if(len < 0) error1("command read error: %s", strerror(errno)); + break; + } + + debug1("read %i bytes of commands", len); + /* one command on a line - separation by \n -> C strings in a row */ + for(counter = 0; counter < len; ++counter) + { + /* line end is command end */ + if( (buf[counter] == '\n') || (buf[counter] == '\r') ) + { + debug1("line end at counter=%i", counter); + buf[counter] = 0; /* now it's a properly ending C string */ + comstr = next_comstr; + + /* skip the additional line ender of \r\n or \n\r */ + if( (counter < (len - 1)) && ((buf[counter+1] == '\n') || (buf[counter+1] == '\r')) ) buf[++counter] = 0; + + /* next "real" char is first of next command */ + next_comstr = buf + counter+1; + + /* directly process the command now */ + debug1("interpreting command: %s", comstr); + if(strlen(comstr) == 0) continue; + + /* PAUSE */ + if (!strcasecmp(comstr, "P") || !strcasecmp(comstr, "PAUSE")) { + if(mode != MODE_STOPPED) + { + if (mode == MODE_PLAYING) { + mode = MODE_PAUSED; + if(param.usebuffer) buffer_stop(); + generic_sendmsg("P 1"); + } else { + mode = MODE_PLAYING; + if(param.usebuffer) buffer_start(); + generic_sendmsg("P 2"); + } + } else generic_sendmsg("P 0"); + continue; + } + + /* STOP */ + if (!strcasecmp(comstr, "S") || !strcasecmp(comstr, "STOP")) { + if (mode != MODE_STOPPED) { + if(param.usebuffer) + { + buffer_stop(); + buffer_resync(); + } + close_track(); + mode = MODE_STOPPED; + generic_sendmsg("P 0"); + } else generic_sendmsg("P 0"); + continue; + } + + /* SILENCE */ + if(!strcasecmp(comstr, "SILENCE")) { + silent = 1; + generic_sendmsg("silence"); + continue; + } + + if(!strcasecmp(comstr, "T") || !strcasecmp(comstr, "TAG")) { + generic_sendalltag(fr); + continue; + } + + if(!strcasecmp(comstr, "SCAN")) + { + if(mode != MODE_STOPPED) + { + if(mpg123_scan(fr) == MPG123_OK) + generic_sendmsg("SCAN done"); + else + generic_sendmsg("E %s", mpg123_strerror(fr)); + } + else generic_sendmsg("E No track loaded!"); + + continue; + } + + if(!strcasecmp(comstr, "SAMPLE")) + { + off_t pos = mpg123_tell(fr); + off_t len = mpg123_length(fr); + /* I need to have portable printf specifiers that do not truncate the type... more autoconf... */ + if(len < 0) generic_sendmsg("E %s", mpg123_strerror(fr)); + else generic_sendmsg("SAMPLE %li %li", (long)pos, (long)len); + continue; + } + + if(!strcasecmp(comstr, "SHOWEQ")) + { + int i; + generic_sendmsg("SHOWEQ {"); + for(i=0; i<32; ++i) + { + generic_sendmsg("SHOWEQ %i : %i : %f", MPG123_LEFT, i, mpg123_geteq(fr, MPG123_LEFT, i)); + generic_sendmsg("SHOWEQ %i : %i : %f", MPG123_RIGHT, i, mpg123_geteq(fr, MPG123_RIGHT, i)); + } + generic_sendmsg("SHOWEQ }"); + continue; + } + + if(!strcasecmp(comstr, "STATE")) + { + long val; + generic_sendmsg("STATE {"); + /* Get some state information bits and display them. */ + if(mpg123_getstate(fr, MPG123_ACCURATE, &val, NULL) == MPG123_OK) + generic_sendmsg("STATE accurate %li", val); + + generic_sendmsg("STATE }"); + continue; + } + + /* QUIT */ + if (!strcasecmp(comstr, "Q") || !strcasecmp(comstr, "QUIT")){ + alive = FALSE; continue; + } + + /* some HELP */ + if (!strcasecmp(comstr, "H") || !strcasecmp(comstr, "HELP")) { + generic_sendmsg("H {"); + generic_sendmsg("H HELP/H: command listing (LONG/SHORT forms), command case insensitve"); + generic_sendmsg("H LOAD/L : load and start playing resource "); + generic_sendmsg("H LOADPAUSED/LP : load but do not start playing resource "); + generic_sendmsg("H LOADLIST : load a playlist from given , and display its entries, optionally load and play one of these specificed by the integer (<0: just list, 0: play last track, >0:play track with that position in list)"); + generic_sendmsg("H PAUSE/P: pause playback"); + generic_sendmsg("H STOP/S: stop playback (closes file)"); + generic_sendmsg("H JUMP/J |<+offset>|<-offset>|<[+|-]seconds>s: jump to mpeg frame or change position by offset, same in seconds if number followed by \"s\""); + generic_sendmsg("H VOLUME/V : set volume in % (0..100...); float value"); + generic_sendmsg("H RVA off|(mix|radio)|(album|audiophile): set rva mode"); + generic_sendmsg("H EQ/E : set equalizer value for frequency band 0 to 31 on channel %i (left) or %i (right) or %i (both)", MPG123_LEFT, MPG123_RIGHT, MPG123_LR); + generic_sendmsg("H EQFILE : load EQ settings from a file"); + generic_sendmsg("H SHOWEQ: show all equalizer settings (as lines in a SHOWEQ block (like TAG))"); + generic_sendmsg("H SEEK/K |<+offset>|<-offset>: jump to output sample position or change position by offset"); + generic_sendmsg("H SCAN: scan through the file, building seek index"); + generic_sendmsg("H SAMPLE: print out the sample position and total number of samples"); + generic_sendmsg("H SEQ : simple eq setting..."); + generic_sendmsg("H PITCH <[+|-]value>: adjust playback speed (+0.01 is 1 %% faster)"); + generic_sendmsg("H SILENCE: be silent during playback (meaning silence in text form)"); + generic_sendmsg("H STATE: Print auxiliary state info in several lines (just try it to see what info is there)."); + generic_sendmsg("H TAG/T: Print all available (ID3) tag info, for ID3v2 that gives output of all collected text fields, using the ID3v2.3/4 4-character names."); + generic_sendmsg("H The output is multiple lines, begin marked by \"@T {\", end by \"@T }\"."); + generic_sendmsg("H ID3v1 data is like in the @I info lines (see below), just with \"@T\" in front."); + generic_sendmsg("H An ID3v2 data field is introduced via ([ ... ] means optional):"); + generic_sendmsg("H @T ID3v2.[ [lang()] desc()]:"); + generic_sendmsg("H The lines of data follow with \"=\" prefixed:"); + generic_sendmsg("H @T ="); + generic_sendmsg("H meaning of the @S stream info:"); + generic_sendmsg("H %s", remote_header_help); + generic_sendmsg("H The @I lines after loading a track give some ID3 info, the format:"); + generic_sendmsg("H @I ID3:artist album year comment genretext"); + generic_sendmsg("H where artist,album and comment are exactly 30 characters each, year is 4 characters, genre text unspecified."); + generic_sendmsg("H You will encounter \"@I ID3.genre:\" and \"@I ID3.track:\"."); + generic_sendmsg("H Then, there is an excerpt of ID3v2 info in the structure"); + generic_sendmsg("H @I ID3v2.title:Blabla bla Bla"); + generic_sendmsg("H for every line of the \"title\" data field. Likewise for other fields (author, album, etc)."); + generic_sendmsg("H }"); + continue; + } + + /* commands with arguments */ + cmd = NULL; + arg = NULL; + cmd = strtok(comstr," \t"); /* get the main command */ + arg = strtok(NULL,""); /* get the args */ + + if (cmd && strlen(cmd) && arg && strlen(arg)) + { + /* Simple EQ: SEQ */ + if (!strcasecmp(cmd, "SEQ")) { + double b,m,t; + int cn; + if(sscanf(arg, "%lf %lf %lf", &b, &m, &t) == 3) + { + /* Consider adding mpg123_seq()... but also, on could define a nicer courve for that. */ + if ((t >= 0) && (t <= 3)) + for(cn=0; cn < 1; ++cn) mpg123_eq(fr, MPG123_LEFT|MPG123_RIGHT, cn, b); + + if ((m >= 0) && (m <= 3)) + for(cn=1; cn < 2; ++cn) mpg123_eq(fr, MPG123_LEFT|MPG123_RIGHT, cn, m); + + if ((b >= 0) && (b <= 3)) + for(cn=2; cn < 32; ++cn) mpg123_eq(fr, MPG123_LEFT|MPG123_RIGHT, cn, t); + + generic_sendmsg("bass: %f mid: %f treble: %f", b, m, t); + } + else generic_sendmsg("E invalid arguments for SEQ: %s", arg); + continue; + } + + /* Equalizer control :) (JMG) */ + if (!strcasecmp(cmd, "E") || !strcasecmp(cmd, "EQ")) { + double e; /* ThOr: equalizer is of type real... whatever that is */ + int c, v; + /*generic_sendmsg("%s",updown);*/ + if(sscanf(arg, "%i %i %lf", &c, &v, &e) == 3) + { + if(mpg123_eq(fr, c, v, e) == MPG123_OK) + generic_sendmsg("%i : %i : %f", c, v, e); + else + generic_sendmsg("E failed to set eq: %s", mpg123_strerror(fr)); + } + else generic_sendmsg("E invalid arguments for EQ: %s", arg); + continue; + } + + if(!strcasecmp(cmd, "EQFILE")) + { + equalfile = arg; + if(load_equalizer(fr) == 0) + generic_sendmsg("EQFILE done"); + else + generic_sendmsg("E failed to parse given eq file"); + + continue; + } + + /* SEEK to a sample offset */ + if(!strcasecmp(cmd, "K") || !strcasecmp(cmd, "SEEK")) + { + off_t soff; + char *spos = arg; + int whence = SEEK_SET; + if(mode == MODE_STOPPED) + { + generic_sendmsg("E No track loaded!"); + continue; + } + + soff = (off_t) atobigint(spos); + if(spos[0] == '-' || spos[0] == '+') whence = SEEK_CUR; + if(0 > (soff = mpg123_seek(fr, soff, whence))) + { + generic_sendmsg("E Error while seeking: %s", mpg123_strerror(fr)); + mpg123_seek(fr, 0, SEEK_SET); + } + if(param.usebuffer) buffer_resync(); + + generic_sendmsg("K %li", (long)mpg123_tell(fr)); + continue; + } + /* JUMP */ + if (!strcasecmp(cmd, "J") || !strcasecmp(cmd, "JUMP")) { + char *spos; + off_t offset; + double secs; + + spos = arg; + if(mode == MODE_STOPPED) + { + generic_sendmsg("E No track loaded!"); + continue; + } + + if(spos[strlen(spos)-1] == 's' && sscanf(arg, "%lf", &secs) == 1) offset = mpg123_timeframe(fr, secs); + else offset = atol(spos); + /* totally replaced that stuff - it never fully worked + a bit usure about why +pos -> spos+1 earlier... */ + if (spos[0] == '-' || spos[0] == '+') offset += framenum; + + if(0 > (framenum = mpg123_seek_frame(fr, offset, SEEK_SET))) + { + generic_sendmsg("E Error while seeking"); + mpg123_seek_frame(fr, 0, SEEK_SET); + } + if(param.usebuffer) buffer_resync(); + + generic_sendmsg("J %d", framenum); + continue; + } + + /* VOLUME in percent */ + if(!strcasecmp(cmd, "V") || !strcasecmp(cmd, "VOLUME")) + { + double v; + mpg123_volume(fr, atof(arg)/100); + mpg123_getvolume(fr, &v, NULL, NULL); /* Necessary? */ + generic_sendmsg("V %f%%", v * 100); + continue; + } + + /* PITCH (playback speed) in percent */ + if(!strcasecmp(cmd, "PITCH")) + { + double p; + if(sscanf(arg, "%lf", &p) == 1) + { + set_pitch(fr, ao, p); + generic_sendmsg("PITCH %f", param.pitch); + } + else generic_sendmsg("E invalid arguments for PITCH: %s", arg); + continue; + } + + /* RVA mode */ + if(!strcasecmp(cmd, "RVA")) + { + if(!strcasecmp(arg, "off")) param.rva = MPG123_RVA_OFF; + else if(!strcasecmp(arg, "mix") || !strcasecmp(arg, "radio")) param.rva = MPG123_RVA_MIX; + else if(!strcasecmp(arg, "album") || !strcasecmp(arg, "audiophile")) param.rva = MPG123_RVA_ALBUM; + mpg123_volume_change(fr, 0.); + generic_sendmsg("RVA %s", rva_name[param.rva]); + continue; + } + + /* LOAD - actually play */ + if (!strcasecmp(cmd, "L") || !strcasecmp(cmd, "LOAD")){ generic_load(fr, arg, MODE_PLAYING); continue; } + + if (!strcasecmp(cmd, "L") || !strcasecmp(cmd, "LOADLIST")){ generic_loadlist(fr, arg); continue; } + + /* LOADPAUSED */ + if (!strcasecmp(cmd, "LP") || !strcasecmp(cmd, "LOADPAUSED")){ generic_load(fr, arg, MODE_PAUSED); continue; } + + /* no command matched */ + generic_sendmsg("E Unknown command: %s", cmd); /* unknown command */ + } /* end commands with arguments */ + else generic_sendmsg("E Unknown command or no arguments: %s", comstr); /* unknown command */ + + } /* end of single command processing */ + } /* end of scanning the command buffer */ + + /* + when last command had no \n... should I discard it? + Ideally, I should remember the part and wait for next + read() to get the rest up to a \n. But that can go + to infinity. Too long commands too quickly are just + bad. Cannot/Won't change that. So, discard the unfinished + command and have fingers crossed that the rest of this + unfinished one qualifies as "unknown". + */ + if(buf[len-1] != 0) + { + char lasti = buf[len-1]; + buf[len-1] = 0; + generic_sendmsg("E Unfinished command: %s%c", comstr, lasti); + } + } /* end command reading & processing */ + } /* end main (alive) loop */ + debug("going to end"); + /* quit gracefully */ +#ifndef NOXFERMEM + if (param.usebuffer) { + kill(buffer_pid, SIGINT); + xfermem_done_writer(buffermem); + waitpid(buffer_pid, NULL, 0); + xfermem_done(buffermem); + } +#endif + debug("closing control"); +#ifdef FIFO +#if WANT_WIN32_FIFO + win32_fifo_close(); +#else + close(control_file); /* be it FIFO or STDIN */ + if(param.fifo) unlink(param.fifo); +#endif /* WANT_WIN32_FIFO */ +#endif + debug("control_generic returning"); + return 0; +} + +/* EOF */ diff --git a/node_modules/lame/deps/mpg123/src/equalizer.c b/node_modules/lame/deps/mpg123/src/equalizer.c new file mode 100644 index 0000000..ecce78b --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/equalizer.c @@ -0,0 +1,48 @@ +/* + equalizer: code for loading equalizer settings + + copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp (exported to this file by Thomas Orgis) +*/ + +#include "mpg123app.h" + +/* Load the settings from the path in the global variable equalfile. + If there is no file, restore equalizer defaults. */ +int load_equalizer(mpg123_handle *mh) +{ + if(equalfile != NULL) + { /* tst; ThOr: not TRUE or FALSE: allocated or not... */ + FILE *fe; + int i; + fe = fopen(equalfile,"r"); + if(fe) { + char line[256]; + for(i=0;i<32;i++) { + float e0 = 1.0; + float e1 = 1.0; /* %f -> float! */ + do /* ignore comments */ + { + line[0]=0; + fgets(line,255,fe); + } + while(line[0]=='#'); + /* Hm, why not use fscanf? Comments... */ + sscanf(line,"%f %f",&e0,&e1); + /* If scanning failed, we have default 1.0 value. */ + mpg123_eq(mh, MPG123_LEFT, i, e0); + mpg123_eq(mh, MPG123_RIGHT, i, e1); + } + fclose(fe); + } + else + { + fprintf(stderr,"Can't open equalizer file '%s'\n",equalfile); + return -1; + } + } + else mpg123_reset_eq(mh); + + return 0; +} diff --git a/node_modules/lame/deps/mpg123/src/genre.c b/node_modules/lame/deps/mpg123/src/genre.c new file mode 100644 index 0000000..f820d38 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/genre.c @@ -0,0 +1,271 @@ +/* + genre: id3 genre definition + + copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Shane Wegner +*/ + +char *genre_table[] = +{ + "Blues", + "Classic Rock", + "Country", + "Dance", + "Disco", + "Funk", + "Grunge", + "Hip-Hop", + "Jazz", + "Metal", + "New Age", + "Oldies", + "Other", + "Pop", + "R&B", + "Rap", + "Reggae", + "Rock", + "Techno", + "Industrial", + "Alternative", + "Ska", + "Death Metal", + "Pranks", + "Soundtrack", + "Euro-Techno", + "Ambient", + "Trip-Hop", + "Vocal", + "Jazz+Funk", + "Fusion", + "Trance", + "Classical", + "Instrumental", + "Acid", + "House", + "Game", + "Sound Clip", + "Gospel", + "Noise", + "AlternRock", + "Bass", + "Soul", + "Punk", + "Space", + "Meditative", + "Instrumental Pop", + "Instrumental Rock", + "Ethnic", + "Gothic", + "Darkwave", + "Techno-Industrial", + "Electronic", + "Pop-Folk", + "Eurodance", + "Dream", + "Southern Rock", + "Comedy", + "Cult", + "Gangsta", + "Top 40", + "Christian Rap", + "Pop/Funk", + "Jungle", + "Native American", + "Cabaret", + "New Wave", + "Psychedelic", + "Rave", + "Showtunes", + "Trailer", + "Lo-Fi", + "Tribal", + "Acid Punk", + "Acid Jazz", + "Polka", + "Retro", + "Musical", + "Rock & Roll", + "Hard Rock", + "Folk", + "Folk/Rock", + "National folk", + "Swing", + "Fast-fusion", + "Bebob", + "Latin", + "Revival", + "Celtic", + "Bluegrass", + "Avantgarde", + "Gothic Rock", + "Progressive Rock", + "Psychedelic Rock", + "Symphonic Rock", + "Slow Rock", + "Big Band", + "Chorus", + "Easy Listening", + "Acoustic", + "Humour", + "Speech", + "Chanson", + "Opera", + "Chamber Music", + "Sonata", + "Symphony", + "Booty Bass", + "Primus", + "Porn Groove", + "Satire", + "Slow Jam", + "Club", + "Tango", + "Samba", + "Folklore", + "Ballad", + "Powder Ballad", + "Rhythmic Soul", + "Freestyle", + "Duet", + "Punk Rock", + "Drum Solo", + "A Capella", + "Euro-House", + "Dance Hall", + "Goa", + "Drum & Bass", + "Club House", + "Hardcore", + "Terror", + "Indie", + "BritPop", + "NegerPunk", + "Polsk Punk", + "Beat", + "Christian Gangsta", + "Heavy Metal", + "Black Metal", + "Crossover", + "Contemporary C", + "Christian Rock", + "Merengue", + "Salsa", + "Thrash Metal", + "Anime", + "JPop", + "SynthPop" +/* , + "Unknown", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" +*/ +}; + +const int genre_count = ((int)(sizeof(genre_table)/sizeof(char*))-1); diff --git a/node_modules/lame/deps/mpg123/src/genre.h b/node_modules/lame/deps/mpg123/src/genre.h new file mode 100644 index 0000000..0a493d0 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/genre.h @@ -0,0 +1,15 @@ +/* + genre: id3 genre definition + + copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Shane Wegner +*/ + +#ifndef _MPG123_GENRE_H_ +#define _MPG123_GENRE_H_ + +extern char *genre_table[]; +extern const int genre_count; + +#endif diff --git a/node_modules/lame/deps/mpg123/src/getlopt.c b/node_modules/lame/deps/mpg123/src/getlopt.c new file mode 100644 index 0000000..2296886 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/getlopt.c @@ -0,0 +1,148 @@ +/* + getlopt: command line option/parameter parsing + + copyright ?-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written Oliver Fromme + old timestamp: Tue Apr 8 07:15:13 MET DST 1997 +*/ + +#include +#include "config.h" +#include "getlopt.h" +#include "compat.h" +#include "debug.h" + +int loptind = 1; /* index in argv[] */ +int loptchr = 0; /* index in argv[loptind] */ +char *loptarg; /* points to argument if present, else to option */ + +topt *findopt (int islong, char *opt, topt *opts) +{ + if (!opts) + return (0); + while (opts->lname) { + if (islong) { + if (!strcmp(opts->lname, opt)) + return (opts); + } + else + if (opts->sname == *opt) + return (opts); + opts++; + } + return (0); +} + +int performoption (int argc, char *argv[], topt *opt) +{ + int result = GLO_CONTINUE; + /* this really is not supposed to happen, so the exit may be justified to create asap ficing pressure */ + #define prog_error() \ + { \ + fprintf(stderr, __FILE__ ":%i Option without type flag! This is a programming error! Developer: fix this ASAP to regain your honor.\n", __LINE__); \ + exit(1); \ + } + + if (!(opt->flags & GLO_ARG)) { /* doesn't take argument */ + if (opt->var) { + if (opt->flags & GLO_CHAR) /* var is *char */ + { + debug1("char at %p", opt->var); + *((char *) opt->var) = (char) opt->value;\ + } + else if(opt->flags & GLO_LONG) + { + debug1("long at %p", opt->var); + *( (long *) opt->var ) = opt->value; + } + else if(opt->flags & GLO_INT) + { + debug1("int at %p", opt->var); + *( (int *) opt->var ) = (int) opt->value; + } + /* GLO_DOUBLE is not supported here */ + else prog_error(); + + debug("casting assignment done"); + } + else + result = opt->value ? opt->value : opt->sname; + } + else { /* requires argument */ + if (loptind >= argc) + return (GLO_NOARG); + loptarg = argv[loptind++]+loptchr; + loptchr = 0; + if (opt->var) { + if (opt->flags & GLO_CHAR) /* var is *char */ + *((char **) opt->var) = strdup(loptarg); /* valgrind claims lost memory here */ + else if(opt->flags & GLO_LONG) + *((long *) opt->var) = atol(loptarg); + else if(opt->flags & GLO_INT) + *((int *) opt->var) = atoi(loptarg); + else if(opt->flags & GLO_DOUBLE) + *((double *) opt->var) = atof(loptarg); + else prog_error(); + } + else + result = opt->value ? opt->value : opt->sname; + } + if (opt->func) + opt->func(loptarg); + return (result); +} + +int getsingleopt (int argc, char *argv[], topt *opts) +{ + char *thisopt; + topt *opt; + static char shortopt[2] = {0, 0}; + + if (loptind >= argc) + return (GLO_END); + thisopt = argv[loptind]; + debug1("getsingleopt: %s", thisopt); + if (!loptchr) { /* start new option string */ + if (thisopt[0] != '-' || !thisopt[1]) /* no more options */ + return (GLO_END); + if (thisopt[1] == '-') { /* "--" */ + if (thisopt[2]) { /* long option */ + loptarg = thisopt+2; + loptind++; + if (!(opt = findopt(1, thisopt+2, opts))) + return (GLO_UNKNOWN); + else + return (performoption(argc, argv, opt)); + } + else { /* "--" == end of options */ + loptind++; + return (GLO_END); + } + } + else /* start short option(s) */ + loptchr = 1; + } + shortopt[0] = thisopt[loptchr]; + loptarg = shortopt; + opt = findopt(0, thisopt+(loptchr++), opts); + if (!thisopt[loptchr]) { + loptind++; + loptchr = 0; + } + if (!opt) + return (GLO_UNKNOWN); + else + return (performoption(argc, argv, opt)); +} + +int getlopt (int argc, char *argv[], topt *opts) +{ + + int result; + + while ((result = getsingleopt(argc, argv, opts)) == GLO_CONTINUE); + return (result); +} + +/* EOF */ diff --git a/node_modules/lame/deps/mpg123/src/getlopt.h b/node_modules/lame/deps/mpg123/src/getlopt.h new file mode 100644 index 0000000..3fca39c --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/getlopt.h @@ -0,0 +1,77 @@ +/* + getlopt: command line option/parameter parsing + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written Oliver Fromme + old timestamp: Tue Apr 8 07:13:39 MET DST 1997 +*/ + +#include +#include + + +#ifndef _MPG123_GETLOPT_H_ +#define _MPG123_GETLOPT_H_ + +extern int loptind; /* index in argv[] */ +extern int loptchr; /* index in argv[loptind] */ +extern char *loptarg; /* points to argument if present, else to option */ + +typedef struct { + char sname; /* short option name, can be 0 */ + char *lname; /* long option name, can be 0 */ + int flags; /* see below */ + void (*func)(char *); /* called if != 0 (after setting of var) */ + void *var; /* type is *long, *char or **char, see below */ + long value; +} topt; + +/* ThOr: make this clear; distict long from int (since this is != on my Alpha) and really use a flag for every case (spare the 0 case +for .... no flag) */ +#define GLO_ARG 1 +#define GLO_CHAR 2 +#define GLO_INT 4 +#define GLO_LONG 8 +#define GLO_DOUBLE 16 + +/* flags: + * bit 0 = 0 - no argument + * if var != NULL + * *var := value or (char)value [see bit 1] + * else + * loptarg = &option + * return ((value != 0) ? value : sname) + * bit 0 = 1 - argument required + * if var != NULL + * *var := atoi(arg) or strdup(arg) [see bit 1] + * else + * loptarg = &arg + * return ((value != 0) ? value : sname) + * + * bit 1 = 1 - var is a pointer to a char (or string), + * and value is interpreted as char + * bit 2 = 1 - var is a pointer to int + * bit 3 = 1 - var is a pointer to long + * + * Note: The options definition is terminated by a topt + * containing only zeroes. + */ + +#define GLO_END 0 +#define GLO_UNKNOWN -1 +#define GLO_NOARG -2 +#define GLO_CONTINUE -3 + +int getlopt (int argc, char *argv[], topt *opts); + +/* return values: + * GLO_END (0) end of options + * GLO_UNKNOWN (-1) unknown option *loptarg + * GLO_NOARG (-2) missing argument + * GLO_CONTINUE (-3) (reserved for internal use) + * else - return value according to flags (see above) + */ + + +#endif diff --git a/node_modules/lame/deps/mpg123/src/httpget.c b/node_modules/lame/deps/mpg123/src/httpget.c new file mode 100644 index 0000000..4339858 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/httpget.c @@ -0,0 +1,700 @@ +/* + httpget.c: http communication + + copyright ?-2011 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written Oliver Fromme + old timestamp: Wed Apr 9 20:57:47 MET DST 1997 + + Thomas' notes: + + I used to do + GET http://server/path HTTP/1.0 + + But RFC 1945 says: The absoluteURI form is only allowed when the request is being made to a proxy. + + so I should not do that. Since name based virtual hosts need the hostname in the request, I still need to provide that info. + Enter HTTP/1.1... there is a Host eader field to use (that mpg123 supposedly has used since some time anyway - but did it really work with my vhost test server)? + Now + GET /path/bla HTTP/1.1\r\nHost: host[:port] + Should work, but as a funny sidenote: + + RFC2616: To allow for transition to absoluteURIs in all requests in future versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI form in requests, even though HTTP/1.1 clients will only generate them in requests to proxies. + + I was already full-on HTTP/1.1 as I recognized that mpg123 then would have to accept the chunked transfer encoding. + That is not desireable for its purpose... maybe when interleaving of shoutcasts with metadata chunks is supported, we can upgrade to 1.1. + Funny aspect there is that shoutcast servers do not do HTTP/1.1 chunked transfer but implement some different chunking themselves... +*/ + +#include "mpg123app.h" +#include "httpget.h" + +#ifdef NETWORK +#include "resolver.h" + +#include +#include "true.h" +#endif + +#include "debug.h" + +void httpdata_init(struct httpdata *e) +{ + mpg123_init_string(&e->content_type); + mpg123_init_string(&e->icy_url); + mpg123_init_string(&e->icy_name); + e->icy_interval = 0; + e->proxystate = PROXY_UNKNOWN; + mpg123_init_string(&e->proxyhost); + mpg123_init_string(&e->proxyport); +} + +void httpdata_reset(struct httpdata *e) +{ + mpg123_free_string(&e->content_type); + mpg123_free_string(&e->icy_url); + mpg123_free_string(&e->icy_name); + e->icy_interval = 0; + /* the other stuff shall persist */ +} + +void httpdata_free(struct httpdata *e) +{ + httpdata_reset(e); + mpg123_free_string(&e->proxyhost); + mpg123_free_string(&e->proxyport); +} + +/* mime type classes */ +#define M_FILE 0 +#define M_M3U 1 +#define M_PLS 2 +static const char* mime_file[] = +{ + "audio/mpeg", "audio/x-mpeg", + "audio/mp3", "audio/x-mp3", + "audio/mpeg3", "audio/x-mpeg3", + "audio/mpg", "audio/x-mpg", + "audio/x-mpegaudio", + "application/octet-stream", /* Assume raw binary data is some MPEG data. */ + NULL +}; +static const char* mime_m3u[] = { "audio/mpegurl", "audio/mpeg-url", "audio/x-mpegurl", NULL }; +static const char* mime_pls[] = { "audio/x-scpls", "audio/scpls", "application/pls", NULL }; +static const char** mimes[] = { mime_file, mime_m3u, mime_pls, NULL }; + +int debunk_mime(const char* mime) +{ + int i,j; + size_t len; + int r = 0; + char *aux; + /* Watch out for such: "audio/x-mpegurl; charset=utf-8" */ + aux = strchr(mime, ';'); + if(aux != NULL) + { + fprintf(stderr, "Warning: additional info in content-type ignored (%s)\n", aux+1); + /* Just compare up to before the ";". */ + len = aux-mime; + } + /* Else, compare the whole string -- including the end. */ + else len = strlen(mime)+1; + + for(i=0; mimes[i] != NULL; ++i) + for(j=0; mimes[i][j] != NULL; ++j) + if(!strncasecmp(mimes[i][j], mime, len)) goto debunk_result; + +debunk_result: + if(mimes[i] != NULL) + { + switch(i) + { + case M_FILE: r = IS_FILE; break; + case M_M3U: r = IS_LIST|IS_M3U; break; + case M_PLS: r = IS_LIST|IS_PLS; break; + default: error("unexpected MIME debunk result -- coding error?!"); + } + } + return r; +} + + +#ifdef NETWORK +#if !defined (WANT_WIN32_SOCKETS) +static int writestring (int fd, mpg123_string *string) +{ + size_t result, bytes; + char *ptr = string->p; + bytes = string->fill ? string->fill-1 : 0; + + while(bytes) + { + result = write(fd, ptr, bytes); + if(result < 0 && errno != EINTR) + { + perror ("writing http string"); + return FALSE; + } + else if(result == 0) + { + error("write: socket closed unexpectedly"); + return FALSE; + } + ptr += result; + bytes -= result; + } + return TRUE; +} + +static size_t readstring (mpg123_string *string, size_t maxlen, FILE *f) +{ + int err; + debug2("Attempting readstring on %d for %"SIZE_P" bytes", f ? fileno(f) : 0, (size_p)maxlen); + string->fill = 0; + while(maxlen == 0 || string->fill < maxlen) + { + if(string->size-string->fill < 1) + if(!mpg123_grow_string(string, string->fill+4096)) + { + error("Cannot allocate memory for reading."); + string->fill = 0; + return 0; + } + err = read(fileno(f),string->p+string->fill,1); + /* Whoa... reading one byte at a time... one could ensure the line break in another way, but more work. */ + if( err == 1) + { + string->fill++; + if(string->p[string->fill-1] == '\n') break; + } + else if(errno != EINTR) + { + error("Error reading from socket or unexpected EOF."); + string->fill = 0; + /* bail out to prevent endless loop */ + return 0; + } + } + + if(!mpg123_grow_string(string, string->fill+1)) + { + string->fill=0; + } + else + { + string->p[string->fill] = 0; + string->fill++; + } + return string->fill; +} +#endif /* WANT_WIN32_SOCKETS */ + +void encode64 (char *source,char *destination) +{ + static char *Base64Digits = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + int n = 0; + int ssiz=strlen(source); + int i; + + for (i = 0 ; i < ssiz ; i += 3) { + unsigned int buf; + buf = ((unsigned char *)source)[i] << 16; + if (i+1 < ssiz) + buf |= ((unsigned char *)source)[i+1] << 8; + if (i+2 < ssiz) + buf |= ((unsigned char *)source)[i+2]; + + destination[n++] = Base64Digits[(buf >> 18) % 64]; + destination[n++] = Base64Digits[(buf >> 12) % 64]; + if (i+1 < ssiz) + destination[n++] = Base64Digits[(buf >> 6) % 64]; + else + destination[n++] = '='; + if (i+2 < ssiz) + destination[n++] = Base64Digits[buf % 64]; + else + destination[n++] = '='; + } + destination[n++] = 0; +} + +/* Look out for HTTP header field to parse, construct C string with the value. + Attention: Modifies argument, since it's so convenient... */ +char *get_header_val(const char *hname, mpg123_string *response) +{ + char *tmp = NULL; + size_t prelen = strlen(hname); + /* if header name found, next char is at least something, so just check for : */ + if(!strncasecmp(hname, response->p, prelen) && (response->p[prelen] == ':')) + { + ++prelen; + if((tmp = strchr(response->p, '\r')) != NULL ) tmp[0] = 0; + if((tmp = strchr(response->p, '\n')) != NULL ) tmp[0] = 0; + tmp = response->p+prelen; + /* I _know_ that there is a terminating zero, so this loop is safe. */ + while((tmp[0] == ' ') || (tmp[0] == '\t')) + { + ++tmp; + } + } + return tmp; +} + +/* Iterate over header field names and storage locations, to possibly get those values. */ +void get_header_string(mpg123_string *response, const char *fieldname, mpg123_string *store) +{ + char *tmp; + if((tmp = get_header_val(fieldname, response))) + { + if(mpg123_set_string(store, tmp)){ debug2("got %s %s", fieldname, store->p); return; } + else{ error2("unable to set %s to %s!", fieldname, tmp); } + } +} + +/* shoutcsast meta data: 1=on, 0=off */ + +char *httpauth = NULL; + +size_t accept_length(void) +{ + int i,j; + static size_t l = 0; + if(l) return l; + l += strlen("Accept: "); + for(i=0; mimes[i] != NULL; ++i) + for(j=0; mimes[i][j] != NULL; ++j){ l += strlen(mimes[i][j]) + strlen(", "); } + l += strlen("*/*\r\n"); + debug1("initial computation of accept header length: %lu", (unsigned long)l); + return l; +} + +/* Returns TRUE or FALSE for success. */ +int proxy_init(struct httpdata *hd) +{ + int ret = TRUE; + /* If we don't have explicit proxy given, probe the environment. */ + if (!param.proxyurl) + if (!(param.proxyurl = getenv("MP3_HTTP_PROXY"))) + if (!(param.proxyurl = getenv("http_proxy"))) + param.proxyurl = getenv("HTTP_PROXY"); + /* Now continue if we have something. */ + if (param.proxyurl && param.proxyurl[0] && strcmp(param.proxyurl, "none")) + { + mpg123_string proxyurl; + mpg123_init_string(&proxyurl); + if( !mpg123_set_string(&proxyurl, param.proxyurl) + || !split_url(&proxyurl, NULL, &hd->proxyhost, &hd->proxyport, NULL)) + { + error("splitting proxy URL"); + ret = FALSE; + } + else if(param.verbose > 1) fprintf(stderr, "Note: Using proxy %s\n", hd->proxyhost.p); +#if 0 /* not yet there */ + if(!try_host_lookup(proxyhost)) + { + error("Unknown proxy host \"%s\".\n", proxyhost.p); + ret = FALSE; + } +#endif + mpg123_free_string(&proxyurl); + if(ret) hd->proxystate = PROXY_HOST; /* We got hostname and port settled. */ + else hd->proxystate = PROXY_NONE; + } + else hd->proxystate = PROXY_NONE; + + return ret; +} + +static int append_accept(mpg123_string *s) +{ + size_t i,j; + if(!mpg123_add_string(s, "Accept: ")) return FALSE; + + /* We prefer what we know. */ + for(i=0; mimes[i] != NULL; ++i) + for(j=0; mimes[i][j] != NULL; ++j) + { + if( !mpg123_add_string(s, mimes[i][j]) + || !mpg123_add_string(s, ", ") ) + return FALSE; + } + /* Well... in the end, we accept everything, trying to make sense with reality. */ + if(!mpg123_add_string(s, "*/*\r\n")) return FALSE; + + return TRUE; +} + + +/* + Converts spaces to "%20" ... actually, I have to ask myself why. + What about converting them to "+" instead? Would make things a lot easier. + Or, on the other hand... what about avoiding HTML encoding at all? +*/ +int translate_url(const char *url, mpg123_string *purl) +{ + const char *sptr; + /* The length of purl is upper bound by 3*strlen(url) + 1 if + * everything in it is a space (%20) - or any encoded character */ + if (strlen(url) >= SIZE_MAX/3) + { + error("URL too long. Skipping..."); + return FALSE; + } + /* Prepare purl in one chunk, to minimize mallocs. */ + if(!mpg123_resize_string(purl, strlen(url) + 31)) return FALSE; + /* + * 2000-10-21: + * We would like spaces to be automatically converted to %20's when + * fetching via HTTP. + * -- Martin Sjgren + * Hm, why only spaces? Maybe one should do this http stuff more properly... + */ + if ((sptr = strchr(url, ' ')) == NULL) + mpg123_set_string(purl, url); + else + { /* Note that sptr is set from the if to this else... */ + const char *urlptr = url; + mpg123_set_string(purl, ""); + do { + if(! ( mpg123_add_substring(purl, urlptr, 0, sptr-urlptr) + && mpg123_add_string(purl, "%20") ) ) + return FALSE; + urlptr = sptr + 1; + } while ((sptr = strchr (urlptr, ' ')) != NULL); + if(!mpg123_add_string(purl, urlptr)) return FALSE; + } + /* now see if a terminating / may be needed */ + if(strchr(purl->p+(strncmp("http://", purl->p, 7) ? 0 : 7), '/') == NULL + && !mpg123_add_string(purl, "/")) + return FALSE; + + return TRUE; +} + +int fill_request(mpg123_string *request, mpg123_string *host, mpg123_string *port, mpg123_string *httpauth1, int *try_without_port) +{ + char* ttemp; + int ret = TRUE; + const char *icy = param.talk_icy ? icy_yes : icy_no; + + /* hm, my test redirection had troubles with line break before HTTP/1.0 */ + if((ttemp = strchr(request->p,'\r')) != NULL){ *ttemp = 0; request->fill = ttemp-request->p+1; } + + if((ttemp = strchr(request->p,'\n')) != NULL){ *ttemp = 0; request->fill = ttemp-request->p+1; } + + /* Fill out the request further... */ + if( !mpg123_add_string(request, " HTTP/1.0\r\nUser-Agent: ") + || !mpg123_add_string(request, PACKAGE_NAME) + || !mpg123_add_string(request, "/") + || !mpg123_add_string(request, PACKAGE_VERSION) + || !mpg123_add_string(request, "\r\n") ) + return FALSE; + + if(host->fill) + { /* Give virtual hosting a chance... adding the "Host: ... " line. */ + debug2("Host: %s:%s", host->p, port->p); + if( mpg123_add_string(request, "Host: ") + && mpg123_add_string(request, host->p) + && ( *try_without_port || ( + mpg123_add_string(request, ":") + && mpg123_add_string(request, port->p) )) + && mpg123_add_string(request, "\r\n") ) + { + if(*try_without_port) *try_without_port = 0; + } + else return FALSE; + } + + /* Acceptance, stream setup. */ + if( !append_accept(request) + || !mpg123_add_string(request, CONN_HEAD) + || !mpg123_add_string(request, icy) ) + return FALSE; + + /* Authorization. */ + if (httpauth1->fill || httpauth) { + char *buf; + if(!mpg123_add_string(request,"Authorization: Basic ")) return FALSE; + if(httpauth1->fill) { + if(httpauth1->fill > SIZE_MAX / 4) return FALSE; + + buf=(char *)malloc(httpauth1->fill * 4); + if(!buf) + { + error("malloc() failed for http auth, out of memory."); + return FALSE; + } + encode64(httpauth1->p,buf); + } else { + if(strlen(httpauth) > SIZE_MAX / 4 - 4 ) return FALSE; + + buf=(char *)malloc((strlen(httpauth) + 1) * 4); + if(!buf) + { + error("malloc() for http auth failed, out of memory."); + return FALSE; + } + encode64(httpauth,buf); + } + + if( !mpg123_add_string(request, buf) || !mpg123_add_string(request, "\r\n")) + ret = FALSE; + + free(buf); /* Watch out for leaking if you introduce returns before this line. */ + } + if(ret) ret = mpg123_add_string(request, "\r\n"); + + return ret; +} +#if !defined (WANT_WIN32_SOCKETS) +static int resolve_redirect(mpg123_string *response, mpg123_string *request_url, mpg123_string *purl) +{ + debug1("request_url:%s", request_url->p); + /* initialized with full old url */ + if(!mpg123_copy_string(request_url, purl)) return FALSE; + + /* We may strip it down to a prefix ot totally. */ + if(strncasecmp(response->p, "Location: http://", 17)) + { /* OK, only partial strip, need prefix for relative path. */ + char* ptmp = NULL; + /* though it's not RFC (?), accept relative URIs as wget does */ + fprintf(stderr, "NOTE: no complete URL in redirect, constructing one\n"); + /* not absolute uri, could still be server-absolute */ + /* I prepend a part of the request... out of the request */ + if(response->p[10] == '/') + { + /* only prepend http://server/ */ + /* I null the first / after http:// */ + ptmp = strchr(purl->p+7,'/'); + if(ptmp != NULL){ purl->fill = ptmp-purl->p+1; purl->p[purl->fill-1] = 0; } + } + else + { + /* prepend http://server/path/ */ + /* now we want the last / */ + ptmp = strrchr(purl->p+7, '/'); + if(ptmp != NULL){ purl->fill = ptmp-purl->p+2; purl->p[purl->fill-1] = 0; } + } + } + else purl->fill = 0; + + debug1("prefix=%s", purl->fill ? purl->p : ""); + if(!mpg123_add_string(purl, response->p+10)) return FALSE; + + debug1(" purl: %s", purl->p); + debug1("old request_url: %s", request_url->p); + + return TRUE; +} + +int http_open(char* url, struct httpdata *hd) +{ + mpg123_string purl, host, port, path; + mpg123_string request, response, request_url; + mpg123_string httpauth1; + int sock = -1; + int oom = 0; + int relocate, numrelocs = 0; + int got_location = FALSE; + FILE *myfile = NULL; + /* + workaround for http://www.global24music.com/rautemusik/files/extreme/isdn.pls + this site's apache gives me a relocation to the same place when I give the port in Host request field + for the record: Apache/2.0.51 (Fedora) + */ + int try_without_port = 0; + mpg123_init_string(&purl); + mpg123_init_string(&host); + mpg123_init_string(&port); + mpg123_init_string(&path); + mpg123_init_string(&request); + mpg123_init_string(&response); + mpg123_init_string(&request_url); + mpg123_init_string(&httpauth1); + + /* Get initial info for proxy server. Once. */ + if(hd->proxystate == PROXY_UNKNOWN && !proxy_init(hd)) goto exit; + + if(!translate_url(url, &purl)){ oom=1; goto exit; } + + /* Don't confuse the different auth strings... */ + if(!split_url(&purl, &httpauth1, NULL, NULL, NULL) ){ oom=1; goto exit; } + + /* "GET http://" 11 + * " HTTP/1.0\r\nUser-Agent: /\r\n" + * 26 + PACKAGE_NAME + PACKAGE_VERSION + * accept header + accept_length() + * "Authorization: Basic \r\n" 23 + * "\r\n" 2 + * ... plus the other predefined header lines + */ + /* Just use this estimate as first guess to reduce malloc calls in string library. */ + { + size_t length_estimate = 62 + strlen(PACKAGE_NAME) + strlen(PACKAGE_VERSION) + + accept_length() + strlen(CONN_HEAD) + strlen(icy_yes) + purl.fill; + if( !mpg123_grow_string(&request, length_estimate) + || !mpg123_grow_string(&response,4096) ) + { + oom=1; goto exit; + } + } + + do + { + /* Storing the request url, with http:// prepended if needed. */ + /* used to be url here... seemed wrong to me (when loop advanced...) */ + if(strncasecmp(purl.p, "http://", 7) != 0) mpg123_set_string(&request_url, "http://"); + else mpg123_set_string(&request_url, ""); + + mpg123_add_string(&request_url, purl.p); + + if (hd->proxystate >= PROXY_HOST) + { + /* We will connect to proxy, full URL goes into the request. */ + if( !mpg123_copy_string(&hd->proxyhost, &host) + || !mpg123_copy_string(&hd->proxyport, &port) + || !mpg123_set_string(&request, "GET ") + || !mpg123_add_string(&request, request_url.p) ) + { + oom=1; goto exit; + } + } + else + { + /* We will connect to the host from the URL and only the path goes into the request. */ + if(!split_url(&purl, NULL, &host, &port, &path)){ oom=1; goto exit; } + if( !mpg123_set_string(&request, "GET ") + || !mpg123_add_string(&request, path.p) ) + { + oom=1; goto exit; + } + } + + if(!fill_request(&request, &host, &port, &httpauth1, &try_without_port)){ oom=1; goto exit; } + + httpauth1.fill = 0; /* We use the auth data from the URL only once. */ + debug2("attempting to open_connection to %s:%s", host.p, port.p); + sock = open_connection(&host, &port); + if(sock < 0) + { + error1("Unable to establish connection to %s", host.fill ? host.p : ""); + goto exit; + } +#define http_failure close(sock); sock=-1; goto exit; + + if(param.verbose > 2) fprintf(stderr, "HTTP request:\n%s\n",request.p); + if(!writestring(sock, &request)){ http_failure; } + if (!(myfile = fdopen(sock, "rb"))) + { + error1("fdopen: %s", strerror(errno)); + http_failure; + } + relocate = FALSE; + /* Arbitrary length limit here... */ +#define safe_readstring \ + readstring(&response, SIZE_MAX/16, myfile); \ + if(response.fill > SIZE_MAX/16) /* > because of appended zero. */ \ + { \ + error("HTTP response line exceeds max. length"); \ + http_failure; \ + } \ + else if(response.fill == 0) \ + { \ + error("readstring failed"); \ + http_failure; \ + } \ + if(param.verbose > 2) fprintf(stderr, "HTTP in: %s", response.p); + safe_readstring; + + { + char *sptr; + if((sptr = strchr(response.p, ' '))) + { + if(response.fill > sptr-response.p+2) + switch (sptr[1]) + { + case '3': + relocate = TRUE; + case '2': + break; + default: + fprintf (stderr, "HTTP request failed: %s", sptr+1); /* '\n' is included */ + http_failure; + } + else{ error("Too short response,"); http_failure; } + } + } + + /* If we are relocated, we need to look out for a Location header. */ + got_location = FALSE; + + do + { + safe_readstring; /* Think about that: Should we really error out when we get nothing? Could be that the server forgot the trailing empty line... */ + if (!strncasecmp(response.p, "Location: ", 10)) + { /* It is a redirection! */ + if(!resolve_redirect(&response, &request_url, &purl)){ oom=1, http_failure; } + + if(!strcmp(purl.p, request_url.p)) + { + warning("relocated to very same place! trying request again without host port"); + try_without_port = 1; + } + got_location = TRUE; + } + else + { /* We got a header line (or the closing empty line). */ + char *tmp; + debug1("searching for header values... %s", response.p); + /* Not sure if I want to bail out on error here. */ + /* Also: What text encoding are these strings in? Doesn't need to be plain ASCII... */ + get_header_string(&response, "content-type", &hd->content_type); + get_header_string(&response, "icy-name", &hd->icy_name); + get_header_string(&response, "icy-url", &hd->icy_url); + + /* watch out for icy-metaint */ + if((tmp = get_header_val("icy-metaint", &response))) + { + hd->icy_interval = (off_t) atol(tmp); /* atoll ? */ + debug1("got icy-metaint %li", (long int)hd->icy_interval); + } + } + } while(response.p[0] != '\r' && response.p[0] != '\n'); + } while(relocate && got_location && purl.fill && numrelocs++ < HTTP_MAX_RELOCATIONS); + if(relocate) + { + if(!got_location) + error("Server meant to redirect but failed to provide a location!"); + else + error1("Too many HTTP relocations (%i).", numrelocs); + + http_failure; + } + +exit: /* The end as well as the exception handling point... */ + if(oom) error("Apparently, I ran out of memory or had some bad input data..."); + + mpg123_free_string(&purl); + mpg123_free_string(&host); + mpg123_free_string(&port); + mpg123_free_string(&path); + mpg123_free_string(&request); + mpg123_free_string(&response); + mpg123_free_string(&request_url); + mpg123_free_string(&httpauth1); + return sock; +} +#endif /*WANT_WIN32_SOCKETS*/ + +#else /* NETWORK */ + +/* stub */ +int http_open (char* url, struct httpdata *hd) +{ + return -1; +} +#endif + +/* EOF */ + diff --git a/node_modules/lame/deps/mpg123/src/httpget.h b/node_modules/lame/deps/mpg123/src/httpget.h new file mode 100644 index 0000000..2fccfaf --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/httpget.h @@ -0,0 +1,66 @@ +/* + httpget: HTTP input routines (the header) + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis + + Note about MIME types: + You feed debunk_mime() a MIME string and it classifies it as it is relevant for mpg123. + In httpget.c are the MIME class lists, which may be appended to to support more bogus MIME types. +*/ + +#ifndef _HTTPGET_H_ +#define _HTTPGET_H_ +#include "mpg123.h" + +/* Pulled in by mpg123app.h! */ + +struct httpdata +{ + mpg123_string content_type; + mpg123_string icy_name; + mpg123_string icy_url; + off_t icy_interval; + mpg123_string proxyhost; + mpg123_string proxyport; + /* Partly dummy for now... later proxy host resolution will be cached (PROXY_ADDR). */ + enum { PROXY_UNKNOWN=0, PROXY_NONE, PROXY_HOST, PROXY_ADDR } proxystate; +}; + +void httpdata_init(struct httpdata *e); +void httpdata_reset(struct httpdata *e); +void httpdata_free(struct httpdata *e); + +/* There is a whole lot of MIME types for the same thing. + the function will reduce it to a combination of these flags */ +#define IS_FILE 1 +#define IS_LIST 2 +#define IS_M3U 4 +#define IS_PLS 8 + +#define HTTP_MAX_RELOCATIONS 20 + +int debunk_mime(const char* mime); + +/*Previously static functions, shared for win32_net_support */ +int proxy_init(struct httpdata *hd); +int translate_url(const char *url, mpg123_string *purl); +size_t accept_length(void); +int fill_request(mpg123_string *request, mpg123_string *host, mpg123_string *port, mpg123_string *httpauth1, int *try_without_port); +void get_header_string(mpg123_string *response, const char *fieldname, mpg123_string *store); +char *get_header_val(const char *hname, mpg123_string *response); + +/* needed for HTTP/1.1 non-pipelining mode */ +/* #define CONN_HEAD "Connection: close\r\n" */ +#define CONN_HEAD "" +#define icy_yes "Icy-MetaData: 1\r\n" +#define icy_no "Icy-MetaData: 0\r\n" + +extern char *proxyurl; +extern unsigned long proxyip; +/* takes url and content type string address, opens resource, returns fd for data, allocates and sets content type */ +extern int http_open (char* url, struct httpdata *hd); +extern char *httpauth; + +#endif diff --git a/node_modules/lame/deps/mpg123/src/legacy_module.c b/node_modules/lame/deps/mpg123/src/legacy_module.c new file mode 100644 index 0000000..812032d --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/legacy_module.c @@ -0,0 +1,74 @@ +/* + legacy_module.c: dummy interface to modular code loader for legacy build system + + copyright 2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Nicholas J Humfrey +*/ + +#include "mpg123app.h" +#include "debug.h" + +/* A single module is staticly compiled in for each type */ +extern mpg123_module_t mpg123_output_module_info; +/* extern mpg123_module_t mpg123_input_module_info; */ + + +/* Open a module */ +mpg123_module_t* +open_module( const char* type, const char* name ) +{ + mpg123_module_t *mod = NULL; + + /* Select the module info structure, based on the desired type */ + if (strcmp(type, "output")==0) { + mod = &mpg123_output_module_info; +/* + } else if (strcmp(type, "input")==0) { + mod = &mpg123_input_module_info; +*/ + } else { + error1("Unable to open module type '%s'.", type); + return NULL; + } + + /* Check the module compiled in is the module requested */ + if (strcmp(name, mod->name)!=0) { + error1("Unable to open requested module '%s'.", name); + error1("The only available statically compiled module is '%s'.", mod->name); + return NULL; + } + + /* Debugging info */ + debug1("Details of static module type '%s':", type); + debug1(" api_version=%d", mod->api_version); + debug1(" name=%s", mod->name); + debug1(" description=%s", mod->description); + debug1(" revision=%s", mod->revision); + debug1(" handle=%p", (void*)mod->handle); + + return mod; +} + + +void close_module( mpg123_module_t* module ) +{ + debug("close_module()"); + + /* Module was never really 'loaded', so nothing to do here. */ +} + + +void list_modules() +{ + debug("list_modules()" ); + + printf("\nmpg123 has been built in legacy mode - dynamic modules are not available.\n"); + + printf("Available modules\n"); + printf("-----------------\n"); + printf("%-15s%s %s\n", mpg123_output_module_info.name, "output", mpg123_output_module_info.description ); + +} + + diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/Makefile.am b/node_modules/lame/deps/mpg123/src/libmpg123/Makefile.am new file mode 100644 index 0000000..22035a1 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/Makefile.am @@ -0,0 +1,141 @@ +## Makefile.am: produce Makefile.in from this + +## copyright by the mpg123 project - free software under the terms of the LGPL 2.1 +## see COPYING and AUTHORS files in distribution or http://mpg123.org +## initially written by Nicholas J. Humfrey + +#AM_CFLAGS = @AUDIO_CFLAGS@ +#AM_LDFLAGS = +INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/libmpg123 + +EXTRA_DIST = mpg123.h.in + +EXTRA_PROGRAMS = testcpu +testcpu_dependencies = getcpuflags.$(OBJEXT) +testcpu_sources = testcpu.c +testcpu_LDADD = getcpuflags.$(OBJEXT) + + +CLEANFILES = *.a + + +# The library can have different names, depending on largefile setup. +# Libtool macros think they're smart. Because of that mpg123.la does not work, it must be libmpg123.la . +lib_LTLIBRARIES = libmpg123.la +nodist_include_HEADERS = mpg123.h + +libmpg123_la_LDFLAGS = -no-undefined -version-info @LIBMPG123_VERSION@ -export-symbols-regex '^mpg123_' +libmpg123_la_LIBADD = @DECODER_LOBJ@ @LFS_LOBJ@ +libmpg123_la_DEPENDENCIES = @DECODER_LOBJ@ @LFS_LOBJ@ + +libmpg123_la_SOURCES = \ + intsym.h \ + compat.c \ + compat.h \ + mpeghead.h \ + parse.c \ + parse.h \ + frame.c \ + format.c \ + frame.h \ + reader.h \ + debug.h \ + decode.h \ + sample.h \ + dct64.c \ + synth.h \ + synth_mono.h \ + synth_ntom.h \ + synth_8bit.h \ + synths.h \ + equalizer.c \ + huffman.h \ + icy.h \ + icy2utf8.h \ + id3.h \ + id3.c \ + true.h \ + getbits.h \ + optimize.h \ + optimize.c \ + readers.c \ + tabinit.c \ + libmpg123.c \ + gapless.h \ + mpg123lib_intern.h \ + mangle.h \ + getcpuflags.h \ + index.h \ + index.c + +EXTRA_libmpg123_la_SOURCES = \ + lfs_alias.c \ + lfs_wrap.c \ + icy.c \ + icy2utf8.c \ + l2tables.h \ + layer1.c \ + layer2.c \ + layer3.c \ + dither.h \ + dither.c \ + feature.c \ + dct36_3dnowext.S \ + dct36_3dnow.S \ + dct64_3dnowext.S \ + dct64_3dnow.S \ + dct64_altivec.c \ + dct64_i386.c \ + dct64_i486.c \ + dct64_mmx.S \ + dct64_sse.S \ + dct64_sse_float.S \ + dct64_x86_64.S \ + dct64_x86_64_float.S \ + dct64_neon.S \ + dct64_neon_float.S \ + synth_3dnowext.S \ + synth_3dnow.S \ + synth_altivec.c \ + synth_i486.c \ + synth_i586_dither.S \ + synth_i586.S \ + synth_mmx.S \ + synth_sse3d.h \ + synth_sse.S \ + synth_sse_float.S \ + synth_sse_s32.S \ + synth_sse_accurate.S \ + synth_stereo_sse_float.S \ + synth_stereo_sse_s32.S \ + synth_stereo_sse_accurate.S \ + synth_x86_64.S \ + synth_x86_64_float.S \ + synth_x86_64_s32.S \ + synth_x86_64_accurate.S \ + synth_stereo_x86_64.S \ + synth_stereo_x86_64_float.S \ + synth_stereo_x86_64_s32.S \ + synth_stereo_x86_64_accurate.S \ + synth_arm.S \ + synth_arm_accurate.S \ + synth_neon.S \ + synth_neon_float.S \ + synth_neon_s32.S \ + synth_neon_accurate.S \ + synth_stereo_neon.S \ + synth_stereo_neon_float.S \ + synth_stereo_neon_s32.S \ + synth_stereo_neon_accurate.S \ + ntom.c \ + synth.c \ + synth_8bit.c \ + synth_real.c \ + synth_s32.c \ + equalizer_3dnow.S \ + tabinit_mmx.S \ + stringbuf.c \ + getcpuflags.S \ + l12_integer_tables.h \ + l3_integer_tables.h + diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/Makefile.in b/node_modules/lame/deps/mpg123/src/libmpg123/Makefile.in new file mode 100644 index 0000000..a980f10 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/Makefile.in @@ -0,0 +1,919 @@ +# Makefile.in generated by automake 1.12.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +EXTRA_PROGRAMS = testcpu$(EXEEXT) +subdir = src/libmpg123 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/mpg123.h.in $(top_srcdir)/build/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/addrconfig.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/config.h +CONFIG_CLEAN_FILES = mpg123.h +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am_libmpg123_la_OBJECTS = compat.lo parse.lo frame.lo format.lo \ + dct64.lo equalizer.lo id3.lo optimize.lo readers.lo tabinit.lo \ + libmpg123.lo index.lo +libmpg123_la_OBJECTS = $(am_libmpg123_la_OBJECTS) +libmpg123_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libmpg123_la_LDFLAGS) $(LDFLAGS) -o $@ +testcpu_SOURCES = testcpu.c +testcpu_OBJECTS = testcpu.$(OBJEXT) +testcpu_DEPENDENCIES = getcpuflags.$(OBJEXT) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/build/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) +LTCPPASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libmpg123_la_SOURCES) $(EXTRA_libmpg123_la_SOURCES) \ + testcpu.c +DIST_SOURCES = $(libmpg123_la_SOURCES) $(EXTRA_libmpg123_la_SOURCES) \ + testcpu.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(nodist_include_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AIX_CFLAGS = @AIX_CFLAGS@ +AIX_LDFLAGS = @AIX_LDFLAGS@ +AIX_LIBS = @AIX_LIBS@ +ALIB_CFLAGS = @ALIB_CFLAGS@ +ALIB_LDFLAGS = @ALIB_LDFLAGS@ +ALIB_LIBS = @ALIB_LIBS@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LDFLAGS = @ALSA_LDFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMTAR = @AMTAR@ +API_VERSION = @API_VERSION@ +AR = @AR@ +ARTS_CFLAGS = @ARTS_CFLAGS@ +ARTS_LDFLAGS = @ARTS_LDFLAGS@ +ARTS_LIBS = @ARTS_LIBS@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COREAUDIO_CFLAGS = @COREAUDIO_CFLAGS@ +COREAUDIO_LDFLAGS = @COREAUDIO_LDFLAGS@ +COREAUDIO_LIBS = @COREAUDIO_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DECODER_LOBJ = @DECODER_LOBJ@ +DECODER_OBJ = @DECODER_OBJ@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMMY_CFLAGS = @DUMMY_CFLAGS@ +DUMMY_LDFLAGS = @DUMMY_LDFLAGS@ +DUMMY_LIBS = @DUMMY_LIBS@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ESD_CFLAGS = @ESD_CFLAGS@ +ESD_LDFLAGS = @ESD_LDFLAGS@ +ESD_LIBS = @ESD_LIBS@ +EXEC_LT_LDFLAGS = @EXEC_LT_LDFLAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HP_CFLAGS = @HP_CFLAGS@ +HP_LDFLAGS = @HP_LDFLAGS@ +HP_LIBS = @HP_LIBS@ +INCLUDE_STDIO_H = @INCLUDE_STDIO_H@ +INCLUDE_STDLIB_H = @INCLUDE_STDLIB_H@ +INCLUDE_SYS_TYPE_H = @INCLUDE_SYS_TYPE_H@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LDFLAGS = @JACK_LDFLAGS@ +JACK_LIBS = @JACK_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LFS_LOBJ = @LFS_LOBJ@ +LIBMPG123_VERSION = @LIBMPG123_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_LDFLAGS = @LT_LDFLAGS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MINT_CFLAGS = @MINT_CFLAGS@ +MINT_LDFLAGS = @MINT_LDFLAGS@ +MINT_LIBS = @MINT_LIBS@ +MKDIR_P = @MKDIR_P@ +MODULE_OBJ = @MODULE_OBJ@ +NAS_CFLAGS = @NAS_CFLAGS@ +NAS_LDFLAGS = @NAS_LDFLAGS@ +NAS_LIBS = @NAS_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENAL_CFLAGS = @OPENAL_CFLAGS@ +OPENAL_LDFLAGS = @OPENAL_LDFLAGS@ +OPENAL_LIBS = @OPENAL_LIBS@ +OS2_CFLAGS = @OS2_CFLAGS@ +OS2_LDFLAGS = @OS2_LDFLAGS@ +OS2_LIBS = @OS2_LIBS@ +OSS_CFLAGS = @OSS_CFLAGS@ +OSS_LDFLAGS = @OSS_LDFLAGS@ +OSS_LIBS = @OSS_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +OUTPUT_CFLAGS = @OUTPUT_CFLAGS@ +OUTPUT_LDFLAGS = @OUTPUT_LDFLAGS@ +OUTPUT_LIBS = @OUTPUT_LIBS@ +OUTPUT_MOD = @OUTPUT_MOD@ +OUTPUT_OBJ = @OUTPUT_OBJ@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PORTAUDIO_CFLAGS = @PORTAUDIO_CFLAGS@ +PORTAUDIO_LDFLAGS = @PORTAUDIO_LDFLAGS@ +PORTAUDIO_LIBS = @PORTAUDIO_LIBS@ +PULSE_CFLAGS = @PULSE_CFLAGS@ +PULSE_LDFLAGS = @PULSE_LDFLAGS@ +PULSE_LIBS = @PULSE_LIBS@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LDFLAGS = @SDL_LDFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SGI_CFLAGS = @SGI_CFLAGS@ +SGI_LDFLAGS = @SGI_LDFLAGS@ +SGI_LIBS = @SGI_LIBS@ +SHELL = @SHELL@ +SNDIO_CFLAGS = @SNDIO_CFLAGS@ +SNDIO_LDFLAGS = @SNDIO_LDFLAGS@ +SNDIO_LIBS = @SNDIO_LIBS@ +STRIP = @STRIP@ +SUN_CFLAGS = @SUN_CFLAGS@ +SUN_LDFLAGS = @SUN_LDFLAGS@ +SUN_LIBS = @SUN_LIBS@ +VERSION = @VERSION@ +WIN32_CFLAGS = @WIN32_CFLAGS@ +WIN32_LDFLAGS = @WIN32_LDFLAGS@ +WIN32_LIBS = @WIN32_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +#AM_CFLAGS = @AUDIO_CFLAGS@ +#AM_LDFLAGS = +INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/libmpg123 +EXTRA_DIST = mpg123.h.in +testcpu_dependencies = getcpuflags.$(OBJEXT) +testcpu_sources = testcpu.c +testcpu_LDADD = getcpuflags.$(OBJEXT) +CLEANFILES = *.a + +# The library can have different names, depending on largefile setup. +# Libtool macros think they're smart. Because of that mpg123.la does not work, it must be libmpg123.la . +lib_LTLIBRARIES = libmpg123.la +nodist_include_HEADERS = mpg123.h +libmpg123_la_LDFLAGS = -no-undefined -version-info @LIBMPG123_VERSION@ -export-symbols-regex '^mpg123_' +libmpg123_la_LIBADD = @DECODER_LOBJ@ @LFS_LOBJ@ +libmpg123_la_DEPENDENCIES = @DECODER_LOBJ@ @LFS_LOBJ@ +libmpg123_la_SOURCES = \ + intsym.h \ + compat.c \ + compat.h \ + mpeghead.h \ + parse.c \ + parse.h \ + frame.c \ + format.c \ + frame.h \ + reader.h \ + debug.h \ + decode.h \ + sample.h \ + dct64.c \ + synth.h \ + synth_mono.h \ + synth_ntom.h \ + synth_8bit.h \ + synths.h \ + equalizer.c \ + huffman.h \ + icy.h \ + icy2utf8.h \ + id3.h \ + id3.c \ + true.h \ + getbits.h \ + optimize.h \ + optimize.c \ + readers.c \ + tabinit.c \ + libmpg123.c \ + gapless.h \ + mpg123lib_intern.h \ + mangle.h \ + getcpuflags.h \ + index.h \ + index.c + +EXTRA_libmpg123_la_SOURCES = \ + lfs_alias.c \ + lfs_wrap.c \ + icy.c \ + icy2utf8.c \ + l2tables.h \ + layer1.c \ + layer2.c \ + layer3.c \ + dither.h \ + dither.c \ + feature.c \ + dct36_3dnowext.S \ + dct36_3dnow.S \ + dct64_3dnowext.S \ + dct64_3dnow.S \ + dct64_altivec.c \ + dct64_i386.c \ + dct64_i486.c \ + dct64_mmx.S \ + dct64_sse.S \ + dct64_sse_float.S \ + dct64_x86_64.S \ + dct64_x86_64_float.S \ + dct64_neon.S \ + dct64_neon_float.S \ + synth_3dnowext.S \ + synth_3dnow.S \ + synth_altivec.c \ + synth_i486.c \ + synth_i586_dither.S \ + synth_i586.S \ + synth_mmx.S \ + synth_sse3d.h \ + synth_sse.S \ + synth_sse_float.S \ + synth_sse_s32.S \ + synth_sse_accurate.S \ + synth_stereo_sse_float.S \ + synth_stereo_sse_s32.S \ + synth_stereo_sse_accurate.S \ + synth_x86_64.S \ + synth_x86_64_float.S \ + synth_x86_64_s32.S \ + synth_x86_64_accurate.S \ + synth_stereo_x86_64.S \ + synth_stereo_x86_64_float.S \ + synth_stereo_x86_64_s32.S \ + synth_stereo_x86_64_accurate.S \ + synth_arm.S \ + synth_arm_accurate.S \ + synth_neon.S \ + synth_neon_float.S \ + synth_neon_s32.S \ + synth_neon_accurate.S \ + synth_stereo_neon.S \ + synth_stereo_neon_float.S \ + synth_stereo_neon_s32.S \ + synth_stereo_neon_accurate.S \ + ntom.c \ + synth.c \ + synth_8bit.c \ + synth_real.c \ + synth_s32.c \ + equalizer_3dnow.S \ + tabinit_mmx.S \ + stringbuf.c \ + getcpuflags.S \ + l12_integer_tables.h \ + l3_integer_tables.h + +all: all-am + +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libmpg123/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/libmpg123/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +mpg123.h: $(top_builddir)/config.status $(srcdir)/mpg123.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +libmpg123.la: $(libmpg123_la_OBJECTS) $(libmpg123_la_DEPENDENCIES) $(EXTRA_libmpg123_la_DEPENDENCIES) + $(libmpg123_la_LINK) -rpath $(libdir) $(libmpg123_la_OBJECTS) $(libmpg123_la_LIBADD) $(LIBS) +testcpu$(EXEEXT): $(testcpu_OBJECTS) $(testcpu_DEPENDENCIES) $(EXTRA_testcpu_DEPENDENCIES) + @rm -f testcpu$(EXEEXT) + $(LINK) $(testcpu_OBJECTS) $(testcpu_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct36_3dnow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct36_3dnowext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_3dnow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_3dnowext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_altivec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_i386.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_i486.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_mmx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_neon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_neon_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_sse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_sse_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_x86_64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dct64_x86_64_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/equalizer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/equalizer_3dnow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/feature.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frame.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcpuflags.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icy2utf8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layer1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layer2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layer3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lfs_alias.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lfs_wrap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpg123.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntom.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optimize.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringbuf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_3dnow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_3dnowext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_8bit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_altivec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_arm.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_arm_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_i486.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_i586.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_i586_dither.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_mmx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_neon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_neon_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_neon_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_neon_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_real.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_sse.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_sse_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_sse_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_sse_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_neon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_neon_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_neon_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_neon_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_sse_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_sse_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_sse_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_x86_64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_x86_64_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_x86_64_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_stereo_x86_64_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_x86_64.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_x86_64_accurate.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_x86_64_float.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/synth_x86_64_s32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tabinit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tabinit_mmx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcpu.Po@am__quote@ + +.S.o: +@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ $< + +.S.obj: +@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.S.lo: +@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCCAS_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(LTCPPASCOMPILE) -c -o $@ $< + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-nodist_includeHEADERS: $(nodist_include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-nodist_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-nodist_includeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES uninstall-nodist_includeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man \ + install-nodist_includeHEADERS install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-nodist_includeHEADERS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/compat.c b/node_modules/lame/deps/mpg123/src/libmpg123/compat.c new file mode 100644 index 0000000..18ea76e --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/compat.c @@ -0,0 +1,138 @@ +/* + compat: Some compatibility functions. + + The mpg123 code is determined to keep it's legacy. A legacy of old, old UNIX. + So anything possibly somewhat advanced should be considered to be put here, with proper #ifdef;-) + + copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis, Windows Unicode stuff by JonY. +*/ + +#include "config.h" +#include "compat.h" + +#ifdef _MSC_VER +#include +#else +#include +#endif +#include + +#ifdef WANT_WIN32_UNICODE +#include +#include +#include +#endif + +#include "debug.h" + +/* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ +void *safe_realloc(void *ptr, size_t size) +{ + if(ptr == NULL) return malloc(size); + else return realloc(ptr, size); +} + +#ifndef HAVE_STRERROR +const char *strerror(int errnum) +{ + extern int sys_nerr; + extern char *sys_errlist[]; + + return (errnum < sys_nerr) ? sys_errlist[errnum] : ""; +} +#endif + +#ifndef HAVE_STRDUP +char *strdup(const char *src) +{ + char *dest; + + if (!(dest = (char *) malloc(strlen(src)+1))) + return NULL; + else + return strcpy(dest, src); +} +#endif + +int compat_open(const char *filename, int flags) +{ + int ret; +#if defined (WANT_WIN32_UNICODE) + wchar_t *frag = NULL; + + ret = win32_utf8_wide(filename, &frag, NULL); + if ((frag == NULL) || (ret == 0)) goto fallback; /* Fallback to plain open when ucs-2 conversion fails */ + + ret = _wopen(frag, flags); /*Try _wopen */ + if (ret != -1 ) goto open_ok; /* msdn says -1 means failure */ + +fallback: +#endif + +#if (defined(WIN32) && !defined (__CYGWIN__)) /* MSDN says POSIX function is deprecated beginning in Visual C++ 2005 */ + ret = _open(filename, flags); /* Try plain old _open(), if it fails, do nothing */ +#else + /* On UNIX, we always add a default permission mask in case flags|O_CREAT. */ + ret = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); +#endif + +#if defined (WANT_WIN32_UNICODE) +open_ok: + free ((void *)frag); /* Freeing a NULL should be OK */ +#endif + + return ret; +} + +int compat_close(int infd) +{ +#if (defined(WIN32) && !defined (__CYGWIN__)) /* MSDN says POSIX function is deprecated beginning in Visual C++ 2005 */ + return _close(infd); +#else + return close(infd); +#endif +} + +/* Windows Unicode stuff */ + +#ifdef WANT_WIN32_UNICODE +int win32_wide_utf8(const wchar_t * const wptr, char **mbptr, size_t * buflen) +{ + size_t len; + char *buf; + int ret = 0; + + len = WideCharToMultiByte(CP_UTF8, 0, wptr, -1, NULL, 0, NULL, NULL); /* Get utf-8 string length */ + buf = calloc(len + 1, sizeof (char)); /* Can we assume sizeof char always = 1? */ + + if(!buf) len = 0; + else { + if (len != 0) ret = WideCharToMultiByte(CP_UTF8, 0, wptr, -1, buf, len, NULL, NULL); /*Do actual conversion*/ + buf[len] = '0'; /* Must terminate */ + } + *mbptr = buf; /* Set string pointer to allocated buffer */ + if(buflen != NULL) *buflen = (len) * sizeof (char); /* Give length of allocated memory if needed. */ + return ret; +} + +int win32_utf8_wide(const char *const mbptr, wchar_t **wptr, size_t *buflen) +{ + size_t len; + wchar_t *buf; + int ret = 0; + + len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, mbptr, -1, NULL, 0); /* Get converted size */ + buf = calloc(len + 1, sizeof (wchar_t)); /* Allocate memory accordingly */ + + if(!buf) len = 0; + else { + if (len != 0) ret = MultiByteToWideChar (CP_UTF8, MB_ERR_INVALID_CHARS, mbptr, -1, buf, len); /* Do conversion */ + buf[len] = L'0'; /* Must terminate */ + } + *wptr = buf; /* Set string pointer to allocated buffer */ + if (buflen != NULL) *buflen = len * sizeof (wchar_t); /* Give length of allocated memory if needed. */ + return ret; /* Number of characters written */ +} +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/compat.h b/node_modules/lame/deps/mpg123/src/libmpg123/compat.h new file mode 100644 index 0000000..046d23b --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/compat.h @@ -0,0 +1,178 @@ +/* + compat: Some compatibility functions and header inclusions. + Basic standard C stuff, that may barely be above/around C89. + + The mpg123 code is determined to keep it's legacy. A legacy of old, old UNIX. + It is envisioned to include this compat header instead of any of the "standard" headers, to catch compatibility issues. + So, don't include stdlib.h or string.h ... include compat.h. + + copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#ifndef MPG123_COMPAT_H +#define MPG123_COMPAT_H + +#include "config.h" +#include "intsym.h" + +#ifdef HAVE_STDLIB_H +/* realloc, size_t */ +#include +#endif + +#include +#include + +#ifdef HAVE_SIGNAL_H +#include +#else +#ifdef HAVE_SYS_SIGNAL_H +#include +#endif +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +/* Types, types, types. */ +/* Do we actually need these two in addition to sys/types.h? As replacement? */ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_INTTYPES_H +#include +#endif +#ifdef HAVE_STDINT_H +#include +#endif +/* We want SIZE_MAX, etc. */ +#ifdef HAVE_LIMITS_H +#include +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX ((size_t)-1) +#endif +#ifndef ULONG_MAX +#define ULONG_MAX ((unsigned long)-1) +#endif + +#ifdef HAVE_STRING_H +#include +#endif + +#ifdef OS2 +#include +#endif + +#ifdef HAVE_SYS_TIME_H +#include +#endif +/* For select(), I need select.h according to POSIX 2001, else: sys/time.h sys/types.h unistd.h */ +#ifdef HAVE_SYS_SELECT_H +#include +#endif + +/* To parse big numbers... */ +#ifdef HAVE_ATOLL +#define atobigint atoll +#else +#define atobigint atol +#endif + +typedef unsigned char byte; + +/* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ +void *safe_realloc(void *ptr, size_t size); +#ifndef HAVE_STRERROR +const char *strerror(int errnum); +#endif + +#ifndef HAVE_STRDUP +char *strdup(const char *s); +#endif + +/* If we have the size checks enabled, try to derive some sane printfs. + Simple start: Use max integer type and format if long is not big enough. + I am hesitating to use %ll without making sure that it's there... */ +#if !(defined PLAIN_C89) && (defined SIZEOF_OFF_T) && (SIZEOF_OFF_T > SIZEOF_LONG) && (defined PRIiMAX) +# define OFF_P PRIiMAX +typedef intmax_t off_p; +#else +# define OFF_P "li" +typedef long off_p; +#endif + +#if !(defined PLAIN_C89) && (defined SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > SIZEOF_LONG) && (defined PRIuMAX) +# define SIZE_P PRIuMAX +typedef uintmax_t size_p; +#else +# define SIZE_P "lu" +typedef unsigned long size_p; +#endif + +#if !(defined PLAIN_C89) && (defined SIZEOF_SSIZE_T) && (SIZEOF_SSIZE_T > SIZEOF_LONG) && (defined PRIiMAX) +# define SSIZE_P PRIuMAX +typedef intmax_t ssize_p; +#else +# define SSIZE_P "li" +typedef long ssize_p; +#endif + +/** + * Opening a file handle can be different. + * This function here is defined to take a path in native encoding (ISO8859 / UTF-8 / ...), or, when MS Windows Unicode support is enabled, an UTF-8 string that will be converted back to native UCS-2 (wide character) before calling the system's open function. + * @param[in] wptr Pointer to wide string. + * @param[in] mbptr Pointer to multibyte string. + * @return file descriptor (>=0) or error code. + */ +int compat_open(const char *filename, int flags); + +/** + * Closing a file handle can be platform specific. + * This function takes a file descriptor that is to be closed. + * @param[in] infd File descriptor to be closed. + * @return 0 if the file was successfully closed. A return value of -1 indicates an error. + */ +int compat_close(int infd); + +/* Those do make sense in a separate file, but I chose to include them in compat.c because that's the one source whose object is shared between mpg123 and libmpg123 -- and both need the functionality internally. */ + +#ifdef WANT_WIN32_UNICODE +/** + * win32_uni2mbc + * Converts a null terminated UCS-2 string to a multibyte (UTF-8) equivalent. + * Caller is supposed to free allocated buffer. + * @param[in] wptr Pointer to wide string. + * @param[out] mbptr Pointer to multibyte string. + * @param[out] buflen Optional parameter for length of allocated buffer. + * @return status of WideCharToMultiByte conversion. + * + * WideCharToMultiByte - http://msdn.microsoft.com/en-us/library/dd374130(VS.85).aspx + */ +int win32_wide_utf8(const wchar_t * const wptr, char **mbptr, size_t * buflen); + +/** + * win32_mbc2uni + * Converts a null terminated UTF-8 string to a UCS-2 equivalent. + * Caller is supposed to free allocated buffer. + * @param[out] mbptr Pointer to multibyte string. + * @param[in] wptr Pointer to wide string. + * @param[out] buflen Optional parameter for length of allocated buffer. + * @return status of WideCharToMultiByte conversion. + * + * MultiByteToWideChar - http://msdn.microsoft.com/en-us/library/dd319072(VS.85).aspx + */ + +int win32_utf8_wide(const char *const mbptr, wchar_t **wptr, size_t *buflen); +#endif + +/* That one comes from Tellie on OS/2, needed in resolver. */ +#ifdef __KLIBC__ +typedef int socklen_t; +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct36_3dnow.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct36_3dnow.S new file mode 100644 index 0000000..644204f --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct36_3dnow.S @@ -0,0 +1,505 @@ +/* + dct64_3dnow.s: Replacement of dct36() with AMD's 3DNow! SIMD operations support + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Syuuhei Kashiyama + + This code based 'dct36_3dnow.s' by Syuuhei Kashiyama + ,only two types of changes have been made: + + - remove PREFETCH instruction for speedup + - change function name for support 3DNow! automatic detect + + You can find Kashiyama's original 3dnow! support patch + (for mpg123-0.59o) at + http://user.ecc.u-tokyo.ac.jp/~g810370/linux-simd/ (Japanese). + + by KIMURA Takuhiro - until 31.Mar.1999 + - after 1.Apr.1999 + + Replacement of dct36() with AMD's 3DNow! SIMD operations support + + Syuuhei Kashiyama + + The author of this program disclaim whole expressed or implied + warranties with regard to this program, and in no event shall the + author of this program liable to whatever resulted from the use of + this program. Use it at your own risk. +*/ + +#include "mangle.h" + + .globl ASM_NAME(dct36_3dnow) +/* .type ASM_NAME(dct36_3dnow),@function */ +ASM_NAME(dct36_3dnow): + pushl %ebp + movl %esp,%ebp + subl $120,%esp + pushl %esi + pushl %ebx + movl 8(%ebp),%eax + movl 12(%ebp),%esi + movl 16(%ebp),%ecx + movl 20(%ebp),%edx + movl 24(%ebp),%ebx + leal -128(%ebp),%esp + + femms + movq (%eax),%mm0 + movq 4(%eax),%mm1 + pfadd %mm1,%mm0 + movq %mm0,4(%eax) + psrlq $32,%mm1 + movq 12(%eax),%mm2 + punpckldq %mm2,%mm1 + pfadd %mm2,%mm1 + movq %mm1,12(%eax) + psrlq $32,%mm2 + movq 20(%eax),%mm3 + punpckldq %mm3,%mm2 + pfadd %mm3,%mm2 + movq %mm2,20(%eax) + psrlq $32,%mm3 + movq 28(%eax),%mm4 + punpckldq %mm4,%mm3 + pfadd %mm4,%mm3 + movq %mm3,28(%eax) + psrlq $32,%mm4 + movq 36(%eax),%mm5 + punpckldq %mm5,%mm4 + pfadd %mm5,%mm4 + movq %mm4,36(%eax) + psrlq $32,%mm5 + movq 44(%eax),%mm6 + punpckldq %mm6,%mm5 + pfadd %mm6,%mm5 + movq %mm5,44(%eax) + psrlq $32,%mm6 + movq 52(%eax),%mm7 + punpckldq %mm7,%mm6 + pfadd %mm7,%mm6 + movq %mm6,52(%eax) + psrlq $32,%mm7 + movq 60(%eax),%mm0 + punpckldq %mm0,%mm7 + pfadd %mm0,%mm7 + movq %mm7,60(%eax) + psrlq $32,%mm0 + movd 68(%eax),%mm1 + pfadd %mm1,%mm0 + movd %mm0,68(%eax) + movd 4(%eax),%mm0 + movd 12(%eax),%mm1 + punpckldq %mm1,%mm0 + punpckldq 20(%eax),%mm1 + pfadd %mm1,%mm0 + movd %mm0,12(%eax) + psrlq $32,%mm0 + movd %mm0,20(%eax) + psrlq $32,%mm1 + movd 28(%eax),%mm2 + punpckldq %mm2,%mm1 + punpckldq 36(%eax),%mm2 + pfadd %mm2,%mm1 + movd %mm1,28(%eax) + psrlq $32,%mm1 + movd %mm1,36(%eax) + psrlq $32,%mm2 + movd 44(%eax),%mm3 + punpckldq %mm3,%mm2 + punpckldq 52(%eax),%mm3 + pfadd %mm3,%mm2 + movd %mm2,44(%eax) + psrlq $32,%mm2 + movd %mm2,52(%eax) + psrlq $32,%mm3 + movd 60(%eax),%mm4 + punpckldq %mm4,%mm3 + punpckldq 68(%eax),%mm4 + pfadd %mm4,%mm3 + movd %mm3,60(%eax) + psrlq $32,%mm3 + movd %mm3,68(%eax) + + movq 24(%eax),%mm0 + movq 48(%eax),%mm1 + movd ASM_NAME(COS9)+12,%mm2 + punpckldq %mm2,%mm2 + movd ASM_NAME(COS9)+24,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm2,%mm0 + pfmul %mm3,%mm1 + pushl %eax + movl $1,%eax + movd %eax,%mm7 + pi2fd %mm7,%mm7 + popl %eax + movq 8(%eax),%mm2 + movd ASM_NAME(COS9)+4,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfadd %mm0,%mm2 + movq 40(%eax),%mm3 + movd ASM_NAME(COS9)+20,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq 56(%eax),%mm3 + movd ASM_NAME(COS9)+28,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd ASM_NAME(COS9)+8,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq 32(%eax),%mm4 + movd ASM_NAME(COS9)+16,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd ASM_NAME(COS9)+32,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+0,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 108(%edx),%mm6 + punpckldq 104(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,36(%ecx) + psrlq $32,%mm5 + movd %mm5,32(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 32(%edx),%mm6 + punpckldq 36(%edx),%mm6 + pfmul %mm6,%mm5 + movd 32(%esi),%mm6 + punpckldq 36(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,1024(%ebx) + psrlq $32,%mm5 + movd %mm5,1152(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+32,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 140(%edx),%mm6 + punpckldq 72(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,68(%ecx) + psrlq $32,%mm5 + movd %mm5,0(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 0(%edx),%mm6 + punpckldq 68(%edx),%mm6 + pfmul %mm6,%mm5 + movd 0(%esi),%mm6 + punpckldq 68(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,0(%ebx) + psrlq $32,%mm5 + movd %mm5,2176(%ebx) + movq 8(%eax),%mm2 + movq 40(%eax),%mm3 + pfsub %mm3,%mm2 + movq 56(%eax),%mm3 + pfsub %mm3,%mm2 + movd ASM_NAME(COS9)+12,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + movq 16(%eax),%mm3 + movq 32(%eax),%mm4 + pfsub %mm4,%mm3 + movq 64(%eax),%mm4 + pfsub %mm4,%mm3 + movd ASM_NAME(COS9)+24,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + movq 48(%eax),%mm4 + pfsub %mm4,%mm3 + movq (%eax),%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+4,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 112(%edx),%mm6 + punpckldq 100(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,40(%ecx) + psrlq $32,%mm5 + movd %mm5,28(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 28(%edx),%mm6 + punpckldq 40(%edx),%mm6 + pfmul %mm6,%mm5 + movd 28(%esi),%mm6 + punpckldq 40(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,896(%ebx) + psrlq $32,%mm5 + movd %mm5,1280(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+28,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 136(%edx),%mm6 + punpckldq 76(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,64(%ecx) + psrlq $32,%mm5 + movd %mm5,4(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 4(%edx),%mm6 + punpckldq 64(%edx),%mm6 + pfmul %mm6,%mm5 + movd 4(%esi),%mm6 + punpckldq 64(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,128(%ebx) + psrlq $32,%mm5 + movd %mm5,2048(%ebx) + + movq 8(%eax),%mm2 + movd ASM_NAME(COS9)+20,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfsub %mm0,%mm2 + movq 40(%eax),%mm3 + movd ASM_NAME(COS9)+28,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfsub %mm3,%mm2 + movq 56(%eax),%mm3 + movd ASM_NAME(COS9)+4,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd ASM_NAME(COS9)+32,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq 32(%eax),%mm4 + movd ASM_NAME(COS9)+8,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd ASM_NAME(COS9)+16,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+8,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 116(%edx),%mm6 + punpckldq 96(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,44(%ecx) + psrlq $32,%mm5 + movd %mm5,24(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 24(%edx),%mm6 + punpckldq 44(%edx),%mm6 + pfmul %mm6,%mm5 + movd 24(%esi),%mm6 + punpckldq 44(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,768(%ebx) + psrlq $32,%mm5 + movd %mm5,1408(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+24,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 132(%edx),%mm6 + punpckldq 80(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,60(%ecx) + psrlq $32,%mm5 + movd %mm5,8(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 8(%edx),%mm6 + punpckldq 60(%edx),%mm6 + pfmul %mm6,%mm5 + movd 8(%esi),%mm6 + punpckldq 60(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,256(%ebx) + psrlq $32,%mm5 + movd %mm5,1920(%ebx) + movq 8(%eax),%mm2 + movd ASM_NAME(COS9)+28,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfsub %mm0,%mm2 + movq 40(%eax),%mm3 + movd ASM_NAME(COS9)+4,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq 56(%eax),%mm3 + movd ASM_NAME(COS9)+20,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfsub %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd ASM_NAME(COS9)+16,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq 32(%eax),%mm4 + movd ASM_NAME(COS9)+32,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd ASM_NAME(COS9)+8,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+12,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 120(%edx),%mm6 + punpckldq 92(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,48(%ecx) + psrlq $32,%mm5 + movd %mm5,20(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 20(%edx),%mm6 + punpckldq 48(%edx),%mm6 + pfmul %mm6,%mm5 + movd 20(%esi),%mm6 + punpckldq 48(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,640(%ebx) + psrlq $32,%mm5 + movd %mm5,1536(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+20,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 128(%edx),%mm6 + punpckldq 84(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,56(%ecx) + psrlq $32,%mm5 + movd %mm5,12(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 12(%edx),%mm6 + punpckldq 56(%edx),%mm6 + pfmul %mm6,%mm5 + movd 12(%esi),%mm6 + punpckldq 56(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,384(%ebx) + psrlq $32,%mm5 + movd %mm5,1792(%ebx) + + movq (%eax),%mm4 + movq 16(%eax),%mm3 + pfsub %mm3,%mm4 + movq 32(%eax),%mm3 + pfadd %mm3,%mm4 + movq 48(%eax),%mm3 + pfsub %mm3,%mm4 + movq 64(%eax),%mm3 + pfadd %mm3,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+16,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 124(%edx),%mm6 + punpckldq 88(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,52(%ecx) + psrlq $32,%mm5 + movd %mm5,16(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 16(%edx),%mm6 + punpckldq 52(%edx),%mm6 + pfmul %mm6,%mm5 + movd 16(%esi),%mm6 + punpckldq 52(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,512(%ebx) + psrlq $32,%mm5 + movd %mm5,1664(%ebx) + + femms + popl %ebx + popl %esi + movl %ebp,%esp + popl %ebp + ret + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct36_3dnowext.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct36_3dnowext.S new file mode 100644 index 0000000..6bfacc2 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct36_3dnowext.S @@ -0,0 +1,512 @@ +/* + dct36_3dnowext: extended 3DNow optimized DCT36 + + copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + Transformed back into standalone asm, with help of + gcc -S -DHAVE_CONFIG_H -I. -march=k6-3 -O3 -Wall -pedantic -fno-strict-aliasing -DREAL_IS_FLOAT -c -o dct36_3dnowext.{S,c} + + MPlayer comment follows. +*/ + +/* + * dct36_3dnow.c - 3DNow! optimized dct36() + * + * This code based 'dct36_3dnow.s' by Syuuhei Kashiyama + * , only two types of changes have been made: + * + * - removed PREFETCH instruction for speedup + * - changed function name for support 3DNow! automatic detection + * + * You can find Kashiyama's original 3dnow! support patch + * (for mpg123-0.59o) at + * http://user.ecc.u-tokyo.ac.jp/~g810370/linux-simd/ (Japanese). + * + * by KIMURA Takuhiro - until 31.Mar.1999 + * - after 1.Apr.1999 + * + * Modified for use with MPlayer, for details see the changelog at + * http://svn.mplayerhq.hu/mplayer/trunk/ + * $Id: dct36_3dnow.c 18786 2006-06-22 13:34:00Z diego $ + * + * Original disclaimer: + * The author of this program disclaim whole expressed or implied + * warranties with regard to this program, and in no event shall the + * author of this program liable to whatever resulted from the use of + * this program. Use it at your own risk. + * + * 2003/06/21: Moved to GCC inline assembly - Alex Beregszaszi + */ + +#include "mangle.h" + + .text + ALIGN32 +.globl ASM_NAME(dct36_3dnowext) + /* .type ASM_NAME(dct36_3dnowext), @function */ +ASM_NAME(dct36_3dnowext): + pushl %ebp + movl %esp, %ebp + pushl %esi + pushl %ebx + movl 8(%ebp), %eax + movl 12(%ebp), %esi + movl 16(%ebp), %ecx + movl 20(%ebp), %edx + movl 24(%ebp), %ebx +/* APP */ + movq (%eax),%mm0 + movq 4(%eax),%mm1 + pfadd %mm1,%mm0 + movq %mm0,4(%eax) + psrlq $32,%mm1 + movq 12(%eax),%mm2 + punpckldq %mm2,%mm1 + pfadd %mm2,%mm1 + movq %mm1,12(%eax) + psrlq $32,%mm2 + movq 20(%eax),%mm3 + punpckldq %mm3,%mm2 + pfadd %mm3,%mm2 + movq %mm2,20(%eax) + psrlq $32,%mm3 + movq 28(%eax),%mm4 + punpckldq %mm4,%mm3 + pfadd %mm4,%mm3 + movq %mm3,28(%eax) + psrlq $32,%mm4 + movq 36(%eax),%mm5 + punpckldq %mm5,%mm4 + pfadd %mm5,%mm4 + movq %mm4,36(%eax) + psrlq $32,%mm5 + movq 44(%eax),%mm6 + punpckldq %mm6,%mm5 + pfadd %mm6,%mm5 + movq %mm5,44(%eax) + psrlq $32,%mm6 + movq 52(%eax),%mm7 + punpckldq %mm7,%mm6 + pfadd %mm7,%mm6 + movq %mm6,52(%eax) + psrlq $32,%mm7 + movq 60(%eax),%mm0 + punpckldq %mm0,%mm7 + pfadd %mm0,%mm7 + movq %mm7,60(%eax) + psrlq $32,%mm0 + movd 68(%eax),%mm1 + pfadd %mm1,%mm0 + movd %mm0,68(%eax) + movd 4(%eax),%mm0 + movd 12(%eax),%mm1 + punpckldq %mm1,%mm0 + punpckldq 20(%eax),%mm1 + pfadd %mm1,%mm0 + movd %mm0,12(%eax) + psrlq $32,%mm0 + movd %mm0,20(%eax) + psrlq $32,%mm1 + movd 28(%eax),%mm2 + punpckldq %mm2,%mm1 + punpckldq 36(%eax),%mm2 + pfadd %mm2,%mm1 + movd %mm1,28(%eax) + psrlq $32,%mm1 + movd %mm1,36(%eax) + psrlq $32,%mm2 + movd 44(%eax),%mm3 + punpckldq %mm3,%mm2 + punpckldq 52(%eax),%mm3 + pfadd %mm3,%mm2 + movd %mm2,44(%eax) + psrlq $32,%mm2 + movd %mm2,52(%eax) + psrlq $32,%mm3 + movd 60(%eax),%mm4 + punpckldq %mm4,%mm3 + punpckldq 68(%eax),%mm4 + pfadd %mm4,%mm3 + movd %mm3,60(%eax) + psrlq $32,%mm3 + movd %mm3,68(%eax) + movq 24(%eax),%mm0 + movq 48(%eax),%mm1 + movd ASM_NAME(COS9)+12,%mm2 + punpckldq %mm2,%mm2 + movd ASM_NAME(COS9)+24,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm2,%mm0 + pfmul %mm3,%mm1 + pushl %eax + movl $1,%eax + movd %eax,%mm7 + pi2fd %mm7,%mm7 + popl %eax + movq 8(%eax),%mm2 + movd ASM_NAME(COS9)+4,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfadd %mm0,%mm2 + movq 40(%eax),%mm3 + movd ASM_NAME(COS9)+20,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq 56(%eax),%mm3 + movd ASM_NAME(COS9)+28,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd ASM_NAME(COS9)+8,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq 32(%eax),%mm4 + movd ASM_NAME(COS9)+16,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd ASM_NAME(COS9)+32,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+0,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 108(%edx),%mm6 + punpckldq 104(%edx),%mm6 + pfmul %mm6,%mm5 + pswapd %mm5,%mm5 + movq %mm5,32(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 32(%edx),%mm6 + punpckldq 36(%edx),%mm6 + pfmul %mm6,%mm5 + movd 32(%esi),%mm6 + punpckldq 36(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,1024(%ebx) + psrlq $32,%mm5 + movd %mm5,1152(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+32,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 140(%edx),%mm6 + punpckldq 72(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,68(%ecx) + psrlq $32,%mm5 + movd %mm5,0(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 0(%edx),%mm6 + punpckldq 68(%edx),%mm6 + pfmul %mm6,%mm5 + movd 0(%esi),%mm6 + punpckldq 68(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,0(%ebx) + psrlq $32,%mm5 + movd %mm5,2176(%ebx) + movq 8(%eax),%mm2 + movq 40(%eax),%mm3 + pfsub %mm3,%mm2 + movq 56(%eax),%mm3 + pfsub %mm3,%mm2 + movd ASM_NAME(COS9)+12,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + movq 16(%eax),%mm3 + movq 32(%eax),%mm4 + pfsub %mm4,%mm3 + movq 64(%eax),%mm4 + pfsub %mm4,%mm3 + movd ASM_NAME(COS9)+24,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + movq 48(%eax),%mm4 + pfsub %mm4,%mm3 + movq (%eax),%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+4,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 112(%edx),%mm6 + punpckldq 100(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,40(%ecx) + psrlq $32,%mm5 + movd %mm5,28(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 28(%edx),%mm6 + punpckldq 40(%edx),%mm6 + pfmul %mm6,%mm5 + movd 28(%esi),%mm6 + punpckldq 40(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,896(%ebx) + psrlq $32,%mm5 + movd %mm5,1280(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+28,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 136(%edx),%mm6 + punpckldq 76(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,64(%ecx) + psrlq $32,%mm5 + movd %mm5,4(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 4(%edx),%mm6 + punpckldq 64(%edx),%mm6 + pfmul %mm6,%mm5 + movd 4(%esi),%mm6 + punpckldq 64(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,128(%ebx) + psrlq $32,%mm5 + movd %mm5,2048(%ebx) + movq 8(%eax),%mm2 + movd ASM_NAME(COS9)+20,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfsub %mm0,%mm2 + movq 40(%eax),%mm3 + movd ASM_NAME(COS9)+28,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfsub %mm3,%mm2 + movq 56(%eax),%mm3 + movd ASM_NAME(COS9)+4,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd ASM_NAME(COS9)+32,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq 32(%eax),%mm4 + movd ASM_NAME(COS9)+8,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd ASM_NAME(COS9)+16,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+8,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 116(%edx),%mm6 + punpckldq 96(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,44(%ecx) + psrlq $32,%mm5 + movd %mm5,24(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 24(%edx),%mm6 + punpckldq 44(%edx),%mm6 + pfmul %mm6,%mm5 + movd 24(%esi),%mm6 + punpckldq 44(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,768(%ebx) + psrlq $32,%mm5 + movd %mm5,1408(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+24,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 132(%edx),%mm6 + punpckldq 80(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,60(%ecx) + psrlq $32,%mm5 + movd %mm5,8(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 8(%edx),%mm6 + punpckldq 60(%edx),%mm6 + pfmul %mm6,%mm5 + movd 8(%esi),%mm6 + punpckldq 60(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,256(%ebx) + psrlq $32,%mm5 + movd %mm5,1920(%ebx) + movq 8(%eax),%mm2 + movd ASM_NAME(COS9)+28,%mm3 + punpckldq %mm3,%mm3 + pfmul %mm3,%mm2 + pfsub %mm0,%mm2 + movq 40(%eax),%mm3 + movd ASM_NAME(COS9)+4,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfadd %mm3,%mm2 + movq 56(%eax),%mm3 + movd ASM_NAME(COS9)+20,%mm4 + punpckldq %mm4,%mm4 + pfmul %mm4,%mm3 + pfsub %mm3,%mm2 + movq (%eax),%mm3 + movq 16(%eax),%mm4 + movd ASM_NAME(COS9)+16,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq 32(%eax),%mm4 + movd ASM_NAME(COS9)+32,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfadd %mm4,%mm3 + pfadd %mm1,%mm3 + movq 64(%eax),%mm4 + movd ASM_NAME(COS9)+8,%mm5 + punpckldq %mm5,%mm5 + pfmul %mm5,%mm4 + pfsub %mm4,%mm3 + movq %mm2,%mm4 + pfadd %mm3,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+12,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 120(%edx),%mm6 + punpckldq 92(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,48(%ecx) + psrlq $32,%mm5 + movd %mm5,20(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 20(%edx),%mm6 + punpckldq 48(%edx),%mm6 + pfmul %mm6,%mm5 + movd 20(%esi),%mm6 + punpckldq 48(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,640(%ebx) + psrlq $32,%mm5 + movd %mm5,1536(%ebx) + movq %mm3,%mm4 + pfsub %mm2,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+20,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 128(%edx),%mm6 + punpckldq 84(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,56(%ecx) + psrlq $32,%mm5 + movd %mm5,12(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 12(%edx),%mm6 + punpckldq 56(%edx),%mm6 + pfmul %mm6,%mm5 + movd 12(%esi),%mm6 + punpckldq 56(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,384(%ebx) + psrlq $32,%mm5 + movd %mm5,1792(%ebx) + movq (%eax),%mm4 + movq 16(%eax),%mm3 + pfsub %mm3,%mm4 + movq 32(%eax),%mm3 + pfadd %mm3,%mm4 + movq 48(%eax),%mm3 + pfsub %mm3,%mm4 + movq 64(%eax),%mm3 + pfadd %mm3,%mm4 + movq %mm7,%mm5 + punpckldq ASM_NAME(tfcos36)+16,%mm5 + pfmul %mm5,%mm4 + movq %mm4,%mm5 + pfacc %mm5,%mm5 + movd 124(%edx),%mm6 + punpckldq 88(%edx),%mm6 + pfmul %mm6,%mm5 + movd %mm5,52(%ecx) + psrlq $32,%mm5 + movd %mm5,16(%ecx) + movq %mm4,%mm6 + punpckldq %mm6,%mm5 + pfsub %mm6,%mm5 + punpckhdq %mm5,%mm5 + movd 16(%edx),%mm6 + punpckldq 52(%edx),%mm6 + pfmul %mm6,%mm5 + movd 16(%esi),%mm6 + punpckldq 52(%esi),%mm6 + pfadd %mm6,%mm5 + movd %mm5,512(%ebx) + psrlq $32,%mm5 + movd %mm5,1664(%ebx) + femms + +/* NO_APP */ + popl %ebx + popl %esi + leave + ret + /* .size ASM_NAME(dct36_3dnowext), .-ASM_NAME(dct36_3dnowext) */ + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64.c b/node_modules/lame/deps/mpg123/src/libmpg123/dct64.c new file mode 100644 index 0000000..a25047a --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64.c @@ -0,0 +1,174 @@ +/* + dct64.c: DCT64, the plain C version + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +/* + * Discrete Cosine Tansform (DCT) for subband synthesis + * + * -funroll-loops (for gcc) will remove the loops for better performance + * using loops in the source-code enhances readabillity + * + * + * TODO: write an optimized version for the down-sampling modes + * (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero + */ + +#include "mpg123lib_intern.h" + +void dct64(real *out0,real *out1,real *samples) +{ + real bufs[64]; + + { + register int i,j; + register real *b1,*b2,*bs,*costab; + + b1 = samples; + bs = bufs; + costab = pnts[0]+16; + b2 = b1 + 32; + + for(i=15;i>=0;i--) + *bs++ = (*b1++ + *--b2); + for(i=15;i>=0;i--) + *bs++ = REAL_MUL((*--b2 - *b1++), *--costab); + + b1 = bufs; + costab = pnts[1]+8; + b2 = b1 + 16; + + { + for(i=7;i>=0;i--) + *bs++ = (*b1++ + *--b2); + for(i=7;i>=0;i--) + *bs++ = REAL_MUL((*--b2 - *b1++), *--costab); + b2 += 32; + costab += 8; + for(i=7;i>=0;i--) + *bs++ = (*b1++ + *--b2); + for(i=7;i>=0;i--) + *bs++ = REAL_MUL((*b1++ - *--b2), *--costab); + b2 += 32; + } + + bs = bufs; + costab = pnts[2]; + b2 = b1 + 8; + + for(j=2;j;j--) + { + for(i=3;i>=0;i--) + *bs++ = (*b1++ + *--b2); + for(i=3;i>=0;i--) + *bs++ = REAL_MUL((*--b2 - *b1++), costab[i]); + b2 += 16; + for(i=3;i>=0;i--) + *bs++ = (*b1++ + *--b2); + for(i=3;i>=0;i--) + *bs++ = REAL_MUL((*b1++ - *--b2), costab[i]); + b2 += 16; + } + + b1 = bufs; + costab = pnts[3]; + b2 = b1 + 4; + + for(j=4;j;j--) + { + *bs++ = (*b1++ + *--b2); + *bs++ = (*b1++ + *--b2); + *bs++ = REAL_MUL((*--b2 - *b1++), costab[1]); + *bs++ = REAL_MUL((*--b2 - *b1++), costab[0]); + b2 += 8; + *bs++ = (*b1++ + *--b2); + *bs++ = (*b1++ + *--b2); + *bs++ = REAL_MUL((*b1++ - *--b2), costab[1]); + *bs++ = REAL_MUL((*b1++ - *--b2), costab[0]); + b2 += 8; + } + bs = bufs; + costab = pnts[4]; + + for(j=8;j;j--) + { + real v0,v1; + v0=*b1++; v1 = *b1++; + *bs++ = (v0 + v1); + *bs++ = REAL_MUL((v0 - v1), (*costab)); + v0=*b1++; v1 = *b1++; + *bs++ = (v0 + v1); + *bs++ = REAL_MUL((v1 - v0), (*costab)); + } + + } + + + { + register real *b1; + register int i; + + for(b1=bufs,i=8;i;i--,b1+=4) + b1[2] += b1[3]; + + for(b1=bufs,i=4;i;i--,b1+=8) + { + b1[4] += b1[6]; + b1[6] += b1[5]; + b1[5] += b1[7]; + } + + for(b1=bufs,i=2;i;i--,b1+=16) + { + b1[8] += b1[12]; + b1[12] += b1[10]; + b1[10] += b1[14]; + b1[14] += b1[9]; + b1[9] += b1[13]; + b1[13] += b1[11]; + b1[11] += b1[15]; + } + } + + + out0[0x10*16] = REAL_SCALE_DCT64(bufs[0]); + out0[0x10*15] = REAL_SCALE_DCT64(bufs[16+0] + bufs[16+8]); + out0[0x10*14] = REAL_SCALE_DCT64(bufs[8]); + out0[0x10*13] = REAL_SCALE_DCT64(bufs[16+8] + bufs[16+4]); + out0[0x10*12] = REAL_SCALE_DCT64(bufs[4]); + out0[0x10*11] = REAL_SCALE_DCT64(bufs[16+4] + bufs[16+12]); + out0[0x10*10] = REAL_SCALE_DCT64(bufs[12]); + out0[0x10* 9] = REAL_SCALE_DCT64(bufs[16+12] + bufs[16+2]); + out0[0x10* 8] = REAL_SCALE_DCT64(bufs[2]); + out0[0x10* 7] = REAL_SCALE_DCT64(bufs[16+2] + bufs[16+10]); + out0[0x10* 6] = REAL_SCALE_DCT64(bufs[10]); + out0[0x10* 5] = REAL_SCALE_DCT64(bufs[16+10] + bufs[16+6]); + out0[0x10* 4] = REAL_SCALE_DCT64(bufs[6]); + out0[0x10* 3] = REAL_SCALE_DCT64(bufs[16+6] + bufs[16+14]); + out0[0x10* 2] = REAL_SCALE_DCT64(bufs[14]); + out0[0x10* 1] = REAL_SCALE_DCT64(bufs[16+14] + bufs[16+1]); + out0[0x10* 0] = REAL_SCALE_DCT64(bufs[1]); + + out1[0x10* 0] = REAL_SCALE_DCT64(bufs[1]); + out1[0x10* 1] = REAL_SCALE_DCT64(bufs[16+1] + bufs[16+9]); + out1[0x10* 2] = REAL_SCALE_DCT64(bufs[9]); + out1[0x10* 3] = REAL_SCALE_DCT64(bufs[16+9] + bufs[16+5]); + out1[0x10* 4] = REAL_SCALE_DCT64(bufs[5]); + out1[0x10* 5] = REAL_SCALE_DCT64(bufs[16+5] + bufs[16+13]); + out1[0x10* 6] = REAL_SCALE_DCT64(bufs[13]); + out1[0x10* 7] = REAL_SCALE_DCT64(bufs[16+13] + bufs[16+3]); + out1[0x10* 8] = REAL_SCALE_DCT64(bufs[3]); + out1[0x10* 9] = REAL_SCALE_DCT64(bufs[16+3] + bufs[16+11]); + out1[0x10*10] = REAL_SCALE_DCT64(bufs[11]); + out1[0x10*11] = REAL_SCALE_DCT64(bufs[16+11] + bufs[16+7]); + out1[0x10*12] = REAL_SCALE_DCT64(bufs[7]); + out1[0x10*13] = REAL_SCALE_DCT64(bufs[16+7] + bufs[16+15]); + out1[0x10*14] = REAL_SCALE_DCT64(bufs[15]); + out1[0x10*15] = REAL_SCALE_DCT64(bufs[16+15]); + +} + + diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_3dnow.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_3dnow.S new file mode 100644 index 0000000..cd6060b --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_3dnow.S @@ -0,0 +1,712 @@ +/* + dct64_3dnow.s: Replacement of dct64() with AMD's 3DNow! SIMD operations support + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Syuuhei Kashiyama + + Original "license" statement: + The author of this program disclaim whole expressed or implied + warranties with regard to this program, and in no event shall the + author of this program liable to whatever resulted from the use of + this program. Use it at your own risk. +*/ + +#include "mangle.h" + + .globl ASM_NAME(dct64_3dnow) +/* .type ASM_NAME(dct64_3dnow),@function */ +ASM_NAME(dct64_3dnow): + subl $256,%esp + pushl %ebp + pushl %edi + pushl %esi + pushl %ebx + leal 16(%esp),%ebx + movl 284(%esp),%edi + movl 276(%esp),%ebp + movl 280(%esp),%edx + leal 128(%ebx),%esi + + /* femms */ + + /* 1 */ + movl ASM_NAME(pnts),%eax + movq 0(%edi),%mm0 + movq %mm0,%mm1 + movd 124(%edi),%mm2 + punpckldq 120(%edi),%mm2 + movq 0(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,0(%ebx) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,124(%ebx) + psrlq $32,%mm1 + movd %mm1,120(%ebx) + movq 8(%edi),%mm4 + movq %mm4,%mm5 + movd 116(%edi),%mm6 + punpckldq 112(%edi),%mm6 + movq 8(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,8(%ebx) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,116(%ebx) + psrlq $32,%mm5 + movd %mm5,112(%ebx) + movq 16(%edi),%mm0 + movq %mm0,%mm1 + movd 108(%edi),%mm2 + punpckldq 104(%edi),%mm2 + movq 16(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,16(%ebx) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,108(%ebx) + psrlq $32,%mm1 + movd %mm1,104(%ebx) + movq 24(%edi),%mm4 + movq %mm4,%mm5 + movd 100(%edi),%mm6 + punpckldq 96(%edi),%mm6 + movq 24(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,24(%ebx) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,100(%ebx) + psrlq $32,%mm5 + movd %mm5,96(%ebx) + movq 32(%edi),%mm0 + movq %mm0,%mm1 + movd 92(%edi),%mm2 + punpckldq 88(%edi),%mm2 + movq 32(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,32(%ebx) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,92(%ebx) + psrlq $32,%mm1 + movd %mm1,88(%ebx) + movq 40(%edi),%mm4 + movq %mm4,%mm5 + movd 84(%edi),%mm6 + punpckldq 80(%edi),%mm6 + movq 40(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,40(%ebx) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,84(%ebx) + psrlq $32,%mm5 + movd %mm5,80(%ebx) + movq 48(%edi),%mm0 + movq %mm0,%mm1 + movd 76(%edi),%mm2 + punpckldq 72(%edi),%mm2 + movq 48(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,48(%ebx) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,76(%ebx) + psrlq $32,%mm1 + movd %mm1,72(%ebx) + movq 56(%edi),%mm4 + movq %mm4,%mm5 + movd 68(%edi),%mm6 + punpckldq 64(%edi),%mm6 + movq 56(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,56(%ebx) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,68(%ebx) + psrlq $32,%mm5 + movd %mm5,64(%ebx) + + /* 2 */ + movl ASM_NAME(pnts)+4,%eax + /* 0,14 */ + movq 0(%ebx),%mm0 + movq %mm0,%mm1 + movd 60(%ebx),%mm2 + punpckldq 56(%ebx),%mm2 + movq 0(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,0(%esi) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,60(%esi) + psrlq $32,%mm1 + movd %mm1,56(%esi) + /* 16,30 */ + movq 64(%ebx),%mm0 + movq %mm0,%mm1 + movd 124(%ebx),%mm2 + punpckldq 120(%ebx),%mm2 + pfadd %mm2,%mm0 + movq %mm0,64(%esi) + pfsubr %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,124(%esi) + psrlq $32,%mm1 + movd %mm1,120(%esi) + /* 2,12 */ + movq 8(%ebx),%mm4 + movq %mm4,%mm5 + movd 52(%ebx),%mm6 + punpckldq 48(%ebx),%mm6 + movq 8(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,8(%esi) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,52(%esi) + psrlq $32,%mm5 + movd %mm5,48(%esi) + /* 18,28 */ + movq 72(%ebx),%mm4 + movq %mm4,%mm5 + movd 116(%ebx),%mm6 + punpckldq 112(%ebx),%mm6 + pfadd %mm6,%mm4 + movq %mm4,72(%esi) + pfsubr %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,116(%esi) + psrlq $32,%mm5 + movd %mm5,112(%esi) + /* 4,10 */ + movq 16(%ebx),%mm0 + movq %mm0,%mm1 + movd 44(%ebx),%mm2 + punpckldq 40(%ebx),%mm2 + movq 16(%eax),%mm3 + pfadd %mm2,%mm0 + movq %mm0,16(%esi) + pfsub %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,44(%esi) + psrlq $32,%mm1 + movd %mm1,40(%esi) + /* 20,26 */ + movq 80(%ebx),%mm0 + movq %mm0,%mm1 + movd 108(%ebx),%mm2 + punpckldq 104(%ebx),%mm2 + pfadd %mm2,%mm0 + movq %mm0,80(%esi) + pfsubr %mm2,%mm1 + pfmul %mm3,%mm1 + movd %mm1,108(%esi) + psrlq $32,%mm1 + movd %mm1,104(%esi) + /* 6,8 */ + movq 24(%ebx),%mm4 + movq %mm4,%mm5 + movd 36(%ebx),%mm6 + punpckldq 32(%ebx),%mm6 + movq 24(%eax),%mm7 + pfadd %mm6,%mm4 + movq %mm4,24(%esi) + pfsub %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,36(%esi) + psrlq $32,%mm5 + movd %mm5,32(%esi) + /* 22,24 */ + movq 88(%ebx),%mm4 + movq %mm4,%mm5 + movd 100(%ebx),%mm6 + punpckldq 96(%ebx),%mm6 + pfadd %mm6,%mm4 + movq %mm4,88(%esi) + pfsubr %mm6,%mm5 + pfmul %mm7,%mm5 + movd %mm5,100(%esi) + psrlq $32,%mm5 + movd %mm5,96(%esi) + + /* 3 */ + movl ASM_NAME(pnts)+8,%eax + movq 0(%eax),%mm0 + movq 8(%eax),%mm1 + /* 0,6 */ + movq 0(%esi),%mm2 + movq %mm2,%mm3 + movd 28(%esi),%mm4 + punpckldq 24(%esi),%mm4 + pfadd %mm4,%mm2 + pfsub %mm4,%mm3 + pfmul %mm0,%mm3 + movq %mm2,0(%ebx) + movd %mm3,28(%ebx) + psrlq $32,%mm3 + movd %mm3,24(%ebx) + /* 2,4 */ + movq 8(%esi),%mm5 + movq %mm5,%mm6 + movd 20(%esi),%mm7 + punpckldq 16(%esi),%mm7 + pfadd %mm7,%mm5 + pfsub %mm7,%mm6 + pfmul %mm1,%mm6 + movq %mm5,8(%ebx) + movd %mm6,20(%ebx) + psrlq $32,%mm6 + movd %mm6,16(%ebx) + /* 8,14 */ + movq 32(%esi),%mm2 + movq %mm2,%mm3 + movd 60(%esi),%mm4 + punpckldq 56(%esi),%mm4 + pfadd %mm4,%mm2 + pfsubr %mm4,%mm3 + pfmul %mm0,%mm3 + movq %mm2,32(%ebx) + movd %mm3,60(%ebx) + psrlq $32,%mm3 + movd %mm3,56(%ebx) + /* 10,12 */ + movq 40(%esi),%mm5 + movq %mm5,%mm6 + movd 52(%esi),%mm7 + punpckldq 48(%esi),%mm7 + pfadd %mm7,%mm5 + pfsubr %mm7,%mm6 + pfmul %mm1,%mm6 + movq %mm5,40(%ebx) + movd %mm6,52(%ebx) + psrlq $32,%mm6 + movd %mm6,48(%ebx) + /* 16,22 */ + movq 64(%esi),%mm2 + movq %mm2,%mm3 + movd 92(%esi),%mm4 + punpckldq 88(%esi),%mm4 + pfadd %mm4,%mm2 + pfsub %mm4,%mm3 + pfmul %mm0,%mm3 + movq %mm2,64(%ebx) + movd %mm3,92(%ebx) + psrlq $32,%mm3 + movd %mm3,88(%ebx) + /* 18,20 */ + movq 72(%esi),%mm5 + movq %mm5,%mm6 + movd 84(%esi),%mm7 + punpckldq 80(%esi),%mm7 + pfadd %mm7,%mm5 + pfsub %mm7,%mm6 + pfmul %mm1,%mm6 + movq %mm5,72(%ebx) + movd %mm6,84(%ebx) + psrlq $32,%mm6 + movd %mm6,80(%ebx) + /* 24,30 */ + movq 96(%esi),%mm2 + movq %mm2,%mm3 + movd 124(%esi),%mm4 + punpckldq 120(%esi),%mm4 + pfadd %mm4,%mm2 + pfsubr %mm4,%mm3 + pfmul %mm0,%mm3 + movq %mm2,96(%ebx) + movd %mm3,124(%ebx) + psrlq $32,%mm3 + movd %mm3,120(%ebx) + /* 26,28 */ + movq 104(%esi),%mm5 + movq %mm5,%mm6 + movd 116(%esi),%mm7 + punpckldq 112(%esi),%mm7 + pfadd %mm7,%mm5 + pfsubr %mm7,%mm6 + pfmul %mm1,%mm6 + movq %mm5,104(%ebx) + movd %mm6,116(%ebx) + psrlq $32,%mm6 + movd %mm6,112(%ebx) + + /* 4 */ + movl ASM_NAME(pnts)+12,%eax + movq 0(%eax),%mm0 + /* 0 */ + movq 0(%ebx),%mm1 + movq %mm1,%mm2 + movd 12(%ebx),%mm3 + punpckldq 8(%ebx),%mm3 + pfadd %mm3,%mm1 + pfsub %mm3,%mm2 + pfmul %mm0,%mm2 + movq %mm1,0(%esi) + movd %mm2,12(%esi) + psrlq $32,%mm2 + movd %mm2,8(%esi) + /* 4 */ + movq 16(%ebx),%mm4 + movq %mm4,%mm5 + movd 28(%ebx),%mm6 + punpckldq 24(%ebx),%mm6 + pfadd %mm6,%mm4 + pfsubr %mm6,%mm5 + pfmul %mm0,%mm5 + movq %mm4,16(%esi) + movd %mm5,28(%esi) + psrlq $32,%mm5 + movd %mm5,24(%esi) + /* 8 */ + movq 32(%ebx),%mm1 + movq %mm1,%mm2 + movd 44(%ebx),%mm3 + punpckldq 40(%ebx),%mm3 + pfadd %mm3,%mm1 + pfsub %mm3,%mm2 + pfmul %mm0,%mm2 + movq %mm1,32(%esi) + movd %mm2,44(%esi) + psrlq $32,%mm2 + movd %mm2,40(%esi) + /* 12 */ + movq 48(%ebx),%mm4 + movq %mm4,%mm5 + movd 60(%ebx),%mm6 + punpckldq 56(%ebx),%mm6 + pfadd %mm6,%mm4 + pfsubr %mm6,%mm5 + pfmul %mm0,%mm5 + movq %mm4,48(%esi) + movd %mm5,60(%esi) + psrlq $32,%mm5 + movd %mm5,56(%esi) + /* 16 */ + movq 64(%ebx),%mm1 + movq %mm1,%mm2 + movd 76(%ebx),%mm3 + punpckldq 72(%ebx),%mm3 + pfadd %mm3,%mm1 + pfsub %mm3,%mm2 + pfmul %mm0,%mm2 + movq %mm1,64(%esi) + movd %mm2,76(%esi) + psrlq $32,%mm2 + movd %mm2,72(%esi) + /* 20 */ + movq 80(%ebx),%mm4 + movq %mm4,%mm5 + movd 92(%ebx),%mm6 + punpckldq 88(%ebx),%mm6 + pfadd %mm6,%mm4 + pfsubr %mm6,%mm5 + pfmul %mm0,%mm5 + movq %mm4,80(%esi) + movd %mm5,92(%esi) + psrlq $32,%mm5 + movd %mm5,88(%esi) + /* 24 */ + movq 96(%ebx),%mm1 + movq %mm1,%mm2 + movd 108(%ebx),%mm3 + punpckldq 104(%ebx),%mm3 + pfadd %mm3,%mm1 + pfsub %mm3,%mm2 + pfmul %mm0,%mm2 + movq %mm1,96(%esi) + movd %mm2,108(%esi) + psrlq $32,%mm2 + movd %mm2,104(%esi) + /* 28 */ + movq 112(%ebx),%mm4 + movq %mm4,%mm5 + movd 124(%ebx),%mm6 + punpckldq 120(%ebx),%mm6 + pfadd %mm6,%mm4 + pfsubr %mm6,%mm5 + pfmul %mm0,%mm5 + movq %mm4,112(%esi) + movd %mm5,124(%esi) + psrlq $32,%mm5 + movd %mm5,120(%esi) + + /* 5 */ + movl $-1,%eax + movd %eax,%mm1 + movl $1,%eax + /* L | H */ + movd %eax,%mm0 + punpckldq %mm1,%mm0 + /* 1.0 | -1.0 */ + pi2fd %mm0,%mm0 + movd %eax,%mm1 + pi2fd %mm1,%mm1 + movl ASM_NAME(pnts)+16,%eax + movd 0(%eax),%mm2 + /* 1.0 | cos0 */ + punpckldq %mm2,%mm1 + /* 0 */ + movq 0(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq %mm2,0(%ebx) + movq 8(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm4,8(%ebx) + /* 4 */ + movq 16(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq 24(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm2,%mm3 + psrlq $32,%mm3 + pfadd %mm4,%mm2 + pfadd %mm3,%mm4 + movq %mm2,16(%ebx) + movq %mm4,24(%ebx) + /* 8 */ + movq 32(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq %mm2,32(%ebx) + movq 40(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm4,40(%ebx) + /* 12 */ + movq 48(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq 56(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm2,%mm3 + psrlq $32,%mm3 + pfadd %mm4,%mm2 + pfadd %mm3,%mm4 + movq %mm2,48(%ebx) + movq %mm4,56(%ebx) + /* 16 */ + movq 64(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq %mm2,64(%ebx) + movq 72(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm4,72(%ebx) + /* 20 */ + movq 80(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq 88(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm2,%mm3 + psrlq $32,%mm3 + pfadd %mm4,%mm2 + pfadd %mm3,%mm4 + movq %mm2,80(%ebx) + movq %mm4,88(%ebx) + /* 24 */ + movq 96(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq %mm2,96(%ebx) + movq 104(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm4,104(%ebx) + /* 28 */ + movq 112(%esi),%mm2 + movq %mm2,%mm3 + pfmul %mm0,%mm3 + pfacc %mm3,%mm2 + pfmul %mm1,%mm2 + movq 120(%esi),%mm4 + movq %mm4,%mm5 + pfmul %mm0,%mm5 + pfacc %mm5,%mm4 + pfmul %mm0,%mm4 + pfmul %mm1,%mm4 + movq %mm4,%mm5 + psrlq $32,%mm5 + pfacc %mm5,%mm4 + movq %mm2,%mm3 + psrlq $32,%mm3 + pfadd %mm4,%mm2 + pfadd %mm3,%mm4 + movq %mm2,112(%ebx) + movq %mm4,120(%ebx) + + /* Phase6 */ + movl 0(%ebx),%eax + movl %eax,1024(%ebp) + movl 4(%ebx),%eax + movl %eax,0(%ebp) + movl %eax,0(%edx) + movl 8(%ebx),%eax + movl %eax,512(%ebp) + movl 12(%ebx),%eax + movl %eax,512(%edx) + + movl 16(%ebx),%eax + movl %eax,768(%ebp) + movl 20(%ebx),%eax + movl %eax,256(%edx) + + movl 24(%ebx),%eax + movl %eax,256(%ebp) + movl 28(%ebx),%eax + movl %eax,768(%edx) + + movq 32(%ebx),%mm0 + movq 48(%ebx),%mm1 + pfadd %mm1,%mm0 + movd %mm0,896(%ebp) + psrlq $32,%mm0 + movd %mm0,128(%edx) + movq 40(%ebx),%mm2 + pfadd %mm2,%mm1 + movd %mm1,640(%ebp) + psrlq $32,%mm1 + movd %mm1,384(%edx) + + movq 56(%ebx),%mm3 + pfadd %mm3,%mm2 + movd %mm2,384(%ebp) + psrlq $32,%mm2 + movd %mm2,640(%edx) + + movd 36(%ebx),%mm4 + pfadd %mm4,%mm3 + movd %mm3,128(%ebp) + psrlq $32,%mm3 + movd %mm3,896(%edx) + movq 96(%ebx),%mm0 + movq 64(%ebx),%mm1 + + movq 112(%ebx),%mm2 + pfadd %mm2,%mm0 + movq %mm0,%mm3 + pfadd %mm1,%mm3 + movd %mm3,960(%ebp) + psrlq $32,%mm3 + movd %mm3,64(%edx) + movq 80(%ebx),%mm1 + pfadd %mm1,%mm0 + movd %mm0,832(%ebp) + psrlq $32,%mm0 + movd %mm0,192(%edx) + movq 104(%ebx),%mm3 + pfadd %mm3,%mm2 + movq %mm2,%mm4 + pfadd %mm1,%mm4 + movd %mm4,704(%ebp) + psrlq $32,%mm4 + movd %mm4,320(%edx) + movq 72(%ebx),%mm1 + pfadd %mm1,%mm2 + movd %mm2,576(%ebp) + psrlq $32,%mm2 + movd %mm2,448(%edx) + + movq 120(%ebx),%mm4 + pfadd %mm4,%mm3 + movq %mm3,%mm5 + pfadd %mm1,%mm5 + movd %mm5,448(%ebp) + psrlq $32,%mm5 + movd %mm5,576(%edx) + movq 88(%ebx),%mm1 + pfadd %mm1,%mm3 + movd %mm3,320(%ebp) + psrlq $32,%mm3 + movd %mm3,704(%edx) + + movd 100(%ebx),%mm5 + pfadd %mm5,%mm4 + movq %mm4,%mm6 + pfadd %mm1,%mm6 + movd %mm6,192(%ebp) + psrlq $32,%mm6 + movd %mm6,832(%edx) + movd 68(%ebx),%mm1 + pfadd %mm1,%mm4 + movd %mm4,64(%ebp) + psrlq $32,%mm4 + movd %mm4,960(%edx) + + /* femms */ + + popl %ebx + popl %esi + popl %edi + popl %ebp + addl $256,%esp + + ret + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_3dnowext.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_3dnowext.S new file mode 100644 index 0000000..1b4c583 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_3dnowext.S @@ -0,0 +1,714 @@ +/* + dct64_3dnowext: extended 3DNow optimized DCT64 + + copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + Transformed back into standalone asm, with help of + gcc -S -DHAVE_CONFIG_H -I. -march=k6-3 -O3 -Wall -pedantic -fno-strict-aliasing -DREAL_IS_FLOAT -c -o dct64_3dnowext.{S,c} + + MPlayer comment follows. +*/ + +/* +* This code was taken from http://www.mpg123.org +* See ChangeLog of mpg123-0.59s-pre.1 for detail +* Applied to mplayer by Nick Kurshev +* Partial 3dnowex-DSP! optimization by Nick Kurshev +* +* TODO: optimize scalar 3dnow! code +* Warning: Phases 7 & 8 are not tested +*/ + +#include "mangle.h" + + .data + ALIGN4 + /* .type plus_1f, @object + .size plus_1f, 4 */ +plus_1f: + .long 1065353216 + ALIGN8 + /* .type x_plus_minus_3dnow, @object + .size x_plus_minus_3dnow, 8 */ +x_plus_minus_3dnow: + .long 0 + .long -2147483648 + + .text + ALIGN32 +.globl ASM_NAME(dct64_3dnowext) + /* .type ASM_NAME(dct64_3dnowext), @function */ +ASM_NAME(dct64_3dnowext): + pushl %ebp + movl %esp, %ebp + pushl %edi + pushl %esi + pushl %ebx + subl $256, %esp +/* APP */ + movl 16(%ebp),%eax + leal 128+-268(%ebp),%edx + movl 8(%ebp),%esi + movl 12(%ebp),%edi + movl ASM_VALUE(costab_mmxsse),%ebx + leal -268(%ebp),%ecx + movq (%eax), %mm0 + movq 8(%eax), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 120(%eax), %mm1 + pswapd 112(%eax), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, (%edx) + movq %mm4, 8(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul (%ebx), %mm3 + pfmul 8(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 120(%edx) + movq %mm7, 112(%edx) + movq 16(%eax), %mm0 + movq 24(%eax), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 104(%eax), %mm1 + pswapd 96(%eax), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 16(%edx) + movq %mm4, 24(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul 16(%ebx), %mm3 + pfmul 24(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 104(%edx) + movq %mm7, 96(%edx) + movq 32(%eax), %mm0 + movq 40(%eax), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 88(%eax), %mm1 + pswapd 80(%eax), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 32(%edx) + movq %mm4, 40(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul 32(%ebx), %mm3 + pfmul 40(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 88(%edx) + movq %mm7, 80(%edx) + movq 48(%eax), %mm0 + movq 56(%eax), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 72(%eax), %mm1 + pswapd 64(%eax), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 48(%edx) + movq %mm4, 56(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul 48(%ebx), %mm3 + pfmul 56(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 72(%edx) + movq %mm7, 64(%edx) + movq (%edx), %mm0 + movq 8(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 56(%edx), %mm1 + pswapd 48(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, (%ecx) + movq %mm4, 8(%ecx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul 64(%ebx), %mm3 + pfmul 72(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 56(%ecx) + movq %mm7, 48(%ecx) + movq 16(%edx), %mm0 + movq 24(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 40(%edx), %mm1 + pswapd 32(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 16(%ecx) + movq %mm4, 24(%ecx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul 80(%ebx), %mm3 + pfmul 88(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 40(%ecx) + movq %mm7, 32(%ecx) + movq 64(%edx), %mm0 + movq 72(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 120(%edx), %mm1 + pswapd 112(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 64(%ecx) + movq %mm4, 72(%ecx) + pfsubr %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul 64(%ebx), %mm3 + pfmul 72(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 120(%ecx) + movq %mm7, 112(%ecx) + movq 80(%edx), %mm0 + movq 88(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 104(%edx), %mm1 + pswapd 96(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 80(%ecx) + movq %mm4, 88(%ecx) + pfsubr %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul 80(%ebx), %mm3 + pfmul 88(%ebx), %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 104(%ecx) + movq %mm7, 96(%ecx) + movq 96(%ebx), %mm2 + movq 104(%ebx), %mm6 + movq (%ecx), %mm0 + movq 8(%ecx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 24(%ecx), %mm1 + pswapd 16(%ecx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, (%edx) + movq %mm4, 8(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm6, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 24(%edx) + movq %mm7, 16(%edx) + movq 32(%ecx), %mm0 + movq 40(%ecx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 56(%ecx), %mm1 + pswapd 48(%ecx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 32(%edx) + movq %mm4, 40(%edx) + pfsubr %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm6, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 56(%edx) + movq %mm7, 48(%edx) + movq 64(%ecx), %mm0 + movq 72(%ecx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 88(%ecx), %mm1 + pswapd 80(%ecx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 64(%edx) + movq %mm4, 72(%edx) + pfsub %mm1, %mm3 + pfsub %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm6, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 88(%edx) + movq %mm7, 80(%edx) + movq 96(%ecx), %mm0 + movq 104(%ecx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 120(%ecx), %mm1 + pswapd 112(%ecx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 96(%edx) + movq %mm4, 104(%edx) + pfsubr %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm6, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 120(%edx) + movq %mm7, 112(%edx) + movq 112(%ebx), %mm2 + movq (%edx), %mm0 + movq 16(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 8(%edx), %mm1 + pswapd 24(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, (%ecx) + movq %mm4, 16(%ecx) + pfsub %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm2, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 8(%ecx) + movq %mm7, 24(%ecx) + movq 32(%edx), %mm0 + movq 48(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 40(%edx), %mm1 + pswapd 56(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 32(%ecx) + movq %mm4, 48(%ecx) + pfsub %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm2, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 40(%ecx) + movq %mm7, 56(%ecx) + movq 64(%edx), %mm0 + movq 80(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 72(%edx), %mm1 + pswapd 88(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 64(%ecx) + movq %mm4, 80(%ecx) + pfsub %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm2, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 72(%ecx) + movq %mm7, 88(%ecx) + movq 96(%edx), %mm0 + movq 112(%edx), %mm4 + movq %mm0, %mm3 + movq %mm4, %mm7 + pswapd 104(%edx), %mm1 + pswapd 120(%edx), %mm5 + pfadd %mm1, %mm0 + pfadd %mm5, %mm4 + movq %mm0, 96(%ecx) + movq %mm4, 112(%ecx) + pfsub %mm1, %mm3 + pfsubr %mm5, %mm7 + pfmul %mm2, %mm3 + pfmul %mm2, %mm7 + pswapd %mm3, %mm3 + pswapd %mm7, %mm7 + movq %mm3, 104(%ecx) + movq %mm7, 120(%ecx) + movd plus_1f, %mm6 + punpckldq 120(%ebx), %mm6 + movq x_plus_minus_3dnow, %mm7 + movq 32(%ecx), %mm0 + movq 64(%ecx), %mm2 + movq %mm0, %mm1 + movq %mm2, %mm3 + pxor %mm7, %mm1 + pxor %mm7, %mm3 + pfacc %mm1, %mm0 + pfacc %mm3, %mm2 + pfmul %mm6, %mm0 + pfmul %mm6, %mm2 + movq %mm0, 32(%edx) + movq %mm2, 64(%edx) + movd 44(%ecx), %mm0 + movd 40(%ecx), %mm2 + movd 120(%ebx), %mm3 + punpckldq 76(%ecx), %mm0 + punpckldq 72(%ecx), %mm2 + punpckldq %mm3, %mm3 + movq %mm0, %mm4 + movq %mm2, %mm5 + pfsub %mm2, %mm0 + pfmul %mm3, %mm0 + movq %mm0, %mm1 + pfadd %mm5, %mm0 + pfadd %mm4, %mm0 + movq %mm0, %mm2 + punpckldq %mm1, %mm0 + punpckhdq %mm1, %mm2 + movq %mm0, 40(%edx) + movq %mm2, 72(%edx) + movd 48(%ecx), %mm3 + movd 60(%ecx), %mm2 + pfsub 52(%ecx), %mm3 + pfsub 56(%ecx), %mm2 + pfmul 120(%ebx), %mm3 + pfmul 120(%ebx), %mm2 + movq %mm2, %mm1 + pfadd 56(%ecx), %mm1 + pfadd 60(%ecx), %mm1 + movq %mm1, %mm0 + pfadd 48(%ecx), %mm0 + pfadd 52(%ecx), %mm0 + pfadd %mm3, %mm1 + punpckldq %mm2, %mm1 + pfadd %mm3, %mm2 + punpckldq %mm2, %mm0 + movq %mm1, 56(%edx) + movq %mm0, 48(%edx) + movd 92(%ecx), %mm1 + pfsub 88(%ecx), %mm1 + pfmul 120(%ebx), %mm1 + movd %mm1, 92(%edx) + pfadd 92(%ecx), %mm1 + pfadd 88(%ecx), %mm1 + movq %mm1, %mm0 + pfadd 80(%ecx), %mm0 + pfadd 84(%ecx), %mm0 + movd %mm0, 80(%edx) + movd 80(%ecx), %mm0 + pfsub 84(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + pfadd %mm0, %mm1 + pfadd 92(%edx), %mm0 + punpckldq %mm1, %mm0 + movq %mm0, 84(%edx) + movq 96(%ecx), %mm0 + movq %mm0, %mm1 + pxor %mm7, %mm1 + pfacc %mm1, %mm0 + pfmul %mm6, %mm0 + movq %mm0, 96(%edx) + movd 108(%ecx), %mm0 + pfsub 104(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + movd %mm0, 108(%edx) + pfadd 104(%ecx), %mm0 + pfadd 108(%ecx), %mm0 + movd %mm0, 104(%edx) + movd 124(%ecx), %mm1 + pfsub 120(%ecx), %mm1 + pfmul 120(%ebx), %mm1 + movd %mm1, 124(%edx) + pfadd 120(%ecx), %mm1 + pfadd 124(%ecx), %mm1 + movq %mm1, %mm0 + pfadd 112(%ecx), %mm0 + pfadd 116(%ecx), %mm0 + movd %mm0, 112(%edx) + movd 112(%ecx), %mm0 + pfsub 116(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + pfadd %mm0,%mm1 + pfadd 124(%edx), %mm0 + punpckldq %mm1, %mm0 + movq %mm0, 116(%edx) + jnz .L01 + movd (%ecx), %mm0 + pfadd 4(%ecx), %mm0 + movd %mm0, 1024(%esi) + movd (%ecx), %mm0 + pfsub 4(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + movd %mm0, (%esi) + movd %mm0, (%edi) + movd 12(%ecx), %mm0 + pfsub 8(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + movd %mm0, 512(%edi) + pfadd 12(%ecx), %mm0 + pfadd 8(%ecx), %mm0 + movd %mm0, 512(%esi) + movd 16(%ecx), %mm0 + pfsub 20(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + movq %mm0, %mm3 + movd 28(%ecx), %mm0 + pfsub 24(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + movd %mm0, 768(%edi) + movq %mm0, %mm2 + pfadd 24(%ecx), %mm0 + pfadd 28(%ecx), %mm0 + movq %mm0, %mm1 + pfadd 16(%ecx), %mm0 + pfadd 20(%ecx), %mm0 + movd %mm0, 768(%esi) + pfadd %mm3, %mm1 + movd %mm1, 256(%esi) + pfadd %mm3, %mm2 + movd %mm2, 256(%edi) + movq 32(%edx), %mm0 + movq 48(%edx), %mm1 + pfadd 48(%edx), %mm0 + pfadd 40(%edx), %mm1 + movd %mm0, 896(%esi) + movd %mm1, 640(%esi) + psrlq $32, %mm0 + psrlq $32, %mm1 + movd %mm0, 128(%edi) + movd %mm1, 384(%edi) + movd 40(%edx), %mm0 + pfadd 56(%edx), %mm0 + movd %mm0, 384(%esi) + movd 56(%edx), %mm0 + pfadd 36(%edx), %mm0 + movd %mm0, 128(%esi) + movd 60(%edx), %mm0 + movd %mm0, 896(%edi) + pfadd 44(%edx), %mm0 + movd %mm0, 640(%edi) + movq 96(%edx), %mm0 + movq 112(%edx), %mm2 + movq 104(%edx), %mm4 + pfadd 112(%edx), %mm0 + pfadd 104(%edx), %mm2 + pfadd 120(%edx), %mm4 + movq %mm0, %mm1 + movq %mm2, %mm3 + movq %mm4, %mm5 + pfadd 64(%edx), %mm0 + pfadd 80(%edx), %mm2 + pfadd 72(%edx), %mm4 + movd %mm0, 960(%esi) + movd %mm2, 704(%esi) + movd %mm4, 448(%esi) + psrlq $32, %mm0 + psrlq $32, %mm2 + psrlq $32, %mm4 + movd %mm0, 64(%edi) + movd %mm2, 320(%edi) + movd %mm4, 576(%edi) + pfadd 80(%edx), %mm1 + pfadd 72(%edx), %mm3 + pfadd 88(%edx), %mm5 + movd %mm1, 832(%esi) + movd %mm3, 576(%esi) + movd %mm5, 320(%esi) + psrlq $32, %mm1 + psrlq $32, %mm3 + psrlq $32, %mm5 + movd %mm1, 192(%edi) + movd %mm3, 448(%edi) + movd %mm5, 704(%edi) + movd 120(%edx), %mm0 + pfadd 100(%edx), %mm0 + movq %mm0, %mm1 + pfadd 88(%edx), %mm0 + movd %mm0, 192(%esi) + pfadd 68(%edx), %mm1 + movd %mm1, 64(%esi) + movd 124(%edx), %mm0 + movd %mm0, 960(%edi) + pfadd 92(%edx), %mm0 + movd %mm0, 832(%edi) + jmp .L_bye +.L01: + movq (%ecx), %mm0 + movq %mm0, %mm1 + pxor %mm7, %mm1 + pfacc %mm1, %mm0 + pfmul %mm6, %mm0 + pf2iw %mm0, %mm0 + movd %mm0, %eax + movw %ax, 512(%esi) + psrlq $32, %mm0 + movd %mm0, %eax + movw %ax, (%esi) + movd 12(%ecx), %mm0 + pfsub 8(%ecx), %mm0 + pfmul 120(%ebx), %mm0 + pf2iw %mm0, %mm7 + movd %mm7, %eax + movw %ax, 256(%edi) + pfadd 12(%ecx), %mm0 + pfadd 8(%ecx), %mm0 + pf2iw %mm0, %mm0 + movd %mm0, %eax + movw %ax, 256(%esi) + movd 16(%ecx), %mm3 + pfsub 20(%ecx), %mm3 + pfmul 120(%ebx), %mm3 + movq %mm3, %mm2 + movd 28(%ecx), %mm2 + pfsub 24(%ecx), %mm2 + pfmul 120(%ebx), %mm2 + movq %mm2, %mm1 + pf2iw %mm2, %mm7 + movd %mm7, %eax + movw %ax, 384(%edi) + pfadd 24(%ecx), %mm1 + pfadd 28(%ecx), %mm1 + movq %mm1, %mm0 + pfadd 16(%ecx), %mm0 + pfadd 20(%ecx), %mm0 + pf2iw %mm0, %mm0 + movd %mm0, %eax + movw %ax, 384(%esi) + pfadd %mm3, %mm1 + pf2iw %mm1, %mm1 + movd %mm1, %eax + movw %ax, 128(%esi) + pfadd %mm3, %mm2 + pf2iw %mm2, %mm2 + movd %mm2, %eax + movw %ax, 128(%edi) + movq 32(%edx), %mm0 + movq 48(%edx), %mm1 + pfadd 48(%edx), %mm0 + pfadd 40(%edx), %mm1 + pf2iw %mm0, %mm0 + pf2iw %mm1, %mm1 + movd %mm0, %eax + movd %mm1, %ecx + movw %ax, 448(%esi) + movw %cx, 320(%esi) + psrlq $32, %mm0 + psrlq $32, %mm1 + movd %mm0, %eax + movd %mm1, %ecx + movw %ax, 64(%edi) + movw %cx, 192(%edi) + movd 40(%edx), %mm3 + movd 56(%edx), %mm4 + movd 60(%edx), %mm0 + movd 44(%edx), %mm2 + movd 120(%edx), %mm5 + punpckldq %mm4, %mm3 + punpckldq 124(%edx), %mm0 + pfadd 100(%edx), %mm5 + punpckldq 36(%edx), %mm4 + punpckldq 92(%edx), %mm2 + movq %mm5, %mm6 + pfadd %mm4, %mm3 + pf2iw %mm0, %mm1 + pf2iw %mm3, %mm3 + pfadd 88(%edx), %mm5 + movd %mm1, %eax + movd %mm3, %ecx + movw %ax, 448(%edi) + movw %cx, 192(%esi) + pf2iw %mm5, %mm5 + psrlq $32, %mm1 + psrlq $32, %mm3 + movd %mm5, %ebx + movd %mm1, %eax + movd %mm3, %ecx + movw %bx, 96(%esi) + movw %ax, 480(%edi) + movw %cx, 64(%esi) + pfadd %mm2, %mm0 + pf2iw %mm0, %mm0 + movd %mm0, %eax + pfadd 68(%edx), %mm6 + movw %ax, 320(%edi) + psrlq $32, %mm0 + pf2iw %mm6, %mm6 + movd %mm0, %eax + movd %mm6, %ebx + movw %ax, 416(%edi) + movw %bx, 32(%esi) + movq 96(%edx), %mm0 + movq 112(%edx), %mm2 + movq 104(%edx), %mm4 + pfadd %mm2, %mm0 + pfadd %mm4, %mm2 + pfadd 120(%edx), %mm4 + movq %mm0, %mm1 + movq %mm2, %mm3 + movq %mm4, %mm5 + pfadd 64(%edx), %mm0 + pfadd 80(%edx), %mm2 + pfadd 72(%edx), %mm4 + pf2iw %mm0, %mm0 + pf2iw %mm2, %mm2 + pf2iw %mm4, %mm4 + movd %mm0, %eax + movd %mm2, %ecx + movd %mm4, %ebx + movw %ax, 480(%esi) + movw %cx, 352(%esi) + movw %bx, 224(%esi) + psrlq $32, %mm0 + psrlq $32, %mm2 + psrlq $32, %mm4 + movd %mm0, %eax + movd %mm2, %ecx + movd %mm4, %ebx + movw %ax, 32(%edi) + movw %cx, 160(%edi) + movw %bx, 288(%edi) + pfadd 80(%edx), %mm1 + pfadd 72(%edx), %mm3 + pfadd 88(%edx), %mm5 + pf2iw %mm1, %mm1 + pf2iw %mm3, %mm3 + pf2iw %mm5, %mm5 + movd %mm1, %eax + movd %mm3, %ecx + movd %mm5, %ebx + movw %ax, 416(%esi) + movw %cx, 288(%esi) + movw %bx, 160(%esi) + psrlq $32, %mm1 + psrlq $32, %mm3 + psrlq $32, %mm5 + movd %mm1, %eax + movd %mm3, %ecx + movd %mm5, %ebx + movw %ax, 96(%edi) + movw %cx, 224(%edi) + movw %bx, 352(%edi) + movsw +.L_bye: + femms + +/* NO_APP */ + addl $256, %esp + popl %ebx + popl %esi + popl %edi + leave + ret + /* .size ASM_NAME(dct64_3dnowext), .-ASM_NAME(dct64_3dnowext) */ + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_altivec.c b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_altivec.c new file mode 100644 index 0000000..3d6c7e1 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_altivec.c @@ -0,0 +1,315 @@ +/* + dct64_altivec.c: Discrete Cosine Tansform (DCT) for Altivec + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + altivec optimization by tmkk +*/ + +/* + * Discrete Cosine Tansform (DCT) for subband synthesis + * + * -funroll-loops (for gcc) will remove the loops for better performance + * using loops in the source-code enhances readabillity + * + * + * TODO: write an optimized version for the down-sampling modes + * (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero + */ + +#include "mpg123lib_intern.h" + +#ifndef __APPLE__ +#include +#endif + +void dct64_altivec(real *out0,real *out1,real *samples) +{ + ALIGNED(16) real bufs[32]; + + { + register real *b1,*costab; + + vector unsigned char vinvert,vperm1,vperm2,vperm3,vperm4; + vector float v1,v2,v3,v4,v5,v6,v7,v8; + vector float vbs1,vbs2,vbs3,vbs4,vbs5,vbs6,vbs7,vbs8; + vector float vbs9,vbs10,vbs11,vbs12,vbs13,vbs14,vbs15,vbs16; + vector float vzero; + b1 = samples; + costab = pnts[0]; + + vzero = vec_xor(vzero,vzero); +#ifdef __APPLE__ + vinvert = (vector unsigned char)(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3); +#else + vinvert = (vector unsigned char){12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3}; +#endif + vperm1 = vec_lvsl(0,b1); + vperm2 = vec_perm(vperm1,vperm1,vinvert); + + v1 = vec_ld(0,b1); + v2 = vec_ld(16,b1); + v3 = vec_ld(112,b1); + v4 = vec_ld(127,b1); + v5 = vec_perm(v1,v2,vperm1); /* b1[0,1,2,3] */ + v6 = vec_perm(v3,v4,vperm2); /* b1[31,30,29,28] */ + + vbs1 = vec_add(v5,v6); + vbs8 = vec_sub(v5,v6); + + v1 = vec_ld(32,b1); + v4 = vec_ld(96,b1); + v5 = vec_perm(v2,v1,vperm1); /* b1[4,5,6,7] */ + v6 = vec_perm(v4,v3,vperm2); /* b1[27,26,25,24] */ + + vbs2 = vec_add(v5,v6); + vbs7 = vec_sub(v5,v6); + + v2 = vec_ld(48,b1); + v3 = vec_ld(80,b1); + v5 = vec_perm(v1,v2,vperm1); /* b1[8,9,10,11] */ + v6 = vec_perm(v3,v4,vperm2); /* b1[23,22,21,20] */ + + vbs3 = vec_add(v5,v6); + vbs6 = vec_sub(v5,v6); + + v1 = vec_ld(64,b1); + v5 = vec_perm(v2,v1,vperm1); /* b1[12,13,14,15] */ + v6 = vec_perm(v1,v3,vperm2); /* b1[19,18,17,16] */ + + vbs4 = vec_add(v5,v6); + vbs5 = vec_sub(v5,v6); + + v1 = vec_ld(0,costab); + vbs8 = vec_madd(vbs8,v1,vzero); + v2 = vec_ld(16,costab); + vbs7 = vec_madd(vbs7,v2,vzero); + v3 = vec_ld(32,costab); + vbs6 = vec_madd(vbs6,v3,vzero); + v4 = vec_ld(48,costab); + vbs5 = vec_madd(vbs5,v4,vzero); + vbs6 = vec_perm(vbs6,vbs6,vinvert); + vbs5 = vec_perm(vbs5,vbs5,vinvert); + + + costab = pnts[1]; + + v1 = vec_perm(vbs4,vbs4,vinvert); + vbs9 = vec_add(vbs1,v1); + v3 = vec_sub(vbs1,v1); + v5 = vec_ld(0,costab); + v2 = vec_perm(vbs3,vbs3,vinvert); + vbs10 = vec_add(vbs2,v2); + v4 = vec_sub(vbs2,v2); + v6 = vec_ld(16,costab); + vbs12 = vec_madd(v3,v5,vzero); + vbs11 = vec_madd(v4,v6,vzero); + + v7 = vec_sub(vbs7,vbs6); + v8 = vec_sub(vbs8,vbs5); + vbs13 = vec_add(vbs5,vbs8); + vbs14 = vec_add(vbs6,vbs7); + vbs15 = vec_madd(v7,v6,vzero); + vbs16 = vec_madd(v8,v5,vzero); + + + costab = pnts[2]; + + v1 = vec_perm(vbs10,vbs10,vinvert); + v5 = vec_perm(vbs14,vbs14,vinvert); + vbs1 = vec_add(v1,vbs9); + vbs5 = vec_add(v5,vbs13); + v2 = vec_sub(vbs9,v1); + v6 = vec_sub(vbs13,v5); + v3 = vec_ld(0,costab); + vbs11 = vec_perm(vbs11,vbs11,vinvert); + vbs15 = vec_perm(vbs15,vbs15,vinvert); + vbs3 = vec_add(vbs11,vbs12); + vbs7 = vec_add(vbs15,vbs16); + v4 = vec_sub(vbs12,vbs11); + v7 = vec_sub(vbs16,vbs15); + vbs2 = vec_madd(v2,v3,vzero); + vbs4 = vec_madd(v4,v3,vzero); + vbs6 = vec_madd(v6,v3,vzero); + vbs8 = vec_madd(v7,v3,vzero); + + vbs2 = vec_perm(vbs2,vbs2,vinvert); + vbs4 = vec_perm(vbs4,vbs4,vinvert); + vbs6 = vec_perm(vbs6,vbs6,vinvert); + vbs8 = vec_perm(vbs8,vbs8,vinvert); + + + costab = pnts[3]; + +#ifdef __APPLE__ + vperm1 = (vector unsigned char)(0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23); + vperm2 = (vector unsigned char)(12,13,14,15,8,9,10,11,28,29,30,31,24,25,26,27); + vperm3 = (vector unsigned char)(0,1,2,3,4,5,6,7,20,21,22,23,16,17,18,19); +#else + vperm1 = (vector unsigned char){0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23}; + vperm2 = (vector unsigned char){12,13,14,15,8,9,10,11,28,29,30,31,24,25,26,27}; + vperm3 = (vector unsigned char){0,1,2,3,4,5,6,7,20,21,22,23,16,17,18,19}; +#endif + vperm4 = vec_add(vperm3,vec_splat_u8(8)); + + v1 = vec_ld(0,costab); + v2 = vec_splat(v1,0); + v3 = vec_splat(v1,1); + v1 = vec_mergeh(v2,v3); + + v2 = vec_perm(vbs1,vbs3,vperm1); + v3 = vec_perm(vbs2,vbs4,vperm1); + v4 = vec_perm(vbs1,vbs3,vperm2); + v5 = vec_perm(vbs2,vbs4,vperm2); + v6 = vec_sub(v2,v4); + v7 = vec_sub(v3,v5); + v2 = vec_add(v2,v4); + v3 = vec_add(v3,v5); + v4 = vec_madd(v6,v1,vzero); + v5 = vec_nmsub(v7,v1,vzero); + vbs9 = vec_perm(v2,v4,vperm3); + vbs11 = vec_perm(v2,v4,vperm4); + vbs10 = vec_perm(v3,v5,vperm3); + vbs12 = vec_perm(v3,v5,vperm4); + + v2 = vec_perm(vbs5,vbs7,vperm1); + v3 = vec_perm(vbs6,vbs8,vperm1); + v4 = vec_perm(vbs5,vbs7,vperm2); + v5 = vec_perm(vbs6,vbs8,vperm2); + v6 = vec_sub(v2,v4); + v7 = vec_sub(v3,v5); + v2 = vec_add(v2,v4); + v3 = vec_add(v3,v5); + v4 = vec_madd(v6,v1,vzero); + v5 = vec_nmsub(v7,v1,vzero); + vbs13 = vec_perm(v2,v4,vperm3); + vbs15 = vec_perm(v2,v4,vperm4); + vbs14 = vec_perm(v3,v5,vperm3); + vbs16 = vec_perm(v3,v5,vperm4); + + + costab = pnts[4]; + + v1 = vec_lde(0,costab); +#ifdef __APPLE__ + v2 = (vector float)(1.0f,-1.0f,1.0f,-1.0f); +#else + v2 = (vector float){1.0f,-1.0f,1.0f,-1.0f}; +#endif + v3 = vec_splat(v1,0); + v1 = vec_madd(v2,v3,vzero); + + v2 = vec_mergeh(vbs9,vbs10); + v3 = vec_mergel(vbs9,vbs10); + v4 = vec_mergeh(vbs11,vbs12); + v5 = vec_mergel(vbs11,vbs12); + v6 = vec_mergeh(v2,v3); + v7 = vec_mergel(v2,v3); + v2 = vec_mergeh(v4,v5); + v3 = vec_mergel(v4,v5); + v4 = vec_sub(v6,v7); + v5 = vec_sub(v2,v3); + v6 = vec_add(v6,v7); + v7 = vec_add(v2,v3); + v2 = vec_madd(v4,v1,vzero); + v3 = vec_madd(v5,v1,vzero); + vbs1 = vec_mergeh(v6,v2); + vbs2 = vec_mergel(v6,v2); + vbs3 = vec_mergeh(v7,v3); + vbs4 = vec_mergel(v7,v3); + + v2 = vec_mergeh(vbs13,vbs14); + v3 = vec_mergel(vbs13,vbs14); + v4 = vec_mergeh(vbs15,vbs16); + v5 = vec_mergel(vbs15,vbs16); + v6 = vec_mergeh(v2,v3); + v7 = vec_mergel(v2,v3); + v2 = vec_mergeh(v4,v5); + v3 = vec_mergel(v4,v5); + v4 = vec_sub(v6,v7); + v5 = vec_sub(v2,v3); + v6 = vec_add(v6,v7); + v7 = vec_add(v2,v3); + v2 = vec_madd(v4,v1,vzero); + v3 = vec_madd(v5,v1,vzero); + vbs5 = vec_mergeh(v6,v2); + vbs6 = vec_mergel(v6,v2); + vbs7 = vec_mergeh(v7,v3); + vbs8 = vec_mergel(v7,v3); + + vec_st(vbs1,0,bufs); + vec_st(vbs2,16,bufs); + vec_st(vbs3,32,bufs); + vec_st(vbs4,48,bufs); + vec_st(vbs5,64,bufs); + vec_st(vbs6,80,bufs); + vec_st(vbs7,96,bufs); + vec_st(vbs8,112,bufs); + } + + { + register real *b1; + register int i; + + for(b1=bufs,i=8;i;i--,b1+=4) + b1[2] += b1[3]; + + for(b1=bufs,i=4;i;i--,b1+=8) + { + b1[4] += b1[6]; + b1[6] += b1[5]; + b1[5] += b1[7]; + } + + for(b1=bufs,i=2;i;i--,b1+=16) + { + b1[8] += b1[12]; + b1[12] += b1[10]; + b1[10] += b1[14]; + b1[14] += b1[9]; + b1[9] += b1[13]; + b1[13] += b1[11]; + b1[11] += b1[15]; + } + } + + + out0[0x10*16] = bufs[0]; + out0[0x10*15] = bufs[16+0] + bufs[16+8]; + out0[0x10*14] = bufs[8]; + out0[0x10*13] = bufs[16+8] + bufs[16+4]; + out0[0x10*12] = bufs[4]; + out0[0x10*11] = bufs[16+4] + bufs[16+12]; + out0[0x10*10] = bufs[12]; + out0[0x10* 9] = bufs[16+12] + bufs[16+2]; + out0[0x10* 8] = bufs[2]; + out0[0x10* 7] = bufs[16+2] + bufs[16+10]; + out0[0x10* 6] = bufs[10]; + out0[0x10* 5] = bufs[16+10] + bufs[16+6]; + out0[0x10* 4] = bufs[6]; + out0[0x10* 3] = bufs[16+6] + bufs[16+14]; + out0[0x10* 2] = bufs[14]; + out0[0x10* 1] = bufs[16+14] + bufs[16+1]; + out0[0x10* 0] = bufs[1]; + + out1[0x10* 0] = bufs[1]; + out1[0x10* 1] = bufs[16+1] + bufs[16+9]; + out1[0x10* 2] = bufs[9]; + out1[0x10* 3] = bufs[16+9] + bufs[16+5]; + out1[0x10* 4] = bufs[5]; + out1[0x10* 5] = bufs[16+5] + bufs[16+13]; + out1[0x10* 6] = bufs[13]; + out1[0x10* 7] = bufs[16+13] + bufs[16+3]; + out1[0x10* 8] = bufs[3]; + out1[0x10* 9] = bufs[16+3] + bufs[16+11]; + out1[0x10*10] = bufs[11]; + out1[0x10*11] = bufs[16+11] + bufs[16+7]; + out1[0x10*12] = bufs[7]; + out1[0x10*13] = bufs[16+7] + bufs[16+15]; + out1[0x10*14] = bufs[15]; + out1[0x10*15] = bufs[16+15]; + +} + + diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_i386.c b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_i386.c new file mode 100644 index 0000000..abc05b9 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_i386.c @@ -0,0 +1,336 @@ +/* + dct64_i386.c: DCT64, a C variant for i386 + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + +/* + * Discrete Cosine Tansform (DCT) for subband synthesis + * optimized for machines with no auto-increment. + * The performance is highly compiler dependend. Maybe + * the dct64.c version for 'normal' processor may be faster + * even for Intel processors. + */ + +#include "mpg123lib_intern.h" + +static void dct64_1(real *out0,real *out1,real *b1,real *b2,real *samples) +{ + { + register real *costab = pnts[0]; + + b1[0x00] = samples[0x00] + samples[0x1F]; + b1[0x01] = samples[0x01] + samples[0x1E]; + b1[0x1F] = REAL_MUL(samples[0x00] - samples[0x1F], costab[0x0]); + b1[0x1E] = REAL_MUL(samples[0x01] - samples[0x1E], costab[0x1]); + + b1[0x02] = samples[0x02] + samples[0x1D]; + b1[0x03] = samples[0x03] + samples[0x1C]; + b1[0x1D] = REAL_MUL(samples[0x02] - samples[0x1D], costab[0x2]); + b1[0x1C] = REAL_MUL(samples[0x03] - samples[0x1C], costab[0x3]); + + b1[0x04] = samples[0x04] + samples[0x1B]; + b1[0x05] = samples[0x05] + samples[0x1A]; + b1[0x1B] = REAL_MUL(samples[0x04] - samples[0x1B], costab[0x4]); + b1[0x1A] = REAL_MUL(samples[0x05] - samples[0x1A], costab[0x5]); + + b1[0x06] = samples[0x06] + samples[0x19]; + b1[0x07] = samples[0x07] + samples[0x18]; + b1[0x19] = REAL_MUL(samples[0x06] - samples[0x19], costab[0x6]); + b1[0x18] = REAL_MUL(samples[0x07] - samples[0x18], costab[0x7]); + + b1[0x08] = samples[0x08] + samples[0x17]; + b1[0x09] = samples[0x09] + samples[0x16]; + b1[0x17] = REAL_MUL(samples[0x08] - samples[0x17], costab[0x8]); + b1[0x16] = REAL_MUL(samples[0x09] - samples[0x16], costab[0x9]); + + b1[0x0A] = samples[0x0A] + samples[0x15]; + b1[0x0B] = samples[0x0B] + samples[0x14]; + b1[0x15] = REAL_MUL(samples[0x0A] - samples[0x15], costab[0xA]); + b1[0x14] = REAL_MUL(samples[0x0B] - samples[0x14], costab[0xB]); + + b1[0x0C] = samples[0x0C] + samples[0x13]; + b1[0x0D] = samples[0x0D] + samples[0x12]; + b1[0x13] = REAL_MUL(samples[0x0C] - samples[0x13], costab[0xC]); + b1[0x12] = REAL_MUL(samples[0x0D] - samples[0x12], costab[0xD]); + + b1[0x0E] = samples[0x0E] + samples[0x11]; + b1[0x0F] = samples[0x0F] + samples[0x10]; + b1[0x11] = REAL_MUL(samples[0x0E] - samples[0x11], costab[0xE]); + b1[0x10] = REAL_MUL(samples[0x0F] - samples[0x10], costab[0xF]); + + } + + + { + register real *costab = pnts[1]; + + b2[0x00] = b1[0x00] + b1[0x0F]; + b2[0x01] = b1[0x01] + b1[0x0E]; + b2[0x0F] = REAL_MUL(b1[0x00] - b1[0x0F], costab[0]); + b2[0x0E] = REAL_MUL(b1[0x01] - b1[0x0E], costab[1]); + + b2[0x02] = b1[0x02] + b1[0x0D]; + b2[0x03] = b1[0x03] + b1[0x0C]; + b2[0x0D] = REAL_MUL(b1[0x02] - b1[0x0D], costab[2]); + b2[0x0C] = REAL_MUL(b1[0x03] - b1[0x0C], costab[3]); + + b2[0x04] = b1[0x04] + b1[0x0B]; + b2[0x05] = b1[0x05] + b1[0x0A]; + b2[0x0B] = REAL_MUL(b1[0x04] - b1[0x0B], costab[4]); + b2[0x0A] = REAL_MUL(b1[0x05] - b1[0x0A], costab[5]); + + b2[0x06] = b1[0x06] + b1[0x09]; + b2[0x07] = b1[0x07] + b1[0x08]; + b2[0x09] = REAL_MUL(b1[0x06] - b1[0x09], costab[6]); + b2[0x08] = REAL_MUL(b1[0x07] - b1[0x08], costab[7]); + + /* */ + + b2[0x10] = b1[0x10] + b1[0x1F]; + b2[0x11] = b1[0x11] + b1[0x1E]; + b2[0x1F] = REAL_MUL(b1[0x1F] - b1[0x10], costab[0]); + b2[0x1E] = REAL_MUL(b1[0x1E] - b1[0x11], costab[1]); + + b2[0x12] = b1[0x12] + b1[0x1D]; + b2[0x13] = b1[0x13] + b1[0x1C]; + b2[0x1D] = REAL_MUL(b1[0x1D] - b1[0x12], costab[2]); + b2[0x1C] = REAL_MUL(b1[0x1C] - b1[0x13], costab[3]); + + b2[0x14] = b1[0x14] + b1[0x1B]; + b2[0x15] = b1[0x15] + b1[0x1A]; + b2[0x1B] = REAL_MUL(b1[0x1B] - b1[0x14], costab[4]); + b2[0x1A] = REAL_MUL(b1[0x1A] - b1[0x15], costab[5]); + + b2[0x16] = b1[0x16] + b1[0x19]; + b2[0x17] = b1[0x17] + b1[0x18]; + b2[0x19] = REAL_MUL(b1[0x19] - b1[0x16], costab[6]); + b2[0x18] = REAL_MUL(b1[0x18] - b1[0x17], costab[7]); + } + + { + register real *costab = pnts[2]; + + b1[0x00] = b2[0x00] + b2[0x07]; + b1[0x07] = REAL_MUL(b2[0x00] - b2[0x07], costab[0]); + b1[0x01] = b2[0x01] + b2[0x06]; + b1[0x06] = REAL_MUL(b2[0x01] - b2[0x06], costab[1]); + b1[0x02] = b2[0x02] + b2[0x05]; + b1[0x05] = REAL_MUL(b2[0x02] - b2[0x05], costab[2]); + b1[0x03] = b2[0x03] + b2[0x04]; + b1[0x04] = REAL_MUL(b2[0x03] - b2[0x04], costab[3]); + + b1[0x08] = b2[0x08] + b2[0x0F]; + b1[0x0F] = REAL_MUL(b2[0x0F] - b2[0x08], costab[0]); + b1[0x09] = b2[0x09] + b2[0x0E]; + b1[0x0E] = REAL_MUL(b2[0x0E] - b2[0x09], costab[1]); + b1[0x0A] = b2[0x0A] + b2[0x0D]; + b1[0x0D] = REAL_MUL(b2[0x0D] - b2[0x0A], costab[2]); + b1[0x0B] = b2[0x0B] + b2[0x0C]; + b1[0x0C] = REAL_MUL(b2[0x0C] - b2[0x0B], costab[3]); + + b1[0x10] = b2[0x10] + b2[0x17]; + b1[0x17] = REAL_MUL(b2[0x10] - b2[0x17], costab[0]); + b1[0x11] = b2[0x11] + b2[0x16]; + b1[0x16] = REAL_MUL(b2[0x11] - b2[0x16], costab[1]); + b1[0x12] = b2[0x12] + b2[0x15]; + b1[0x15] = REAL_MUL(b2[0x12] - b2[0x15], costab[2]); + b1[0x13] = b2[0x13] + b2[0x14]; + b1[0x14] = REAL_MUL(b2[0x13] - b2[0x14], costab[3]); + + b1[0x18] = b2[0x18] + b2[0x1F]; + b1[0x1F] = REAL_MUL(b2[0x1F] - b2[0x18], costab[0]); + b1[0x19] = b2[0x19] + b2[0x1E]; + b1[0x1E] = REAL_MUL(b2[0x1E] - b2[0x19], costab[1]); + b1[0x1A] = b2[0x1A] + b2[0x1D]; + b1[0x1D] = REAL_MUL(b2[0x1D] - b2[0x1A], costab[2]); + b1[0x1B] = b2[0x1B] + b2[0x1C]; + b1[0x1C] = REAL_MUL(b2[0x1C] - b2[0x1B], costab[3]); + } + + { + register real const cos0 = pnts[3][0]; + register real const cos1 = pnts[3][1]; + + b2[0x00] = b1[0x00] + b1[0x03]; + b2[0x03] = REAL_MUL(b1[0x00] - b1[0x03], cos0); + b2[0x01] = b1[0x01] + b1[0x02]; + b2[0x02] = REAL_MUL(b1[0x01] - b1[0x02], cos1); + + b2[0x04] = b1[0x04] + b1[0x07]; + b2[0x07] = REAL_MUL(b1[0x07] - b1[0x04], cos0); + b2[0x05] = b1[0x05] + b1[0x06]; + b2[0x06] = REAL_MUL(b1[0x06] - b1[0x05], cos1); + + b2[0x08] = b1[0x08] + b1[0x0B]; + b2[0x0B] = REAL_MUL(b1[0x08] - b1[0x0B], cos0); + b2[0x09] = b1[0x09] + b1[0x0A]; + b2[0x0A] = REAL_MUL(b1[0x09] - b1[0x0A], cos1); + + b2[0x0C] = b1[0x0C] + b1[0x0F]; + b2[0x0F] = REAL_MUL(b1[0x0F] - b1[0x0C], cos0); + b2[0x0D] = b1[0x0D] + b1[0x0E]; + b2[0x0E] = REAL_MUL(b1[0x0E] - b1[0x0D], cos1); + + b2[0x10] = b1[0x10] + b1[0x13]; + b2[0x13] = REAL_MUL(b1[0x10] - b1[0x13], cos0); + b2[0x11] = b1[0x11] + b1[0x12]; + b2[0x12] = REAL_MUL(b1[0x11] - b1[0x12], cos1); + + b2[0x14] = b1[0x14] + b1[0x17]; + b2[0x17] = REAL_MUL(b1[0x17] - b1[0x14], cos0); + b2[0x15] = b1[0x15] + b1[0x16]; + b2[0x16] = REAL_MUL(b1[0x16] - b1[0x15], cos1); + + b2[0x18] = b1[0x18] + b1[0x1B]; + b2[0x1B] = REAL_MUL(b1[0x18] - b1[0x1B], cos0); + b2[0x19] = b1[0x19] + b1[0x1A]; + b2[0x1A] = REAL_MUL(b1[0x19] - b1[0x1A], cos1); + + b2[0x1C] = b1[0x1C] + b1[0x1F]; + b2[0x1F] = REAL_MUL(b1[0x1F] - b1[0x1C], cos0); + b2[0x1D] = b1[0x1D] + b1[0x1E]; + b2[0x1E] = REAL_MUL(b1[0x1E] - b1[0x1D], cos1); + } + + { + register real const cos0 = pnts[4][0]; + + b1[0x00] = b2[0x00] + b2[0x01]; + b1[0x01] = REAL_MUL(b2[0x00] - b2[0x01], cos0); + b1[0x02] = b2[0x02] + b2[0x03]; + b1[0x03] = REAL_MUL(b2[0x03] - b2[0x02], cos0); + b1[0x02] += b1[0x03]; + + b1[0x04] = b2[0x04] + b2[0x05]; + b1[0x05] = REAL_MUL(b2[0x04] - b2[0x05], cos0); + b1[0x06] = b2[0x06] + b2[0x07]; + b1[0x07] = REAL_MUL(b2[0x07] - b2[0x06], cos0); + b1[0x06] += b1[0x07]; + b1[0x04] += b1[0x06]; + b1[0x06] += b1[0x05]; + b1[0x05] += b1[0x07]; + + b1[0x08] = b2[0x08] + b2[0x09]; + b1[0x09] = REAL_MUL(b2[0x08] - b2[0x09], cos0); + b1[0x0A] = b2[0x0A] + b2[0x0B]; + b1[0x0B] = REAL_MUL(b2[0x0B] - b2[0x0A], cos0); + b1[0x0A] += b1[0x0B]; + + b1[0x0C] = b2[0x0C] + b2[0x0D]; + b1[0x0D] = REAL_MUL(b2[0x0C] - b2[0x0D], cos0); + b1[0x0E] = b2[0x0E] + b2[0x0F]; + b1[0x0F] = REAL_MUL(b2[0x0F] - b2[0x0E], cos0); + b1[0x0E] += b1[0x0F]; + b1[0x0C] += b1[0x0E]; + b1[0x0E] += b1[0x0D]; + b1[0x0D] += b1[0x0F]; + + b1[0x10] = b2[0x10] + b2[0x11]; + b1[0x11] = REAL_MUL(b2[0x10] - b2[0x11], cos0); + b1[0x12] = b2[0x12] + b2[0x13]; + b1[0x13] = REAL_MUL(b2[0x13] - b2[0x12], cos0); + b1[0x12] += b1[0x13]; + + b1[0x14] = b2[0x14] + b2[0x15]; + b1[0x15] = REAL_MUL(b2[0x14] - b2[0x15], cos0); + b1[0x16] = b2[0x16] + b2[0x17]; + b1[0x17] = REAL_MUL(b2[0x17] - b2[0x16], cos0); + b1[0x16] += b1[0x17]; + b1[0x14] += b1[0x16]; + b1[0x16] += b1[0x15]; + b1[0x15] += b1[0x17]; + + b1[0x18] = b2[0x18] + b2[0x19]; + b1[0x19] = REAL_MUL(b2[0x18] - b2[0x19], cos0); + b1[0x1A] = b2[0x1A] + b2[0x1B]; + b1[0x1B] = REAL_MUL(b2[0x1B] - b2[0x1A], cos0); + b1[0x1A] += b1[0x1B]; + + b1[0x1C] = b2[0x1C] + b2[0x1D]; + b1[0x1D] = REAL_MUL(b2[0x1C] - b2[0x1D], cos0); + b1[0x1E] = b2[0x1E] + b2[0x1F]; + b1[0x1F] = REAL_MUL(b2[0x1F] - b2[0x1E], cos0); + b1[0x1E] += b1[0x1F]; + b1[0x1C] += b1[0x1E]; + b1[0x1E] += b1[0x1D]; + b1[0x1D] += b1[0x1F]; + } + + out0[0x10*16] = REAL_SCALE_DCT64(b1[0x00]); + out0[0x10*12] = REAL_SCALE_DCT64(b1[0x04]); + out0[0x10* 8] = REAL_SCALE_DCT64(b1[0x02]); + out0[0x10* 4] = REAL_SCALE_DCT64(b1[0x06]); + out0[0x10* 0] = REAL_SCALE_DCT64(b1[0x01]); + out1[0x10* 0] = REAL_SCALE_DCT64(b1[0x01]); + out1[0x10* 4] = REAL_SCALE_DCT64(b1[0x05]); + out1[0x10* 8] = REAL_SCALE_DCT64(b1[0x03]); + out1[0x10*12] = REAL_SCALE_DCT64(b1[0x07]); + +#if 1 + out0[0x10*14] = REAL_SCALE_DCT64(b1[0x08] + b1[0x0C]); + out0[0x10*10] = REAL_SCALE_DCT64(b1[0x0C] + b1[0x0a]); + out0[0x10* 6] = REAL_SCALE_DCT64(b1[0x0A] + b1[0x0E]); + out0[0x10* 2] = REAL_SCALE_DCT64(b1[0x0E] + b1[0x09]); + out1[0x10* 2] = REAL_SCALE_DCT64(b1[0x09] + b1[0x0D]); + out1[0x10* 6] = REAL_SCALE_DCT64(b1[0x0D] + b1[0x0B]); + out1[0x10*10] = REAL_SCALE_DCT64(b1[0x0B] + b1[0x0F]); + out1[0x10*14] = REAL_SCALE_DCT64(b1[0x0F]); +#else + b1[0x08] += b1[0x0C]; + out0[0x10*14] = REAL_SCALE_DCT64(b1[0x08]); + b1[0x0C] += b1[0x0a]; + out0[0x10*10] = REAL_SCALE_DCT64(b1[0x0C]); + b1[0x0A] += b1[0x0E]; + out0[0x10* 6] = REAL_SCALE_DCT64(b1[0x0A]); + b1[0x0E] += b1[0x09]; + out0[0x10* 2] = REAL_SCALE_DCT64(b1[0x0E]); + b1[0x09] += b1[0x0D]; + out1[0x10* 2] = REAL_SCALE_DCT64(b1[0x09]); + b1[0x0D] += b1[0x0B]; + out1[0x10* 6] = REAL_SCALE_DCT64(b1[0x0D]); + b1[0x0B] += b1[0x0F]; + out1[0x10*10] = REAL_SCALE_DCT64(b1[0x0B]); + out1[0x10*14] = REAL_SCALE_DCT64(b1[0x0F]); +#endif + + { + real tmp; + tmp = b1[0x18] + b1[0x1C]; + out0[0x10*15] = REAL_SCALE_DCT64(tmp + b1[0x10]); + out0[0x10*13] = REAL_SCALE_DCT64(tmp + b1[0x14]); + tmp = b1[0x1C] + b1[0x1A]; + out0[0x10*11] = REAL_SCALE_DCT64(tmp + b1[0x14]); + out0[0x10* 9] = REAL_SCALE_DCT64(tmp + b1[0x12]); + tmp = b1[0x1A] + b1[0x1E]; + out0[0x10* 7] = REAL_SCALE_DCT64(tmp + b1[0x12]); + out0[0x10* 5] = REAL_SCALE_DCT64(tmp + b1[0x16]); + tmp = b1[0x1E] + b1[0x19]; + out0[0x10* 3] = REAL_SCALE_DCT64(tmp + b1[0x16]); + out0[0x10* 1] = REAL_SCALE_DCT64(tmp + b1[0x11]); + tmp = b1[0x19] + b1[0x1D]; + out1[0x10* 1] = REAL_SCALE_DCT64(tmp + b1[0x11]); + out1[0x10* 3] = REAL_SCALE_DCT64(tmp + b1[0x15]); + tmp = b1[0x1D] + b1[0x1B]; + out1[0x10* 5] = REAL_SCALE_DCT64(tmp + b1[0x15]); + out1[0x10* 7] = REAL_SCALE_DCT64(tmp + b1[0x13]); + tmp = b1[0x1B] + b1[0x1F]; + out1[0x10* 9] = REAL_SCALE_DCT64(tmp + b1[0x13]); + out1[0x10*11] = REAL_SCALE_DCT64(tmp + b1[0x17]); + out1[0x10*13] = REAL_SCALE_DCT64(b1[0x17] + b1[0x1F]); + out1[0x10*15] = REAL_SCALE_DCT64(b1[0x1F]); + } +} + +/* + * the call via dct64 is a trick to force GCC to use + * (new) registers for the b1,b2 pointer to the bufs[xx] field + */ +void dct64_i386(real *a,real *b,real *c) +{ + real bufs[0x40]; + dct64_1(a,b,bufs,bufs+0x20,c); +} + diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_i486.c b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_i486.c new file mode 100644 index 0000000..b81d060 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_i486.c @@ -0,0 +1,342 @@ +/* + dct64_i486.c: DCT64, a plain C variant for i486 + + copyright 1998-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Fabrice Bellard +*/ + +/* Discrete Cosine Tansform (DCT) for subband synthesis. + * + * This code is optimized for 80486. It should be compiled with gcc + * 2.7.2 or higher. + * + * Note: This code does not give the necessary accuracy. Moreover, no + * overflow test are done. + * + * (c) 1998 Fabrice Bellard. + */ + +#include "mpg123lib_intern.h" + +#define COS_0_0 16403 +#define COS_0_1 16563 +#define COS_0_2 16890 +#define COS_0_3 17401 +#define COS_0_4 18124 +#define COS_0_5 19101 +#define COS_0_6 20398 +#define COS_0_7 22112 +#define COS_0_8 24396 +#define COS_0_9 27503 +#define COS_0_10 31869 +#define COS_0_11 38320 +#define COS_0_12 48633 +#define COS_0_13 67429 +#define COS_0_14 111660 +#define COS_0_15 333906 +#define COS_1_0 16463 +#define COS_1_1 17121 +#define COS_1_2 18577 +#define COS_1_3 21195 +#define COS_1_4 25826 +#define COS_1_5 34756 +#define COS_1_6 56441 +#define COS_1_7 167154 +#define COS_2_0 16704 +#define COS_2_1 19704 +#define COS_2_2 29490 +#define COS_2_3 83981 +#define COS_3_0 17733 +#define COS_3_1 42813 +#define COS_4_0 23170 + +#define SETOUT(out,n,expr) out[FIR_BUFFER_SIZE*(n)]=(expr) +#define MULL(a,b) (((long long)(a)*(long long)(b)) >> 15) +#define MUL(a,b) \ +(\ + ((!(b & 0x3F)) ? (((a)*(b >> 6)) >> 9) :\ + ((!(b & 0x1F)) ? (((a)*(b >> 5)) >> 10) :\ + ((!(b & 0x0F)) ? (((a)*(b >> 4)) >> 11) :\ + ((!(b & 0x07)) ? (((a)*(b >> 3)) >> 12) :\ + ((!(b & 0x03)) ? (((a)*(b >> 2)) >> 13) :\ + ((!(b & 0x01)) ? (((a)*(b >> 1)) >> 14) :\ + (((a)*(b )) >> 15)))))))) + + +void dct64_1_486(int *out0,int *out1,int *b1,int *b2) +{ + b1[0x00] = b2[0x00] + b2[0x1F]; + b1[0x1F] = MUL((b2[0x00] - b2[0x1F]),COS_0_0); + + b1[0x01] = b2[0x01] + b2[0x1E]; + b1[0x1E] = MUL((b2[0x01] - b2[0x1E]),COS_0_1); + + b1[0x02] = b2[0x02] + b2[0x1D]; + b1[0x1D] = MUL((b2[0x02] - b2[0x1D]),COS_0_2); + + b1[0x03] = b2[0x03] + b2[0x1C]; + b1[0x1C] = MUL((b2[0x03] - b2[0x1C]),COS_0_3); + + b1[0x04] = b2[0x04] + b2[0x1B]; + b1[0x1B] = MUL((b2[0x04] - b2[0x1B]),COS_0_4); + + b1[0x05] = b2[0x05] + b2[0x1A]; + b1[0x1A] = MUL((b2[0x05] - b2[0x1A]),COS_0_5); + + b1[0x06] = b2[0x06] + b2[0x19]; + b1[0x19] = MUL((b2[0x06] - b2[0x19]),COS_0_6); + + b1[0x07] = b2[0x07] + b2[0x18]; + b1[0x18] = MUL((b2[0x07] - b2[0x18]),COS_0_7); + + b1[0x08] = b2[0x08] + b2[0x17]; + b1[0x17] = MUL((b2[0x08] - b2[0x17]),COS_0_8); + + b1[0x09] = b2[0x09] + b2[0x16]; + b1[0x16] = MUL((b2[0x09] - b2[0x16]),COS_0_9); + + b1[0x0A] = b2[0x0A] + b2[0x15]; + b1[0x15] = MUL((b2[0x0A] - b2[0x15]),COS_0_10); + + b1[0x0B] = b2[0x0B] + b2[0x14]; + b1[0x14] = MUL((b2[0x0B] - b2[0x14]),COS_0_11); + + b1[0x0C] = b2[0x0C] + b2[0x13]; + b1[0x13] = MUL((b2[0x0C] - b2[0x13]),COS_0_12); + + b1[0x0D] = b2[0x0D] + b2[0x12]; + b1[0x12] = MULL((b2[0x0D] - b2[0x12]),COS_0_13); + + b1[0x0E] = b2[0x0E] + b2[0x11]; + b1[0x11] = MULL((b2[0x0E] - b2[0x11]),COS_0_14); + + b1[0x0F] = b2[0x0F] + b2[0x10]; + b1[0x10] = MULL((b2[0x0F] - b2[0x10]),COS_0_15); + + + b2[0x00] = b1[0x00] + b1[0x0F]; + b2[0x0F] = MUL((b1[0x00] - b1[0x0F]),COS_1_0); + b2[0x01] = b1[0x01] + b1[0x0E]; + b2[0x0E] = MUL((b1[0x01] - b1[0x0E]),COS_1_1); + b2[0x02] = b1[0x02] + b1[0x0D]; + b2[0x0D] = MUL((b1[0x02] - b1[0x0D]),COS_1_2); + b2[0x03] = b1[0x03] + b1[0x0C]; + b2[0x0C] = MUL((b1[0x03] - b1[0x0C]),COS_1_3); + b2[0x04] = b1[0x04] + b1[0x0B]; + b2[0x0B] = MUL((b1[0x04] - b1[0x0B]),COS_1_4); + b2[0x05] = b1[0x05] + b1[0x0A]; + b2[0x0A] = MUL((b1[0x05] - b1[0x0A]),COS_1_5); + b2[0x06] = b1[0x06] + b1[0x09]; + b2[0x09] = MUL((b1[0x06] - b1[0x09]),COS_1_6); + b2[0x07] = b1[0x07] + b1[0x08]; + b2[0x08] = MULL((b1[0x07] - b1[0x08]),COS_1_7); + + b2[0x10] = b1[0x10] + b1[0x1F]; + b2[0x1F] = MUL((b1[0x1F] - b1[0x10]),COS_1_0); + b2[0x11] = b1[0x11] + b1[0x1E]; + b2[0x1E] = MUL((b1[0x1E] - b1[0x11]),COS_1_1); + b2[0x12] = b1[0x12] + b1[0x1D]; + b2[0x1D] = MUL((b1[0x1D] - b1[0x12]),COS_1_2); + b2[0x13] = b1[0x13] + b1[0x1C]; + b2[0x1C] = MUL((b1[0x1C] - b1[0x13]),COS_1_3); + b2[0x14] = b1[0x14] + b1[0x1B]; + b2[0x1B] = MUL((b1[0x1B] - b1[0x14]),COS_1_4); + b2[0x15] = b1[0x15] + b1[0x1A]; + b2[0x1A] = MUL((b1[0x1A] - b1[0x15]),COS_1_5); + b2[0x16] = b1[0x16] + b1[0x19]; + b2[0x19] = MUL((b1[0x19] - b1[0x16]),COS_1_6); + b2[0x17] = b1[0x17] + b1[0x18]; + b2[0x18] = MULL((b1[0x18] - b1[0x17]),COS_1_7); + + + b1[0x00] = b2[0x00] + b2[0x07]; + b1[0x07] = MUL((b2[0x00] - b2[0x07]),COS_2_0); + b1[0x01] = b2[0x01] + b2[0x06]; + b1[0x06] = MUL((b2[0x01] - b2[0x06]),COS_2_1); + b1[0x02] = b2[0x02] + b2[0x05]; + b1[0x05] = MUL((b2[0x02] - b2[0x05]),COS_2_2); + b1[0x03] = b2[0x03] + b2[0x04]; + b1[0x04] = MULL((b2[0x03] - b2[0x04]),COS_2_3); + + b1[0x08] = b2[0x08] + b2[0x0F]; + b1[0x0F] = MUL((b2[0x0F] - b2[0x08]),COS_2_0); + b1[0x09] = b2[0x09] + b2[0x0E]; + b1[0x0E] = MUL((b2[0x0E] - b2[0x09]),COS_2_1); + b1[0x0A] = b2[0x0A] + b2[0x0D]; + b1[0x0D] = MUL((b2[0x0D] - b2[0x0A]),COS_2_2); + b1[0x0B] = b2[0x0B] + b2[0x0C]; + b1[0x0C] = MULL((b2[0x0C] - b2[0x0B]),COS_2_3); + + b1[0x10] = b2[0x10] + b2[0x17]; + b1[0x17] = MUL((b2[0x10] - b2[0x17]),COS_2_0); + b1[0x11] = b2[0x11] + b2[0x16]; + b1[0x16] = MUL((b2[0x11] - b2[0x16]),COS_2_1); + b1[0x12] = b2[0x12] + b2[0x15]; + b1[0x15] = MUL((b2[0x12] - b2[0x15]),COS_2_2); + b1[0x13] = b2[0x13] + b2[0x14]; + b1[0x14] = MULL((b2[0x13] - b2[0x14]),COS_2_3); + + b1[0x18] = b2[0x18] + b2[0x1F]; + b1[0x1F] = MUL((b2[0x1F] - b2[0x18]),COS_2_0); + b1[0x19] = b2[0x19] + b2[0x1E]; + b1[0x1E] = MUL((b2[0x1E] - b2[0x19]),COS_2_1); + b1[0x1A] = b2[0x1A] + b2[0x1D]; + b1[0x1D] = MUL((b2[0x1D] - b2[0x1A]),COS_2_2); + b1[0x1B] = b2[0x1B] + b2[0x1C]; + b1[0x1C] = MULL((b2[0x1C] - b2[0x1B]),COS_2_3); + + + b2[0x00] = b1[0x00] + b1[0x03]; + b2[0x03] = MUL((b1[0x00] - b1[0x03]),COS_3_0); + b2[0x01] = b1[0x01] + b1[0x02]; + b2[0x02] = MUL((b1[0x01] - b1[0x02]),COS_3_1); + + b2[0x04] = b1[0x04] + b1[0x07]; + b2[0x07] = MUL((b1[0x07] - b1[0x04]),COS_3_0); + b2[0x05] = b1[0x05] + b1[0x06]; + b2[0x06] = MUL((b1[0x06] - b1[0x05]),COS_3_1); + + b2[0x08] = b1[0x08] + b1[0x0B]; + b2[0x0B] = MUL((b1[0x08] - b1[0x0B]),COS_3_0); + b2[0x09] = b1[0x09] + b1[0x0A]; + b2[0x0A] = MUL((b1[0x09] - b1[0x0A]),COS_3_1); + + b2[0x0C] = b1[0x0C] + b1[0x0F]; + b2[0x0F] = MUL((b1[0x0F] - b1[0x0C]),COS_3_0); + b2[0x0D] = b1[0x0D] + b1[0x0E]; + b2[0x0E] = MUL((b1[0x0E] - b1[0x0D]),COS_3_1); + + b2[0x10] = b1[0x10] + b1[0x13]; + b2[0x13] = MUL((b1[0x10] - b1[0x13]),COS_3_0); + b2[0x11] = b1[0x11] + b1[0x12]; + b2[0x12] = MUL((b1[0x11] - b1[0x12]),COS_3_1); + + b2[0x14] = b1[0x14] + b1[0x17]; + b2[0x17] = MUL((b1[0x17] - b1[0x14]),COS_3_0); + b2[0x15] = b1[0x15] + b1[0x16]; + b2[0x16] = MUL((b1[0x16] - b1[0x15]),COS_3_1); + + b2[0x18] = b1[0x18] + b1[0x1B]; + b2[0x1B] = MUL((b1[0x18] - b1[0x1B]),COS_3_0); + b2[0x19] = b1[0x19] + b1[0x1A]; + b2[0x1A] = MUL((b1[0x19] - b1[0x1A]),COS_3_1); + + b2[0x1C] = b1[0x1C] + b1[0x1F]; + b2[0x1F] = MUL((b1[0x1F] - b1[0x1C]),COS_3_0); + b2[0x1D] = b1[0x1D] + b1[0x1E]; + b2[0x1E] = MUL((b1[0x1E] - b1[0x1D]),COS_3_1); + + { + int i; + for(i=0;i<32;i+=4) { + b1[i+0x00] = b2[i+0x00] + b2[i+0x01]; + b1[i+0x01] = MUL((b2[i+0x00] - b2[i+0x01]),COS_4_0); + b1[i+0x02] = b2[i+0x02] + b2[i+0x03]; + b1[i+0x03] = MUL((b2[i+0x03] - b2[i+0x02]),COS_4_0); + } + } + + b1[0x02] += b1[0x03]; + b1[0x06] += b1[0x07]; + b1[0x04] += b1[0x06]; + b1[0x06] += b1[0x05]; + b1[0x05] += b1[0x07]; + + b1[0x0A] += b1[0x0B]; + b1[0x0E] += b1[0x0F]; + b1[0x0C] += b1[0x0E]; + b1[0x0E] += b1[0x0D]; + b1[0x0D] += b1[0x0F]; + + b1[0x12] += b1[0x13]; + b1[0x16] += b1[0x17]; + b1[0x14] += b1[0x16]; + b1[0x16] += b1[0x15]; + b1[0x15] += b1[0x17]; + + b1[0x1A] += b1[0x1B]; + b1[0x1E] += b1[0x1F]; + b1[0x1C] += b1[0x1E]; + b1[0x1E] += b1[0x1D]; + b1[0x1D] += b1[0x1F]; + + SETOUT(out0,16,b1[0x00]); + SETOUT(out0,12,b1[0x04]); + SETOUT(out0, 8,b1[0x02]); + SETOUT(out0, 4,b1[0x06]); + SETOUT(out0, 0,b1[0x01]); + SETOUT(out1, 0,b1[0x01]); + SETOUT(out1, 4,b1[0x05]); + SETOUT(out1, 8,b1[0x03]); + SETOUT(out1,12,b1[0x07]); + + b1[0x08] += b1[0x0C]; + SETOUT(out0,14,b1[0x08]); + b1[0x0C] += b1[0x0a]; + SETOUT(out0,10,b1[0x0C]); + b1[0x0A] += b1[0x0E]; + SETOUT(out0, 6,b1[0x0A]); + b1[0x0E] += b1[0x09]; + SETOUT(out0, 2,b1[0x0E]); + b1[0x09] += b1[0x0D]; + SETOUT(out1, 2,b1[0x09]); + b1[0x0D] += b1[0x0B]; + SETOUT(out1, 6,b1[0x0D]); + b1[0x0B] += b1[0x0F]; + SETOUT(out1,10,b1[0x0B]); + SETOUT(out1,14,b1[0x0F]); + + b1[0x18] += b1[0x1C]; + SETOUT(out0,15,b1[0x10] + b1[0x18]); + SETOUT(out0,13,b1[0x18] + b1[0x14]); + b1[0x1C] += b1[0x1a]; + SETOUT(out0,11,b1[0x14] + b1[0x1C]); + SETOUT(out0, 9,b1[0x1C] + b1[0x12]); + b1[0x1A] += b1[0x1E]; + SETOUT(out0, 7,b1[0x12] + b1[0x1A]); + SETOUT(out0, 5,b1[0x1A] + b1[0x16]); + b1[0x1E] += b1[0x19]; + SETOUT(out0, 3,b1[0x16] + b1[0x1E]); + SETOUT(out0, 1,b1[0x1E] + b1[0x11]); + b1[0x19] += b1[0x1D]; + SETOUT(out1, 1,b1[0x11] + b1[0x19]); + SETOUT(out1, 3,b1[0x19] + b1[0x15]); + b1[0x1D] += b1[0x1B]; + SETOUT(out1, 5,b1[0x15] + b1[0x1D]); + SETOUT(out1, 7,b1[0x1D] + b1[0x13]); + b1[0x1B] += b1[0x1F]; + SETOUT(out1, 9,b1[0x13] + b1[0x1B]); + SETOUT(out1,11,b1[0x1B] + b1[0x17]); + SETOUT(out1,13,b1[0x17] + b1[0x1F]); + SETOUT(out1,15,b1[0x1F]); +} + + +/* + * the call via dct64 is a trick to force GCC to use + * (new) registers for the b1,b2 pointer to the bufs[xx] field + */ +void dct64_i486(int *a,int *b,real *samples) +{ + int bufs[64]; + int i; + +#ifdef REAL_IS_FIXED +#define TOINT(a) ((a) * 32768 / (int)REAL_FACTOR) + + for(i=0;i<32;i++) { + bufs[i]=TOINT(samples[i]); + } +#else + int *p = bufs; + register double const scale = ((65536.0 * 32) + 1) * 65536.0; + + for(i=0;i<32;i++) { + *((double *) (p++)) = scale + *samples++; /* beware on bufs overrun: 8B store from x87 */ + } +#endif + + dct64_1_486(a,b,bufs+32,bufs); +} + diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_mmx.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_mmx.S new file mode 100644 index 0000000..b700732 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_mmx.S @@ -0,0 +1,811 @@ +/* + dct64_mmx.s: MMX optimized DCT64 + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by the mysterious higway (apparently) +*/ + +#include "mangle.h" + +.text + + ALIGN32 +.globl ASM_NAME(dct64_mmx) +ASM_NAME(dct64_mmx): + + xorl %ecx,%ecx +.globl ASM_NAME(dct64_MMX) +ASM_NAME(dct64_MMX): + pushl %ebx + pushl %esi + pushl %edi + subl $256,%esp + movl 280(%esp),%eax + flds (%eax) + leal 128(%esp),%edx + fadds 124(%eax) + movl 272(%esp),%esi + fstps (%edx) + movl 276(%esp),%edi + flds 4(%eax) + movl ASM_VALUE(costab_mmxsse),%ebx + fadds 120(%eax) + orl %ecx,%ecx + fstps 4(%edx) + flds (%eax) + movl %esp,%ecx + fsubs 124(%eax) + fmuls (%ebx) + fstps 124(%edx) + flds 4(%eax) + fsubs 120(%eax) + fmuls 4(%ebx) + fstps 120(%edx) + flds 8(%eax) + fadds 116(%eax) + fstps 8(%edx) + flds 12(%eax) + fadds 112(%eax) + fstps 12(%edx) + flds 8(%eax) + fsubs 116(%eax) + fmuls 8(%ebx) + fstps 116(%edx) + flds 12(%eax) + fsubs 112(%eax) + fmuls 12(%ebx) + fstps 112(%edx) + flds 16(%eax) + fadds 108(%eax) + fstps 16(%edx) + flds 20(%eax) + fadds 104(%eax) + fstps 20(%edx) + flds 16(%eax) + fsubs 108(%eax) + fmuls 16(%ebx) + fstps 108(%edx) + flds 20(%eax) + fsubs 104(%eax) + fmuls 20(%ebx) + fstps 104(%edx) + flds 24(%eax) + fadds 100(%eax) + fstps 24(%edx) + flds 28(%eax) + fadds 96(%eax) + fstps 28(%edx) + flds 24(%eax) + fsubs 100(%eax) + fmuls 24(%ebx) + fstps 100(%edx) + flds 28(%eax) + fsubs 96(%eax) + fmuls 28(%ebx) + fstps 96(%edx) + flds 32(%eax) + fadds 92(%eax) + fstps 32(%edx) + flds 36(%eax) + fadds 88(%eax) + fstps 36(%edx) + flds 32(%eax) + fsubs 92(%eax) + fmuls 32(%ebx) + fstps 92(%edx) + flds 36(%eax) + fsubs 88(%eax) + fmuls 36(%ebx) + fstps 88(%edx) + flds 40(%eax) + fadds 84(%eax) + fstps 40(%edx) + flds 44(%eax) + fadds 80(%eax) + fstps 44(%edx) + flds 40(%eax) + fsubs 84(%eax) + fmuls 40(%ebx) + fstps 84(%edx) + flds 44(%eax) + fsubs 80(%eax) + fmuls 44(%ebx) + fstps 80(%edx) + flds 48(%eax) + fadds 76(%eax) + fstps 48(%edx) + flds 52(%eax) + fadds 72(%eax) + fstps 52(%edx) + flds 48(%eax) + fsubs 76(%eax) + fmuls 48(%ebx) + fstps 76(%edx) + flds 52(%eax) + fsubs 72(%eax) + fmuls 52(%ebx) + fstps 72(%edx) + flds 56(%eax) + fadds 68(%eax) + fstps 56(%edx) + flds 60(%eax) + fadds 64(%eax) + fstps 60(%edx) + flds 56(%eax) + fsubs 68(%eax) + fmuls 56(%ebx) + fstps 68(%edx) + flds 60(%eax) + fsubs 64(%eax) + fmuls 60(%ebx) + fstps 64(%edx) + + flds (%edx) + fadds 60(%edx) + fstps (%ecx) + flds 4(%edx) + fadds 56(%edx) + fstps 4(%ecx) + flds (%edx) + fsubs 60(%edx) + fmuls 64(%ebx) + fstps 60(%ecx) + flds 4(%edx) + fsubs 56(%edx) + fmuls 68(%ebx) + fstps 56(%ecx) + flds 8(%edx) + fadds 52(%edx) + fstps 8(%ecx) + flds 12(%edx) + fadds 48(%edx) + fstps 12(%ecx) + flds 8(%edx) + fsubs 52(%edx) + fmuls 72(%ebx) + fstps 52(%ecx) + flds 12(%edx) + fsubs 48(%edx) + fmuls 76(%ebx) + fstps 48(%ecx) + flds 16(%edx) + fadds 44(%edx) + fstps 16(%ecx) + flds 20(%edx) + fadds 40(%edx) + fstps 20(%ecx) + flds 16(%edx) + fsubs 44(%edx) + fmuls 80(%ebx) + fstps 44(%ecx) + flds 20(%edx) + fsubs 40(%edx) + fmuls 84(%ebx) + fstps 40(%ecx) + flds 24(%edx) + fadds 36(%edx) + fstps 24(%ecx) + flds 28(%edx) + fadds 32(%edx) + fstps 28(%ecx) + flds 24(%edx) + fsubs 36(%edx) + fmuls 88(%ebx) + fstps 36(%ecx) + flds 28(%edx) + fsubs 32(%edx) + fmuls 92(%ebx) + fstps 32(%ecx) + + flds 64(%edx) + fadds 124(%edx) + fstps 64(%ecx) + flds 68(%edx) + fadds 120(%edx) + fstps 68(%ecx) + flds 124(%edx) + fsubs 64(%edx) + fmuls 64(%ebx) + fstps 124(%ecx) + flds 120(%edx) + fsubs 68(%edx) + fmuls 68(%ebx) + fstps 120(%ecx) + flds 72(%edx) + fadds 116(%edx) + fstps 72(%ecx) + flds 76(%edx) + fadds 112(%edx) + fstps 76(%ecx) + flds 116(%edx) + fsubs 72(%edx) + fmuls 72(%ebx) + fstps 116(%ecx) + flds 112(%edx) + fsubs 76(%edx) + fmuls 76(%ebx) + fstps 112(%ecx) + flds 80(%edx) + fadds 108(%edx) + fstps 80(%ecx) + flds 84(%edx) + fadds 104(%edx) + fstps 84(%ecx) + flds 108(%edx) + fsubs 80(%edx) + fmuls 80(%ebx) + fstps 108(%ecx) + flds 104(%edx) + fsubs 84(%edx) + fmuls 84(%ebx) + fstps 104(%ecx) + flds 88(%edx) + fadds 100(%edx) + fstps 88(%ecx) + flds 92(%edx) + fadds 96(%edx) + fstps 92(%ecx) + flds 100(%edx) + fsubs 88(%edx) + fmuls 88(%ebx) + fstps 100(%ecx) + flds 96(%edx) + fsubs 92(%edx) + fmuls 92(%ebx) + fstps 96(%ecx) + + flds (%ecx) + fadds 28(%ecx) + fstps (%edx) + flds (%ecx) + fsubs 28(%ecx) + fmuls 96(%ebx) + fstps 28(%edx) + flds 4(%ecx) + fadds 24(%ecx) + fstps 4(%edx) + flds 4(%ecx) + fsubs 24(%ecx) + fmuls 100(%ebx) + fstps 24(%edx) + flds 8(%ecx) + fadds 20(%ecx) + fstps 8(%edx) + flds 8(%ecx) + fsubs 20(%ecx) + fmuls 104(%ebx) + fstps 20(%edx) + flds 12(%ecx) + fadds 16(%ecx) + fstps 12(%edx) + flds 12(%ecx) + fsubs 16(%ecx) + fmuls 108(%ebx) + fstps 16(%edx) + flds 32(%ecx) + fadds 60(%ecx) + fstps 32(%edx) + flds 60(%ecx) + fsubs 32(%ecx) + fmuls 96(%ebx) + fstps 60(%edx) + flds 36(%ecx) + fadds 56(%ecx) + fstps 36(%edx) + flds 56(%ecx) + fsubs 36(%ecx) + fmuls 100(%ebx) + fstps 56(%edx) + flds 40(%ecx) + fadds 52(%ecx) + fstps 40(%edx) + flds 52(%ecx) + fsubs 40(%ecx) + fmuls 104(%ebx) + fstps 52(%edx) + flds 44(%ecx) + fadds 48(%ecx) + fstps 44(%edx) + flds 48(%ecx) + fsubs 44(%ecx) + fmuls 108(%ebx) + fstps 48(%edx) + flds 64(%ecx) + fadds 92(%ecx) + fstps 64(%edx) + flds 64(%ecx) + fsubs 92(%ecx) + fmuls 96(%ebx) + fstps 92(%edx) + flds 68(%ecx) + fadds 88(%ecx) + fstps 68(%edx) + flds 68(%ecx) + fsubs 88(%ecx) + fmuls 100(%ebx) + fstps 88(%edx) + flds 72(%ecx) + fadds 84(%ecx) + fstps 72(%edx) + flds 72(%ecx) + fsubs 84(%ecx) + fmuls 104(%ebx) + fstps 84(%edx) + flds 76(%ecx) + fadds 80(%ecx) + fstps 76(%edx) + flds 76(%ecx) + fsubs 80(%ecx) + fmuls 108(%ebx) + fstps 80(%edx) + flds 96(%ecx) + fadds 124(%ecx) + fstps 96(%edx) + flds 124(%ecx) + fsubs 96(%ecx) + fmuls 96(%ebx) + fstps 124(%edx) + flds 100(%ecx) + fadds 120(%ecx) + fstps 100(%edx) + flds 120(%ecx) + fsubs 100(%ecx) + fmuls 100(%ebx) + fstps 120(%edx) + flds 104(%ecx) + fadds 116(%ecx) + fstps 104(%edx) + flds 116(%ecx) + fsubs 104(%ecx) + fmuls 104(%ebx) + fstps 116(%edx) + flds 108(%ecx) + fadds 112(%ecx) + fstps 108(%edx) + flds 112(%ecx) + fsubs 108(%ecx) + fmuls 108(%ebx) + fstps 112(%edx) + flds (%edx) + fadds 12(%edx) + fstps (%ecx) + flds (%edx) + fsubs 12(%edx) + fmuls 112(%ebx) + fstps 12(%ecx) + flds 4(%edx) + fadds 8(%edx) + fstps 4(%ecx) + flds 4(%edx) + fsubs 8(%edx) + fmuls 116(%ebx) + fstps 8(%ecx) + flds 16(%edx) + fadds 28(%edx) + fstps 16(%ecx) + flds 28(%edx) + fsubs 16(%edx) + fmuls 112(%ebx) + fstps 28(%ecx) + flds 20(%edx) + fadds 24(%edx) + fstps 20(%ecx) + flds 24(%edx) + fsubs 20(%edx) + fmuls 116(%ebx) + fstps 24(%ecx) + flds 32(%edx) + fadds 44(%edx) + fstps 32(%ecx) + flds 32(%edx) + fsubs 44(%edx) + fmuls 112(%ebx) + fstps 44(%ecx) + flds 36(%edx) + fadds 40(%edx) + fstps 36(%ecx) + flds 36(%edx) + fsubs 40(%edx) + fmuls 116(%ebx) + fstps 40(%ecx) + flds 48(%edx) + fadds 60(%edx) + fstps 48(%ecx) + flds 60(%edx) + fsubs 48(%edx) + fmuls 112(%ebx) + fstps 60(%ecx) + flds 52(%edx) + fadds 56(%edx) + fstps 52(%ecx) + flds 56(%edx) + fsubs 52(%edx) + fmuls 116(%ebx) + fstps 56(%ecx) + flds 64(%edx) + fadds 76(%edx) + fstps 64(%ecx) + flds 64(%edx) + fsubs 76(%edx) + fmuls 112(%ebx) + fstps 76(%ecx) + flds 68(%edx) + fadds 72(%edx) + fstps 68(%ecx) + flds 68(%edx) + fsubs 72(%edx) + fmuls 116(%ebx) + fstps 72(%ecx) + flds 80(%edx) + fadds 92(%edx) + fstps 80(%ecx) + flds 92(%edx) + fsubs 80(%edx) + fmuls 112(%ebx) + fstps 92(%ecx) + flds 84(%edx) + fadds 88(%edx) + fstps 84(%ecx) + flds 88(%edx) + fsubs 84(%edx) + fmuls 116(%ebx) + fstps 88(%ecx) + flds 96(%edx) + fadds 108(%edx) + fstps 96(%ecx) + flds 96(%edx) + fsubs 108(%edx) + fmuls 112(%ebx) + fstps 108(%ecx) + flds 100(%edx) + fadds 104(%edx) + fstps 100(%ecx) + flds 100(%edx) + fsubs 104(%edx) + fmuls 116(%ebx) + fstps 104(%ecx) + flds 112(%edx) + fadds 124(%edx) + fstps 112(%ecx) + flds 124(%edx) + fsubs 112(%edx) + fmuls 112(%ebx) + fstps 124(%ecx) + flds 116(%edx) + fadds 120(%edx) + fstps 116(%ecx) + flds 120(%edx) + fsubs 116(%edx) + fmuls 116(%ebx) + fstps 120(%ecx) + + flds 32(%ecx) + fadds 36(%ecx) + fstps 32(%edx) + flds 32(%ecx) + fsubs 36(%ecx) + fmuls 120(%ebx) + fstps 36(%edx) + flds 44(%ecx) + fsubs 40(%ecx) + fmuls 120(%ebx) + fsts 44(%edx) + fadds 40(%ecx) + fadds 44(%ecx) + fstps 40(%edx) + flds 48(%ecx) + fsubs 52(%ecx) + fmuls 120(%ebx) + flds 60(%ecx) + fsubs 56(%ecx) + fmuls 120(%ebx) + fld %st(0) + fadds 56(%ecx) + fadds 60(%ecx) + fld %st(0) + fadds 48(%ecx) + fadds 52(%ecx) + fstps 48(%edx) + fadd %st(2) + fstps 56(%edx) + fsts 60(%edx) + faddp %st(1) + fstps 52(%edx) + flds 64(%ecx) + fadds 68(%ecx) + fstps 64(%edx) + flds 64(%ecx) + fsubs 68(%ecx) + fmuls 120(%ebx) + fstps 68(%edx) + flds 76(%ecx) + fsubs 72(%ecx) + fmuls 120(%ebx) + fsts 76(%edx) + fadds 72(%ecx) + fadds 76(%ecx) + fstps 72(%edx) + flds 92(%ecx) + fsubs 88(%ecx) + fmuls 120(%ebx) + fsts 92(%edx) + fadds 92(%ecx) + fadds 88(%ecx) + fld %st(0) + fadds 80(%ecx) + fadds 84(%ecx) + fstps 80(%edx) + flds 80(%ecx) + fsubs 84(%ecx) + fmuls 120(%ebx) + fadd %st(0), %st(1) + fadds 92(%edx) + fstps 84(%edx) + fstps 88(%edx) + flds 96(%ecx) + fadds 100(%ecx) + fstps 96(%edx) + flds 96(%ecx) + fsubs 100(%ecx) + fmuls 120(%ebx) + fstps 100(%edx) + flds 108(%ecx) + fsubs 104(%ecx) + fmuls 120(%ebx) + fsts 108(%edx) + fadds 104(%ecx) + fadds 108(%ecx) + fstps 104(%edx) + flds 124(%ecx) + fsubs 120(%ecx) + fmuls 120(%ebx) + fsts 124(%edx) + fadds 120(%ecx) + fadds 124(%ecx) + fld %st(0) + fadds 112(%ecx) + fadds 116(%ecx) + fstps 112(%edx) + flds 112(%ecx) + fsubs 116(%ecx) + fmuls 120(%ebx) + fadd %st(0),%st(1) + fadds 124(%edx) + fstps 116(%edx) + fstps 120(%edx) + jnz .L01 + + flds (%ecx) + fadds 4(%ecx) + fstps 1024(%esi) + flds (%ecx) + fsubs 4(%ecx) + fmuls 120(%ebx) + fsts (%esi) + fstps (%edi) + flds 12(%ecx) + fsubs 8(%ecx) + fmuls 120(%ebx) + fsts 512(%edi) + fadds 12(%ecx) + fadds 8(%ecx) + fstps 512(%esi) + flds 16(%ecx) + fsubs 20(%ecx) + fmuls 120(%ebx) + flds 28(%ecx) + fsubs 24(%ecx) + fmuls 120(%ebx) + fsts 768(%edi) + fld %st(0) + fadds 24(%ecx) + fadds 28(%ecx) + fld %st(0) + fadds 16(%ecx) + fadds 20(%ecx) + fstps 768(%esi) + fadd %st(2) + fstps 256(%esi) + faddp %st(1) + fstps 256(%edi) + + flds 32(%edx) + fadds 48(%edx) + fstps 896(%esi) + flds 48(%edx) + fadds 40(%edx) + fstps 640(%esi) + flds 40(%edx) + fadds 56(%edx) + fstps 384(%esi) + flds 56(%edx) + fadds 36(%edx) + fstps 128(%esi) + flds 36(%edx) + fadds 52(%edx) + fstps 128(%edi) + flds 52(%edx) + fadds 44(%edx) + fstps 384(%edi) + flds 60(%edx) + fsts 896(%edi) + fadds 44(%edx) + fstps 640(%edi) + flds 96(%edx) + fadds 112(%edx) + fld %st(0) + fadds 64(%edx) + fstps 960(%esi) + fadds 80(%edx) + fstps 832(%esi) + flds 112(%edx) + fadds 104(%edx) + fld %st(0) + fadds 80(%edx) + fstps 704(%esi) + fadds 72(%edx) + fstps 576(%esi) + flds 104(%edx) + fadds 120(%edx) + fld %st(0) + fadds 72(%edx) + fstps 448(%esi) + fadds 88(%edx) + fstps 320(%esi) + flds 120(%edx) + fadds 100(%edx) + fld %st(0) + fadds 88(%edx) + fstps 192(%esi) + fadds 68(%edx) + fstps 64(%esi) + flds 100(%edx) + fadds 116(%edx) + fld %st(0) + fadds 68(%edx) + fstps 64(%edi) + fadds 84(%edx) + fstps 192(%edi) + flds 116(%edx) + fadds 108(%edx) + fld %st(0) + fadds 84(%edx) + fstps 320(%edi) + fadds 76(%edx) + fstps 448(%edi) + flds 108(%edx) + fadds 124(%edx) + fld %st(0) + fadds 76(%edx) + fstps 576(%edi) + fadds 92(%edx) + fstps 704(%edi) + flds 124(%edx) + fsts 960(%edi) + fadds 92(%edx) + fstps 832(%edi) + addl $256,%esp + popl %edi + popl %esi + popl %ebx + ret +.L01: + flds (%ecx) + fadds 4(%ecx) + fistps 512(%esi) + flds (%ecx) + fsubs 4(%ecx) + fmuls 120(%ebx) + + fistps (%esi) + + flds 12(%ecx) + fsubs 8(%ecx) + fmuls 120(%ebx) + fists 256(%edi) + fadds 12(%ecx) + fadds 8(%ecx) + fistps 256(%esi) + flds 16(%ecx) + fsubs 20(%ecx) + fmuls 120(%ebx) + flds 28(%ecx) + fsubs 24(%ecx) + fmuls 120(%ebx) + fists 384(%edi) + fld %st(0) + fadds 24(%ecx) + fadds 28(%ecx) + fld %st(0) + fadds 16(%ecx) + fadds 20(%ecx) + fistps 384(%esi) + fadd %st(2) + fistps 128(%esi) + faddp %st(1) + fistps 128(%edi) + + flds 32(%edx) + fadds 48(%edx) + fistps 448(%esi) + flds 48(%edx) + fadds 40(%edx) + fistps 320(%esi) + flds 40(%edx) + fadds 56(%edx) + fistps 192(%esi) + flds 56(%edx) + fadds 36(%edx) + fistps 64(%esi) + flds 36(%edx) + fadds 52(%edx) + fistps 64(%edi) + flds 52(%edx) + fadds 44(%edx) + fistps 192(%edi) + flds 60(%edx) + fists 448(%edi) + fadds 44(%edx) + fistps 320(%edi) + flds 96(%edx) + fadds 112(%edx) + fld %st(0) + fadds 64(%edx) + fistps 480(%esi) + fadds 80(%edx) + fistps 416(%esi) + flds 112(%edx) + fadds 104(%edx) + fld %st(0) + fadds 80(%edx) + fistps 352(%esi) + fadds 72(%edx) + fistps 288(%esi) + flds 104(%edx) + fadds 120(%edx) + fld %st(0) + fadds 72(%edx) + fistps 224(%esi) + fadds 88(%edx) + fistps 160(%esi) + flds 120(%edx) + fadds 100(%edx) + fld %st(0) + fadds 88(%edx) + fistps 96(%esi) + fadds 68(%edx) + fistps 32(%esi) + flds 100(%edx) + fadds 116(%edx) + fld %st(0) + fadds 68(%edx) + fistps 32(%edi) + fadds 84(%edx) + fistps 96(%edi) + flds 116(%edx) + fadds 108(%edx) + fld %st(0) + fadds 84(%edx) + fistps 160(%edi) + fadds 76(%edx) + fistps 224(%edi) + flds 108(%edx) + fadds 124(%edx) + fld %st(0) + fadds 76(%edx) + fistps 288(%edi) + fadds 92(%edx) + fistps 352(%edi) + flds 124(%edx) + fists 480(%edi) + fadds 92(%edx) + fistps 416(%edi) + movsw + addl $256,%esp + popl %edi + popl %esi + popl %ebx + ret + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_neon.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_neon.S new file mode 100644 index 0000000..a8a3614 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_neon.S @@ -0,0 +1,297 @@ +/* + dct64_neon: ARM NEON optimized dct64 + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + + .text + ALIGN16 +costab_arm: + .word 1056974725 + .word 1057056395 + .word 1057223771 + .word 1057485416 + .word 1057855544 + .word 1058356026 + .word 1059019886 + .word 1059897405 + .word 1061067246 + .word 1062657950 + .word 1064892987 + .word 1066774581 + .word 1069414683 + .word 1073984175 + .word 1079645762 + .word 1092815430 + .word 1057005197 + .word 1057342072 + .word 1058087743 + .word 1059427869 + .word 1061799040 + .word 1065862217 + .word 1071413542 + .word 1084439708 + .word 1057128951 + .word 1058664893 + .word 1063675095 + .word 1076102863 + .word 1057655764 + .word 1067924853 + .word 1060439283 + .word 1060439283 + .globl ASM_NAME(dct64_neon) +ASM_NAME(dct64_neon): + vpush {q4-q7} + + adr r3, costab_arm + vld1.32 {q0, q1}, [r2]! + vld1.32 {q2, q3}, [r2]! + vld1.32 {q4, q5}, [r2]! + vld1.32 {q6, q7}, [r2] + vld1.32 {q12, q13}, [r3, :128]! + vld1.32 {q14, q15}, [r3, :128]! + + vrev64.32 q4, q4 + vrev64.32 q5, q5 + vrev64.32 q6, q6 + vrev64.32 q7, q7 + vswp d8, d9 + vswp d10, d11 + vswp d12, d13 + vswp d14, d15 + + vsub.f32 q8, q0, q7 + vsub.f32 q9, q1, q6 + vsub.f32 q10, q2, q5 + vsub.f32 q11, q3, q4 + vadd.f32 q0, q0, q7 + vadd.f32 q1, q1, q6 + vadd.f32 q2, q2, q5 + vadd.f32 q3, q3, q4 + vmul.f32 q4, q8, q12 + vmul.f32 q5, q9, q13 + vmul.f32 q6, q10, q14 + vmul.f32 q7, q11, q15 + + vld1.32 {q12, q13}, [r3, :128]! + vld1.32 {q14, q15}, [r3, :128] + + vrev64.32 q2, q2 + vrev64.32 q3, q3 + vrev64.32 q6, q6 + vrev64.32 q7, q7 + vswp d4, d5 + vswp d6, d7 + vswp d12, d13 + vswp d14, d15 + + vsub.f32 q8, q0, q3 + vsub.f32 q9, q1, q2 + vsub.f32 q10, q4, q7 + vsub.f32 q11, q5, q6 + vadd.f32 q0, q0, q3 + vadd.f32 q1, q1, q2 + vadd.f32 q4, q4, q7 + vadd.f32 q5, q5, q6 + vmul.f32 q2, q8, q12 + vmul.f32 q3, q9, q13 + vmul.f32 q6, q10, q12 + vmul.f32 q7, q11, q13 + + vrev64.32 q1, q1 + vrev64.32 q3, q3 + vrev64.32 q5, q5 + vrev64.32 q7, q7 + vswp d2, d3 + vswp d6, d7 + vswp d10, d11 + vswp d14, d15 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q14 + vmul.f32 q3, q9, q14 + vmul.f32 q5, q10, q14 + vmul.f32 q7, q11, q14 + + vdup.32 q12, d31[0] + vmov d31, d30 + + vswp d1, d2 + vswp d5, d6 + vswp d9, d10 + vswp d13, d14 + vrev64.32 q1, q1 + vrev64.32 q3, q3 + vrev64.32 q5, q5 + vrev64.32 q7, q7 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q15 + vmul.f32 q3, q9, q15 + vmul.f32 q5, q10, q15 + vmul.f32 q7, q11, q15 + + vtrn.32 q0, q1 + vtrn.32 q2, q3 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q12 + vmul.f32 q3, q9, q12 + vmul.f32 q5, q10, q12 + vmul.f32 q7, q11, q12 + + vtrn.32 q0, q1 + vtrn.32 q2, q3 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + vswp d1, d2 + vswp d5, d6 + vswp d9, d10 + vswp d13, d14 + + vshr.u64 d16, d1, #32 + vshr.u64 d17, d3, #32 + vshr.u64 d18, d5, #32 + vshr.u64 d19, d7, #32 + vadd.f32 d1, d1, d16 + vadd.f32 d3, d3, d17 + vadd.f32 d5, d5, d18 + vadd.f32 d7, d7, d19 + vshr.u64 d20, d9, #32 + vshr.u64 d21, d11, #32 + vshr.u64 d22, d13, #32 + vshr.u64 d23, d15, #32 + vadd.f32 d9, d9, d20 + vadd.f32 d11, d11, d21 + vadd.f32 d13, d13, d22 + vadd.f32 d15, d15, d23 + + vshr.u64 d16, d2, #32 + vshr.u64 d18, d6, #32 + vshr.u64 d20, d10, #32 + vshr.u64 d22, d14, #32 + vext.8 q8, q1, q8, #8 + vext.8 q9, q3, q9, #8 + vext.8 q10, q5, q10, #8 + vext.8 q11, q7, q11, #8 + vadd.f32 q1, q1, q8 + vadd.f32 q3, q3, q9 + vadd.f32 q5, q5, q10 + vadd.f32 q7, q7, q11 + + vshr.u64 d16, d4, #32 + vshr.u64 d18, d12, #32 + vext.8 q8, q2, q8, #8 + vext.8 q9, q6, q9, #8 + vadd.f32 q2, q2, q3 + vadd.f32 q6, q6, q7 + vadd.f32 q3, q3, q8 + vadd.f32 q7, q7, q9 + + vrev64.32 q8, q4 + vshr.u64 d19, d9, #32 + vext.8 d17, d17, d16, #4 + vswp d9, d10 + vswp d13, d14 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + vmov d16, d9 + vmov d18, d11 + + vadd.f32 q4, q6 + vadd.f32 q5, q7 + vadd.f32 q6, q8 + vadd.f32 q7, q9 + + vmov.i32 q8, #0x4b000000 + vorr.i32 q8, #0x00400000 + vadd.f32 q0, q0, q8 + vadd.f32 q1, q1, q8 + vadd.f32 q2, q2, q8 + vadd.f32 q3, q3, q8 + vadd.f32 q4, q4, q8 + vadd.f32 q5, q5, q8 + vadd.f32 q6, q6, q8 + vadd.f32 q7, q7, q8 + vshl.i32 q0, q0, #10 + vshl.i32 q1, q1, #10 + vshl.i32 q2, q2, #10 + vshl.i32 q3, q3, #10 + vshl.i32 q4, q4, #10 + vshl.i32 q5, q5, #10 + vshl.i32 q6, q6, #10 + vshl.i32 q7, q7, #10 + vqshrn.s32 d0, q0, #10 + vqshrn.s32 d2, q1, #10 + vqshrn.s32 d4, q2, #10 + vqshrn.s32 d6, q3, #10 + vqshrn.s32 d8, q4, #10 + vqshrn.s32 d10, q5, #10 + vqshrn.s32 d12, q6, #10 + vqshrn.s32 d14, q7, #10 + + mov r3, #32 + vst1.16 {d0[1]}, [r0, :16], r3 + vst1.16 {d12[3]}, [r0, :16], r3 + vst1.16 {d6[2]}, [r0, :16], r3 + vst1.16 {d8[3]}, [r0, :16], r3 + vst1.16 {d2[2]}, [r0, :16], r3 + vst1.16 {d12[1]}, [r0, :16], r3 + vst1.16 {d4[2]}, [r0, :16], r3 + vst1.16 {d8[1]}, [r0, :16], r3 + vst1.16 {d0[2]}, [r0, :16], r3 + vst1.16 {d12[2]}, [r0, :16], r3 + vst1.16 {d6[0]}, [r0, :16], r3 + vst1.16 {d8[2]}, [r0, :16], r3 + vst1.16 {d2[0]}, [r0, :16], r3 + vst1.16 {d12[0]}, [r0, :16], r3 + vst1.16 {d4[0]}, [r0, :16], r3 + vst1.16 {d8[0]}, [r0, :16], r3 + vst1.16 {d0[0]}, [r0, :16] + + vst1.16 {d0[1]}, [r1, :16], r3 + vst1.16 {d10[0]}, [r1, :16], r3 + vst1.16 {d4[1]}, [r1, :16], r3 + vst1.16 {d14[0]}, [r1, :16], r3 + vst1.16 {d2[1]}, [r1, :16], r3 + vst1.16 {d10[2]}, [r1, :16], r3 + vst1.16 {d6[1]}, [r1, :16], r3 + vst1.16 {d14[2]}, [r1, :16], r3 + vst1.16 {d0[3]}, [r1, :16], r3 + vst1.16 {d10[1]}, [r1, :16], r3 + vst1.16 {d4[3]}, [r1, :16], r3 + vst1.16 {d14[1]}, [r1, :16], r3 + vst1.16 {d2[3]}, [r1, :16], r3 + vst1.16 {d10[3]}, [r1, :16], r3 + vst1.16 {d6[3]}, [r1, :16], r3 + vst1.16 {d14[3]}, [r1, :16] + + vpop {q4-q7} + bx lr diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_neon_float.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_neon_float.S new file mode 100644 index 0000000..fae43aa --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_neon_float.S @@ -0,0 +1,270 @@ +/* + dct64_neon_float: ARM NEON optimized dct64 (float output version) + + copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + + .text + ALIGN16 +costab_arm: + .word 1056974725 + .word 1057056395 + .word 1057223771 + .word 1057485416 + .word 1057855544 + .word 1058356026 + .word 1059019886 + .word 1059897405 + .word 1061067246 + .word 1062657950 + .word 1064892987 + .word 1066774581 + .word 1069414683 + .word 1073984175 + .word 1079645762 + .word 1092815430 + .word 1057005197 + .word 1057342072 + .word 1058087743 + .word 1059427869 + .word 1061799040 + .word 1065862217 + .word 1071413542 + .word 1084439708 + .word 1057128951 + .word 1058664893 + .word 1063675095 + .word 1076102863 + .word 1057655764 + .word 1067924853 + .word 1060439283 + .word 1060439283 + .globl ASM_NAME(dct64_real_neon) +ASM_NAME(dct64_real_neon): + vpush {q4-q7} + + adr r3, costab_arm + vld1.32 {q0, q1}, [r2]! + vld1.32 {q2, q3}, [r2]! + vld1.32 {q4, q5}, [r2]! + vld1.32 {q6, q7}, [r2] + vld1.32 {q12, q13}, [r3, :128]! + vld1.32 {q14, q15}, [r3, :128]! + + vrev64.32 q4, q4 + vrev64.32 q5, q5 + vrev64.32 q6, q6 + vrev64.32 q7, q7 + vswp d8, d9 + vswp d10, d11 + vswp d12, d13 + vswp d14, d15 + + vsub.f32 q8, q0, q7 + vsub.f32 q9, q1, q6 + vsub.f32 q10, q2, q5 + vsub.f32 q11, q3, q4 + vadd.f32 q0, q0, q7 + vadd.f32 q1, q1, q6 + vadd.f32 q2, q2, q5 + vadd.f32 q3, q3, q4 + vmul.f32 q4, q8, q12 + vmul.f32 q5, q9, q13 + vmul.f32 q6, q10, q14 + vmul.f32 q7, q11, q15 + + vld1.32 {q12, q13}, [r3, :128]! + vld1.32 {q14, q15}, [r3, :128] + + vrev64.32 q2, q2 + vrev64.32 q3, q3 + vrev64.32 q6, q6 + vrev64.32 q7, q7 + vswp d4, d5 + vswp d6, d7 + vswp d12, d13 + vswp d14, d15 + + vsub.f32 q8, q0, q3 + vsub.f32 q9, q1, q2 + vsub.f32 q10, q4, q7 + vsub.f32 q11, q5, q6 + vadd.f32 q0, q0, q3 + vadd.f32 q1, q1, q2 + vadd.f32 q4, q4, q7 + vadd.f32 q5, q5, q6 + vmul.f32 q2, q8, q12 + vmul.f32 q3, q9, q13 + vmul.f32 q6, q10, q12 + vmul.f32 q7, q11, q13 + + vrev64.32 q1, q1 + vrev64.32 q3, q3 + vrev64.32 q5, q5 + vrev64.32 q7, q7 + vswp d2, d3 + vswp d6, d7 + vswp d10, d11 + vswp d14, d15 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q14 + vmul.f32 q3, q9, q14 + vmul.f32 q5, q10, q14 + vmul.f32 q7, q11, q14 + + vdup.32 q12, d31[0] + vmov d31, d30 + + vswp d1, d2 + vswp d5, d6 + vswp d9, d10 + vswp d13, d14 + vrev64.32 q1, q1 + vrev64.32 q3, q3 + vrev64.32 q5, q5 + vrev64.32 q7, q7 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q15 + vmul.f32 q3, q9, q15 + vmul.f32 q5, q10, q15 + vmul.f32 q7, q11, q15 + + vtrn.32 q0, q1 + vtrn.32 q2, q3 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + + vsub.f32 q8, q0, q1 + vsub.f32 q9, q2, q3 + vsub.f32 q10, q4, q5 + vsub.f32 q11, q6, q7 + vadd.f32 q0, q0, q1 + vadd.f32 q2, q2, q3 + vadd.f32 q4, q4, q5 + vadd.f32 q6, q6, q7 + vmul.f32 q1, q8, q12 + vmul.f32 q3, q9, q12 + vmul.f32 q5, q10, q12 + vmul.f32 q7, q11, q12 + + vtrn.32 q0, q1 + vtrn.32 q2, q3 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + vswp d1, d2 + vswp d5, d6 + vswp d9, d10 + vswp d13, d14 + + vshr.u64 d16, d1, #32 + vshr.u64 d17, d3, #32 + vshr.u64 d18, d5, #32 + vshr.u64 d19, d7, #32 + vadd.f32 d1, d1, d16 + vadd.f32 d3, d3, d17 + vadd.f32 d5, d5, d18 + vadd.f32 d7, d7, d19 + vshr.u64 d20, d9, #32 + vshr.u64 d21, d11, #32 + vshr.u64 d22, d13, #32 + vshr.u64 d23, d15, #32 + vadd.f32 d9, d9, d20 + vadd.f32 d11, d11, d21 + vadd.f32 d13, d13, d22 + vadd.f32 d15, d15, d23 + + vshr.u64 d16, d2, #32 + vshr.u64 d18, d6, #32 + vshr.u64 d20, d10, #32 + vshr.u64 d22, d14, #32 + vext.8 q8, q1, q8, #8 + vext.8 q9, q3, q9, #8 + vext.8 q10, q5, q10, #8 + vext.8 q11, q7, q11, #8 + vadd.f32 q1, q1, q8 + vadd.f32 q3, q3, q9 + vadd.f32 q5, q5, q10 + vadd.f32 q7, q7, q11 + + vshr.u64 d16, d4, #32 + vshr.u64 d18, d12, #32 + vext.8 q8, q2, q8, #8 + vext.8 q9, q6, q9, #8 + vadd.f32 q2, q2, q3 + vadd.f32 q6, q6, q7 + vadd.f32 q3, q3, q8 + vadd.f32 q7, q7, q9 + + vrev64.32 q8, q4 + vshr.u64 d19, d9, #32 + vext.8 d17, d17, d16, #4 + vswp d9, d10 + vswp d13, d14 + vtrn.32 q4, q5 + vtrn.32 q6, q7 + vmov d16, d9 + vmov d18, d11 + + vadd.f32 q4, q6 + vadd.f32 q5, q7 + vadd.f32 q6, q8 + vadd.f32 q7, q9 + + mov r3, #64 + vst1.32 {d0[1]}, [r0, :32], r3 + vst1.32 {d13[1]}, [r0, :32], r3 + vst1.32 {d7[0]}, [r0, :32], r3 + vst1.32 {d9[1]}, [r0, :32], r3 + vst1.32 {d3[0]}, [r0, :32], r3 + vst1.32 {d12[1]}, [r0, :32], r3 + vst1.32 {d5[0]}, [r0, :32], r3 + vst1.32 {d8[1]}, [r0, :32], r3 + vst1.32 {d1[0]}, [r0, :32], r3 + vst1.32 {d13[0]}, [r0, :32], r3 + vst1.32 {d6[0]}, [r0, :32], r3 + vst1.32 {d9[0]}, [r0, :32], r3 + vst1.32 {d2[0]}, [r0, :32], r3 + vst1.32 {d12[0]}, [r0, :32], r3 + vst1.32 {d4[0]}, [r0, :32], r3 + vst1.32 {d8[0]}, [r0, :32], r3 + vst1.32 {d0[0]}, [r0, :32] + + vst1.32 {d0[1]}, [r1, :32], r3 + vst1.32 {d10[0]}, [r1, :32], r3 + vst1.32 {d4[1]}, [r1, :32], r3 + vst1.32 {d14[0]}, [r1, :32], r3 + vst1.32 {d2[1]}, [r1, :32], r3 + vst1.32 {d11[0]}, [r1, :32], r3 + vst1.32 {d6[1]}, [r1, :32], r3 + vst1.32 {d15[0]}, [r1, :32], r3 + vst1.32 {d1[1]}, [r1, :32], r3 + vst1.32 {d10[1]}, [r1, :32], r3 + vst1.32 {d5[1]}, [r1, :32], r3 + vst1.32 {d14[1]}, [r1, :32], r3 + vst1.32 {d3[1]}, [r1, :32], r3 + vst1.32 {d11[1]}, [r1, :32], r3 + vst1.32 {d7[1]}, [r1, :32], r3 + vst1.32 {d15[1]}, [r1, :32] + + vpop {q4-q7} + bx lr diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_sse.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_sse.S new file mode 100644 index 0000000..d9abbcd --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_sse.S @@ -0,0 +1,454 @@ +/* + dct64_sse: MMX/SSE optimized dct64 + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#define ARG(n) (8+n*4)(%ebp) +#define TEMP(n) (4+n*16)(%esp) +#define TEMP_BYTE(n) (4+n)(%esp) + +/* + void dct64_sse(short *out0, short *out1, real *samples); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN16 +pnpn: + .long 0 + .long -2147483648 + .long 0 + .long -2147483648 + ALIGN16 +mask: + .long -1 + .long -1 + .long -1 + .long 0 + + .text + ALIGN16 +.globl ASM_NAME(dct64_sse) +ASM_NAME(dct64_sse): + pushl %ebp + movl %esp, %ebp + + andl $-16, %esp /* align the stack at 16 bytes */ + subl $128, %esp /* reserve space for temporal store */ + pushl %ebx + + movl ARG(0), %ecx + movl ARG(1), %ebx + movl ARG(2), %eax + + MOVUAPS (%eax), %xmm7 + MOVUAPS 16(%eax), %xmm6 + MOVUAPS 112(%eax), %xmm0 + MOVUAPS 96(%eax), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm7, %xmm4 + movaps %xmm6, %xmm5 + addps %xmm0, %xmm4 + addps %xmm1, %xmm5 + subps %xmm0, %xmm7 + subps %xmm1, %xmm6 + movaps %xmm4, TEMP(0) + movaps %xmm5, TEMP(1) + + MOVUAPS 32(%eax), %xmm2 + MOVUAPS 48(%eax), %xmm3 + MOVUAPS 80(%eax), %xmm0 + MOVUAPS 64(%eax), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm2, %xmm5 + movaps %xmm3, %xmm4 + addps %xmm0, %xmm2 + addps %xmm1, %xmm3 + subps %xmm0, %xmm5 + subps %xmm1, %xmm4 + + mulps ASM_NAME(costab_mmxsse), %xmm7 + mulps ASM_NAME(costab_mmxsse)+16, %xmm6 + mulps ASM_NAME(costab_mmxsse)+32, %xmm5 + mulps ASM_NAME(costab_mmxsse)+48, %xmm4 + + shufps $0x1b, %xmm2, %xmm2 + shufps $0x1b, %xmm3, %xmm3 + shufps $0x1b, %xmm4, %xmm4 + shufps $0x1b, %xmm5, %xmm5 + movaps TEMP(0), %xmm0 + movaps TEMP(1), %xmm1 + subps %xmm3, %xmm0 + subps %xmm2, %xmm1 + addps TEMP(0), %xmm3 + addps TEMP(1), %xmm2 + movaps %xmm3, TEMP(0) + movaps %xmm2, TEMP(1) + movaps %xmm6, %xmm2 + movaps %xmm7, %xmm3 + subps %xmm5, %xmm6 + subps %xmm4, %xmm7 + addps %xmm3, %xmm4 + addps %xmm2, %xmm5 + mulps ASM_NAME(costab_mmxsse)+64, %xmm0 + mulps ASM_NAME(costab_mmxsse)+80, %xmm1 + mulps ASM_NAME(costab_mmxsse)+80, %xmm6 + mulps ASM_NAME(costab_mmxsse)+64, %xmm7 + + movaps TEMP(0), %xmm2 + movaps TEMP(1), %xmm3 + shufps $0x1b, %xmm3, %xmm3 + shufps $0x1b, %xmm5, %xmm5 + shufps $0x1b, %xmm1, %xmm1 + shufps $0x1b, %xmm6, %xmm6 + movaps %xmm0, TEMP(1) + subps %xmm3, %xmm2 + subps %xmm1, %xmm0 + addps TEMP(0), %xmm3 + addps TEMP(1), %xmm1 + movaps %xmm3, TEMP(0) + movaps %xmm1, TEMP(2) + movaps %xmm5, %xmm1 + movaps %xmm4, %xmm5 + movaps %xmm7, %xmm3 + subps %xmm1, %xmm5 + subps %xmm6, %xmm7 + addps %xmm1, %xmm4 + addps %xmm3, %xmm6 + mulps ASM_NAME(costab_mmxsse)+96, %xmm2 + mulps ASM_NAME(costab_mmxsse)+96, %xmm0 + mulps ASM_NAME(costab_mmxsse)+96, %xmm5 + mulps ASM_NAME(costab_mmxsse)+96, %xmm7 + movaps %xmm2, TEMP(1) + movaps %xmm0, TEMP(3) + + movaps %xmm4, %xmm2 + movaps %xmm5, %xmm3 + shufps $0x44, %xmm6, %xmm2 + shufps $0xbb, %xmm7, %xmm5 + shufps $0xbb, %xmm6, %xmm4 + shufps $0x44, %xmm7, %xmm3 + movaps %xmm2, %xmm6 + movaps %xmm3, %xmm7 + subps %xmm4, %xmm2 + subps %xmm5, %xmm3 + addps %xmm6, %xmm4 + addps %xmm7, %xmm5 + movaps ASM_NAME(costab_mmxsse)+112, %xmm0 + movlhps %xmm0, %xmm0 + mulps %xmm0, %xmm2 + mulps %xmm0, %xmm3 + movaps %xmm0, TEMP(4) + movaps %xmm4, %xmm6 + movaps %xmm5, %xmm7 + shufps $0x14, %xmm2, %xmm4 + shufps $0xbe, %xmm2, %xmm6 + shufps $0x14, %xmm3, %xmm5 + shufps $0xbe, %xmm3, %xmm7 + movaps %xmm5, TEMP(5) + movaps %xmm7, TEMP(7) + + movaps TEMP(0), %xmm0 + movaps TEMP(1), %xmm1 + movaps %xmm0, %xmm2 + movaps %xmm1, %xmm3 + shufps $0x44, TEMP(2), %xmm2 + shufps $0xbb, TEMP(3), %xmm1 + shufps $0xbb, TEMP(2), %xmm0 + shufps $0x44, TEMP(3), %xmm3 + movaps %xmm2, %xmm5 + movaps %xmm3, %xmm7 + subps %xmm0, %xmm2 + subps %xmm1, %xmm3 + addps %xmm5, %xmm0 + addps %xmm7, %xmm1 + mulps TEMP(4), %xmm2 + mulps TEMP(4), %xmm3 + movaps %xmm0, %xmm5 + movaps %xmm1, %xmm7 + shufps $0x14, %xmm2, %xmm0 + shufps $0xbe, %xmm2, %xmm5 + shufps $0x14, %xmm3, %xmm1 + shufps $0xbe, %xmm3, %xmm7 + + movaps %xmm0, TEMP(0) + movaps %xmm1, TEMP(1) + movaps %xmm5, TEMP(2) + movaps %xmm7, TEMP(3) + + movss ASM_NAME(costab_mmxsse)+120, %xmm5 + shufps $0x00, %xmm5, %xmm5 + xorps pnpn, %xmm5 + + movaps %xmm4, %xmm0 + movaps %xmm6, %xmm1 + unpcklps TEMP(5), %xmm4 + unpckhps TEMP(5), %xmm0 + unpcklps TEMP(7), %xmm6 + unpckhps TEMP(7), %xmm1 + movaps %xmm4, %xmm2 + movaps %xmm6, %xmm3 + unpcklps %xmm0, %xmm4 + unpckhps %xmm0, %xmm2 + unpcklps %xmm1, %xmm6 + unpckhps %xmm1, %xmm3 + movaps %xmm4, %xmm0 + movaps %xmm6, %xmm1 + subps %xmm2, %xmm0 + subps %xmm3, %xmm1 + addps %xmm2, %xmm4 + addps %xmm3, %xmm6 + mulps %xmm5, %xmm0 + mulps %xmm5, %xmm1 + movaps %xmm5, TEMP(5) + movaps %xmm4, %xmm5 + movaps %xmm6, %xmm7 + unpcklps %xmm0, %xmm4 + unpckhps %xmm0, %xmm5 + unpcklps %xmm1, %xmm6 + unpckhps %xmm1, %xmm7 + + movaps TEMP(0), %xmm0 + movaps TEMP(2), %xmm2 + movaps %xmm4, TEMP(4) + movaps %xmm6, TEMP(6) + + movaps %xmm0, %xmm4 + movaps %xmm2, %xmm6 + unpcklps TEMP(1), %xmm0 + unpckhps TEMP(1), %xmm4 + unpcklps TEMP(3), %xmm2 + unpckhps TEMP(3), %xmm6 + movaps %xmm0, %xmm1 + movaps %xmm2, %xmm3 + unpcklps %xmm4, %xmm0 + unpckhps %xmm4, %xmm1 + unpcklps %xmm6, %xmm2 + unpckhps %xmm6, %xmm3 + movaps %xmm0, %xmm4 + movaps %xmm2, %xmm6 + subps %xmm1, %xmm4 + subps %xmm3, %xmm6 + addps %xmm1, %xmm0 + addps %xmm3, %xmm2 + mulps TEMP(5), %xmm4 + mulps TEMP(5), %xmm6 + movaps %xmm0, %xmm1 + movaps %xmm2, %xmm3 + unpcklps %xmm4, %xmm0 + unpckhps %xmm4, %xmm1 + unpcklps %xmm6, %xmm2 + unpckhps %xmm6, %xmm3 + + movaps %xmm0, TEMP(0) + movaps %xmm1, TEMP(1) + movaps %xmm2, TEMP(2) + movaps %xmm3, TEMP(3) + movaps %xmm5, TEMP(5) + movaps %xmm7, TEMP(7) + + movss TEMP_BYTE(12), %xmm0 + movss TEMP_BYTE(28), %xmm1 + movss TEMP_BYTE(44), %xmm2 + movss TEMP_BYTE(60), %xmm3 + addss TEMP_BYTE(8), %xmm0 + addss TEMP_BYTE(24), %xmm1 + addss TEMP_BYTE(40), %xmm2 + addss TEMP_BYTE(56), %xmm3 + movss %xmm0, TEMP_BYTE(8) + movss %xmm1, TEMP_BYTE(24) + movss %xmm2, TEMP_BYTE(40) + movss %xmm3, TEMP_BYTE(56) + movss TEMP_BYTE(76), %xmm0 + movss TEMP_BYTE(92), %xmm1 + movss TEMP_BYTE(108), %xmm2 + movss TEMP_BYTE(124), %xmm3 + addss TEMP_BYTE(72), %xmm0 + addss TEMP_BYTE(88), %xmm1 + addss TEMP_BYTE(104), %xmm2 + addss TEMP_BYTE(120), %xmm3 + movss %xmm0, TEMP_BYTE(72) + movss %xmm1, TEMP_BYTE(88) + movss %xmm2, TEMP_BYTE(104) + movss %xmm3, TEMP_BYTE(120) + + movaps TEMP_BYTE(16), %xmm1 + movaps TEMP_BYTE(48), %xmm3 + movaps TEMP_BYTE(80), %xmm5 + movaps TEMP_BYTE(112), %xmm7 + movaps %xmm1, %xmm0 + movaps %xmm3, %xmm2 + movaps %xmm5, %xmm4 + movaps %xmm7, %xmm6 + shufps $0x1e, %xmm0, %xmm0 + shufps $0x1e, %xmm2, %xmm2 + shufps $0x1e, %xmm4, %xmm4 + shufps $0x1e, %xmm6, %xmm6 + andps mask, %xmm0 + andps mask, %xmm2 + andps mask, %xmm4 + andps mask, %xmm6 + addps %xmm0, %xmm1 + addps %xmm2, %xmm3 + addps %xmm4, %xmm5 + addps %xmm6, %xmm7 + + movaps TEMP_BYTE(32), %xmm2 + movaps TEMP_BYTE(96), %xmm6 + movaps %xmm2, %xmm0 + movaps %xmm6, %xmm4 + shufps $0x1e, %xmm0, %xmm0 + shufps $0x1e, %xmm4, %xmm4 + andps mask, %xmm0 + andps mask, %xmm4 + addps %xmm3, %xmm2 + addps %xmm0, %xmm3 + addps %xmm7, %xmm6 + addps %xmm4, %xmm7 + + movaps TEMP_BYTE(0), %xmm0 + movaps TEMP_BYTE(64), %xmm4 + + cvtps2pi %xmm0, %mm0 + cvtps2pi %xmm1, %mm1 + movhlps %xmm0, %xmm0 + movhlps %xmm1, %xmm1 + cvtps2pi %xmm0, %mm2 + cvtps2pi %xmm1, %mm3 + packssdw %mm2, %mm0 + packssdw %mm3, %mm1 + + cvtps2pi %xmm2, %mm2 + cvtps2pi %xmm3, %mm3 + movhlps %xmm2, %xmm2 + movhlps %xmm3, %xmm3 + cvtps2pi %xmm2, %mm4 + cvtps2pi %xmm3, %mm5 + packssdw %mm4, %mm2 + packssdw %mm5, %mm3 + + movd %mm0, %eax + movd %mm1, %edx + movw %ax, 512(%ecx) + movw %dx, 384(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, (%ecx) + movw %ax, (%ebx) + movw %dx, 128(%ebx) + + movd %mm2, %eax + movd %mm3, %edx + movw %ax, 448(%ecx) + movw %dx, 320(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 64(%ebx) + movw %dx, 192(%ebx) + + psrlq $32, %mm0 + psrlq $32, %mm1 + movd %mm0, %eax + movd %mm1, %edx + movw %ax, 256(%ecx) + movw %dx, 128(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 256(%ebx) + movw %dx, 384(%ebx) + + psrlq $32, %mm2 + psrlq $32, %mm3 + movd %mm2, %eax + movd %mm3, %edx + movw %ax, 192(%ecx) + movw %dx, 64(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 320(%ebx) + movw %dx, 448(%ebx) + + movaps %xmm4, %xmm0 + shufps $0x1e, %xmm0, %xmm0 + movaps %xmm5, %xmm1 + andps mask, %xmm0 + + addps %xmm6, %xmm4 + addps %xmm7, %xmm5 + addps %xmm1, %xmm6 + addps %xmm0, %xmm7 + + cvtps2pi %xmm4, %mm0 + cvtps2pi %xmm5, %mm1 + movhlps %xmm4, %xmm4 + movhlps %xmm5, %xmm5 + cvtps2pi %xmm4, %mm2 + cvtps2pi %xmm5, %mm3 + packssdw %mm2, %mm0 + packssdw %mm3, %mm1 + + cvtps2pi %xmm6, %mm2 + cvtps2pi %xmm7, %mm3 + movhlps %xmm6, %xmm6 + movhlps %xmm7, %xmm7 + cvtps2pi %xmm6, %mm4 + cvtps2pi %xmm7, %mm5 + packssdw %mm4, %mm2 + packssdw %mm5, %mm3 + + movd %mm0, %eax + movd %mm2, %edx + movw %ax, 480(%ecx) + movw %dx, 416(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 32(%ebx) + movw %dx, 96(%ebx) + + psrlq $32, %mm0 + psrlq $32, %mm2 + movd %mm0, %eax + movd %mm2, %edx + movw %ax, 224(%ecx) + movw %dx, 160(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 288(%ebx) + movw %dx, 352(%ebx) + + movd %mm1, %eax + movd %mm3, %edx + movw %ax, 352(%ecx) + movw %dx, 288(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 160(%ebx) + movw %dx, 224(%ebx) + + psrlq $32, %mm1 + psrlq $32, %mm3 + movd %mm1, %eax + movd %mm3, %edx + movw %ax, 96(%ecx) + movw %dx, 32(%ecx) + shrl $16, %eax + shrl $16, %edx + movw %ax, 416(%ebx) + movw %dx, 480(%ebx) + + popl %ebx + movl %ebp, %esp + popl %ebp + ret + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_sse_float.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_sse_float.S new file mode 100644 index 0000000..40a06bf --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_sse_float.S @@ -0,0 +1,401 @@ +/* + dct64_sse_float: SSE optimized dct64 (float output version) + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#define ARG(n) (8+n*4)(%ebp) +#define TEMP(n) (4+n*16)(%esp) +#define TEMP_BYTE(n) (4+n)(%esp) + +/* + void dct64_real_sse(real *out0, real *out1, real *samples); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN16 +pnpn: + .long 0 + .long -2147483648 + .long 0 + .long -2147483648 + ALIGN16 +mask: + .long -1 + .long -1 + .long -1 + .long 0 + + .text + ALIGN16 +.globl ASM_NAME(dct64_real_sse) +ASM_NAME(dct64_real_sse): + pushl %ebp + movl %esp, %ebp + + andl $-16, %esp /* align the stack at 16 bytes */ + subl $128, %esp /* reserve space for temporal store */ + pushl %ebx + + movl ARG(0), %ecx + movl ARG(1), %ebx + movl ARG(2), %eax + + MOVUAPS (%eax), %xmm7 + MOVUAPS 16(%eax), %xmm6 + MOVUAPS 112(%eax), %xmm0 + MOVUAPS 96(%eax), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm7, %xmm4 + movaps %xmm6, %xmm5 + addps %xmm0, %xmm4 + addps %xmm1, %xmm5 + subps %xmm0, %xmm7 + subps %xmm1, %xmm6 + movaps %xmm4, TEMP(0) + movaps %xmm5, TEMP(1) + + MOVUAPS 32(%eax), %xmm2 + MOVUAPS 48(%eax), %xmm3 + MOVUAPS 80(%eax), %xmm0 + MOVUAPS 64(%eax), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm2, %xmm5 + movaps %xmm3, %xmm4 + addps %xmm0, %xmm2 + addps %xmm1, %xmm3 + subps %xmm0, %xmm5 + subps %xmm1, %xmm4 + + mulps ASM_NAME(costab_mmxsse), %xmm7 + mulps ASM_NAME(costab_mmxsse)+16, %xmm6 + mulps ASM_NAME(costab_mmxsse)+32, %xmm5 + mulps ASM_NAME(costab_mmxsse)+48, %xmm4 + + shufps $0x1b, %xmm2, %xmm2 + shufps $0x1b, %xmm3, %xmm3 + shufps $0x1b, %xmm4, %xmm4 + shufps $0x1b, %xmm5, %xmm5 + movaps TEMP(0), %xmm0 + movaps TEMP(1), %xmm1 + subps %xmm3, %xmm0 + subps %xmm2, %xmm1 + addps TEMP(0), %xmm3 + addps TEMP(1), %xmm2 + movaps %xmm3, TEMP(0) + movaps %xmm2, TEMP(1) + movaps %xmm6, %xmm2 + movaps %xmm7, %xmm3 + subps %xmm5, %xmm6 + subps %xmm4, %xmm7 + addps %xmm3, %xmm4 + addps %xmm2, %xmm5 + mulps ASM_NAME(costab_mmxsse)+64, %xmm0 + mulps ASM_NAME(costab_mmxsse)+80, %xmm1 + mulps ASM_NAME(costab_mmxsse)+80, %xmm6 + mulps ASM_NAME(costab_mmxsse)+64, %xmm7 + + movaps TEMP(0), %xmm2 + movaps TEMP(1), %xmm3 + shufps $0x1b, %xmm3, %xmm3 + shufps $0x1b, %xmm5, %xmm5 + shufps $0x1b, %xmm1, %xmm1 + shufps $0x1b, %xmm6, %xmm6 + movaps %xmm0, TEMP(1) + subps %xmm3, %xmm2 + subps %xmm1, %xmm0 + addps TEMP(0), %xmm3 + addps TEMP(1), %xmm1 + movaps %xmm3, TEMP(0) + movaps %xmm1, TEMP(2) + movaps %xmm5, %xmm1 + movaps %xmm4, %xmm5 + movaps %xmm7, %xmm3 + subps %xmm1, %xmm5 + subps %xmm6, %xmm7 + addps %xmm1, %xmm4 + addps %xmm3, %xmm6 + mulps ASM_NAME(costab_mmxsse)+96, %xmm2 + mulps ASM_NAME(costab_mmxsse)+96, %xmm0 + mulps ASM_NAME(costab_mmxsse)+96, %xmm5 + mulps ASM_NAME(costab_mmxsse)+96, %xmm7 + movaps %xmm2, TEMP(1) + movaps %xmm0, TEMP(3) + + movaps %xmm4, %xmm2 + movaps %xmm5, %xmm3 + shufps $0x44, %xmm6, %xmm2 + shufps $0xbb, %xmm7, %xmm5 + shufps $0xbb, %xmm6, %xmm4 + shufps $0x44, %xmm7, %xmm3 + movaps %xmm2, %xmm6 + movaps %xmm3, %xmm7 + subps %xmm4, %xmm2 + subps %xmm5, %xmm3 + addps %xmm6, %xmm4 + addps %xmm7, %xmm5 + movaps ASM_NAME(costab_mmxsse)+112, %xmm0 + movlhps %xmm0, %xmm0 + mulps %xmm0, %xmm2 + mulps %xmm0, %xmm3 + movaps %xmm0, TEMP(4) + movaps %xmm4, %xmm6 + movaps %xmm5, %xmm7 + shufps $0x14, %xmm2, %xmm4 + shufps $0xbe, %xmm2, %xmm6 + shufps $0x14, %xmm3, %xmm5 + shufps $0xbe, %xmm3, %xmm7 + movaps %xmm5, TEMP(5) + movaps %xmm7, TEMP(7) + + movaps TEMP(0), %xmm0 + movaps TEMP(1), %xmm1 + movaps %xmm0, %xmm2 + movaps %xmm1, %xmm3 + shufps $0x44, TEMP(2), %xmm2 + shufps $0xbb, TEMP(3), %xmm1 + shufps $0xbb, TEMP(2), %xmm0 + shufps $0x44, TEMP(3), %xmm3 + movaps %xmm2, %xmm5 + movaps %xmm3, %xmm7 + subps %xmm0, %xmm2 + subps %xmm1, %xmm3 + addps %xmm5, %xmm0 + addps %xmm7, %xmm1 + mulps TEMP(4), %xmm2 + mulps TEMP(4), %xmm3 + movaps %xmm0, %xmm5 + movaps %xmm1, %xmm7 + shufps $0x14, %xmm2, %xmm0 + shufps $0xbe, %xmm2, %xmm5 + shufps $0x14, %xmm3, %xmm1 + shufps $0xbe, %xmm3, %xmm7 + + movaps %xmm0, TEMP(0) + movaps %xmm1, TEMP(1) + movaps %xmm5, TEMP(2) + movaps %xmm7, TEMP(3) + + movss ASM_NAME(costab_mmxsse)+120, %xmm5 + shufps $0x00, %xmm5, %xmm5 + xorps pnpn, %xmm5 + + movaps %xmm4, %xmm0 + movaps %xmm6, %xmm1 + unpcklps TEMP(5), %xmm4 + unpckhps TEMP(5), %xmm0 + unpcklps TEMP(7), %xmm6 + unpckhps TEMP(7), %xmm1 + movaps %xmm4, %xmm2 + movaps %xmm6, %xmm3 + unpcklps %xmm0, %xmm4 + unpckhps %xmm0, %xmm2 + unpcklps %xmm1, %xmm6 + unpckhps %xmm1, %xmm3 + movaps %xmm4, %xmm0 + movaps %xmm6, %xmm1 + subps %xmm2, %xmm0 + subps %xmm3, %xmm1 + addps %xmm2, %xmm4 + addps %xmm3, %xmm6 + mulps %xmm5, %xmm0 + mulps %xmm5, %xmm1 + movaps %xmm5, TEMP(5) + movaps %xmm4, %xmm5 + movaps %xmm6, %xmm7 + unpcklps %xmm0, %xmm4 + unpckhps %xmm0, %xmm5 + unpcklps %xmm1, %xmm6 + unpckhps %xmm1, %xmm7 + + movaps TEMP(0), %xmm0 + movaps TEMP(2), %xmm2 + movaps %xmm4, TEMP(4) + movaps %xmm6, TEMP(6) + + movaps %xmm0, %xmm4 + movaps %xmm2, %xmm6 + unpcklps TEMP(1), %xmm0 + unpckhps TEMP(1), %xmm4 + unpcklps TEMP(3), %xmm2 + unpckhps TEMP(3), %xmm6 + movaps %xmm0, %xmm1 + movaps %xmm2, %xmm3 + unpcklps %xmm4, %xmm0 + unpckhps %xmm4, %xmm1 + unpcklps %xmm6, %xmm2 + unpckhps %xmm6, %xmm3 + movaps %xmm0, %xmm4 + movaps %xmm2, %xmm6 + subps %xmm1, %xmm4 + subps %xmm3, %xmm6 + addps %xmm1, %xmm0 + addps %xmm3, %xmm2 + mulps TEMP(5), %xmm4 + mulps TEMP(5), %xmm6 + movaps %xmm0, %xmm1 + movaps %xmm2, %xmm3 + unpcklps %xmm4, %xmm0 + unpckhps %xmm4, %xmm1 + unpcklps %xmm6, %xmm2 + unpckhps %xmm6, %xmm3 + + movaps %xmm0, TEMP(0) + movaps %xmm1, TEMP(1) + movaps %xmm2, TEMP(2) + movaps %xmm3, TEMP(3) + movaps %xmm5, TEMP(5) + movaps %xmm7, TEMP(7) + + movss TEMP_BYTE(12), %xmm0 + movss TEMP_BYTE(28), %xmm1 + movss TEMP_BYTE(44), %xmm2 + movss TEMP_BYTE(60), %xmm3 + addss TEMP_BYTE(8), %xmm0 + addss TEMP_BYTE(24), %xmm1 + addss TEMP_BYTE(40), %xmm2 + addss TEMP_BYTE(56), %xmm3 + movss %xmm0, TEMP_BYTE(8) + movss %xmm1, TEMP_BYTE(24) + movss %xmm2, TEMP_BYTE(40) + movss %xmm3, TEMP_BYTE(56) + movss TEMP_BYTE(76), %xmm0 + movss TEMP_BYTE(92), %xmm1 + movss TEMP_BYTE(108), %xmm2 + movss TEMP_BYTE(124), %xmm3 + addss TEMP_BYTE(72), %xmm0 + addss TEMP_BYTE(88), %xmm1 + addss TEMP_BYTE(104), %xmm2 + addss TEMP_BYTE(120), %xmm3 + movss %xmm0, TEMP_BYTE(72) + movss %xmm1, TEMP_BYTE(88) + movss %xmm2, TEMP_BYTE(104) + movss %xmm3, TEMP_BYTE(120) + + movaps TEMP_BYTE(16), %xmm1 + movaps TEMP_BYTE(48), %xmm3 + movaps TEMP_BYTE(80), %xmm5 + movaps TEMP_BYTE(112), %xmm7 + movaps %xmm1, %xmm0 + movaps %xmm3, %xmm2 + movaps %xmm5, %xmm4 + movaps %xmm7, %xmm6 + shufps $0x1e, %xmm0, %xmm0 + shufps $0x1e, %xmm2, %xmm2 + shufps $0x1e, %xmm4, %xmm4 + shufps $0x1e, %xmm6, %xmm6 + andps mask, %xmm0 + andps mask, %xmm2 + andps mask, %xmm4 + andps mask, %xmm6 + addps %xmm0, %xmm1 + addps %xmm2, %xmm3 + addps %xmm4, %xmm5 + addps %xmm6, %xmm7 + + movaps TEMP_BYTE(32), %xmm2 + movaps TEMP_BYTE(96), %xmm6 + movaps %xmm2, %xmm0 + movaps %xmm6, %xmm4 + shufps $0x1e, %xmm0, %xmm0 + shufps $0x1e, %xmm4, %xmm4 + andps mask, %xmm0 + andps mask, %xmm4 + addps %xmm3, %xmm2 + addps %xmm0, %xmm3 + addps %xmm7, %xmm6 + addps %xmm4, %xmm7 + + movaps TEMP_BYTE(0), %xmm0 + movaps TEMP_BYTE(64), %xmm4 + + movss %xmm0, 1024(%ecx) + movss %xmm2, 896(%ecx) + movss %xmm1, 768(%ecx) + movss %xmm3, 640(%ecx) + + shufps $0xe1, %xmm0, %xmm0 + shufps $0xe1, %xmm2, %xmm2 + shufps $0xe1, %xmm1, %xmm1 + shufps $0xe1, %xmm3, %xmm3 + movss %xmm0, (%ecx) + movss %xmm0, (%ebx) + movss %xmm2, 128(%ebx) + movss %xmm1, 256(%ebx) + movss %xmm3, 384(%ebx) + + movhlps %xmm0, %xmm0 + movhlps %xmm2, %xmm2 + movhlps %xmm1, %xmm1 + movhlps %xmm3, %xmm3 + movss %xmm0, 512(%ecx) + movss %xmm2, 384(%ecx) + movss %xmm1, 256(%ecx) + movss %xmm3, 128(%ecx) + + shufps $0xe1, %xmm0, %xmm0 + shufps $0xe1, %xmm2, %xmm2 + shufps $0xe1, %xmm1, %xmm1 + shufps $0xe1, %xmm3, %xmm3 + movss %xmm0, 512(%ebx) + movss %xmm2, 640(%ebx) + movss %xmm1, 768(%ebx) + movss %xmm3, 896(%ebx) + + movaps %xmm4, %xmm0 + shufps $0x1e, %xmm0, %xmm0 + movaps %xmm5, %xmm1 + andps mask, %xmm0 + + addps %xmm6, %xmm4 + addps %xmm7, %xmm5 + addps %xmm1, %xmm6 + addps %xmm0, %xmm7 + + movss %xmm4, 960(%ecx) + movss %xmm6, 832(%ecx) + movss %xmm5, 704(%ecx) + movss %xmm7, 576(%ecx) + movhlps %xmm4, %xmm0 + movhlps %xmm6, %xmm1 + movhlps %xmm5, %xmm2 + movhlps %xmm7, %xmm3 + movss %xmm0, 448(%ecx) + movss %xmm1, 320(%ecx) + movss %xmm2, 192(%ecx) + movss %xmm3, 64(%ecx) + + shufps $0xe1, %xmm4, %xmm4 + shufps $0xe1, %xmm6, %xmm6 + shufps $0xe1, %xmm5, %xmm5 + shufps $0xe1, %xmm7, %xmm7 + movss %xmm4, 64(%ebx) + movss %xmm6, 192(%ebx) + movss %xmm5, 320(%ebx) + movss %xmm7, 448(%ebx) + + shufps $0xe1, %xmm0, %xmm0 + shufps $0xe1, %xmm1, %xmm1 + shufps $0xe1, %xmm2, %xmm2 + shufps $0xe1, %xmm3, %xmm3 + movss %xmm0, 576(%ebx) + movss %xmm1, 704(%ebx) + movss %xmm2, 832(%ebx) + movss %xmm3, 960(%ebx) + + popl %ebx + movl %ebp, %esp + popl %ebp + ret + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_x86_64.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_x86_64.S new file mode 100644 index 0000000..0144039 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_x86_64.S @@ -0,0 +1,464 @@ +/* + dct64_x86_64: SSE optimized dct64 for x86-64 + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifdef _WIN64 +/* short *out0 */ +#define ARG0 %r9 +/* short *out1 */ +#define ARG1 %rdx +/* real *samples */ +#define ARG2 %r8 +#else +/* short *out0 */ +#define ARG0 %rdi +/* short *out1 */ +#define ARG1 %rsi +/* real *samples */ +#define ARG2 %rdx +#endif + +/* + void dct64_x86_64(short *out0, short *out1, real *samples); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN32 +ASM_NAME(costab_x86_64): + .long 1056974725 + .long 1057056395 + .long 1057223771 + .long 1057485416 + .long 1057855544 + .long 1058356026 + .long 1059019886 + .long 1059897405 + .long 1061067246 + .long 1062657950 + .long 1064892987 + .long 1066774581 + .long 1069414683 + .long 1073984175 + .long 1079645762 + .long 1092815430 + .long 1057005197 + .long 1057342072 + .long 1058087743 + .long 1059427869 + .long 1061799040 + .long 1065862217 + .long 1071413542 + .long 1084439708 + .long 1057128951 + .long 1058664893 + .long 1063675095 + .long 1076102863 + .long 1057655764 + .long 1067924853 + .long 1060439283 + .long 0 + .text + ALIGN16 +.globl ASM_NAME(dct64_x86_64) +ASM_NAME(dct64_x86_64): +#ifdef _WIN64 /* should save xmm6-15 */ + movq %rcx, ARG0 + subq $168, %rsp /* stack alignment + 10 xmm registers */ + movaps %xmm6, (%rsp) + movaps %xmm7, 16(%rsp) + movaps %xmm8, 32(%rsp) + movaps %xmm9, 48(%rsp) + movaps %xmm10, 64(%rsp) + movaps %xmm11, 80(%rsp) + movaps %xmm12, 96(%rsp) + movaps %xmm13, 112(%rsp) + movaps %xmm14, 128(%rsp) + movaps %xmm15, 144(%rsp) +#endif + + leaq ASM_NAME(costab_x86_64)(%rip), %rcx + + MOVUAPS (ARG2), %xmm15 + MOVUAPS 16(ARG2), %xmm14 + MOVUAPS 112(ARG2), %xmm0 + MOVUAPS 96(ARG2), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm15, %xmm8 + movaps %xmm14, %xmm9 + addps %xmm0, %xmm8 + addps %xmm1, %xmm9 + subps %xmm0, %xmm15 + subps %xmm1, %xmm14 + + MOVUAPS 32(ARG2), %xmm13 + MOVUAPS 48(ARG2), %xmm12 + MOVUAPS 80(ARG2), %xmm0 + MOVUAPS 64(ARG2), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm13, %xmm10 + movaps %xmm12, %xmm11 + addps %xmm0, %xmm10 + addps %xmm1, %xmm11 + subps %xmm0, %xmm13 + subps %xmm1, %xmm12 + + movaps (%rcx), %xmm0 + movaps 16(%rcx), %xmm1 + movaps 32(%rcx), %xmm2 + movaps 48(%rcx), %xmm3 + mulps %xmm0, %xmm15 + mulps %xmm1, %xmm14 + mulps %xmm2, %xmm13 + mulps %xmm3, %xmm12 + + movaps 64(%rcx), %xmm0 + movaps 80(%rcx), %xmm1 + + pshufd $0x1b, %xmm11, %xmm2 + pshufd $0x1b, %xmm10, %xmm3 + shufps $0x1b, %xmm13, %xmm13 + shufps $0x1b, %xmm12, %xmm12 + movaps %xmm8, %xmm11 + movaps %xmm9, %xmm10 + movaps %xmm14, %xmm4 + movaps %xmm15, %xmm5 + subps %xmm2, %xmm11 + subps %xmm3, %xmm10 + subps %xmm13, %xmm14 + subps %xmm12, %xmm15 + addps %xmm2, %xmm8 + addps %xmm3, %xmm9 + addps %xmm5, %xmm12 + addps %xmm4, %xmm13 + mulps %xmm0, %xmm11 + mulps %xmm1, %xmm10 + mulps %xmm1, %xmm14 + mulps %xmm0, %xmm15 + + movaps 96(%rcx), %xmm0 + + pshufd $0x1b, %xmm9, %xmm1 + pshufd $0x1b, %xmm13, %xmm2 + shufps $0x1b, %xmm10, %xmm10 + shufps $0x1b, %xmm14, %xmm14 + movaps %xmm8, %xmm9 + movaps %xmm12, %xmm13 + movaps %xmm11, %xmm3 + movaps %xmm15, %xmm4 + subps %xmm1, %xmm9 + subps %xmm2, %xmm13 + subps %xmm10, %xmm11 + subps %xmm14, %xmm15 + addps %xmm1, %xmm8 + addps %xmm2, %xmm12 + addps %xmm3, %xmm10 + addps %xmm4, %xmm14 + mulps %xmm0, %xmm9 + mulps %xmm0, %xmm13 + mulps %xmm0, %xmm11 + mulps %xmm0, %xmm15 + + movaps 112(%rcx), %xmm0 + movaps %xmm0, %xmm1 + movlhps %xmm1, %xmm1 + + movaps %xmm8, %xmm2 + movaps %xmm9, %xmm3 + shufps $0x44, %xmm10, %xmm2 + shufps $0xbb, %xmm11, %xmm9 + shufps $0xbb, %xmm10, %xmm8 + shufps $0x44, %xmm11, %xmm3 + movaps %xmm2, %xmm4 + movaps %xmm3, %xmm5 + subps %xmm8, %xmm2 + subps %xmm9, %xmm3 + addps %xmm4, %xmm8 + addps %xmm5, %xmm9 + mulps %xmm1, %xmm2 + mulps %xmm1, %xmm3 + movaps %xmm8, %xmm10 + movaps %xmm9, %xmm11 + shufps $0x14, %xmm2, %xmm8 + shufps $0xbe, %xmm2, %xmm10 + shufps $0x14, %xmm3, %xmm9 + shufps $0xbe, %xmm3, %xmm11 + + movaps %xmm12, %xmm2 + movaps %xmm13, %xmm3 + shufps $0x44, %xmm14, %xmm2 + shufps $0xbb, %xmm15, %xmm13 + shufps $0xbb, %xmm14, %xmm12 + shufps $0x44, %xmm15, %xmm3 + movaps %xmm2, %xmm4 + movaps %xmm3, %xmm5 + subps %xmm12, %xmm2 + subps %xmm13, %xmm3 + addps %xmm4, %xmm12 + addps %xmm5, %xmm13 + mulps %xmm1, %xmm2 + mulps %xmm1, %xmm3 + movaps %xmm12, %xmm14 + movaps %xmm13, %xmm15 + shufps $0x14, %xmm2, %xmm12 + shufps $0xbe, %xmm2, %xmm14 + shufps $0x14, %xmm3, %xmm13 + shufps $0xbe, %xmm3, %xmm15 + + shufps $0xaa, %xmm0, %xmm0 + pcmpeqd %xmm1, %xmm1 + pslld $31, %xmm1 + psllq $32, %xmm1 + xorps %xmm1, %xmm0 + + movaps %xmm8, %xmm1 + movaps %xmm10, %xmm2 + unpcklps %xmm9, %xmm8 + unpckhps %xmm9, %xmm1 + unpcklps %xmm11, %xmm10 + unpckhps %xmm11, %xmm2 + movaps %xmm8, %xmm3 + movaps %xmm10, %xmm4 + unpcklps %xmm1, %xmm8 + unpckhps %xmm1, %xmm3 + unpcklps %xmm2, %xmm10 + unpckhps %xmm2, %xmm4 + movaps %xmm8, %xmm1 + movaps %xmm10, %xmm2 + subps %xmm3, %xmm1 + subps %xmm4, %xmm2 + addps %xmm3, %xmm8 + addps %xmm4, %xmm10 + mulps %xmm0, %xmm1 + mulps %xmm0, %xmm2 + movaps %xmm8, %xmm9 + movaps %xmm10, %xmm11 + unpcklps %xmm1, %xmm8 + unpckhps %xmm1, %xmm9 + unpcklps %xmm2, %xmm10 + unpckhps %xmm2, %xmm11 + + movaps %xmm12, %xmm1 + movaps %xmm14, %xmm2 + unpcklps %xmm13, %xmm12 + unpckhps %xmm13, %xmm1 + unpcklps %xmm15, %xmm14 + unpckhps %xmm15, %xmm2 + movaps %xmm12, %xmm3 + movaps %xmm14, %xmm4 + unpcklps %xmm1, %xmm12 + unpckhps %xmm1, %xmm3 + unpcklps %xmm2, %xmm14 + unpckhps %xmm2, %xmm4 + movaps %xmm12, %xmm1 + movaps %xmm14, %xmm2 + subps %xmm3, %xmm1 + subps %xmm4, %xmm2 + addps %xmm3, %xmm12 + addps %xmm4, %xmm14 + mulps %xmm0, %xmm1 + mulps %xmm0, %xmm2 + movaps %xmm12, %xmm13 + movaps %xmm14, %xmm15 + unpcklps %xmm1, %xmm12 + unpckhps %xmm1, %xmm13 + unpcklps %xmm2, %xmm14 + unpckhps %xmm2, %xmm15 + + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm8, %xmm0 + shufpd $0x2, %xmm9, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm8 + addps %xmm1, %xmm9 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm10, %xmm0 + shufpd $0x2, %xmm11, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm10 + addps %xmm1, %xmm11 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm12, %xmm0 + shufpd $0x2, %xmm13, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm12 + addps %xmm1, %xmm13 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm14, %xmm0 + shufpd $0x2, %xmm15, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm14 + addps %xmm1, %xmm15 + + pshufd $0x78, %xmm9, %xmm0 + pshufd $0x78, %xmm11, %xmm1 + pshufd $0x78, %xmm13, %xmm2 + pshufd $0x78, %xmm15, %xmm3 + psrldq $4, %xmm0 + psrldq $4, %xmm1 + psrldq $4, %xmm2 + psrldq $4, %xmm3 + addps %xmm0, %xmm9 + addps %xmm1, %xmm11 + addps %xmm2, %xmm13 + addps %xmm3, %xmm15 + + pshufd $0x78, %xmm10, %xmm0 + pshufd $0x78, %xmm14, %xmm1 + psrldq $4, %xmm0 + psrldq $4, %xmm1 + addps %xmm11, %xmm10 + addps %xmm15, %xmm14 + addps %xmm0, %xmm11 + addps %xmm1, %xmm15 + + cvtps2dq %xmm8, %xmm8 + cvtps2dq %xmm9, %xmm9 + cvtps2dq %xmm10, %xmm10 + cvtps2dq %xmm11, %xmm11 + packssdw %xmm10, %xmm8 + packssdw %xmm11, %xmm9 + + movd %xmm8, %eax + movd %xmm9, %ecx + movw %ax, 512(ARG0) + movw %cx, 384(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, (ARG0) + movw %ax, (ARG1) + movw %cx, 128(ARG1) + + movhlps %xmm8, %xmm0 + movhlps %xmm9, %xmm1 + movd %xmm0, %eax + movd %xmm1, %ecx + movw %ax, 448(ARG0) + movw %cx, 320(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 64(ARG1) + movw %cx, 192(ARG1) + + pshuflw $0xee, %xmm8, %xmm2 + pshuflw $0xee, %xmm9, %xmm3 + movd %xmm2, %eax + movd %xmm3, %ecx + movw %ax, 256(ARG0) + movw %cx, 128(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 256(ARG1) + movw %cx, 384(ARG1) + + pshuflw $0xee, %xmm0, %xmm0 + pshuflw $0xee, %xmm1, %xmm1 + movd %xmm0, %eax + movd %xmm1, %ecx + movw %ax, 192(ARG0) + movw %cx, 64(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 320(ARG1) + movw %cx, 448(ARG1) + + movaps %xmm12, %xmm0 + movaps %xmm13, %xmm1 + movaps %xmm14, %xmm2 + movaps %xmm15, %xmm3 + shufps $0x1e, %xmm0, %xmm0 + pslldq $4, %xmm0 + psrldq $4, %xmm0 + addps %xmm2, %xmm12 + addps %xmm3, %xmm13 + addps %xmm1, %xmm14 + addps %xmm0, %xmm15 + + cvtps2dq %xmm12, %xmm12 + cvtps2dq %xmm13, %xmm13 + cvtps2dq %xmm14, %xmm14 + cvtps2dq %xmm15, %xmm15 + packssdw %xmm13, %xmm12 + packssdw %xmm15, %xmm14 + + movd %xmm12, %eax + movd %xmm14, %ecx + movw %ax, 480(ARG0) + movw %cx, 416(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 32(ARG1) + movw %cx, 96(ARG1) + + pshuflw $0xee, %xmm12, %xmm0 + pshuflw $0xee, %xmm14, %xmm1 + movd %xmm0, %eax + movd %xmm1, %ecx + movw %ax, 224(ARG0) + movw %cx, 160(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 288(ARG1) + movw %cx, 352(ARG1) + + movhlps %xmm12, %xmm0 + movhlps %xmm14, %xmm1 + movd %xmm0, %eax + movd %xmm1, %ecx + movw %ax, 352(ARG0) + movw %cx, 288(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 160(ARG1) + movw %cx, 224(ARG1) + + pshuflw $0xee, %xmm0, %xmm0 + pshuflw $0xee, %xmm1, %xmm1 + movd %xmm0, %eax + movd %xmm1, %ecx + movw %ax, 96(ARG0) + movw %cx, 32(ARG0) + shrl $16, %eax + shrl $16, %ecx + movw %ax, 416(ARG1) + movw %cx, 480(ARG1) + +#ifdef _WIN64 + movaps (%rsp), %xmm6 + movaps 16(%rsp), %xmm7 + movaps 32(%rsp), %xmm8 + movaps 48(%rsp), %xmm9 + movaps 64(%rsp), %xmm10 + movaps 80(%rsp), %xmm11 + movaps 96(%rsp), %xmm12 + movaps 112(%rsp), %xmm13 + movaps 128(%rsp), %xmm14 + movaps 144(%rsp), %xmm15 + addq $168, %rsp +#endif + ret + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dct64_x86_64_float.S b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_x86_64_float.S new file mode 100644 index 0000000..168a321 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dct64_x86_64_float.S @@ -0,0 +1,426 @@ +/* + dct64_x86_64_float: SSE optimized dct64 for x86-64 (float output version) + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "mangle.h" + +#ifdef _WIN64 +/* short *out0 */ +#define ARG0 %r9 +/* short *out1 */ +#define ARG1 %rdx +/* real *samples */ +#define ARG2 %r8 +#else +/* real *out0 */ +#define ARG0 %rdi +/* real *out1 */ +#define ARG1 %rsi +/* real *samples */ +#define ARG2 %rdx +#endif + +/* + void dct64_real_x86_64(real *out0, real *out1, real *samples); +*/ + +#ifndef __APPLE__ + .section .rodata +#else + .data +#endif + ALIGN32 +ASM_NAME(costab_x86_64): + .long 1056974725 + .long 1057056395 + .long 1057223771 + .long 1057485416 + .long 1057855544 + .long 1058356026 + .long 1059019886 + .long 1059897405 + .long 1061067246 + .long 1062657950 + .long 1064892987 + .long 1066774581 + .long 1069414683 + .long 1073984175 + .long 1079645762 + .long 1092815430 + .long 1057005197 + .long 1057342072 + .long 1058087743 + .long 1059427869 + .long 1061799040 + .long 1065862217 + .long 1071413542 + .long 1084439708 + .long 1057128951 + .long 1058664893 + .long 1063675095 + .long 1076102863 + .long 1057655764 + .long 1067924853 + .long 1060439283 + .long 0 + .text + ALIGN16 +.globl ASM_NAME(dct64_real_x86_64) +ASM_NAME(dct64_real_x86_64): +#ifdef _WIN64 /* should save xmm6-15 */ + movq %rcx, ARG0 + subq $168, %rsp /* stack alignment + 10 xmm registers */ + movaps %xmm6, (%rsp) + movaps %xmm7, 16(%rsp) + movaps %xmm8, 32(%rsp) + movaps %xmm9, 48(%rsp) + movaps %xmm10, 64(%rsp) + movaps %xmm11, 80(%rsp) + movaps %xmm12, 96(%rsp) + movaps %xmm13, 112(%rsp) + movaps %xmm14, 128(%rsp) + movaps %xmm15, 144(%rsp) +#endif + + leaq ASM_NAME(costab_x86_64)(%rip), %rcx + + MOVUAPS (ARG2), %xmm15 + MOVUAPS 16(ARG2), %xmm14 + MOVUAPS 112(ARG2), %xmm0 + MOVUAPS 96(ARG2), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm15, %xmm8 + movaps %xmm14, %xmm9 + addps %xmm0, %xmm8 + addps %xmm1, %xmm9 + subps %xmm0, %xmm15 + subps %xmm1, %xmm14 + + MOVUAPS 32(ARG2), %xmm13 + MOVUAPS 48(ARG2), %xmm12 + MOVUAPS 80(ARG2), %xmm0 + MOVUAPS 64(ARG2), %xmm1 + shufps $0x1b, %xmm0, %xmm0 + shufps $0x1b, %xmm1, %xmm1 + movaps %xmm13, %xmm10 + movaps %xmm12, %xmm11 + addps %xmm0, %xmm10 + addps %xmm1, %xmm11 + subps %xmm0, %xmm13 + subps %xmm1, %xmm12 + + movaps (%rcx), %xmm0 + movaps 16(%rcx), %xmm1 + movaps 32(%rcx), %xmm2 + movaps 48(%rcx), %xmm3 + mulps %xmm0, %xmm15 + mulps %xmm1, %xmm14 + mulps %xmm2, %xmm13 + mulps %xmm3, %xmm12 + + movaps 64(%rcx), %xmm0 + movaps 80(%rcx), %xmm1 + + pshufd $0x1b, %xmm11, %xmm2 + pshufd $0x1b, %xmm10, %xmm3 + shufps $0x1b, %xmm13, %xmm13 + shufps $0x1b, %xmm12, %xmm12 + movaps %xmm8, %xmm11 + movaps %xmm9, %xmm10 + movaps %xmm14, %xmm4 + movaps %xmm15, %xmm5 + subps %xmm2, %xmm11 + subps %xmm3, %xmm10 + subps %xmm13, %xmm14 + subps %xmm12, %xmm15 + addps %xmm2, %xmm8 + addps %xmm3, %xmm9 + addps %xmm5, %xmm12 + addps %xmm4, %xmm13 + mulps %xmm0, %xmm11 + mulps %xmm1, %xmm10 + mulps %xmm1, %xmm14 + mulps %xmm0, %xmm15 + + movaps 96(%rcx), %xmm0 + + pshufd $0x1b, %xmm9, %xmm1 + pshufd $0x1b, %xmm13, %xmm2 + shufps $0x1b, %xmm10, %xmm10 + shufps $0x1b, %xmm14, %xmm14 + movaps %xmm8, %xmm9 + movaps %xmm12, %xmm13 + movaps %xmm11, %xmm3 + movaps %xmm15, %xmm4 + subps %xmm1, %xmm9 + subps %xmm2, %xmm13 + subps %xmm10, %xmm11 + subps %xmm14, %xmm15 + addps %xmm1, %xmm8 + addps %xmm2, %xmm12 + addps %xmm3, %xmm10 + addps %xmm4, %xmm14 + mulps %xmm0, %xmm9 + mulps %xmm0, %xmm13 + mulps %xmm0, %xmm11 + mulps %xmm0, %xmm15 + + movaps 112(%rcx), %xmm0 + movaps %xmm0, %xmm1 + movlhps %xmm1, %xmm1 + + movaps %xmm8, %xmm2 + movaps %xmm9, %xmm3 + shufps $0x44, %xmm10, %xmm2 + shufps $0xbb, %xmm11, %xmm9 + shufps $0xbb, %xmm10, %xmm8 + shufps $0x44, %xmm11, %xmm3 + movaps %xmm2, %xmm4 + movaps %xmm3, %xmm5 + subps %xmm8, %xmm2 + subps %xmm9, %xmm3 + addps %xmm4, %xmm8 + addps %xmm5, %xmm9 + mulps %xmm1, %xmm2 + mulps %xmm1, %xmm3 + movaps %xmm8, %xmm10 + movaps %xmm9, %xmm11 + shufps $0x14, %xmm2, %xmm8 + shufps $0xbe, %xmm2, %xmm10 + shufps $0x14, %xmm3, %xmm9 + shufps $0xbe, %xmm3, %xmm11 + + movaps %xmm12, %xmm2 + movaps %xmm13, %xmm3 + shufps $0x44, %xmm14, %xmm2 + shufps $0xbb, %xmm15, %xmm13 + shufps $0xbb, %xmm14, %xmm12 + shufps $0x44, %xmm15, %xmm3 + movaps %xmm2, %xmm4 + movaps %xmm3, %xmm5 + subps %xmm12, %xmm2 + subps %xmm13, %xmm3 + addps %xmm4, %xmm12 + addps %xmm5, %xmm13 + mulps %xmm1, %xmm2 + mulps %xmm1, %xmm3 + movaps %xmm12, %xmm14 + movaps %xmm13, %xmm15 + shufps $0x14, %xmm2, %xmm12 + shufps $0xbe, %xmm2, %xmm14 + shufps $0x14, %xmm3, %xmm13 + shufps $0xbe, %xmm3, %xmm15 + + shufps $0xaa, %xmm0, %xmm0 + pcmpeqd %xmm1, %xmm1 + pslld $31, %xmm1 + psllq $32, %xmm1 + xorps %xmm1, %xmm0 + + movaps %xmm8, %xmm1 + movaps %xmm10, %xmm2 + unpcklps %xmm9, %xmm8 + unpckhps %xmm9, %xmm1 + unpcklps %xmm11, %xmm10 + unpckhps %xmm11, %xmm2 + movaps %xmm8, %xmm3 + movaps %xmm10, %xmm4 + unpcklps %xmm1, %xmm8 + unpckhps %xmm1, %xmm3 + unpcklps %xmm2, %xmm10 + unpckhps %xmm2, %xmm4 + movaps %xmm8, %xmm1 + movaps %xmm10, %xmm2 + subps %xmm3, %xmm1 + subps %xmm4, %xmm2 + addps %xmm3, %xmm8 + addps %xmm4, %xmm10 + mulps %xmm0, %xmm1 + mulps %xmm0, %xmm2 + movaps %xmm8, %xmm9 + movaps %xmm10, %xmm11 + unpcklps %xmm1, %xmm8 + unpckhps %xmm1, %xmm9 + unpcklps %xmm2, %xmm10 + unpckhps %xmm2, %xmm11 + + movaps %xmm12, %xmm1 + movaps %xmm14, %xmm2 + unpcklps %xmm13, %xmm12 + unpckhps %xmm13, %xmm1 + unpcklps %xmm15, %xmm14 + unpckhps %xmm15, %xmm2 + movaps %xmm12, %xmm3 + movaps %xmm14, %xmm4 + unpcklps %xmm1, %xmm12 + unpckhps %xmm1, %xmm3 + unpcklps %xmm2, %xmm14 + unpckhps %xmm2, %xmm4 + movaps %xmm12, %xmm1 + movaps %xmm14, %xmm2 + subps %xmm3, %xmm1 + subps %xmm4, %xmm2 + addps %xmm3, %xmm12 + addps %xmm4, %xmm14 + mulps %xmm0, %xmm1 + mulps %xmm0, %xmm2 + movaps %xmm12, %xmm13 + movaps %xmm14, %xmm15 + unpcklps %xmm1, %xmm12 + unpckhps %xmm1, %xmm13 + unpcklps %xmm2, %xmm14 + unpckhps %xmm2, %xmm15 + + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm8, %xmm0 + shufpd $0x2, %xmm9, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm8 + addps %xmm1, %xmm9 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm10, %xmm0 + shufpd $0x2, %xmm11, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm10 + addps %xmm1, %xmm11 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm12, %xmm0 + shufpd $0x2, %xmm13, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm12 + addps %xmm1, %xmm13 + + xorps %xmm0, %xmm0 + xorps %xmm1, %xmm1 + shufpd $0x2, %xmm14, %xmm0 + shufpd $0x2, %xmm15, %xmm1 + psrlq $32, %xmm0 + psrlq $32, %xmm1 + addps %xmm0, %xmm14 + addps %xmm1, %xmm15 + + pshufd $0x78, %xmm9, %xmm0 + pshufd $0x78, %xmm11, %xmm1 + pshufd $0x78, %xmm13, %xmm2 + pshufd $0x78, %xmm15, %xmm3 + psrldq $4, %xmm0 + psrldq $4, %xmm1 + psrldq $4, %xmm2 + psrldq $4, %xmm3 + addps %xmm0, %xmm9 + addps %xmm1, %xmm11 + addps %xmm2, %xmm13 + addps %xmm3, %xmm15 + + pshufd $0x78, %xmm10, %xmm0 + pshufd $0x78, %xmm14, %xmm1 + psrldq $4, %xmm0 + psrldq $4, %xmm1 + addps %xmm11, %xmm10 + addps %xmm15, %xmm14 + addps %xmm0, %xmm11 + addps %xmm1, %xmm15 + + + movss %xmm8, 1024(ARG0) + movss %xmm10, 896(ARG0) + movss %xmm9, 768(ARG0) + movss %xmm11, 640(ARG0) + movhlps %xmm8, %xmm0 + movhlps %xmm10, %xmm1 + movhlps %xmm9, %xmm2 + movhlps %xmm11, %xmm3 + movss %xmm0, 512(ARG0) + movss %xmm1, 384(ARG0) + movss %xmm2, 256(ARG0) + movss %xmm3, 128(ARG0) + + pshuflw $0xee, %xmm8, %xmm4 + pshuflw $0xee, %xmm10, %xmm5 + pshuflw $0xee, %xmm9, %xmm6 + pshuflw $0xee, %xmm11, %xmm7 + movss %xmm4, (ARG0) + movss %xmm4, (ARG1) + movss %xmm5, 128(ARG1) + movss %xmm6, 256(ARG1) + movss %xmm7, 384(ARG1) + + pshuflw $0xee, %xmm0, %xmm0 + pshuflw $0xee, %xmm1, %xmm1 + pshuflw $0xee, %xmm2, %xmm2 + pshuflw $0xee, %xmm3, %xmm3 + movss %xmm0, 512(ARG1) + movss %xmm1, 640(ARG1) + movss %xmm2, 768(ARG1) + movss %xmm3, 896(ARG1) + + pshufd $0x78, %xmm12, %xmm0 + movaps %xmm13, %xmm1 + psrldq $4, %xmm0 + + addps %xmm14, %xmm12 + addps %xmm15, %xmm13 + addps %xmm1, %xmm14 + addps %xmm0, %xmm15 + + movss %xmm12, 960(ARG0) + movss %xmm14, 832(ARG0) + movss %xmm13, 704(ARG0) + movss %xmm15, 576(ARG0) + movhlps %xmm12, %xmm0 + movhlps %xmm14, %xmm1 + movhlps %xmm13, %xmm2 + movhlps %xmm15, %xmm3 + movss %xmm0, 448(ARG0) + movss %xmm1, 320(ARG0) + movss %xmm2, 192(ARG0) + movss %xmm3, 64(ARG0) + + pshuflw $0xee, %xmm12, %xmm4 + pshuflw $0xee, %xmm14, %xmm5 + pshuflw $0xee, %xmm13, %xmm6 + pshuflw $0xee, %xmm15, %xmm7 + movss %xmm4, 64(ARG1) + movss %xmm5, 192(ARG1) + movss %xmm6, 320(ARG1) + movss %xmm7, 448(ARG1) + + pshuflw $0xee, %xmm0, %xmm0 + pshuflw $0xee, %xmm1, %xmm1 + pshuflw $0xee, %xmm2, %xmm2 + pshuflw $0xee, %xmm3, %xmm3 + movss %xmm0, 576(ARG1) + movss %xmm1, 704(ARG1) + movss %xmm2, 832(ARG1) + movss %xmm3, 960(ARG1) + +#ifdef _WIN64 + movaps (%rsp), %xmm6 + movaps 16(%rsp), %xmm7 + movaps 32(%rsp), %xmm8 + movaps 48(%rsp), %xmm9 + movaps 64(%rsp), %xmm10 + movaps 80(%rsp), %xmm11 + movaps 96(%rsp), %xmm12 + movaps 112(%rsp), %xmm13 + movaps 128(%rsp), %xmm14 + movaps 144(%rsp), %xmm15 + addq $168, %rsp +#endif + ret + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/debug.h b/node_modules/lame/deps/mpg123/src/libmpg123/debug.h new file mode 100644 index 0000000..32d471c --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/debug.h @@ -0,0 +1,171 @@ +/* + debug.h: + if DEBUG defined: debugging macro fprintf wrappers + else: macros defined to do nothing + That saves typing #ifdef DEBUG all the time and still preserves + lean code without debugging. + + public domain (or LGPL / GPL, if you like that more;-) + generated by debugdef.pl, what was + trivially written by Thomas Orgis +*/ + +#include "config.h" + +/* + I could do that with variadic macros available: + #define sdebug(me, s) fprintf(stderr, "[location] " s "\n") + #define debug(me, s, ...) fprintf(stderr, "[location] " s "}n", __VA_ARGS__) + + Variadic macros are a C99 feature... + Now just predefining stuff non-variadic for up to 15 arguments. + It's cumbersome to have them all with different names, though... +*/ + +#ifdef DEBUG +#include +#define debug(s) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__) +#define debug1(s, a) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a) +#define debug2(s, a, b) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b) +#define debug3(s, a, b, c) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c) +#define debug4(s, a, b, c, d) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d) +#define debug5(s, a, b, c, d, e) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e) +#define debug6(s, a, b, c, d, e, f) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f) +#define debug7(s, a, b, c, d, e, f, g) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g) +#define debug8(s, a, b, c, d, e, f, g, h) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h) +#define debug9(s, a, b, c, d, e, f, g, h, i) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i) +#define debug10(s, a, b, c, d, e, f, g, h, i, j) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j) +#define debug11(s, a, b, c, d, e, f, g, h, i, j, k) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k) +#define debug12(s, a, b, c, d, e, f, g, h, i, j, k, l) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l) +#define debug13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define debug14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define debug15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) fprintf(stderr, "[" __FILE__ ":%i] debug: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#else +#define debug(s) +#define debug1(s, a) +#define debug2(s, a, b) +#define debug3(s, a, b, c) +#define debug4(s, a, b, c, d) +#define debug5(s, a, b, c, d, e) +#define debug6(s, a, b, c, d, e, f) +#define debug7(s, a, b, c, d, e, f, g) +#define debug8(s, a, b, c, d, e, f, g, h) +#define debug9(s, a, b, c, d, e, f, g, h, i) +#define debug10(s, a, b, c, d, e, f, g, h, i, j) +#define debug11(s, a, b, c, d, e, f, g, h, i, j, k) +#define debug12(s, a, b, c, d, e, f, g, h, i, j, k, l) +#define debug13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define debug14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define debug15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#endif + +/* warning macros also here... */ +#ifndef NO_WARNING +#define warning(s) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__) +#define warning1(s, a) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a) +#define warning2(s, a, b) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b) +#define warning3(s, a, b, c) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c) +#define warning4(s, a, b, c, d) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d) +#define warning5(s, a, b, c, d, e) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e) +#define warning6(s, a, b, c, d, e, f) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f) +#define warning7(s, a, b, c, d, e, f, g) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g) +#define warning8(s, a, b, c, d, e, f, g, h) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h) +#define warning9(s, a, b, c, d, e, f, g, h, i) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i) +#define warning10(s, a, b, c, d, e, f, g, h, i, j) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j) +#define warning11(s, a, b, c, d, e, f, g, h, i, j, k) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k) +#define warning12(s, a, b, c, d, e, f, g, h, i, j, k, l) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l) +#define warning13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define warning14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define warning15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) fprintf(stderr, "[" __FILE__ ":%i] warning: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#else +#define warning(s) +#define warning1(s, a) +#define warning2(s, a, b) +#define warning3(s, a, b, c) +#define warning4(s, a, b, c, d) +#define warning5(s, a, b, c, d, e) +#define warning6(s, a, b, c, d, e, f) +#define warning7(s, a, b, c, d, e, f, g) +#define warning8(s, a, b, c, d, e, f, g, h) +#define warning9(s, a, b, c, d, e, f, g, h, i) +#define warning10(s, a, b, c, d, e, f, g, h, i, j) +#define warning11(s, a, b, c, d, e, f, g, h, i, j, k) +#define warning12(s, a, b, c, d, e, f, g, h, i, j, k, l) +#define warning13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define warning14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define warning15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#endif + +/* error macros also here... */ +#ifndef NO_ERRORMSG +#define error(s) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__) +#define error1(s, a) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a) +#define error2(s, a, b) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b) +#define error3(s, a, b, c) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c) +#define error4(s, a, b, c, d) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d) +#define error5(s, a, b, c, d, e) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e) +#define error6(s, a, b, c, d, e, f) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f) +#define error7(s, a, b, c, d, e, f, g) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g) +#define error8(s, a, b, c, d, e, f, g, h) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h) +#define error9(s, a, b, c, d, e, f, g, h, i) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i) +#define error10(s, a, b, c, d, e, f, g, h, i, j) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j) +#define error11(s, a, b, c, d, e, f, g, h, i, j, k) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k) +#define error12(s, a, b, c, d, e, f, g, h, i, j, k, l) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l) +#define error13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define error14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define error15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) fprintf(stderr, "[" __FILE__ ":%i] error: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#else +#define error(s) +#define error1(s, a) +#define error2(s, a, b) +#define error3(s, a, b, c) +#define error4(s, a, b, c, d) +#define error5(s, a, b, c, d, e) +#define error6(s, a, b, c, d, e, f) +#define error7(s, a, b, c, d, e, f, g) +#define error8(s, a, b, c, d, e, f, g, h) +#define error9(s, a, b, c, d, e, f, g, h, i) +#define error10(s, a, b, c, d, e, f, g, h, i, j) +#define error11(s, a, b, c, d, e, f, g, h, i, j, k) +#define error12(s, a, b, c, d, e, f, g, h, i, j, k, l) +#define error13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) +#define error14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) +#define error15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) +#endif + +/* ereturn macros also here... */ +#ifndef NO_ERETURN +#define ereturn(rv, s) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__); return rv; }while(0) +#define ereturn1(rv, s, a) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a); return rv; }while(0) +#define ereturn2(rv, s, a, b) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b); return rv; }while(0) +#define ereturn3(rv, s, a, b, c) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c); return rv; }while(0) +#define ereturn4(rv, s, a, b, c, d) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d); return rv; }while(0) +#define ereturn5(rv, s, a, b, c, d, e) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e); return rv; }while(0) +#define ereturn6(rv, s, a, b, c, d, e, f) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f); return rv; }while(0) +#define ereturn7(rv, s, a, b, c, d, e, f, g) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g); return rv; }while(0) +#define ereturn8(rv, s, a, b, c, d, e, f, g, h) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h); return rv; }while(0) +#define ereturn9(rv, s, a, b, c, d, e, f, g, h, i) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i); return rv; }while(0) +#define ereturn10(rv, s, a, b, c, d, e, f, g, h, i, j) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j); return rv; }while(0) +#define ereturn11(rv, s, a, b, c, d, e, f, g, h, i, j, k) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k); return rv; }while(0) +#define ereturn12(rv, s, a, b, c, d, e, f, g, h, i, j, k, l) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l); return rv; }while(0) +#define ereturn13(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m); return rv; }while(0) +#define ereturn14(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n); return rv; }while(0) +#define ereturn15(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) do{ fprintf(stderr, "[" __FILE__ ":%i] ereturn: " s "\n", __LINE__, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); return rv; }while(0) +#else +#define ereturn(rv, s) return rv +#define ereturn1(rv, s, a) return rv +#define ereturn2(rv, s, a, b) return rv +#define ereturn3(rv, s, a, b, c) return rv +#define ereturn4(rv, s, a, b, c, d) return rv +#define ereturn5(rv, s, a, b, c, d, e) return rv +#define ereturn6(rv, s, a, b, c, d, e, f) return rv +#define ereturn7(rv, s, a, b, c, d, e, f, g) return rv +#define ereturn8(rv, s, a, b, c, d, e, f, g, h) return rv +#define ereturn9(rv, s, a, b, c, d, e, f, g, h, i) return rv +#define ereturn10(rv, s, a, b, c, d, e, f, g, h, i, j) return rv +#define ereturn11(rv, s, a, b, c, d, e, f, g, h, i, j, k) return rv +#define ereturn12(rv, s, a, b, c, d, e, f, g, h, i, j, k, l) return rv +#define ereturn13(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m) return rv +#define ereturn14(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) return rv +#define ereturn15(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) return rv +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/decode.h b/node_modules/lame/deps/mpg123/src/libmpg123/decode.h new file mode 100644 index 0000000..e2f167e --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/decode.h @@ -0,0 +1,268 @@ +/* + decode.h: common definitions for decode functions + + This file is strongly tied with optimize.h concerning the synth functions. + Perhaps one should restructure that a bit. + + copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis, taking WRITE_SAMPLE from decode.c +*/ +#ifndef MPG123_DECODE_H +#define MPG123_DECODE_H + +/* Selection of class of output routines for basic format. */ +#ifndef REAL_IS_FIXED +#define OUT_FORMATS 4 /* Basic output formats: 16bit, 8bit, real and s32 */ +#else +#define OUT_FORMATS 2 /* Only up to 16bit */ +#endif + +#define OUT_16 0 +#define OUT_8 1 +/* Those are defined but not supported for fixed point decoding! */ +#define OUT_REAL 2 /* Write a floating point sample (that is, one matching the internal real type). */ +#define OUT_S32 3 + +#ifdef NO_NTOM +#define NTOM_MAX 1 +#else +#define NTOM_MAX 8 /* maximum allowed factor for upsampling */ +#define NTOM_MAX_FREQ 96000 /* maximum frequency to upsample to / downsample from */ +#define NTOM_MUL (32768) +void ntom_set_ntom(mpg123_handle *fr, off_t num); +#endif + +/* Let's collect all possible synth functions here, for an overview. + If they are actually defined and used depends on preprocessor machinery. + See synth.c and optimize.h for that, also some special C and assembler files. */ + +#ifndef NO_16BIT +/* The signed-16bit-producing variants. */ +int synth_1to1 (real*, int, mpg123_handle*, int); +int synth_1to1_dither (real*, int, mpg123_handle*, int); +int synth_1to1_i386 (real*, int, mpg123_handle*, int); +int synth_1to1_i586 (real*, int, mpg123_handle*, int); +int synth_1to1_i586_dither(real*, int, mpg123_handle*, int); +int synth_1to1_mmx (real*, int, mpg123_handle*, int); +int synth_1to1_3dnow (real*, int, mpg123_handle*, int); +int synth_1to1_sse (real*, int, mpg123_handle*, int); +int synth_1to1_stereo_sse (real*, real*, mpg123_handle*); +int synth_1to1_3dnowext (real*, int, mpg123_handle*, int); +int synth_1to1_altivec (real*, int, mpg123_handle*, int); +int synth_1to1_stereo_altivec(real*, real*, mpg123_handle*); +int synth_1to1_x86_64 (real*, int, mpg123_handle*, int); +int synth_1to1_stereo_x86_64(real*, real*, mpg123_handle*); +int synth_1to1_arm (real*, int, mpg123_handle*, int); +int synth_1to1_neon (real*, int, mpg123_handle*, int); +int synth_1to1_stereo_neon(real*, real*, mpg123_handle*); +/* This is different, special usage in layer3.c only. + Hence, the name... and now forget about it. + Never use it outside that special portion of code inside layer3.c! */ +int absynth_1to1_i486(real*, int, mpg123_handle*, int); +/* These mono/stereo converters use one of the above for the grunt work. */ +int synth_1to1_mono (real*, mpg123_handle*); +int synth_1to1_m2s(real*, mpg123_handle*); + +/* Sample rate decimation comes in less flavours. */ +#ifndef NO_DOWNSAMPLE +int synth_2to1 (real*, int, mpg123_handle*, int); +int synth_2to1_dither (real*, int, mpg123_handle*, int); +int synth_2to1_i386 (real*, int, mpg123_handle*, int); +int synth_2to1_mono (real*, mpg123_handle*); +int synth_2to1_m2s(real*, mpg123_handle*); +int synth_4to1 (real *,int, mpg123_handle*, int); +int synth_4to1_dither (real *,int, mpg123_handle*, int); +int synth_4to1_i386 (real*, int, mpg123_handle*, int); +int synth_4to1_mono (real*, mpg123_handle*); +int synth_4to1_m2s(real*, mpg123_handle*); +#endif +#ifndef NO_NTOM +/* NtoM is really just one implementation. */ +int synth_ntom (real *,int, mpg123_handle*, int); +int synth_ntom_mono (real *, mpg123_handle *); +int synth_ntom_m2s (real *, mpg123_handle *); +#endif +#endif + +#ifndef NO_8BIT +/* The 8bit-producing variants. */ +/* There are direct 8-bit synths and wrappers over a possibly optimized 16bit one. */ +int synth_1to1_8bit (real*, int, mpg123_handle*, int); +int synth_1to1_8bit_i386 (real*, int, mpg123_handle*, int); +#ifndef NO_16BIT +int synth_1to1_8bit_wrap (real*, int, mpg123_handle*, int); +int synth_1to1_8bit_mono (real*, mpg123_handle*); +#endif +int synth_1to1_8bit_m2s(real*, mpg123_handle*); +#ifndef NO_16BIT +int synth_1to1_8bit_wrap_mono (real*, mpg123_handle*); +int synth_1to1_8bit_wrap_m2s(real*, mpg123_handle*); +#endif +#ifndef NO_DOWNSAMPLE +int synth_2to1_8bit (real*, int, mpg123_handle*, int); +int synth_2to1_8bit_i386 (real*, int, mpg123_handle*, int); +int synth_2to1_8bit_mono (real*, mpg123_handle*); +int synth_2to1_8bit_m2s(real*, mpg123_handle*); +int synth_4to1_8bit (real*, int, mpg123_handle*, int); +int synth_4to1_8bit_i386 (real*, int, mpg123_handle*, int); +int synth_4to1_8bit_mono (real*, mpg123_handle*); +int synth_4to1_8bit_m2s(real*, mpg123_handle*); +#endif +#ifndef NO_NTOM +int synth_ntom_8bit (real*, int, mpg123_handle*, int); +int synth_ntom_8bit_mono (real*, mpg123_handle*); +int synth_ntom_8bit_m2s(real*, mpg123_handle*); +#endif +#endif + +#ifndef REAL_IS_FIXED + +#ifndef NO_REAL +/* The real-producing variants. */ +int synth_1to1_real (real*, int, mpg123_handle*, int); +int synth_1to1_real_i386 (real*, int, mpg123_handle*, int); +int synth_1to1_real_sse (real*, int, mpg123_handle*, int); +int synth_1to1_real_stereo_sse (real*, real*, mpg123_handle*); +int synth_1to1_real_x86_64 (real*, int, mpg123_handle*, int); +int synth_1to1_real_stereo_x86_64(real*, real*, mpg123_handle*); +int synth_1to1_real_altivec (real*, int, mpg123_handle*, int); +int synth_1to1_real_stereo_altivec(real*, real*, mpg123_handle*); +int synth_1to1_real_neon (real*, int, mpg123_handle*, int); +int synth_1to1_real_stereo_neon(real*, real*, mpg123_handle*); +int synth_1to1_real_mono (real*, mpg123_handle*); +int synth_1to1_real_m2s(real*, mpg123_handle*); +#ifndef NO_DOWNSAMPLE +int synth_2to1_real (real*, int, mpg123_handle*, int); +int synth_2to1_real_i386 (real*, int, mpg123_handle*, int); +int synth_2to1_real_mono (real*, mpg123_handle*); +int synth_2to1_real_m2s(real*, mpg123_handle*); +int synth_4to1_real (real*, int, mpg123_handle*, int); +int synth_4to1_real_i386 (real*, int, mpg123_handle*, int); +int synth_4to1_real_mono (real*, mpg123_handle*); +int synth_4to1_real_m2s(real*, mpg123_handle*); +#endif +#ifndef NO_NTOM +int synth_ntom_real (real*, int, mpg123_handle*, int); +int synth_ntom_real_mono (real*, mpg123_handle*); +int synth_ntom_real_m2s(real*, mpg123_handle*); +#endif +#endif + +#ifndef NO_32BIT +/* 32bit integer */ +int synth_1to1_s32 (real*, int, mpg123_handle*, int); +int synth_1to1_s32_i386 (real*, int, mpg123_handle*, int); +int synth_1to1_s32_sse (real*, int, mpg123_handle*, int); +int synth_1to1_s32_stereo_sse (real*, real*, mpg123_handle*); +int synth_1to1_s32_x86_64 (real*, int, mpg123_handle*, int); +int synth_1to1_s32_stereo_x86_64(real*, real*, mpg123_handle*); +int synth_1to1_s32_altivec (real*, int, mpg123_handle*, int); +int synth_1to1_s32_stereo_altivec(real*, real*, mpg123_handle*); +int synth_1to1_s32_neon (real*, int, mpg123_handle*, int); +int synth_1to1_s32_stereo_neon(real*, real*, mpg123_handle*); +int synth_1to1_s32_mono (real*, mpg123_handle*); +int synth_1to1_s32_m2s(real*, mpg123_handle*); +#ifndef NO_DOWNSAMPLE +int synth_2to1_s32 (real*, int, mpg123_handle*, int); +int synth_2to1_s32_i386 (real*, int, mpg123_handle*, int); +int synth_2to1_s32_mono (real*, mpg123_handle*); +int synth_2to1_s32_m2s(real*, mpg123_handle*); +int synth_4to1_s32 (real*, int, mpg123_handle*, int); +int synth_4to1_s32_i386 (real*, int, mpg123_handle*, int); +int synth_4to1_s32_mono (real*, mpg123_handle*); +int synth_4to1_s32_m2s(real*, mpg123_handle*); +#endif +#ifndef NO_NTOM +int synth_ntom_s32 (real*, int, mpg123_handle*, int); +int synth_ntom_s32_mono (real*, mpg123_handle*); +int synth_ntom_s32_m2s(real*, mpg123_handle*); +#endif +#endif + +#endif /* FIXED */ + + +/* Inside these synth functions, some dct64 variants may be used. + The special optimized ones that only appear in assembler code are not mentioned here. + And, generally, these functions are only employed in a matching synth function. */ +void dct64 (real *,real *,real *); +void dct64_i386 (real *,real *,real *); +void dct64_altivec(real *,real *,real *); +void dct64_i486(int*, int* , real*); /* Yeah, of no use outside of synth_i486.c .*/ + +/* This is used by the layer 3 decoder, one generic function and 3DNow variants. */ +void dct36 (real *,real *,real *,real *,real *); +void dct36_3dnow (real *,real *,real *,real *,real *); +void dct36_3dnowext(real *,real *,real *,real *,real *); + +/* Tools for NtoM resampling synth, defined in ntom.c . */ +int synth_ntom_set_step(mpg123_handle *fr); /* prepare ntom decoding */ +unsigned long ntom_val(mpg123_handle *fr, off_t frame); /* compute ntom_val for frame offset */ +/* Frame and sample offsets. */ +#ifndef NO_NTOM +/* + Outsamples of _this_ frame. + To be exact: The samples to be expected from the next frame decode (using the current ntom_val). When you already decoded _this_ frame, this is the number of samples to be expected from the next one. +*/ +off_t ntom_frame_outsamples(mpg123_handle *fr); +/* Total out/insample offset. */ +off_t ntom_frmouts(mpg123_handle *fr, off_t frame); +off_t ntom_ins2outs(mpg123_handle *fr, off_t ins); +off_t ntom_frameoff(mpg123_handle *fr, off_t soff); +#endif + +/* Initialization of any static data that majy be needed at runtime. + Make sure you call these once before it is too late. */ +#ifndef NO_LAYER3 +void init_layer3(void); +real init_layer3_gainpow2(mpg123_handle *fr, int i); +void init_layer3_stuff(mpg123_handle *fr, real (*gainpow2)(mpg123_handle *fr, int i)); +#endif +#ifndef NO_LAYER12 +void init_layer12(void); +real* init_layer12_table(mpg123_handle *fr, real *table, int m); +void init_layer12_stuff(mpg123_handle *fr, real* (*init_table)(mpg123_handle *fr, real *table, int m)); +#endif + +void prepare_decode_tables(void); + +extern real *pnts[5]; /* tabinit provides, dct64 needs */ + +/* Runtime (re)init functions; needed more often. */ +void make_decode_tables(mpg123_handle *fr); /* For every volume change. */ +/* Stuff needed after updating synth setup (see set_synth_functions()). */ + +#ifdef OPT_MMXORSSE +/* Special treatment for mmx-like decoders, these functions go into the slots below. */ +void make_decode_tables_mmx(mpg123_handle *fr); +#ifndef NO_LAYER3 +real init_layer3_gainpow2_mmx(mpg123_handle *fr, int i); +#endif +#ifndef NO_LAYER12 +real* init_layer12_table_mmx(mpg123_handle *fr, real *table, int m); +#endif +#endif + +#ifndef NO_8BIT +/* Needed when switching to 8bit output. */ +int make_conv16to8_table(mpg123_handle *fr); +#endif + +/* These are the actual workers. + They operate on the parsed frame data and handle decompression to audio samples. + The synth functions defined above are called from inside the layer handlers. */ + +#ifndef NO_LAYER3 +int do_layer3(mpg123_handle *fr); +#endif +#ifndef NO_LAYER2 +int do_layer2(mpg123_handle *fr); +#endif +#ifndef NO_LAYER1 +int do_layer1(mpg123_handle *fr); +#endif +/* There's an 3DNow counterpart in asm. */ +void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]); + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dither.c b/node_modules/lame/deps/mpg123/src/libmpg123/dither.c new file mode 100644 index 0000000..30dbdd1 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dither.c @@ -0,0 +1,119 @@ +/* + dither: Generate shaped noise for dithering + + copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#include "config.h" +#include "compat.h" +#include "dither.h" + +static const uint32_t init_seed = 2463534242UL; + +#define LAP 100 + +/* + xorshift random number generator, with output scaling to [-0.5, 0.5] + This is the white noise... + See http://www.jstatsoft.org/v08/i14/paper on XOR shift random number generators. +*/ +static float rand_xorshift32(uint32_t *seed) +{ + union + { + uint32_t i; + float f; + } fi; + + fi.i = *seed; + fi.i ^= (fi.i<<13); + fi.i ^= (fi.i>>17); + fi.i ^= (fi.i<<5); + *seed = fi.i; + + /* scale the number to [-0.5, 0.5] */ +#ifdef IEEE_FLOAT + fi.i = (fi.i>>9)|0x3f800000; + fi.f -= 1.5f; +#else + fi.f = (double)fi.i / 4294967295.0; + fi.f -= 0.5f; +#endif + return fi.f; +} + +static void white_noise(float *table, size_t count) +{ + size_t i; + uint32_t seed = init_seed; + + for(i=0; i 2*LAP ? LAP : count/2; + + float input_noise; + float xv[9], yv[9]; + + for(i=0;i<9;i++) + { + xv[i] = yv[i] = 0.0f; + } + + for(i=0;i=lap) table[i-lap] = yv[8] * 3.0f; + } +} + +void mpg123_noise(float* table, size_t count, enum mpg123_noise_type noisetype) +{ + switch(noisetype) + { + case mpg123_white_noise: white_noise(table, count); break; + case mpg123_tpdf_noise: tpdf_noise(table, count); break; + case mpg123_highpass_tpdf_noise: + highpass_tpdf_noise(table, count); + break; + } +} + +/* Generate white noise and shape it with a high pass filter. */ +void dither_table_init(float *dithertable) +{ + highpass_tpdf_noise(dithertable, DITHERSIZE); +} diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/dither.h b/node_modules/lame/deps/mpg123/src/libmpg123/dither.h new file mode 100644 index 0000000..6a6cb3e --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/dither.h @@ -0,0 +1,23 @@ +/* + dither: Generate noise for dithering / noise shaping. + + copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#ifndef MPG123_DITHER_H +#define MPG123_DITHER_H + +#define DITHERSIZE 65536 +enum mpg123_noise_type +{ + mpg123_white_noise = 0 + ,mpg123_tpdf_noise + ,mpg123_highpass_tpdf_noise +}; + +void mpg123_noise(float* table, size_t count, enum mpg123_noise_type noisetype); +void dither_table_init(float *dithertable); + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/equalizer.c b/node_modules/lame/deps/mpg123/src/libmpg123/equalizer.c new file mode 100644 index 0000000..bc5d5d9 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/equalizer.c @@ -0,0 +1,17 @@ +/* + equalizer.c: equalizer settings + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp +*/ + + +#include "mpg123lib_intern.h" + +void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]) +{ + int i; + for(i=0;i<32;i++) + bandPtr[i] = REAL_MUL(bandPtr[i], equalizer[channel][i]); +} diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/equalizer_3dnow.S b/node_modules/lame/deps/mpg123/src/libmpg123/equalizer_3dnow.S new file mode 100644 index 0000000..471a0ed --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/equalizer_3dnow.S @@ -0,0 +1,70 @@ +/* + equalizer_3dnow: 3DNow! optimized do_equalizer() + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by KIMURA Takuhiro +*/ + +#include "mangle.h" + +.text + ALIGN4 +.globl ASM_NAME(do_equalizer_3dnow) +/* .type ASM_NAME(do_equalizer_3dnow),@function */ +/* void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]); */ +ASM_NAME(do_equalizer_3dnow): + pushl %esi + pushl %ebx + /* bandPtr */ + movl 12(%esp),%ebx + /* channel */ + movl 16(%esp),%ecx + xorl %edx,%edx + /* equalizer */ + movl 20(%esp),%esi + sall $7,%ecx + ALIGN4 +.L9: + movq (%ebx,%edx),%mm0 + pfmul (%esi,%ecx),%mm0 + + movq 8(%ebx,%edx),%mm1 + pfmul 8(%esi,%ecx),%mm1 + movq %mm0,(%ebx,%edx) + + movq 16(%ebx,%edx),%mm0 + pfmul 16(%esi,%ecx),%mm0 + movq %mm1,8(%ebx,%edx) + + movq 24(%ebx,%edx),%mm1 + pfmul 24(%esi,%ecx),%mm1 + movq %mm0,16(%ebx,%edx) + + movq 32(%ebx,%edx),%mm0 + pfmul 32(%esi,%ecx),%mm0 + movq %mm1,24(%ebx,%edx) + + movq 40(%ebx,%edx),%mm1 + pfmul 40(%esi,%ecx),%mm1 + movq %mm0,32(%ebx,%edx) + + movq 48(%ebx,%edx),%mm0 + pfmul 48(%esi,%ecx),%mm0 + movq %mm1,40(%ebx,%edx) + + movq 56(%ebx,%edx),%mm1 + pfmul 56(%esi,%ecx),%mm1 + movq %mm0,48(%ebx,%edx) + movq %mm1,56(%ebx,%edx) + + addl $64,%edx + addl $32,%ecx + cmpl $124,%edx + jle .L9 + ALIGN4 + popl %ebx + popl %esi + ret + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/feature.c b/node_modules/lame/deps/mpg123/src/libmpg123/feature.c new file mode 100644 index 0000000..1972388 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/feature.c @@ -0,0 +1,106 @@ +#include "mpg123lib_intern.h" + +int mpg123_feature(const enum mpg123_feature_set key) +{ + switch(key) + { + case MPG123_FEATURE_ABI_UTF8OPEN: +#ifdef WANT_WIN32_UNICODE + return 1; +#else + return 0; +#endif /* WANT_WIN32_UNICODE */ + + case MPG123_FEATURE_OUTPUT_8BIT: +#ifdef NO_8BIT + return 0; +#else + return 1; +#endif /* mpg123_output_8bit */ + + case MPG123_FEATURE_OUTPUT_16BIT: +#ifdef NO_16BIT + return 0; +#else + return 1; +#endif /* mpg123_output_16bit */ + + case MPG123_FEATURE_OUTPUT_32BIT: +#ifdef NO_32BIT + return 0; +#else + return 1; +#endif /* mpg123_output_32bit */ + + case MPG123_FEATURE_PARSE_ID3V2: +#ifdef NO_ID3V2 + return 0; +#else + return 1; +#endif /* NO_ID3V2 */ + + case MPG123_FEATURE_DECODE_LAYER1: +#ifdef NO_LAYER1 + return 0; +#else + return 1; +#endif /* NO_LAYER1 */ + + case MPG123_FEATURE_DECODE_LAYER2: +#ifdef NO_LAYER2 + return 0; +#else + return 1; +#endif /* NO_LAYER2 */ + + case MPG123_FEATURE_DECODE_LAYER3: +#ifdef NO_LAYER3 + return 0; +#else + return 1; +#endif /* NO_LAYER3 */ + + case MPG123_FEATURE_DECODE_ACCURATE: +#ifdef ACCURATE_ROUNDING + return 1; +#else + return 0; +#endif /* ACCURATE_ROUNDING */ + + case MPG123_FEATURE_DECODE_DOWNSAMPLE: +#ifdef NO_DOWNSAMPLE + return 0; +#else + return 1; +#endif /* NO_DOWNSAMPLE */ + + case MPG123_FEATURE_DECODE_NTOM: +#ifdef NO_NTOM + return 0; +#else + return 1; +#endif /* NO_NTOM */ + + case MPG123_FEATURE_PARSE_ICY: +#ifdef NO_ICY + return 0; +#else + return 1; +#endif /* NO_ICY */ + + case MPG123_FEATURE_INDEX: +#ifdef FRAME_INDEX + return 1; +#else + return 0; +#endif /* FRAME_INDEX */ + case MPG123_FEATURE_TIMEOUT_READ: +#ifdef TIMEOUT_READ + return 1; +#else + return 0; +#endif + + default: return 0; + } +} diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/format.c b/node_modules/lame/deps/mpg123/src/libmpg123/format.c new file mode 100644 index 0000000..1f4d49e --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/format.c @@ -0,0 +1,521 @@ +/* + format:routines to deal with audio (output) format + + copyright 2008-9 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis, starting with parts of the old audio.c, with only faintly manage to show now +*/ + +#include "mpg123lib_intern.h" +#include "debug.h" + +/* static int chans[NUM_CHANNELS] = { 1 , 2 }; */ +static const long my_rates[MPG123_RATES] = /* only the standard rates */ +{ + 8000, 11025, 12000, + 16000, 22050, 24000, + 32000, 44100, 48000, +}; + +static const int my_encodings[MPG123_ENCODINGS] = +{ + MPG123_ENC_SIGNED_16, + MPG123_ENC_UNSIGNED_16, + MPG123_ENC_SIGNED_32, + MPG123_ENC_UNSIGNED_32, + MPG123_ENC_SIGNED_24, + MPG123_ENC_UNSIGNED_24, + /* Floating point range, see below. */ + MPG123_ENC_FLOAT_32, + MPG123_ENC_FLOAT_64, + /* 8 bit range, see below. */ + MPG123_ENC_SIGNED_8, + MPG123_ENC_UNSIGNED_8, + MPG123_ENC_ULAW_8, + MPG123_ENC_ALAW_8 +}; + +/* Make that match the above table. + And yes, I still don't like this kludgy stuff. */ +/* range[0] <= i < range[1] for forced floating point */ +static const int enc_float_range[2] = { 6, 8 }; +/* same for 8 bit encodings */ +static const int enc_8bit_range[2] = { 8, 12 }; + +/* Only one type of float is supported. */ +# ifdef REAL_IS_FLOAT +# define MPG123_FLOAT_ENC MPG123_ENC_FLOAT_32 +# else +# define MPG123_FLOAT_ENC MPG123_ENC_FLOAT_64 +# endif + +/* The list of actually possible encodings. */ +static const int good_encodings[] = +{ +#ifndef NO_16BIT + MPG123_ENC_SIGNED_16, + MPG123_ENC_UNSIGNED_16, +#endif +#ifndef NO_32BIT + MPG123_ENC_SIGNED_32, + MPG123_ENC_UNSIGNED_32, + MPG123_ENC_SIGNED_24, + MPG123_ENC_UNSIGNED_24, +#endif +#ifndef NO_REAL + MPG123_FLOAT_ENC, +#endif +#ifndef NO_8BIT + MPG123_ENC_SIGNED_8, + MPG123_ENC_UNSIGNED_8, + MPG123_ENC_ULAW_8, + MPG123_ENC_ALAW_8 +#endif +}; + +/* Check if encoding is a valid one in this build. + ...lazy programming: linear search. */ +static int good_enc(const int enc) +{ + size_t i; + for(i=0; iforce_rate != 0 && mp->force_rate == r) return MPG123_RATES; +#endif + + return -1; +} + +static int enc2num(int encoding) +{ + int i; + for(i=0;ichannels-1; + int rn = rate2num(&fr->p, nf->rate); + if(rn >= 0) for(i=f0;ip.audio_caps[c][rn][i]) + { + nf->encoding = my_encodings[i]; + return 1; + } + } + return 0; +} + +static int freq_fit(mpg123_handle *fr, struct audioformat *nf, int f0, int f2) +{ + nf->rate = frame_freq(fr)>>fr->p.down_sample; + if(cap_fit(fr,nf,f0,f2)) return 1; + if(fr->p.flags & MPG123_AUTO_RESAMPLE) + { + nf->rate>>=1; + if(cap_fit(fr,nf,f0,f2)) return 1; + nf->rate>>=1; + if(cap_fit(fr,nf,f0,f2)) return 1; + } +#ifndef NO_NTOM + /* If nothing worked, try the other rates, only without constrains from user. + In case you didn't guess: We enable flexible resampling if we find a working rate. */ + if( fr->p.flags & MPG123_AUTO_RESAMPLE && + !fr->p.force_rate && fr->p.down_sample == 0) + { + int i; + int c = nf->channels-1; + int rn = rate2num(&fr->p, frame_freq(fr)); + int rrn; + if(rn < 0) return 0; + /* Try higher rates first. */ + for(i=f0;ip.audio_caps[c][rrn][i]) + { + nf->rate = my_rates[rrn]; + nf->encoding = my_encodings[i]; + return 1; + } + /* Then lower rates. */ + for(i=f0;i=0; --rrn) + if(fr->p.audio_caps[c][rrn][i]) + { + nf->rate = my_rates[rrn]; + nf->encoding = my_encodings[i]; + return 1; + } + } +#endif + + return 0; +} + +/* match constraints against supported audio formats, store possible setup in frame + return: -1: error; 0: no format change; 1: format change */ +int frame_output_format(mpg123_handle *fr) +{ + struct audioformat nf; + int f0=0; + int f2=MPG123_ENCODINGS; /* Omit the 32bit and float encodings. */ + mpg123_pars *p = &fr->p; + /* initialize new format, encoding comes later */ + nf.channels = fr->stereo; + + /* All this forcing should be removed in favour of the capabilities table... */ + if(p->flags & MPG123_FORCE_8BIT) + { + f0 = enc_8bit_range[0]; + f2 = enc_8bit_range[1]; + } + if(p->flags & MPG123_FORCE_FLOAT) + { + f0 = enc_float_range[0]; + f2 = enc_float_range[1]; + } + + /* force stereo is stronger */ + if(p->flags & MPG123_FORCE_MONO) nf.channels = 1; + if(p->flags & MPG123_FORCE_STEREO) nf.channels = 2; + +#ifndef NO_NTOM + if(p->force_rate) + { + nf.rate = p->force_rate; + if(cap_fit(fr,&nf,f0,2)) goto end; /* 16bit encodings */ + if(cap_fit(fr,&nf,f0<=2 ? 2 : f0,f2)) goto end; /* 8bit encodings */ + + /* try again with different stereoness */ + if(nf.channels == 2 && !(p->flags & MPG123_FORCE_STEREO)) nf.channels = 1; + else if(nf.channels == 1 && !(p->flags & MPG123_FORCE_MONO)) nf.channels = 2; + + if(cap_fit(fr,&nf,f0,2)) goto end; /* 16bit encodings */ + if(cap_fit(fr,&nf,f0<=2 ? 2 : f0,f2)) goto end; /* 8bit encodings */ + + if(NOQUIET) + error3( "Unable to set up output format! Constraints: %s%s%liHz.", + ( p->flags & MPG123_FORCE_STEREO ? "stereo, " : + (p->flags & MPG123_FORCE_MONO ? "mono, " : "") ), + (p->flags & MPG123_FORCE_8BIT ? "8bit, " : ""), + p->force_rate ); +/* if(NOQUIET && p->verbose <= 1) print_capabilities(fr); */ + + fr->err = MPG123_BAD_OUTFORMAT; + return -1; + } +#endif + + if(freq_fit(fr, &nf, f0, 2)) goto end; /* try rates with 16bit */ + if(freq_fit(fr, &nf, f0<=2 ? 2 : f0, f2)) goto end; /* ... 8bit */ + + /* try again with different stereoness */ + if(nf.channels == 2 && !(p->flags & MPG123_FORCE_STEREO)) nf.channels = 1; + else if(nf.channels == 1 && !(p->flags & MPG123_FORCE_MONO)) nf.channels = 2; + + if(freq_fit(fr, &nf, f0, 2)) goto end; /* try rates with 16bit */ + if(freq_fit(fr, &nf, f0<=2 ? 2 : f0, f2)) goto end; /* ... 8bit */ + + /* Here is the _bad_ end. */ + if(NOQUIET) + { + error5( "Unable to set up output format! Constraints: %s%s%li, %li or %liHz.", + ( p->flags & MPG123_FORCE_STEREO ? "stereo, " : + (p->flags & MPG123_FORCE_MONO ? "mono, " : "") ), + (p->flags & MPG123_FORCE_8BIT ? "8bit, " : ""), + frame_freq(fr), frame_freq(fr)>>1, frame_freq(fr)>>2 ); + } +/* if(NOQUIET && p->verbose <= 1) print_capabilities(fr); */ + + fr->err = MPG123_BAD_OUTFORMAT; + return -1; + +end: /* Here is the _good_ end. */ + /* we had a successful match, now see if there's a change */ + if(nf.rate == fr->af.rate && nf.channels == fr->af.channels && nf.encoding == fr->af.encoding) + { + debug2("Old format with %i channels, and FORCE_MONO=%li", nf.channels, p->flags & MPG123_FORCE_MONO); + return 0; /* the same format as before */ + } + else /* a new format */ + { + debug1("New format with %i channels!", nf.channels); + fr->af.rate = nf.rate; + fr->af.channels = nf.channels; + fr->af.encoding = nf.encoding; + /* Cache the size of one sample in bytes, for ease of use. */ + fr->af.encsize = mpg123_encsize(fr->af.encoding); + if(fr->af.encsize < 1) + { + if(NOQUIET) error1("Some unknown encoding??? (%i)", fr->af.encoding); + + fr->err = MPG123_BAD_OUTFORMAT; + return -1; + } + return 1; + } +} + +int attribute_align_arg mpg123_format_none(mpg123_handle *mh) +{ + int r; + if(mh == NULL) return MPG123_ERR; + + r = mpg123_fmt_none(&mh->p); + if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; } + + return r; +} + +int attribute_align_arg mpg123_fmt_none(mpg123_pars *mp) +{ + if(mp == NULL) return MPG123_BAD_PARS; + + if(PVERB(mp,3)) fprintf(stderr, "Note: Disabling all formats.\n"); + + memset(mp->audio_caps,0,sizeof(mp->audio_caps)); + return MPG123_OK; +} + +int attribute_align_arg mpg123_format_all(mpg123_handle *mh) +{ + int r; + if(mh == NULL) return MPG123_ERR; + + r = mpg123_fmt_all(&mh->p); + if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; } + + return r; +} + +int attribute_align_arg mpg123_fmt_all(mpg123_pars *mp) +{ + size_t rate, ch, enc; + if(mp == NULL) return MPG123_BAD_PARS; + + if(PVERB(mp,3)) fprintf(stderr, "Note: Enabling all formats.\n"); + + for(ch=0; ch < NUM_CHANNELS; ++ch) + for(rate=0; rate < MPG123_RATES+1; ++rate) + for(enc=0; enc < MPG123_ENCODINGS; ++enc) + mp->audio_caps[ch][rate][enc] = good_enc(my_encodings[enc]) ? 1 : 0; + + return MPG123_OK; +} + +int attribute_align_arg mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings) +{ + int r; + if(mh == NULL) return MPG123_ERR; + r = mpg123_fmt(&mh->p, rate, channels, encodings); + if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; } + + return r; +} + +int attribute_align_arg mpg123_fmt(mpg123_pars *mp, long rate, int channels, int encodings) +{ + int ie, ic, ratei; + int ch[2] = {0, 1}; + if(mp == NULL) return MPG123_BAD_PARS; + if(!(channels & (MPG123_MONO|MPG123_STEREO))) return MPG123_BAD_CHANNEL; + + if(PVERB(mp,3)) fprintf(stderr, "Note: Want to enable format %li/%i for encodings 0x%x.\n", rate, channels, encodings); + + if(!(channels & MPG123_STEREO)) ch[1] = 0; /* {0,0} */ + else if(!(channels & MPG123_MONO)) ch[0] = 1; /* {1,1} */ + ratei = rate2num(mp, rate); + if(ratei < 0) return MPG123_BAD_RATE; + + /* now match the encodings */ + for(ic = 0; ic < 2; ++ic) + { + for(ie = 0; ie < MPG123_ENCODINGS; ++ie) + if(good_enc(my_encodings[ie]) && ((my_encodings[ie] & encodings) == my_encodings[ie])) + mp->audio_caps[ch[ic]][ratei][ie] = 1; + + if(ch[0] == ch[1]) break; /* no need to do it again */ + } + + return MPG123_OK; +} + +int attribute_align_arg mpg123_format_support(mpg123_handle *mh, long rate, int encoding) +{ + if(mh == NULL) return 0; + else return mpg123_fmt_support(&mh->p, rate, encoding); +} + +int attribute_align_arg mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding) +{ + int ch = 0; + int ratei, enci; + ratei = rate2num(mp, rate); + enci = enc2num(encoding); + if(mp == NULL || ratei < 0 || enci < 0) return 0; + if(mp->audio_caps[0][ratei][enci]) ch |= MPG123_MONO; + if(mp->audio_caps[1][ratei][enci]) ch |= MPG123_STEREO; + return ch; +} + +/* Call this one to ensure that any valid format will be something different than this. */ +void invalidate_format(struct audioformat *af) +{ + af->encoding = 0; + af->rate = 0; + af->channels = 0; +} + +/* Consider 24bit output needing 32bit output as temporary storage. */ +off_t samples_to_storage(mpg123_handle *fr, off_t s) +{ + if(fr->af.encoding & MPG123_ENC_24) + return s*4*fr->af.channels; /* 4 bytes per sample */ + else + return samples_to_bytes(fr, s); +} + +/* take into account: channels, bytes per sample -- NOT resampling!*/ +off_t samples_to_bytes(mpg123_handle *fr , off_t s) +{ + return s * fr->af.encsize * fr->af.channels; +} + +off_t bytes_to_samples(mpg123_handle *fr , off_t b) +{ + return b / fr->af.encsize / fr->af.channels; +} + + +#ifndef NO_32BIT +/* Remove every fourth byte, facilitating conversion from 32 bit to 24 bit integers. + This has to be aware of endianness, of course. */ +static void chop_fourth_byte(struct outbuffer *buf) +{ + unsigned char *wpos = buf->data; + unsigned char *rpos = buf->data; +#ifdef WORDS_BIGENDIAN + while((size_t) (rpos - buf->data + 4) <= buf->fill) + { + /* Really stupid: Copy, increment. Byte per byte. */ + *wpos = *rpos; + wpos++; rpos++; + *wpos = *rpos; + wpos++; rpos++; + *wpos = *rpos; + wpos++; rpos++; + rpos++; /* Skip the lowest byte (last). */ + } +#else + while((size_t) (rpos - buf->data + 4) <= buf->fill) + { + /* Really stupid: Copy, increment. Byte per byte. */ + rpos++; /* Skip the lowest byte (first). */ + *wpos = *rpos; + wpos++; rpos++; + *wpos = *rpos; + wpos++; rpos++; + *wpos = *rpos; + wpos++; rpos++; + } +#endif + buf->fill = wpos-buf->data; +} +#endif + +void postprocess_buffer(mpg123_handle *fr) +{ + /* Handle unsigned output formats via reshifting after decode here. + Also handle conversion to 24 bit. */ +#ifndef NO_32BIT + if(fr->af.encoding == MPG123_ENC_UNSIGNED_32 || fr->af.encoding == MPG123_ENC_UNSIGNED_24) + { /* 32bit signed -> unsigned */ + size_t i; + int32_t *ssamples; + uint32_t *usamples; + ssamples = (int32_t*)fr->buffer.data; + usamples = (uint32_t*)fr->buffer.data; + debug("converting output to unsigned 32 bit integer"); + for(i=0; ibuffer.fill/sizeof(int32_t); ++i) + { + /* Different strategy since we don't have a larger type at hand. + Also watch out for silly +-1 fun because integer constants are signed in C90! */ + if(ssamples[i] >= 0) + usamples[i] = (uint32_t)ssamples[i] + 2147483647+1; + /* The smalles value goes zero. */ + else if(ssamples[i] == ((int32_t)-2147483647-1)) + usamples[i] = 0; + /* Now -value is in the positive range of signed int ... so it's a possible value at all. */ + else + usamples[i] = (uint32_t)2147483647+1 - (uint32_t)(-ssamples[i]); + } + /* Dumb brute force: A second pass for hacking off the last byte. */ + if(fr->af.encoding == MPG123_ENC_UNSIGNED_24) + chop_fourth_byte(&fr->buffer); + } + else if(fr->af.encoding == MPG123_ENC_SIGNED_24) + { + /* We got 32 bit signed ... chop off for 24 bit signed. */ + chop_fourth_byte(&fr->buffer); + } +#endif +#ifndef NO_16BIT + if(fr->af.encoding == MPG123_ENC_UNSIGNED_16) + { + size_t i; + short *ssamples; + unsigned short *usamples; + ssamples = (short*)fr->buffer.data; + usamples = (unsigned short*)fr->buffer.data; + debug("converting output to unsigned 16 bit integer"); + for(i=0; ibuffer.fill/sizeof(short); ++i) + { + long tmp = (long)ssamples[i]+32768; + usamples[i] = (unsigned short)tmp; + } + } +#endif +} diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/frame.c b/node_modules/lame/deps/mpg123/src/libmpg123/frame.c new file mode 100644 index 0000000..f18b781 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/frame.c @@ -0,0 +1,1046 @@ +/* + frame: Heap of routines dealing with the core mpg123 data structure. + + copyright 2008-2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "mpg123lib_intern.h" +#include "getcpuflags.h" +#include "debug.h" + +static void frame_fixed_reset(mpg123_handle *fr); + +/* that's doubled in decode_ntom.c */ +#define NTOM_MUL (32768) + +#define aligned_pointer(p, type, alignment) align_the_pointer(p, alignment) +static void *align_the_pointer(void *base, unsigned int alignment) +{ + /* + Work in unsigned integer realm, explicitly. + Tricking the compiler into integer operations like % by invoking base-NULL is dangerous: It results into ptrdiff_t, which gets negative on big addresses. Big screw up, that. + I try to do it "properly" here: Casting only to uintptr_t and no artihmethic with void*. + */ + uintptr_t baseval = (uintptr_t)(char*)base; + uintptr_t aoff = baseval % alignment; + + debug3("align_the_pointer: pointer %p is off by %u from %u", + base, (unsigned int)aoff, alignment); + + if(aoff) return (char*)base+alignment-aoff; + else return base; +} + +static void frame_default_pars(mpg123_pars *mp) +{ + mp->outscale = 1.0; + mp->flags = 0; +#ifdef GAPLESS + mp->flags |= MPG123_GAPLESS; +#endif + mp->flags |= MPG123_AUTO_RESAMPLE; +#ifndef NO_NTOM + mp->force_rate = 0; +#endif + mp->down_sample = 0; + mp->rva = 0; + mp->halfspeed = 0; + mp->doublespeed = 0; + mp->verbose = 0; +#ifndef NO_ICY + mp->icy_interval = 0; +#endif + mp->timeout = 0; + mp->resync_limit = 1024; +#ifdef FRAME_INDEX + mp->index_size = INDEX_SIZE; +#endif + mp->preframes = 4; /* That's good for layer 3 ISO compliance bitstream. */ + mpg123_fmt_all(mp); + /* Default of keeping some 4K buffers at hand, should cover the "usual" use case (using 16K pipe buffers as role model). */ +#ifndef NO_FEEDER + mp->feedpool = 5; + mp->feedbuffer = 4096; +#endif +} + +void frame_init(mpg123_handle *fr) +{ + frame_init_par(fr, NULL); +} + +void frame_init_par(mpg123_handle *fr, mpg123_pars *mp) +{ + fr->own_buffer = TRUE; + fr->buffer.data = NULL; + fr->buffer.rdata = NULL; + fr->buffer.fill = 0; + fr->buffer.size = 0; + fr->rawbuffs = NULL; + fr->rawbuffss = 0; + fr->rawdecwin = NULL; + fr->rawdecwins = 0; +#ifndef NO_8BIT + fr->conv16to8_buf = NULL; +#endif +#ifdef OPT_DITHER + fr->dithernoise = NULL; +#endif + fr->layerscratch = NULL; + fr->xing_toc = NULL; + fr->cpu_opts.type = defdec(); + fr->cpu_opts.class = decclass(fr->cpu_opts.type); +#ifndef NO_NTOM + /* these two look unnecessary, check guarantee for synth_ntom_set_step (in control_generic, even)! */ + fr->ntom_val[0] = NTOM_MUL>>1; + fr->ntom_val[1] = NTOM_MUL>>1; + fr->ntom_step = NTOM_MUL; +#endif + /* unnecessary: fr->buffer.size = fr->buffer.fill = 0; */ + mpg123_reset_eq(fr); + init_icy(&fr->icy); + init_id3(fr); + /* frame_outbuffer is missing... */ + /* frame_buffers is missing... that one needs cpu opt setting! */ + /* after these... frame_reset is needed before starting full decode */ + invalidate_format(&fr->af); + fr->rdat.r_read = NULL; + fr->rdat.r_lseek = NULL; + fr->rdat.iohandle = NULL; + fr->rdat.r_read_handle = NULL; + fr->rdat.r_lseek_handle = NULL; + fr->rdat.cleanup_handle = NULL; + fr->wrapperdata = NULL; + fr->wrapperclean = NULL; + fr->decoder_change = 1; + fr->err = MPG123_OK; + if(mp == NULL) frame_default_pars(&fr->p); + else memcpy(&fr->p, mp, sizeof(struct mpg123_pars_struct)); + +#ifndef NO_FEEDER + bc_prepare(&fr->rdat.buffer, fr->p.feedpool, fr->p.feedbuffer); +#endif + + fr->down_sample = 0; /* Initialize to silence harmless errors when debugging. */ + frame_fixed_reset(fr); /* Reset only the fixed data, dynamic buffers are not there yet! */ + fr->synth = NULL; + fr->synth_mono = NULL; + fr->make_decode_tables = NULL; +#ifdef FRAME_INDEX + fi_init(&fr->index); + frame_index_setup(fr); /* Apply the size setting. */ +#endif +} + +#ifdef OPT_DITHER +/* Also, only allocate the memory for the table on demand. + In future, one could create special noise for different sampling frequencies(?). */ +int frame_dither_init(mpg123_handle *fr) +{ + /* run-time dither noise table generation */ + if(fr->dithernoise == NULL) + { + fr->dithernoise = malloc(sizeof(float)*DITHERSIZE); + if(fr->dithernoise == NULL) return 0; + + dither_table_init(fr->dithernoise); + } + return 1; +} +#endif + +mpg123_pars attribute_align_arg *mpg123_new_pars(int *error) +{ + mpg123_pars *mp = malloc(sizeof(struct mpg123_pars_struct)); + if(mp != NULL){ frame_default_pars(mp); if(error != NULL) *error = MPG123_OK; } + else if(error != NULL) *error = MPG123_OUT_OF_MEM; + return mp; +} + +void attribute_align_arg mpg123_delete_pars(mpg123_pars* mp) +{ + if(mp != NULL) free(mp); +} + +int attribute_align_arg mpg123_reset_eq(mpg123_handle *mh) +{ + int i; + mh->have_eq_settings = 0; + for(i=0; i < 32; ++i) mh->equalizer[0][i] = mh->equalizer[1][i] = DOUBLE_TO_REAL(1.0); + + return MPG123_OK; +} + +int frame_outbuffer(mpg123_handle *fr) +{ + size_t size = fr->outblock; + if(!fr->own_buffer) + { + if(fr->buffer.size < size) + { + fr->err = MPG123_BAD_BUFFER; + if(NOQUIET) error2("have external buffer of size %"SIZE_P", need %"SIZE_P, (size_p)fr->buffer.size, size); + + return MPG123_ERR; + } + } + + debug1("need frame buffer of %"SIZE_P, (size_p)size); + if(fr->buffer.rdata != NULL && fr->buffer.size != size) + { + free(fr->buffer.rdata); + fr->buffer.rdata = NULL; + } + fr->buffer.size = size; + fr->buffer.data = NULL; + /* be generous: use 16 byte alignment */ + if(fr->buffer.rdata == NULL) fr->buffer.rdata = (unsigned char*) malloc(fr->buffer.size+15); + if(fr->buffer.rdata == NULL) + { + fr->err = MPG123_OUT_OF_MEM; + return MPG123_ERR; + } + fr->buffer.data = aligned_pointer(fr->buffer.rdata, unsigned char*, 16); + fr->own_buffer = TRUE; + fr->buffer.fill = 0; + return MPG123_OK; +} + +int attribute_align_arg mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size) +{ + debug2("replace buffer with %p size %"SIZE_P, data, (size_p)size); + /* Will accept any size, the error comes later... */ + if(data == NULL) + { + mh->err = MPG123_BAD_BUFFER; + return MPG123_ERR; + } + if(mh->buffer.rdata != NULL) free(mh->buffer.rdata); + mh->own_buffer = FALSE; + mh->buffer.rdata = NULL; + mh->buffer.data = data; + mh->buffer.size = size; + mh->buffer.fill = 0; + return MPG123_OK; +} + +#ifdef FRAME_INDEX +int frame_index_setup(mpg123_handle *fr) +{ + int ret = MPG123_ERR; + if(fr->p.index_size >= 0) + { /* Simple fixed index. */ + fr->index.grow_size = 0; + debug1("resizing index to %li", fr->p.index_size); + ret = fi_resize(&fr->index, (size_t)fr->p.index_size); + debug2("index resized... %lu at %p", (unsigned long)fr->index.size, (void*)fr->index.data); + } + else + { /* A growing index. We give it a start, though. */ + fr->index.grow_size = (size_t)(- fr->p.index_size); + if(fr->index.size < fr->index.grow_size) + ret = fi_resize(&fr->index, fr->index.grow_size); + else + ret = MPG123_OK; /* We have minimal size already... and since growing is OK... */ + } + debug2("set up frame index of size %lu (ret=%i)", (unsigned long)fr->index.size, ret); + + return ret; +} +#endif + +static void frame_decode_buffers_reset(mpg123_handle *fr) +{ + memset(fr->rawbuffs, 0, fr->rawbuffss); +} + +int frame_buffers(mpg123_handle *fr) +{ + int buffssize = 0; + debug1("frame %p buffer", (void*)fr); +/* + the used-to-be-static buffer of the synth functions, has some subtly different types/sizes + + 2to1, 4to1, ntom, generic, i386: real[2][2][0x110] + mmx, sse: short[2][2][0x110] + i586(_dither): 4352 bytes; int/long[2][2][0x110] + i486: int[2][2][17*FIR_BUFFER_SIZE] + altivec: static real __attribute__ ((aligned (16))) buffs[4][4][0x110] + + Huh, altivec looks like fun. Well, let it be large... then, the 16 byte alignment seems to be implicit on MacOSX malloc anyway. + Let's make a reasonable attempt to allocate enough memory... + Keep in mind: biggest ones are i486 and altivec (mutually exclusive!), then follows i586 and normal real. + mmx/sse use short but also real for resampling. + Thus, minimum is 2*2*0x110*sizeof(real). +*/ + if(fr->cpu_opts.type == altivec) buffssize = 4*4*0x110*sizeof(real); +#ifdef OPT_I486 + else if(fr->cpu_opts.type == ivier) buffssize = 2*2*17*FIR_BUFFER_SIZE*sizeof(int); +#endif + else if(fr->cpu_opts.type == ifuenf || fr->cpu_opts.type == ifuenf_dither || fr->cpu_opts.type == dreidnow) + buffssize = 2*2*0x110*4; /* don't rely on type real, we need 4352 bytes */ + + if(2*2*0x110*sizeof(real) > buffssize) + buffssize = 2*2*0x110*sizeof(real); + buffssize += 15; /* For 16-byte alignment (SSE likes that). */ + + if(fr->rawbuffs != NULL && fr->rawbuffss != buffssize) + { + free(fr->rawbuffs); + fr->rawbuffs = NULL; + } + + if(fr->rawbuffs == NULL) fr->rawbuffs = (unsigned char*) malloc(buffssize); + if(fr->rawbuffs == NULL) return -1; + fr->rawbuffss = buffssize; + fr->short_buffs[0][0] = aligned_pointer(fr->rawbuffs,short,16); + fr->short_buffs[0][1] = fr->short_buffs[0][0] + 0x110; + fr->short_buffs[1][0] = fr->short_buffs[0][1] + 0x110; + fr->short_buffs[1][1] = fr->short_buffs[1][0] + 0x110; + fr->real_buffs[0][0] = aligned_pointer(fr->rawbuffs,real,16); + fr->real_buffs[0][1] = fr->real_buffs[0][0] + 0x110; + fr->real_buffs[1][0] = fr->real_buffs[0][1] + 0x110; + fr->real_buffs[1][1] = fr->real_buffs[1][0] + 0x110; +#ifdef OPT_I486 + if(fr->cpu_opts.type == ivier) + { + fr->int_buffs[0][0] = (int*) fr->rawbuffs; + fr->int_buffs[0][1] = fr->int_buffs[0][0] + 17*FIR_BUFFER_SIZE; + fr->int_buffs[1][0] = fr->int_buffs[0][1] + 17*FIR_BUFFER_SIZE; + fr->int_buffs[1][1] = fr->int_buffs[1][0] + 17*FIR_BUFFER_SIZE; + } +#endif +#ifdef OPT_ALTIVEC + if(fr->cpu_opts.type == altivec) + { + int i,j; + fr->areal_buffs[0][0] = (real*) fr->rawbuffs; + for(i=0; i<4; ++i) for(j=0; j<4; ++j) + fr->areal_buffs[i][j] = fr->areal_buffs[0][0] + (i*4+j)*0x110; + } +#endif + /* now the different decwins... all of the same size, actually */ + /* The MMX ones want 32byte alignment, which I'll try to ensure manually */ + { + int decwin_size = (512+32)*sizeof(real); +#ifdef OPT_MMXORSSE +#ifdef OPT_MULTI + if(fr->cpu_opts.class == mmxsse) + { +#endif + /* decwin_mmx will share, decwins will be appended ... sizeof(float)==4 */ + if(decwin_size < (512+32)*4) decwin_size = (512+32)*4; + + /* the second window + alignment zone -- we align for 32 bytes for SSE as + requirement, 64 byte for matching cache line size (that matters!) */ + decwin_size += (512+32)*4 + 63; + /* (512+32)*4/32 == 2176/32 == 68, so one decwin block retains alignment for 32 or 64 bytes */ +#ifdef OPT_MULTI + } +#endif +#endif +#if defined(OPT_ALTIVEC) || defined(OPT_ARM) + /* sizeof(real) >= 4 ... yes, it could be 8, for example. + We got it intialized to at least (512+32)*sizeof(real).*/ + decwin_size += 512*sizeof(real); +#endif + /* Hm, that's basically realloc() ... */ + if(fr->rawdecwin != NULL && fr->rawdecwins != decwin_size) + { + free(fr->rawdecwin); + fr->rawdecwin = NULL; + } + + if(fr->rawdecwin == NULL) + fr->rawdecwin = (unsigned char*) malloc(decwin_size); + + if(fr->rawdecwin == NULL) return -1; + + fr->rawdecwins = decwin_size; + fr->decwin = (real*) fr->rawdecwin; +#ifdef OPT_MMXORSSE +#ifdef OPT_MULTI + if(fr->cpu_opts.class == mmxsse) + { +#endif + /* align decwin, assign that to decwin_mmx, append decwins */ + /* I need to add to decwin what is missing to the next full 64 byte -- also I want to make gcc -pedantic happy... */ + fr->decwin = aligned_pointer(fr->rawdecwin,real,64); + debug1("aligned decwin: %p", (void*)fr->decwin); + fr->decwin_mmx = (float*)fr->decwin; + fr->decwins = fr->decwin_mmx+512+32; +#ifdef OPT_MULTI + } + else debug("no decwins/decwin_mmx for that class"); +#endif +#endif + } + + /* Layer scratch buffers are of compile-time fixed size, so allocate only once. */ + if(fr->layerscratch == NULL) + { + /* Allocate specific layer1/2/3 buffers, so that we know they'll work for SSE. */ + size_t scratchsize = 0; + real *scratcher; +#ifndef NO_LAYER1 + scratchsize += sizeof(real) * 2 * SBLIMIT; +#endif +#ifndef NO_LAYER2 + scratchsize += sizeof(real) * 2 * 4 * SBLIMIT; +#endif +#ifndef NO_LAYER3 + scratchsize += sizeof(real) * 2 * SBLIMIT * SSLIMIT; /* hybrid_in */ + scratchsize += sizeof(real) * 2 * SSLIMIT * SBLIMIT; /* hybrid_out */ +#endif + /* + Now figure out correct alignment: + We need 16 byte minimum, smallest unit of the blocks is 2*SBLIMIT*sizeof(real), which is 64*4=256. Let's do 64bytes as heuristic for cache line (as proven useful in buffs above). + */ + fr->layerscratch = malloc(scratchsize+63); + if(fr->layerscratch == NULL) return -1; + + /* Get aligned part of the memory, then divide it up. */ + scratcher = aligned_pointer(fr->layerscratch,real,64); + /* Those funky pointer casts silence compilers... + One might change the code at hand to really just use 1D arrays, but in practice, that would not make a (positive) difference. */ +#ifndef NO_LAYER1 + fr->layer1.fraction = (real(*)[SBLIMIT])scratcher; + scratcher += 2 * SBLIMIT; +#endif +#ifndef NO_LAYER2 + fr->layer2.fraction = (real(*)[4][SBLIMIT])scratcher; + scratcher += 2 * 4 * SBLIMIT; +#endif +#ifndef NO_LAYER3 + fr->layer3.hybrid_in = (real(*)[SBLIMIT][SSLIMIT])scratcher; + scratcher += 2 * SBLIMIT * SSLIMIT; + fr->layer3.hybrid_out = (real(*)[SSLIMIT][SBLIMIT])scratcher; + scratcher += 2 * SSLIMIT * SBLIMIT; +#endif + /* Note: These buffers don't need resetting here. */ + } + + /* Only reset the buffers we created just now. */ + frame_decode_buffers_reset(fr); + + debug1("frame %p buffer done", (void*)fr); + return 0; +} + +int frame_buffers_reset(mpg123_handle *fr) +{ + fr->buffer.fill = 0; /* hm, reset buffer fill... did we do a flush? */ + fr->bsnum = 0; + /* Wondering: could it be actually _wanted_ to retain buffer contents over different files? (special gapless / cut stuff) */ + fr->bsbuf = fr->bsspace[1]; + fr->bsbufold = fr->bsbuf; + fr->bitreservoir = 0; + frame_decode_buffers_reset(fr); + memset(fr->bsspace, 0, 2*(MAXFRAMESIZE+512)); + memset(fr->ssave, 0, 34); + fr->hybrid_blc[0] = fr->hybrid_blc[1] = 0; + memset(fr->hybrid_block, 0, sizeof(real)*2*2*SBLIMIT*SSLIMIT); + return 0; +} + +static void frame_icy_reset(mpg123_handle* fr) +{ +#ifndef NO_ICY + if(fr->icy.data != NULL) free(fr->icy.data); + fr->icy.data = NULL; + fr->icy.interval = 0; + fr->icy.next = 0; +#endif +} + +static void frame_free_toc(mpg123_handle *fr) +{ + if(fr->xing_toc != NULL){ free(fr->xing_toc); fr->xing_toc = NULL; } +} + +/* Just copy the Xing TOC over... */ +int frame_fill_toc(mpg123_handle *fr, unsigned char* in) +{ + if(fr->xing_toc == NULL) fr->xing_toc = malloc(100); + if(fr->xing_toc != NULL) + { + memcpy(fr->xing_toc, in, 100); +#ifdef DEBUG + debug("Got a TOC! Showing the values..."); + { + int i; + for(i=0; i<100; ++i) + debug2("entry %i = %i", i, fr->xing_toc[i]); + } +#endif + return TRUE; + } + return FALSE; +} + +/* Prepare the handle for a new track. + Reset variables, buffers... */ +int frame_reset(mpg123_handle* fr) +{ + frame_buffers_reset(fr); + frame_fixed_reset(fr); + frame_free_toc(fr); +#ifdef FRAME_INDEX + fi_reset(&fr->index); +#endif + + return 0; +} + +/* Reset everythign except dynamic memory. */ +static void frame_fixed_reset(mpg123_handle *fr) +{ + frame_icy_reset(fr); + open_bad(fr); + fr->to_decode = FALSE; + fr->to_ignore = FALSE; + fr->metaflags = 0; + fr->outblock = 0; /* This will be set before decoding! */ + fr->num = -1; + fr->input_offset = -1; + fr->playnum = -1; + fr->state_flags = FRAME_ACCURATE; + fr->silent_resync = 0; + fr->audio_start = 0; + fr->clip = 0; + fr->oldhead = 0; + fr->firsthead = 0; + fr->vbr = MPG123_CBR; + fr->abr_rate = 0; + fr->track_frames = 0; + fr->track_samples = -1; + fr->framesize=0; + fr->mean_frames = 0; + fr->mean_framesize = 0; + fr->freesize = 0; + fr->lastscale = -1; + fr->rva.level[0] = -1; + fr->rva.level[1] = -1; + fr->rva.gain[0] = 0; + fr->rva.gain[1] = 0; + fr->rva.peak[0] = 0; + fr->rva.peak[1] = 0; + fr->fsizeold = 0; + fr->firstframe = 0; + fr->ignoreframe = fr->firstframe-fr->p.preframes; + fr->lastframe = -1; + fr->fresh = 1; + fr->new_format = 0; +#ifdef GAPLESS + frame_gapless_init(fr,-1,0,0); + fr->lastoff = 0; + fr->firstoff = 0; +#endif +#ifdef OPT_I486 + fr->i486bo[0] = fr->i486bo[1] = FIR_SIZE-1; +#endif + fr->bo = 1; /* the usual bo */ +#ifdef OPT_DITHER + fr->ditherindex = 0; +#endif + reset_id3(fr); + reset_icy(&fr->icy); + /* ICY stuff should go into icy.c, eh? */ +#ifndef NO_ICY + fr->icy.interval = 0; + fr->icy.next = 0; +#endif + fr->halfphase = 0; /* here or indeed only on first-time init? */ + fr->error_protection = 0; + fr->freeformat_framesize = -1; +} + +static void frame_free_buffers(mpg123_handle *fr) +{ + if(fr->rawbuffs != NULL) free(fr->rawbuffs); + fr->rawbuffs = NULL; + fr->rawbuffss = 0; + if(fr->rawdecwin != NULL) free(fr->rawdecwin); + fr->rawdecwin = NULL; + fr->rawdecwins = 0; +#ifndef NO_8BIT + if(fr->conv16to8_buf != NULL) free(fr->conv16to8_buf); + fr->conv16to8_buf = NULL; +#endif + if(fr->layerscratch != NULL) free(fr->layerscratch); +} + +void frame_exit(mpg123_handle *fr) +{ + if(fr->buffer.rdata != NULL) + { + debug1("freeing buffer at %p", (void*)fr->buffer.rdata); + free(fr->buffer.rdata); + } + fr->buffer.rdata = NULL; + frame_free_buffers(fr); + frame_free_toc(fr); +#ifdef FRAME_INDEX + fi_exit(&fr->index); +#endif +#ifdef OPT_DITHER + if(fr->dithernoise != NULL) + { + free(fr->dithernoise); + fr->dithernoise = NULL; + } +#endif + exit_id3(fr); + clear_icy(&fr->icy); + /* Clean up possible mess from LFS wrapper. */ + if(fr->wrapperclean != NULL) + { + fr->wrapperclean(fr->wrapperdata); + fr->wrapperdata = NULL; + } +#ifndef NO_FEEDER + bc_cleanup(&fr->rdat.buffer); +#endif +} + +int attribute_align_arg mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi) +{ + if(mh == NULL) return MPG123_ERR; + if(mi == NULL) + { + mh->err = MPG123_ERR_NULL; + return MPG123_ERR; + } + mi->version = mh->mpeg25 ? MPG123_2_5 : (mh->lsf ? MPG123_2_0 : MPG123_1_0); + mi->layer = mh->lay; + mi->rate = frame_freq(mh); + switch(mh->mode) + { + case 0: mi->mode = MPG123_M_STEREO; break; + case 1: mi->mode = MPG123_M_JOINT; break; + case 2: mi->mode = MPG123_M_DUAL; break; + case 3: mi->mode = MPG123_M_MONO; break; + default: error("That mode cannot be!"); + } + mi->mode_ext = mh->mode_ext; + mi->framesize = mh->framesize+4; /* Include header. */ + mi->flags = 0; + if(mh->error_protection) mi->flags |= MPG123_CRC; + if(mh->copyright) mi->flags |= MPG123_COPYRIGHT; + if(mh->extension) mi->flags |= MPG123_PRIVATE; + if(mh->original) mi->flags |= MPG123_ORIGINAL; + mi->emphasis = mh->emphasis; + mi->bitrate = frame_bitrate(mh); + mi->abr_rate = mh->abr_rate; + mi->vbr = mh->vbr; + return MPG123_OK; +} + +int attribute_align_arg mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes) +{ + if(mh == NULL) return MPG123_ERR; + if(!mh->to_decode) return MPG123_ERR; + + if(header != NULL) *header = mh->oldhead; + if(bodydata != NULL) *bodydata = mh->bsbuf; + if(bodybytes != NULL) *bodybytes = mh->framesize; + + return MPG123_OK; +} + +/* + Fuzzy frame offset searching (guessing). + When we don't have an accurate position, we may use an inaccurate one. + Possibilities: + - use approximate positions from Xing TOC (not yet parsed) + - guess wildly from mean framesize and offset of first frame / beginning of file. +*/ + +static off_t frame_fuzzy_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame) +{ + /* Default is to go to the beginning. */ + off_t ret = fr->audio_start; + *get_frame = 0; + + /* But we try to find something better. */ + /* Xing VBR TOC works with relative positions, both in terms of audio frames and stream bytes. + Thus, it only works when whe know the length of things. + Oh... I assume the offsets are relative to the _total_ file length. */ + if(fr->xing_toc != NULL && fr->track_frames > 0 && fr->rdat.filelen > 0) + { + /* One could round... */ + int toc_entry = (int) ((double)want_frame*100./fr->track_frames); + /* It is an index in the 100-entry table. */ + if(toc_entry < 0) toc_entry = 0; + if(toc_entry > 99) toc_entry = 99; + + /* Now estimate back what frame we get. */ + *get_frame = (off_t) ((double)toc_entry/100. * fr->track_frames); + fr->state_flags &= ~FRAME_ACCURATE; + fr->silent_resync = 1; + /* Question: Is the TOC for whole file size (with/without ID3) or the "real" audio data only? + ID3v1 info could also matter. */ + ret = (off_t) ((double)fr->xing_toc[toc_entry]/256.* fr->rdat.filelen); + } + else if(fr->mean_framesize > 0) + { /* Just guess with mean framesize (may be exact with CBR files). */ + /* Query filelen here or not? */ + fr->state_flags &= ~FRAME_ACCURATE; /* Fuzzy! */ + fr->silent_resync = 1; + *get_frame = want_frame; + ret = (off_t) (fr->audio_start+fr->mean_framesize*want_frame); + } + debug5("fuzzy: want %li of %li, get %li at %li B of %li B", + (long)want_frame, (long)fr->track_frames, (long)*get_frame, (long)ret, (long)(fr->rdat.filelen-fr->audio_start)); + return ret; +} + +/* + find the best frame in index just before the wanted one, seek to there + then step to just before wanted one with read_frame + do not care tabout the stuff that was in buffer but not played back + everything that left the decoder is counted as played + + Decide if you want low latency reaction and accurate timing info or stable long-time playback with buffer! +*/ + +off_t frame_index_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame) +{ + /* default is file start if no index position */ + off_t gopos = 0; + *get_frame = 0; +#ifdef FRAME_INDEX + /* Possibly use VBRI index, too? I'd need an example for this... */ + if(fr->index.fill) + { + /* find in index */ + size_t fi; + /* at index fi there is frame step*fi... */ + fi = want_frame/fr->index.step; + if(fi >= fr->index.fill) /* If we are beyond the end of frame index...*/ + { + /* When fuzzy seek is allowed, we have some limited tolerance for the frames we want to read rather then jump over. */ + if(fr->p.flags & MPG123_FUZZY && want_frame - (fr->index.fill-1)*fr->index.step > 10) + { + gopos = frame_fuzzy_find(fr, want_frame, get_frame); + if(gopos > fr->audio_start) return gopos; /* Only in that case, we have a useful guess. */ + /* Else... just continue, fuzzyness didn't help. */ + } + /* Use the last available position, slowly advancing from that one. */ + fi = fr->index.fill - 1; + } + /* We have index position, that yields frame and byte offsets. */ + *get_frame = fi*fr->index.step; + gopos = fr->index.data[fi]; + fr->state_flags |= FRAME_ACCURATE; /* When using the frame index, we are accurate. */ + } + else + { +#endif + if(fr->p.flags & MPG123_FUZZY) + return frame_fuzzy_find(fr, want_frame, get_frame); + /* A bit hackish here... but we need to be fresh when looking for the first header again. */ + fr->firsthead = 0; + fr->oldhead = 0; +#ifdef FRAME_INDEX + } +#endif + debug2("index: 0x%lx for frame %li", (unsigned long)gopos, (long) *get_frame); + return gopos; +} + +off_t frame_ins2outs(mpg123_handle *fr, off_t ins) +{ + off_t outs = 0; + switch(fr->down_sample) + { + case 0: +# ifndef NO_DOWNSAMPLE + case 1: + case 2: +# endif + outs = ins>>fr->down_sample; + break; +# ifndef NO_NTOM + case 3: outs = ntom_ins2outs(fr, ins); break; +# endif + default: error1("Bad down_sample (%i) ... should not be possible!!", fr->down_sample); + } + return outs; +} + +off_t frame_outs(mpg123_handle *fr, off_t num) +{ + off_t outs = 0; + switch(fr->down_sample) + { + case 0: +# ifndef NO_DOWNSAMPLE + case 1: + case 2: +# endif + outs = (spf(fr)>>fr->down_sample)*num; + break; +#ifndef NO_NTOM + case 3: outs = ntom_frmouts(fr, num); break; +#endif + default: error1("Bad down_sample (%i) ... should not be possible!!", fr->down_sample); + } + return outs; +} + +/* Compute the number of output samples we expect from this frame. + This is either simple spf() or a tad more elaborate for ntom. */ +off_t frame_expect_outsamples(mpg123_handle *fr) +{ + off_t outs = 0; + switch(fr->down_sample) + { + case 0: +# ifndef NO_DOWNSAMPLE + case 1: + case 2: +# endif + outs = spf(fr)>>fr->down_sample; + break; +#ifndef NO_NTOM + case 3: outs = ntom_frame_outsamples(fr); break; +#endif + default: error1("Bad down_sample (%i) ... should not be possible!!", fr->down_sample); + } + return outs; +} + +off_t frame_offset(mpg123_handle *fr, off_t outs) +{ + off_t num = 0; + switch(fr->down_sample) + { + case 0: +# ifndef NO_DOWNSAMPLE + case 1: + case 2: +# endif + num = outs/(spf(fr)>>fr->down_sample); + break; +#ifndef NO_NTOM + case 3: num = ntom_frameoff(fr, outs); break; +#endif + default: error("Bad down_sample ... should not be possible!!"); + } + return num; +} + +#ifdef GAPLESS +/* input in _input_ samples */ +void frame_gapless_init(mpg123_handle *fr, off_t framecount, off_t bskip, off_t eskip) +{ + debug3("frame_gaples_init: given %"OFF_P" frames, skip %"OFF_P" and %"OFF_P, (off_p)framecount, (off_p)bskip, (off_p)eskip); + fr->gapless_frames = framecount; + if(fr->gapless_frames > 0) + { + fr->begin_s = bskip+GAPLESS_DELAY; + fr->end_s = framecount*spf(fr)-eskip+GAPLESS_DELAY; + } + else fr->begin_s = fr->end_s = 0; + /* These will get proper values later, from above plus resampling info. */ + fr->begin_os = 0; + fr->end_os = 0; + fr->fullend_os = 0; + debug2("frame_gapless_init: from %"OFF_P" to %"OFF_P" samples", (off_p)fr->begin_s, (off_p)fr->end_s); +} + +void frame_gapless_realinit(mpg123_handle *fr) +{ + fr->begin_os = frame_ins2outs(fr, fr->begin_s); + fr->end_os = frame_ins2outs(fr, fr->end_s); + fr->fullend_os = frame_ins2outs(fr, fr->gapless_frames*spf(fr)); + debug2("frame_gapless_realinit: from %"OFF_P" to %"OFF_P" samples", (off_p)fr->begin_os, (off_p)fr->end_os); +} + +/* At least note when there is trouble... */ +void frame_gapless_update(mpg123_handle *fr, off_t total_samples) +{ + off_t gapless_samples = fr->gapless_frames*spf(fr); + debug2("gapless update with new sample count %"OFF_P" as opposed to known %"OFF_P, total_samples, gapless_samples); + if(NOQUIET && total_samples != gapless_samples) + fprintf(stderr, "\nWarning: Real sample count differs from given gapless sample count. Frankenstein stream?\n"); + + if(gapless_samples > total_samples) + { + if(NOQUIET) error2("End sample count smaller than gapless end! (%"OFF_P" < %"OFF_P"). Disabling gapless mode from now on.", (off_p)total_samples, (off_p)fr->end_s); + /* This invalidates the current position... but what should I do? */ + frame_gapless_init(fr, -1, 0, 0); + frame_gapless_realinit(fr); + fr->lastframe = -1; + fr->lastoff = 0; + } +} + +#endif + +/* Compute the needed frame to ignore from, for getting accurate/consistent output for intended firstframe. */ +static off_t ignoreframe(mpg123_handle *fr) +{ + off_t preshift = fr->p.preframes; + /* Layer 3 _really_ needs at least one frame before. */ + if(fr->lay==3 && preshift < 1) preshift = 1; + /* Layer 1 & 2 reall do not need more than 2. */ + if(fr->lay!=3 && preshift > 2) preshift = 2; + + return fr->firstframe - preshift; +} + +/* The frame seek... This is not simply the seek to fe*spf(fr) samples in output because we think of _input_ frames here. + Seek to frame offset 1 may be just seek to 200 samples offset in output since the beginning of first frame is delay/padding. + Hm, is that right? OK for the padding stuff, but actually, should the decoder delay be better totally hidden or not? + With gapless, even the whole frame position could be advanced further than requested (since Homey don't play dat). */ +void frame_set_frameseek(mpg123_handle *fr, off_t fe) +{ + fr->firstframe = fe; +#ifdef GAPLESS + if(fr->p.flags & MPG123_GAPLESS && fr->gapless_frames > 0) + { + /* Take care of the beginning... */ + off_t beg_f = frame_offset(fr, fr->begin_os); + if(fe <= beg_f) + { + fr->firstframe = beg_f; + fr->firstoff = fr->begin_os - frame_outs(fr, beg_f); + } + else fr->firstoff = 0; + /* The end is set once for a track at least, on the frame_set_frameseek called in get_next_frame() */ + if(fr->end_os > 0) + { + fr->lastframe = frame_offset(fr,fr->end_os); + fr->lastoff = fr->end_os - frame_outs(fr, fr->lastframe); + } else {fr->lastframe = -1; fr->lastoff = 0; } + } else { fr->firstoff = fr->lastoff = 0; fr->lastframe = -1; } +#endif + fr->ignoreframe = ignoreframe(fr); +#ifdef GAPLESS + debug5("frame_set_frameseek: begin at %li frames and %li samples, end at %li and %li; ignore from %li", + (long) fr->firstframe, (long) fr->firstoff, + (long) fr->lastframe, (long) fr->lastoff, (long) fr->ignoreframe); +#else + debug3("frame_set_frameseek: begin at %li frames, end at %li; ignore from %li", + (long) fr->firstframe, (long) fr->lastframe, (long) fr->ignoreframe); +#endif +} + +void frame_skip(mpg123_handle *fr) +{ +#ifndef NO_LAYER3 + if(fr->lay == 3) set_pointer(fr, 512); +#endif +} + +/* Sample accurate seek prepare for decoder. */ +/* This gets unadjusted output samples and takes resampling into account */ +void frame_set_seek(mpg123_handle *fr, off_t sp) +{ + fr->firstframe = frame_offset(fr, sp); + debug1("frame_set_seek: from %"OFF_P, fr->num); +#ifndef NO_NTOM + if(fr->down_sample == 3) ntom_set_ntom(fr, fr->firstframe); +#endif + fr->ignoreframe = ignoreframe(fr); +#ifdef GAPLESS /* The sample offset is used for non-gapless mode, too! */ + fr->firstoff = sp - frame_outs(fr, fr->firstframe); + debug5("frame_set_seek: begin at %li frames and %li samples, end at %li and %li; ignore from %li", + (long) fr->firstframe, (long) fr->firstoff, + (long) fr->lastframe, (long) fr->lastoff, (long) fr->ignoreframe); +#else + debug3("frame_set_seek: begin at %li frames, end at %li; ignore from %li", + (long) fr->firstframe, (long) fr->lastframe, (long) fr->ignoreframe); +#endif +} + +int attribute_align_arg mpg123_volume_change(mpg123_handle *mh, double change) +{ + if(mh == NULL) return MPG123_ERR; + return mpg123_volume(mh, change + (double) mh->p.outscale); +} + +int attribute_align_arg mpg123_volume(mpg123_handle *mh, double vol) +{ + if(mh == NULL) return MPG123_ERR; + + if(vol >= 0) mh->p.outscale = vol; + else mh->p.outscale = 0.; + + do_rva(mh); + return MPG123_OK; +} + +static int get_rva(mpg123_handle *fr, double *peak, double *gain) +{ + double p = -1; + double g = 0; + int ret = 0; + if(fr->p.rva) + { + int rt = 0; + /* Should one assume a zero RVA as no RVA? */ + if(fr->p.rva == 2 && fr->rva.level[1] != -1) rt = 1; + if(fr->rva.level[rt] != -1) + { + p = fr->rva.peak[rt]; + g = fr->rva.gain[rt]; + ret = 1; /* Success. */ + } + } + if(peak != NULL) *peak = p; + if(gain != NULL) *gain = g; + return ret; +} + +/* adjust the volume, taking both fr->outscale and rva values into account */ +void do_rva(mpg123_handle *fr) +{ + double peak = 0; + double gain = 0; + double newscale; + double rvafact = 1; + if(get_rva(fr, &peak, &gain)) + { + if(NOQUIET && fr->p.verbose > 1) fprintf(stderr, "Note: doing RVA with gain %f\n", gain); + rvafact = pow(10,gain/20); + } + + newscale = fr->p.outscale*rvafact; + + /* if peak is unknown (== 0) this check won't hurt */ + if((peak*newscale) > 1.0) + { + newscale = 1.0/peak; + warning2("limiting scale value to %f to prevent clipping with indicated peak factor of %f", newscale, peak); + } + /* first rva setting is forced with fr->lastscale < 0 */ + if(newscale != fr->lastscale || fr->decoder_change) + { + debug3("changing scale value from %f to %f (peak estimated to %f)", fr->lastscale != -1 ? fr->lastscale : fr->p.outscale, newscale, (double) (newscale*peak)); + fr->lastscale = newscale; + /* It may be too early, actually. */ + if(fr->make_decode_tables != NULL) fr->make_decode_tables(fr); /* the actual work */ + } +} + + +int attribute_align_arg mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db) +{ + if(mh == NULL) return MPG123_ERR; + if(base) *base = mh->p.outscale; + if(really) *really = mh->lastscale; + get_rva(mh, NULL, rva_db); + return MPG123_OK; +} + +off_t attribute_align_arg mpg123_framepos(mpg123_handle *mh) +{ + if(mh == NULL) return MPG123_ERR; + + return mh->input_offset; +} diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/frame.h b/node_modules/lame/deps/mpg123/src/libmpg123/frame.h new file mode 100644 index 0000000..26e086e --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/frame.h @@ -0,0 +1,410 @@ +/* + frame: Central data structures and opmitization hooks. + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#ifndef MPG123_FRAME_H +#define MPG123_FRAME_H + +#include +#include "config.h" +#include "mpg123.h" +#include "optimize.h" +#include "id3.h" +#include "icy.h" +#include "reader.h" +#ifdef FRAME_INDEX +#include "index.h" +#endif +#include "synths.h" + +#ifdef OPT_DITHER +#include "dither.h" +int frame_dither_init(mpg123_handle *fr); +#endif + +/* max = 1728 */ +#define MAXFRAMESIZE 3456 + +struct al_table +{ + short bits; + short d; +}; + +/* the output buffer, used to be pcm_sample, pcm_point and audiobufsize */ +struct outbuffer +{ + unsigned char *data; /* main data pointer, aligned */ + unsigned char *p; /* read pointer */ + size_t fill; /* fill from read pointer */ + size_t size; + unsigned char *rdata; /* unaligned base pointer */ +}; + +struct audioformat +{ + int encoding; + int encsize; /* Size of one sample in bytes, plain int should be fine here... */ + int channels; + long rate; +}; + +void invalidate_format(struct audioformat *af); + +struct mpg123_pars_struct +{ + int verbose; /* verbose level */ + long flags; /* combination of above */ +#ifndef NO_NTOM + long force_rate; +#endif + int down_sample; + int rva; /* (which) rva to do: 0: nothing, 1: radio/mix/track 2: album/audiophile */ + long halfspeed; + long doublespeed; + long timeout; +#define NUM_CHANNELS 2 + char audio_caps[NUM_CHANNELS][MPG123_RATES+1][MPG123_ENCODINGS]; +/* long start_frame; */ /* frame offset to begin with */ +/* long frame_number;*/ /* number of frames to decode */ +#ifndef NO_ICY + long icy_interval; +#endif + double outscale; + long resync_limit; + long index_size; /* Long, because: negative values have a meaning. */ + long preframes; +#ifndef NO_FEEDER + long feedpool; + long feedbuffer; +#endif +}; + +enum frame_state_flags +{ + FRAME_ACCURATE = 0x1 /**< 0001 Positions are considered accurate. */ + ,FRAME_FRANKENSTEIN = 0x2 /**< 0010 This stream is concatenated. */ +}; + +/* There is a lot to condense here... many ints can be merged as flags; though the main space is still consumed by buffers. */ +struct mpg123_handle_struct +{ + int fresh; /* to be moved into flags */ + int new_format; + real hybrid_block[2][2][SBLIMIT*SSLIMIT]; + int hybrid_blc[2]; + /* the scratch vars for the decoders, sometimes real, sometimes short... sometimes int/long */ + short *short_buffs[2][2]; + real *real_buffs[2][2]; + unsigned char *rawbuffs; + int rawbuffss; +#ifdef OPT_I486 + int i486bo[2]; +#endif + int bo; /* Just have it always here. */ +#ifdef OPT_DITHER + int ditherindex; + float *dithernoise; +#endif + unsigned char* rawdecwin; /* the block with all decwins */ + int rawdecwins; /* size of rawdecwin memory */ + real *decwin; /* _the_ decode table */ +#ifdef OPT_MMXORSSE + /* I am not really sure that I need both of them... used in assembler */ + float *decwin_mmx; + float *decwins; +#endif + int have_eq_settings; + real equalizer[2][32]; + + /* for halfspeed mode */ + unsigned char ssave[34]; + int halfphase; +#ifndef NO_8BIT + /* a raw buffer and a pointer into the middle for signed short conversion, only allocated on demand */ + unsigned char *conv16to8_buf; + unsigned char *conv16to8; +#endif + /* There's some possible memory saving for stuff that is not _really_ dynamic. */ + + /* layer3 */ + int longLimit[9][23]; + int shortLimit[9][14]; + real gainpow2[256+118+4]; /* not really dynamic, just different for mmx */ + + /* layer2 */ + real muls[27][64]; /* also used by layer 1 */ + +#ifndef NO_NTOM + /* decode_ntom */ + unsigned long ntom_val[2]; + unsigned long ntom_step; +#endif + /* special i486 fun */ +#ifdef OPT_I486 + int *int_buffs[2][2]; +#endif + /* special altivec... */ +#ifdef OPT_ALTIVEC + real *areal_buffs[4][4]; +#endif + struct synth_s synths; + struct + { +#ifdef OPT_MULTI + +#ifndef NO_LAYER3 +#if (defined OPT_3DNOW || defined OPT_3DNOWEXT) + void (*the_dct36)(real *,real *,real *,real *,real *); +#endif +#endif + +#endif + enum optdec type; + enum optcla class; + } cpu_opts; + + int verbose; /* 0: nothing, 1: just print chosen decoder, 2: be verbose */ + + const struct al_table *alloc; + /* The runtime-chosen decoding, based on input and output format. */ + func_synth synth; + func_synth_stereo synth_stereo; + func_synth_mono synth_mono; + /* Yes, this function is runtime-switched, too. */ + void (*make_decode_tables)(mpg123_handle *fr); /* That is the volume control. */ + + int stereo; /* I _think_ 1 for mono and 2 for stereo */ + int jsbound; +#define SINGLE_STEREO -1 +#define SINGLE_LEFT 0 +#define SINGLE_RIGHT 1 +#define SINGLE_MIX 3 + int single; + int II_sblimit; + int down_sample_sblimit; + int lsf; /* 0: MPEG 1.0; 1: MPEG 2.0/2.5 -- both used as bool and array index! */ + /* Many flags in disguise as integers... wasting bytes. */ + int mpeg25; + int down_sample; + int header_change; + int lay; + int (*do_layer)(mpg123_handle *); + int error_protection; + int bitrate_index; + int sampling_frequency; + int padding; + int extension; + int mode; + int mode_ext; + int copyright; + int original; + int emphasis; + int framesize; /* computed framesize */ + int freesize; /* free format frame size */ + enum mpg123_vbr vbr; /* 1 if variable bitrate was detected */ + off_t num; /* frame offset ... */ + off_t input_offset; /* byte offset of this frame in input stream */ + off_t playnum; /* playback offset... includes repetitions, reset at seeks */ + off_t audio_start; /* The byte offset in the file where audio data begins. */ + int state_flags; + char silent_resync; /* Do not complain for the next n resyncs. */ + unsigned char* xing_toc; /* The seek TOC from Xing header. */ + int freeformat; + long freeformat_framesize; + + /* bitstream info; bsi */ + int bitindex; + unsigned char *wordpointer; + /* temporary storage for getbits stuff */ + unsigned long ultmp; + unsigned char uctmp; + + /* rva data, used in common.c, set in id3.c */ + + double maxoutburst; /* The maximum amplitude in current sample represenation. */ + double lastscale; + struct + { + int level[2]; + float gain[2]; + float peak[2]; + } rva; + + /* input data */ + off_t track_frames; + off_t track_samples; + double mean_framesize; + off_t mean_frames; + int fsizeold; + int ssize; + unsigned int bitreservoir; + unsigned char bsspace[2][MAXFRAMESIZE+512]; /* MAXFRAMESIZE */ + unsigned char *bsbuf; + unsigned char *bsbufold; + int bsnum; + /* That is the header matching the last read frame body. */ + unsigned long oldhead; + /* That is the header that is supposedly the first of the stream. */ + unsigned long firsthead; + int abr_rate; +#ifdef FRAME_INDEX + struct frame_index index; +#endif + + /* output data */ + struct outbuffer buffer; + struct audioformat af; + int own_buffer; + size_t outblock; /* number of bytes that this frame produces (upper bound) */ + int to_decode; /* this frame holds data to be decoded */ + int to_ignore; /* the same, somehow */ + off_t firstframe; /* start decoding from here */ + off_t lastframe; /* last frame to decode (for gapless or num_frames limit) */ + off_t ignoreframe; /* frames to decode but discard before firstframe */ +#ifdef GAPLESS + off_t gapless_frames; /* frame count for the gapless part */ + off_t firstoff; /* number of samples to ignore from firstframe */ + off_t lastoff; /* number of samples to use from lastframe */ + off_t begin_s; /* overall begin offset in samples */ + off_t begin_os; + off_t end_s; /* overall end offset in samples */ + off_t end_os; + off_t fullend_os; /* gapless_frames translated to output samples */ +#endif + unsigned int crc; /* Well, I need a safe 16bit type, actually. But wider doesn't hurt. */ + struct reader *rd; /* pointer to the reading functions */ + struct reader_data rdat; /* reader data and state info */ + struct mpg123_pars_struct p; + int err; + int decoder_change; + int delayed_change; + long clip; + /* the meta crap */ + int metaflags; + unsigned char id3buf[128]; +#ifndef NO_ID3V2 + mpg123_id3v2 id3v2; +#endif +#ifndef NO_ICY + struct icy_meta icy; +#endif + /* + More variables needed for decoders, layerX.c. + This time it is not about static variables but about the need for alignment which cannot be guaranteed on the stack by certain compilers (Sun Studio). + We do not require the compiler to align stuff for our hand-written assembly. We only hope that it's able to align stuff for SSE and similar ops it generates itself. + */ + /* + Those layer-specific structs could actually share memory, as they are not in use simultaneously. One might allocate on decoder switch, too. + They all reside in one lump of memory (after each other), allocated to layerscratch. + */ + real *layerscratch; +#ifndef NO_LAYER1 + struct + { + real (*fraction)[SBLIMIT]; /* ALIGNED(16) real fraction[2][SBLIMIT]; */ + } layer1; +#endif +#ifndef NO_LAYER2 + struct + { + real (*fraction)[4][SBLIMIT]; /* ALIGNED(16) real fraction[2][4][SBLIMIT] */ + } layer2; +#endif +#ifndef NO_LAYER3 + /* These are significant chunks of memory already... */ + struct + { + real (*hybrid_in)[SBLIMIT][SSLIMIT]; /* ALIGNED(16) real hybridIn[2][SBLIMIT][SSLIMIT]; */ + real (*hybrid_out)[SSLIMIT][SBLIMIT]; /* ALIGNED(16) real hybridOut[2][SSLIMIT][SBLIMIT]; */ + } layer3; +#endif + /* A place for storing additional data for the large file wrapper. + This is cruft! */ + void *wrapperdata; + /* A callback used to properly destruct the wrapper data. */ + void (*wrapperclean)(void*); +}; + +/* generic init, does not include dynamic buffers */ +void frame_init(mpg123_handle *fr); +void frame_init_par(mpg123_handle *fr, mpg123_pars *mp); +/* output buffer and format */ +int frame_outbuffer(mpg123_handle *fr); +int frame_output_format(mpg123_handle *fr); + +int frame_buffers(mpg123_handle *fr); /* various decoder buffers, needed once */ +int frame_reset(mpg123_handle* fr); /* reset for next track */ +int frame_buffers_reset(mpg123_handle *fr); +void frame_exit(mpg123_handle *fr); /* end, free all buffers */ + +/* Index functions... */ +/* Well... print it... */ +int mpg123_print_index(mpg123_handle *fr, FILE* out); +/* Find a seek position in index. */ +off_t frame_index_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame); +/* Apply index_size setting. */ +int frame_index_setup(mpg123_handle *fr); + +void do_volume(mpg123_handle *fr, double factor); +void do_rva(mpg123_handle *fr); + +/* samples per frame ... +Layer I +Layer II +Layer III +MPEG-1 +384 +1152 +1152 +MPEG-2 LSF +384 +1152 +576 +MPEG 2.5 +384 +1152 +576 +*/ +#define spf(fr) ((fr)->lay == 1 ? 384 : ((fr)->lay==2 ? 1152 : ((fr)->lsf || (fr)->mpeg25 ? 576 : 1152))) + +#ifdef GAPLESS +/* well, I take that one for granted... at least layer3 */ +#define GAPLESS_DELAY 529 +void frame_gapless_init(mpg123_handle *fr, off_t framecount, off_t bskip, off_t eskip); +void frame_gapless_realinit(mpg123_handle *fr); +void frame_gapless_update(mpg123_handle *mh, off_t total_samples); +/*void frame_gapless_position(mpg123_handle* fr); +void frame_gapless_bytify(mpg123_handle *fr); +void frame_gapless_ignore(mpg123_handle *fr, off_t frames);*/ +/* void frame_gapless_buffercheck(mpg123_handle *fr); */ +#endif + +/* Number of samples the decoding of the current frame should yield. */ +off_t frame_expect_outsamples(mpg123_handle *fr); + +/* Skip this frame... do some fake action to get away without actually decoding it. */ +void frame_skip(mpg123_handle *fr); + +/* + Seeking core functions: + - convert input sample offset to output sample offset + - convert frame offset to output sample offset + - get leading frame offset for output sample offset + The offsets are "unadjusted"/internal; resampling is being taken care of. +*/ +off_t frame_ins2outs(mpg123_handle *fr, off_t ins); +off_t frame_outs(mpg123_handle *fr, off_t num); +/* This one just computes the expected sample count for _this_ frame. */ +off_t frame_expect_outsampels(mpg123_handle *fr); +off_t frame_offset(mpg123_handle *fr, off_t outs); +void frame_set_frameseek(mpg123_handle *fr, off_t fe); +void frame_set_seek(mpg123_handle *fr, off_t sp); +off_t frame_tell_seek(mpg123_handle *fr); +/* Take a copy of the Xing VBR TOC for fuzzy seeking. */ +int frame_fill_toc(mpg123_handle *fr, unsigned char* in); +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/gapless.h b/node_modules/lame/deps/mpg123/src/libmpg123/gapless.h new file mode 100644 index 0000000..a98b86b --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/gapless.h @@ -0,0 +1,119 @@ +/* + sampleadjust: gapless sample offset math + + copyright 1995-2012 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + + This is no stand-alone header, precisely to be able to fool it into using fake handle types for testing the math. +*/ + +#include "debug.h" + +#ifdef GAPLESS +/* From internal sample number to external. */ +static off_t sample_adjust(mpg123_handle *mh, off_t x) +{ + off_t s; + if(mh->p.flags & MPG123_GAPLESS) + { + /* It's a bit tricky to do this computation for the padding samples. + They are not there on the outside. */ + if(x > mh->end_os) + { + if(x < mh->fullend_os) + s = mh->end_os - mh->begin_os; + else + s = x - (mh->fullend_os - mh->end_os + mh->begin_os); + } + else + s = x - mh->begin_os; + } + else + s = x; + + return s; +} + +/* from external samples to internal */ +static off_t sample_unadjust(mpg123_handle *mh, off_t x) +{ + off_t s; + if(mh->p.flags & MPG123_GAPLESS) + { + s = x + mh->begin_os; + /* There is a hole; we don't create sample positions in there. + Jump from the end of the gapless track directly to after the padding. */ + if(s >= mh->end_os) + s += mh->fullend_os - mh->end_os; + } + else s = x; + + return s; +} + +/* + Take the buffer after a frame decode (strictly: it is the data from frame fr->num!) and cut samples out. + fr->buffer.fill may then be smaller than before... +*/ +static void frame_buffercheck(mpg123_handle *fr) +{ + /* When we have no accurate position, gapless code does not make sense. */ + if(!(fr->state_flags & FRAME_ACCURATE)) return; + + /* Get a grip on dirty streams that start with a gapless header. + Simply accept all data from frames that are too much, + they are supposedly attached to the stream after the fact. */ + if(fr->gapless_frames > 0 && fr->num >= fr->gapless_frames) return; + + /* Important: We first cut samples from the end, then cut from beginning (including left-shift of the buffer). + This order works also for the case where firstframe == lastframe. */ + + /* The last interesting (planned) frame: Only use some leading samples. + Note a difference from the below: The last frame and offset are unchanges by seeks. + The lastoff keeps being valid. */ + if(fr->lastframe > -1 && fr->num >= fr->lastframe) + { + /* There can be more than one frame of padding at the end, so we ignore the whole frame if we are beyond lastframe. */ + off_t byteoff = (fr->num == fr->lastframe) ? samples_to_bytes(fr, fr->lastoff) : 0; + if((off_t)fr->buffer.fill > byteoff) + { + fr->buffer.fill = byteoff; + } + if(VERBOSE3) fprintf(stderr, "\nNote: Cut frame %"OFF_P" buffer on end of stream to %"OFF_P" samples, fill now %"SIZE_P" bytes.\n", (off_p)fr->num, (off_p)(fr->num == fr->lastframe ? fr->lastoff : 0), (size_p)fr->buffer.fill); + } + + /* The first interesting frame: Skip some leading samples. */ + if(fr->firstoff && fr->num == fr->firstframe) + { + off_t byteoff = samples_to_bytes(fr, fr->firstoff); + if((off_t)fr->buffer.fill > byteoff) + { + fr->buffer.fill -= byteoff; + /* buffer.p != buffer.data only for own buffer */ + debug6("cutting %li samples/%li bytes on begin, own_buffer=%i at %p=%p, buf[1]=%i", + (long)fr->firstoff, (long)byteoff, fr->own_buffer, (void*)fr->buffer.p, (void*)fr->buffer.data, ((short*)fr->buffer.p)[2]); + if(fr->own_buffer) fr->buffer.p = fr->buffer.data + byteoff; + else memmove(fr->buffer.data, fr->buffer.data + byteoff, fr->buffer.fill); + debug3("done cutting, buffer at %p =? %p, buf[1]=%i", + (void*)fr->buffer.p, (void*)fr->buffer.data, ((short*)fr->buffer.p)[2]); + } + else fr->buffer.fill = 0; + + if(VERBOSE3) fprintf(stderr, "\nNote: Cut frame %"OFF_P" buffer on beginning of stream by %"OFF_P" samples, fill now %"SIZE_P" bytes.\n", (off_p)fr->num, (off_p)fr->firstoff, (size_p)fr->buffer.fill); + /* We can only reach this frame again by seeking. And on seeking, firstoff will be recomputed. + So it is safe to null it here (and it makes the if() decision abort earlier). */ + fr->firstoff = 0; + } +} + +#define SAMPLE_ADJUST(mh,x) sample_adjust(mh,x) +#define SAMPLE_UNADJUST(mh,x) sample_unadjust(mh,x) +#define FRAME_BUFFERCHECK(mh) frame_buffercheck(mh) + +#else /* no gapless code included */ + +#define SAMPLE_ADJUST(mh,x) (x) +#define SAMPLE_UNADJUST(mh,x) (x) +#define FRAME_BUFFERCHECK(mh) + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/getbits.h b/node_modules/lame/deps/mpg123/src/libmpg123/getbits.h new file mode 100644 index 0000000..8eff00e --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/getbits.h @@ -0,0 +1,100 @@ +/* + getbits + + copyright ?-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + All code is in the header to suggest/force inlining of these small often-used functions. + This indeed has some impact on performance. +*/ + +#ifndef _MPG123_GETBITS_H_ +#define _MPG123_GETBITS_H_ + +#include "mpg123lib_intern.h" + +#define backbits(fr,nob) ((void)( \ + fr->bitindex -= nob, \ + fr->wordpointer += (fr->bitindex>>3), \ + fr->bitindex &= 0x7 )) + +#define getbitoffset(fr) ((-fr->bitindex)&0x7) +#define getbyte(fr) (*fr->wordpointer++) + +/* There is something wrong with that macro... the function below works also for the layer1 test case. */ +#define macro_getbits(fr, nob) ( \ + fr->ultmp = fr->wordpointer[0],\ + fr->ultmp <<= 8, \ + fr->ultmp |= fr->wordpointer[1], \ + fr->ultmp <<= 8, \ + fr->ultmp |= fr->wordpointer[2], \ + fr->ultmp <<= fr->bitindex, \ + fr->ultmp &= 0xffffff, \ + fr->bitindex += nob, \ + fr->ultmp >>= (24-nob), \ + fr->wordpointer += (fr->bitindex>>3), \ + fr->bitindex &= 7, \ + fr->ultmp) + +static unsigned int getbits(mpg123_handle *fr, int number_of_bits) +{ + unsigned long rval; + +#ifdef DEBUG_GETBITS +fprintf(stderr,"g%d",number_of_bits); +#endif + +/* This is actually slow: if(!number_of_bits) + return 0; */ + +#if 0 + check_buffer_range(number_of_bits+fr->bitindex); +#endif + + { + rval = fr->wordpointer[0]; + rval <<= 8; + rval |= fr->wordpointer[1]; + rval <<= 8; + rval |= fr->wordpointer[2]; + + rval <<= fr->bitindex; + rval &= 0xffffff; + + fr->bitindex += number_of_bits; + + rval >>= (24-number_of_bits); + + fr->wordpointer += (fr->bitindex>>3); + fr->bitindex &= 7; + } + +#ifdef DEBUG_GETBITS +fprintf(stderr,":%lx\n",rval); +#endif + + return rval; +} + + +#define skipbits(fr, nob) fr->ultmp = ( \ + fr->ultmp = fr->wordpointer[0], fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[1], \ + fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[2], fr->ultmp <<= fr->bitindex, \ + fr->ultmp &= 0xffffff, fr->bitindex += nob, \ + fr->ultmp >>= (24-nob), fr->wordpointer += (fr->bitindex>>3), \ + fr->bitindex &= 7 ) + +#define getbits_fast(fr, nob) ( \ + fr->ultmp = (unsigned char) (fr->wordpointer[0] << fr->bitindex), \ + fr->ultmp |= ((unsigned long) fr->wordpointer[1]<bitindex)>>8, \ + fr->ultmp <<= nob, fr->ultmp >>= 8, \ + fr->bitindex += nob, fr->wordpointer += (fr->bitindex>>3), \ + fr->bitindex &= 7, fr->ultmp ) + +#define get1bit(fr) ( \ + fr->uctmp = *fr->wordpointer << fr->bitindex, fr->bitindex++, \ + fr->wordpointer += (fr->bitindex>>3), fr->bitindex &= 7, fr->uctmp>>7 ) + + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/getcpuflags.S b/node_modules/lame/deps/mpg123/src/libmpg123/getcpuflags.S new file mode 100644 index 0000000..89c0f45 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/getcpuflags.S @@ -0,0 +1,91 @@ +/* + getcpucpuflags: get cpuflags for ia32 + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http:#mpg123.org + initially written by KIMURA Takuhiro (for 3DNow!) + extended for general use by Thomas Orgis + + extern int getcpuid(struct cpuflags*) + or just + extern int getcpuid(unsigned int*) + where there is memory for 4 ints + -> the first set of idflags (basic cpu family info) + and the idflags, stdflags, std2flags, extflags written to the parameter + -> 0x00000000 (CPUID instruction not supported) +*/ + +#include "mangle.h" + +.text + ALIGN4 + +.globl ASM_NAME(getcpuflags) +/* .type ASM_NAME(getcpuflags),@function */ +ASM_NAME(getcpuflags): + pushl %ebp + movl %esp,%ebp + pushl %edx + pushl %ecx + pushl %ebx + pushl %esi +/* get the int pointer for storing the flags */ + movl 8(%ebp), %esi +/* does that one make sense? */ + movl $0x80000000,%eax +/* now save the flags and do a check for cpuid availability */ + pushfl + pushfl + popl %eax + movl %eax,%ebx +/* set that bit... */ + xorl $0x00200000,%eax + pushl %eax + popfl +/* ...and read back the flags to see if it is understood */ + pushfl + popl %eax + popfl + cmpl %ebx,%eax + je .Lnocpuid +/* In principle, I would have to check the CPU's identify first to be sure how to interpret the extended flags. */ +/* now get the info, first extended */ + movl $0x0, 12(%esi) /* clear value */ +/* only if supported... */ + movl $0x80000000, %eax + cpuid +/* IDT CPUs should not change EAX, generally I hope that non-3DNow cpus do not set a bogus support level here. */ + cmpl $0x80000001, %eax + jb .Lnoextended /* Skip ext check without minimal support level. */ +/* is supported, get flags value */ + movl $0x80000001,%eax + cpuid + movl %edx,12(%esi) +.Lnoextended: +/* then the other ones, called last to get the id flags in %eax for ret */ + movl $0x00000001,%eax + cpuid + movl %eax, (%esi) + movl %ecx, 4(%esi) + movl %edx, 8(%esi) + jmp .Lend + ALIGN4 +.Lnocpuid: +/* error: set everything to zero */ + movl $0, %eax + movl $0, (%esi) + movl $0, 4(%esi) + movl $0, 8(%esi) + movl $0, 12(%esi) + ALIGN4 +.Lend: +/* return value are the id flags, still stored in %eax */ + popl %esi + popl %ebx + popl %ecx + popl %edx + movl %ebp,%esp + popl %ebp + ret + +NONEXEC_STACK diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/getcpuflags.h b/node_modules/lame/deps/mpg123/src/libmpg123/getcpuflags.h new file mode 100644 index 0000000..68dd975 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/getcpuflags.h @@ -0,0 +1,47 @@ +/* + getcpucpuflags: get cpuflags for ia32 + + copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http:#mpg123.org + initially written by KIMURA Takuhiro (for 3DNow!) + extended for general use by Thomas Orgis +*/ + +#ifndef MPG123_H_GETCPUFLAGS +#define MPG123_H_GETCPUFLAGS + +/* standard level flags part 1 (ECX)*/ +#define FLAG_SSE3 0x00000001 + +/* standard level flags part 2 (EDX) */ +#define FLAG2_MMX 0x00800000 +#define FLAG2_SSE 0x02000000 +#define FLAG2_SSE2 0x04000000 +#define FLAG2_FPU 0x00000001 +/* cpuid extended level 1 (AMD) */ +#define XFLAG_MMX 0x00800000 +#define XFLAG_3DNOW 0x80000000 +#define XFLAG_3DNOWEXT 0x40000000 + +struct cpuflags +{ + unsigned int id; + unsigned int std; + unsigned int std2; + unsigned int ext; +}; + +unsigned int getcpuflags(struct cpuflags* cf); + +/* checks the family */ +#define cpu_i586(s) ( ((s.id & 0xf00)>>8) == 0 || ((s.id & 0xf00)>>8) > 4 ) +/* checking some flags... */ +#define cpu_fpu(s) (FLAG2_FPU & s.std2) +#define cpu_mmx(s) (FLAG2_MMX & s.std2 || XFLAG_MMX & s.ext) +#define cpu_3dnow(s) (XFLAG_3DNOW & s.ext) +#define cpu_3dnowext(s) (XFLAG_3DNOWEXT & s.ext) +#define cpu_sse(s) (FLAG2_SSE & s.std2) +#define cpu_sse2(s) (FLAG2_SSE2 & s.std2) +#define cpu_sse3(s) (FLAG_SSE3 & s.std) + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/huffman.h b/node_modules/lame/deps/mpg123/src/libmpg123/huffman.h new file mode 100644 index 0000000..576fbd8 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/huffman.h @@ -0,0 +1,340 @@ +/* + huffman.h: huffman tables ... recalcualted to work with optimized decoder scheme (MH) + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + probably we could save a few bytes of memory, because the + smaller tables are often the part of a bigger table +*/ + + +#ifndef _MPG123_HUFFMAN_H_ +#define _MPG123_HUFFMAN_H_ + +struct newhuff +{ + unsigned int linbits; + const short *table; +}; + +static const short tab0[] = +{ + 0 +}; + +static const short tab1[] = +{ + -5, -3, -1, 17, 1, 16, 0 +}; + +static const short tab2[] = +{ + -15, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 17, -1, 1, + 16, 0 +}; + +static const short tab3[] = +{ + -13, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 16, 17, -1, + 1, 0 +}; + +static const short tab5[] = +{ + -29, -25, -23, -15, -7, -5, -3, -1, 51, 35, 50, 49, -3, -1, 19, + 3, -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, 17, -1, 1, 16, + 0 +}; + +static const short tab6[] = +{ + -25, -19, -13, -9, -5, -3, -1, 51, 3, 35, -1, 50, 48, -1, 19, + 49, -3, -1, 34, 2, 18, -3, -1, 33, 32, 1, -1, 17, -1, 16, + 0 +}; + +static const short tab7[] = +{ + -69, -65, -57, -39, -29, -17, -11, -7, -3, -1, 85, 69, -1, 84, 83, + -1, 53, 68, -3, -1, 37, 82, 21, -5, -1, 81, -1, 5, 52, -1, + 80, -1, 67, 51, -5, -3, -1, 36, 66, 20, -1, 65, 64, -11, -7, + -3, -1, 4, 35, -1, 50, 3, -1, 19, 49, -3, -1, 48, 34, 18, + -5, -1, 33, -1, 2, 32, 17, -1, 1, 16, 0 +}; + +static const short tab8[] = +{ + -65, -63, -59, -45, -31, -19, -13, -7, -5, -3, -1, 85, 84, 69, 83, + -3, -1, 53, 68, 37, -3, -1, 82, 5, 21, -5, -1, 81, -1, 52, + 67, -3, -1, 80, 51, 36, -5, -3, -1, 66, 20, 65, -3, -1, 4, + 64, -1, 35, 50, -9, -7, -3, -1, 19, 49, -1, 3, 48, 34, -1, + 2, 32, -1, 18, 33, 17, -3, -1, 1, 16, 0 +}; + +static const short tab9[] = +{ + -63, -53, -41, -29, -19, -11, -5, -3, -1, 85, 69, 53, -1, 83, -1, + 84, 5, -3, -1, 68, 37, -1, 82, 21, -3, -1, 81, 52, -1, 67, + -1, 80, 4, -7, -3, -1, 36, 66, -1, 51, 64, -1, 20, 65, -5, + -3, -1, 35, 50, 19, -1, 49, -1, 3, 48, -5, -3, -1, 34, 2, + 18, -1, 33, 32, -3, -1, 17, 1, -1, 16, 0 +}; + +static const short tab10[] = +{ +-125,-121,-111, -83, -55, -35, -21, -13, -7, -3, -1, 119, 103, -1, 118, + 87, -3, -1, 117, 102, 71, -3, -1, 116, 86, -1, 101, 55, -9, -3, + -1, 115, 70, -3, -1, 85, 84, 99, -1, 39, 114, -11, -5, -3, -1, + 100, 7, 112, -1, 98, -1, 69, 53, -5, -1, 6, -1, 83, 68, 23, + -17, -5, -1, 113, -1, 54, 38, -5, -3, -1, 37, 82, 21, -1, 81, + -1, 52, 67, -3, -1, 22, 97, -1, 96, -1, 5, 80, -19, -11, -7, + -3, -1, 36, 66, -1, 51, 4, -1, 20, 65, -3, -1, 64, 35, -1, + 50, 3, -3, -1, 19, 49, -1, 48, 34, -7, -3, -1, 18, 33, -1, + 2, 32, 17, -1, 1, 16, 0 +}; + +static const short tab11[] = +{ +-121,-113, -89, -59, -43, -27, -17, -7, -3, -1, 119, 103, -1, 118, 117, + -3, -1, 102, 71, -1, 116, -1, 87, 85, -5, -3, -1, 86, 101, 55, + -1, 115, 70, -9, -7, -3, -1, 69, 84, -1, 53, 83, 39, -1, 114, + -1, 100, 7, -5, -1, 113, -1, 23, 112, -3, -1, 54, 99, -1, 96, + -1, 68, 37, -13, -7, -5, -3, -1, 82, 5, 21, 98, -3, -1, 38, + 6, 22, -5, -1, 97, -1, 81, 52, -5, -1, 80, -1, 67, 51, -1, + 36, 66, -15, -11, -7, -3, -1, 20, 65, -1, 4, 64, -1, 35, 50, + -1, 19, 49, -5, -3, -1, 3, 48, 34, 33, -5, -1, 18, -1, 2, + 32, 17, -3, -1, 1, 16, 0 +}; + +static const short tab12[] = +{ +-115, -99, -73, -45, -27, -17, -9, -5, -3, -1, 119, 103, 118, -1, 87, + 117, -3, -1, 102, 71, -1, 116, 101, -3, -1, 86, 55, -3, -1, 115, + 85, 39, -7, -3, -1, 114, 70, -1, 100, 23, -5, -1, 113, -1, 7, + 112, -1, 54, 99, -13, -9, -3, -1, 69, 84, -1, 68, -1, 6, 5, + -1, 38, 98, -5, -1, 97, -1, 22, 96, -3, -1, 53, 83, -1, 37, + 82, -17, -7, -3, -1, 21, 81, -1, 52, 67, -5, -3, -1, 80, 4, + 36, -1, 66, 20, -3, -1, 51, 65, -1, 35, 50, -11, -7, -5, -3, + -1, 64, 3, 48, 19, -1, 49, 34, -1, 18, 33, -7, -5, -3, -1, + 2, 32, 0, 17, -1, 1, 16 +}; + +static const short tab13[] = +{ +-509,-503,-475,-405,-333,-265,-205,-153,-115, -83, -53, -35, -21, -13, -9, + -7, -5, -3, -1, 254, 252, 253, 237, 255, -1, 239, 223, -3, -1, 238, + 207, -1, 222, 191, -9, -3, -1, 251, 206, -1, 220, -1, 175, 233, -1, + 236, 221, -9, -5, -3, -1, 250, 205, 190, -1, 235, 159, -3, -1, 249, + 234, -1, 189, 219, -17, -9, -3, -1, 143, 248, -1, 204, -1, 174, 158, + -5, -1, 142, -1, 127, 126, 247, -5, -1, 218, -1, 173, 188, -3, -1, + 203, 246, 111, -15, -7, -3, -1, 232, 95, -1, 157, 217, -3, -1, 245, + 231, -1, 172, 187, -9, -3, -1, 79, 244, -3, -1, 202, 230, 243, -1, + 63, -1, 141, 216, -21, -9, -3, -1, 47, 242, -3, -1, 110, 156, 15, + -5, -3, -1, 201, 94, 171, -3, -1, 125, 215, 78, -11, -5, -3, -1, + 200, 214, 62, -1, 185, -1, 155, 170, -1, 31, 241, -23, -13, -5, -1, + 240, -1, 186, 229, -3, -1, 228, 140, -1, 109, 227, -5, -1, 226, -1, + 46, 14, -1, 30, 225, -15, -7, -3, -1, 224, 93, -1, 213, 124, -3, + -1, 199, 77, -1, 139, 184, -7, -3, -1, 212, 154, -1, 169, 108, -1, + 198, 61, -37, -21, -9, -5, -3, -1, 211, 123, 45, -1, 210, 29, -5, + -1, 183, -1, 92, 197, -3, -1, 153, 122, 195, -7, -5, -3, -1, 167, + 151, 75, 209, -3, -1, 13, 208, -1, 138, 168, -11, -7, -3, -1, 76, + 196, -1, 107, 182, -1, 60, 44, -3, -1, 194, 91, -3, -1, 181, 137, + 28, -43, -23, -11, -5, -1, 193, -1, 152, 12, -1, 192, -1, 180, 106, + -5, -3, -1, 166, 121, 59, -1, 179, -1, 136, 90, -11, -5, -1, 43, + -1, 165, 105, -1, 164, -1, 120, 135, -5, -1, 148, -1, 119, 118, 178, + -11, -3, -1, 27, 177, -3, -1, 11, 176, -1, 150, 74, -7, -3, -1, + 58, 163, -1, 89, 149, -1, 42, 162, -47, -23, -9, -3, -1, 26, 161, + -3, -1, 10, 104, 160, -5, -3, -1, 134, 73, 147, -3, -1, 57, 88, + -1, 133, 103, -9, -3, -1, 41, 146, -3, -1, 87, 117, 56, -5, -1, + 131, -1, 102, 71, -3, -1, 116, 86, -1, 101, 115, -11, -3, -1, 25, + 145, -3, -1, 9, 144, -1, 72, 132, -7, -5, -1, 114, -1, 70, 100, + 40, -1, 130, 24, -41, -27, -11, -5, -3, -1, 55, 39, 23, -1, 113, + -1, 85, 7, -7, -3, -1, 112, 54, -1, 99, 69, -3, -1, 84, 38, + -1, 98, 53, -5, -1, 129, -1, 8, 128, -3, -1, 22, 97, -1, 6, + 96, -13, -9, -5, -3, -1, 83, 68, 37, -1, 82, 5, -1, 21, 81, + -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20, -19, -11, + -5, -1, 65, -1, 4, 64, -3, -1, 35, 50, 19, -3, -1, 49, 3, + -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16, + 0 +}; + +static const short tab15[] = +{ +-495,-445,-355,-263,-183,-115, -77, -43, -27, -13, -7, -3, -1, 255, 239, + -1, 254, 223, -1, 238, -1, 253, 207, -7, -3, -1, 252, 222, -1, 237, + 191, -1, 251, -1, 206, 236, -7, -3, -1, 221, 175, -1, 250, 190, -3, + -1, 235, 205, -1, 220, 159, -15, -7, -3, -1, 249, 234, -1, 189, 219, + -3, -1, 143, 248, -1, 204, 158, -7, -3, -1, 233, 127, -1, 247, 173, + -3, -1, 218, 188, -1, 111, -1, 174, 15, -19, -11, -3, -1, 203, 246, + -3, -1, 142, 232, -1, 95, 157, -3, -1, 245, 126, -1, 231, 172, -9, + -3, -1, 202, 187, -3, -1, 217, 141, 79, -3, -1, 244, 63, -1, 243, + 216, -33, -17, -9, -3, -1, 230, 47, -1, 242, -1, 110, 240, -3, -1, + 31, 241, -1, 156, 201, -7, -3, -1, 94, 171, -1, 186, 229, -3, -1, + 125, 215, -1, 78, 228, -15, -7, -3, -1, 140, 200, -1, 62, 109, -3, + -1, 214, 227, -1, 155, 185, -7, -3, -1, 46, 170, -1, 226, 30, -5, + -1, 225, -1, 14, 224, -1, 93, 213, -45, -25, -13, -7, -3, -1, 124, + 199, -1, 77, 139, -1, 212, -1, 184, 154, -7, -3, -1, 169, 108, -1, + 198, 61, -1, 211, 210, -9, -5, -3, -1, 45, 13, 29, -1, 123, 183, + -5, -1, 209, -1, 92, 208, -1, 197, 138, -17, -7, -3, -1, 168, 76, + -1, 196, 107, -5, -1, 182, -1, 153, 12, -1, 60, 195, -9, -3, -1, + 122, 167, -1, 166, -1, 192, 11, -1, 194, -1, 44, 91, -55, -29, -15, + -7, -3, -1, 181, 28, -1, 137, 152, -3, -1, 193, 75, -1, 180, 106, + -5, -3, -1, 59, 121, 179, -3, -1, 151, 136, -1, 43, 90, -11, -5, + -1, 178, -1, 165, 27, -1, 177, -1, 176, 105, -7, -3, -1, 150, 74, + -1, 164, 120, -3, -1, 135, 58, 163, -17, -7, -3, -1, 89, 149, -1, + 42, 162, -3, -1, 26, 161, -3, -1, 10, 160, 104, -7, -3, -1, 134, + 73, -1, 148, 57, -5, -1, 147, -1, 119, 9, -1, 88, 133, -53, -29, + -13, -7, -3, -1, 41, 103, -1, 118, 146, -1, 145, -1, 25, 144, -7, + -3, -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 71, -7, + -3, -1, 40, 130, -1, 24, 129, -7, -3, -1, 116, 8, -1, 128, 86, + -3, -1, 101, 55, -1, 115, 70, -17, -7, -3, -1, 39, 114, -1, 100, + 23, -3, -1, 85, 113, -3, -1, 7, 112, 54, -7, -3, -1, 99, 69, + -1, 84, 38, -3, -1, 98, 22, -3, -1, 6, 96, 53, -33, -19, -9, + -5, -1, 97, -1, 83, 68, -1, 37, 82, -3, -1, 21, 81, -3, -1, + 5, 80, 52, -7, -3, -1, 67, 36, -1, 66, 51, -1, 65, -1, 20, + 4, -9, -3, -1, 35, 50, -3, -1, 64, 3, 19, -3, -1, 49, 48, + 34, -9, -7, -3, -1, 18, 33, -1, 2, 32, 17, -3, -1, 1, 16, + 0 +}; + +static const short tab16[] = +{ +-509,-503,-461,-323,-103, -37, -27, -15, -7, -3, -1, 239, 254, -1, 223, + 253, -3, -1, 207, 252, -1, 191, 251, -5, -1, 175, -1, 250, 159, -3, + -1, 249, 248, 143, -7, -3, -1, 127, 247, -1, 111, 246, 255, -9, -5, + -3, -1, 95, 245, 79, -1, 244, 243, -53, -1, 240, -1, 63, -29, -19, + -13, -7, -5, -1, 206, -1, 236, 221, 222, -1, 233, -1, 234, 217, -1, + 238, -1, 237, 235, -3, -1, 190, 205, -3, -1, 220, 219, 174, -11, -5, + -1, 204, -1, 173, 218, -3, -1, 126, 172, 202, -5, -3, -1, 201, 125, + 94, 189, 242, -93, -5, -3, -1, 47, 15, 31, -1, 241, -49, -25, -13, + -5, -1, 158, -1, 188, 203, -3, -1, 142, 232, -1, 157, 231, -7, -3, + -1, 187, 141, -1, 216, 110, -1, 230, 156, -13, -7, -3, -1, 171, 186, + -1, 229, 215, -1, 78, -1, 228, 140, -3, -1, 200, 62, -1, 109, -1, + 214, 155, -19, -11, -5, -3, -1, 185, 170, 225, -1, 212, -1, 184, 169, + -5, -1, 123, -1, 183, 208, 227, -7, -3, -1, 14, 224, -1, 93, 213, + -3, -1, 124, 199, -1, 77, 139, -75, -45, -27, -13, -7, -3, -1, 154, + 108, -1, 198, 61, -3, -1, 92, 197, 13, -7, -3, -1, 138, 168, -1, + 153, 76, -3, -1, 182, 122, 60, -11, -5, -3, -1, 91, 137, 28, -1, + 192, -1, 152, 121, -1, 226, -1, 46, 30, -15, -7, -3, -1, 211, 45, + -1, 210, 209, -5, -1, 59, -1, 151, 136, 29, -7, -3, -1, 196, 107, + -1, 195, 167, -1, 44, -1, 194, 181, -23, -13, -7, -3, -1, 193, 12, + -1, 75, 180, -3, -1, 106, 166, 179, -5, -3, -1, 90, 165, 43, -1, + 178, 27, -13, -5, -1, 177, -1, 11, 176, -3, -1, 105, 150, -1, 74, + 164, -5, -3, -1, 120, 135, 163, -3, -1, 58, 89, 42, -97, -57, -33, + -19, -11, -5, -3, -1, 149, 104, 161, -3, -1, 134, 119, 148, -5, -3, + -1, 73, 87, 103, 162, -5, -1, 26, -1, 10, 160, -3, -1, 57, 147, + -1, 88, 133, -9, -3, -1, 41, 146, -3, -1, 118, 9, 25, -5, -1, + 145, -1, 144, 72, -3, -1, 132, 117, -1, 56, 131, -21, -11, -5, -3, + -1, 102, 40, 130, -3, -1, 71, 116, 24, -3, -1, 129, 128, -3, -1, + 8, 86, 55, -9, -5, -1, 115, -1, 101, 70, -1, 39, 114, -5, -3, + -1, 100, 85, 7, 23, -23, -13, -5, -1, 113, -1, 112, 54, -3, -1, + 99, 69, -1, 84, 38, -3, -1, 98, 22, -1, 97, -1, 6, 96, -9, + -5, -1, 83, -1, 53, 68, -1, 37, 82, -1, 81, -1, 21, 5, -33, + -23, -13, -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20, + -5, -1, 65, -1, 4, 64, -1, 35, 50, -3, -1, 19, 49, -3, -1, + 3, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16, + 0 +}; + +static const short tab24[] = +{ +-451,-117, -43, -25, -15, -7, -3, -1, 239, 254, -1, 223, 253, -3, -1, + 207, 252, -1, 191, 251, -5, -1, 250, -1, 175, 159, -1, 249, 248, -9, + -5, -3, -1, 143, 127, 247, -1, 111, 246, -3, -1, 95, 245, -1, 79, + 244, -71, -7, -3, -1, 63, 243, -1, 47, 242, -5, -1, 241, -1, 31, + 240, -25, -9, -1, 15, -3, -1, 238, 222, -1, 237, 206, -7, -3, -1, + 236, 221, -1, 190, 235, -3, -1, 205, 220, -1, 174, 234, -15, -7, -3, + -1, 189, 219, -1, 204, 158, -3, -1, 233, 173, -1, 218, 188, -7, -3, + -1, 203, 142, -1, 232, 157, -3, -1, 217, 126, -1, 231, 172, 255,-235, +-143, -77, -45, -25, -15, -7, -3, -1, 202, 187, -1, 141, 216, -5, -3, + -1, 14, 224, 13, 230, -5, -3, -1, 110, 156, 201, -1, 94, 186, -9, + -5, -1, 229, -1, 171, 125, -1, 215, 228, -3, -1, 140, 200, -3, -1, + 78, 46, 62, -15, -7, -3, -1, 109, 214, -1, 227, 155, -3, -1, 185, + 170, -1, 226, 30, -7, -3, -1, 225, 93, -1, 213, 124, -3, -1, 199, + 77, -1, 139, 184, -31, -15, -7, -3, -1, 212, 154, -1, 169, 108, -3, + -1, 198, 61, -1, 211, 45, -7, -3, -1, 210, 29, -1, 123, 183, -3, + -1, 209, 92, -1, 197, 138, -17, -7, -3, -1, 168, 153, -1, 76, 196, + -3, -1, 107, 182, -3, -1, 208, 12, 60, -7, -3, -1, 195, 122, -1, + 167, 44, -3, -1, 194, 91, -1, 181, 28, -57, -35, -19, -7, -3, -1, + 137, 152, -1, 193, 75, -5, -3, -1, 192, 11, 59, -3, -1, 176, 10, + 26, -5, -1, 180, -1, 106, 166, -3, -1, 121, 151, -3, -1, 160, 9, + 144, -9, -3, -1, 179, 136, -3, -1, 43, 90, 178, -7, -3, -1, 165, + 27, -1, 177, 105, -1, 150, 164, -17, -9, -5, -3, -1, 74, 120, 135, + -1, 58, 163, -3, -1, 89, 149, -1, 42, 162, -7, -3, -1, 161, 104, + -1, 134, 119, -3, -1, 73, 148, -1, 57, 147, -63, -31, -15, -7, -3, + -1, 88, 133, -1, 41, 103, -3, -1, 118, 146, -1, 25, 145, -7, -3, + -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 40, -17, -7, + -3, -1, 130, 24, -1, 71, 116, -5, -1, 129, -1, 8, 128, -1, 86, + 101, -7, -5, -1, 23, -1, 7, 112, 115, -3, -1, 55, 39, 114, -15, + -7, -3, -1, 70, 100, -1, 85, 113, -3, -1, 54, 99, -1, 69, 84, + -7, -3, -1, 38, 98, -1, 22, 97, -5, -3, -1, 6, 96, 53, -1, + 83, 68, -51, -37, -23, -15, -9, -3, -1, 37, 82, -1, 21, -1, 5, + 80, -1, 81, -1, 52, 67, -3, -1, 36, 66, -1, 51, 20, -9, -5, + -1, 65, -1, 4, 64, -1, 35, 50, -1, 19, 49, -7, -5, -3, -1, + 3, 48, 34, 18, -1, 33, -1, 2, 32, -3, -1, 17, 1, -1, 16, + 0 +}; + +static const short tab_c0[] = +{ + -29, -21, -13, -7, -3, -1, 11, 15, -1, 13, 14, -3, -1, 7, 5, + 9, -3, -1, 6, 3, -1, 10, 12, -3, -1, 2, 1, -1, 4, 8, + 0 +}; + +static const short tab_c1[] = +{ + -15, -7, -3, -1, 15, 14, -1, 13, 12, -3, -1, 11, 10, -1, 9, + 8, -7, -3, -1, 7, 6, -1, 5, 4, -3, -1, 3, 2, -1, 1, + 0 +}; + + + +static const struct newhuff ht[] = +{ + { /* 0 */ 0 , tab0 } , + { /* 2 */ 0 , tab1 } , + { /* 3 */ 0 , tab2 } , + { /* 3 */ 0 , tab3 } , + { /* 0 */ 0 , tab0 } , + { /* 4 */ 0 , tab5 } , + { /* 4 */ 0 , tab6 } , + { /* 6 */ 0 , tab7 } , + { /* 6 */ 0 , tab8 } , + { /* 6 */ 0 , tab9 } , + { /* 8 */ 0 , tab10 } , + { /* 8 */ 0 , tab11 } , + { /* 8 */ 0 , tab12 } , + { /* 16 */ 0 , tab13 } , + { /* 0 */ 0 , tab0 } , + { /* 16 */ 0 , tab15 } , + + { /* 16 */ 1 , tab16 } , + { /* 16 */ 2 , tab16 } , + { /* 16 */ 3 , tab16 } , + { /* 16 */ 4 , tab16 } , + { /* 16 */ 6 , tab16 } , + { /* 16 */ 8 , tab16 } , + { /* 16 */ 10, tab16 } , + { /* 16 */ 13, tab16 } , + { /* 16 */ 4 , tab24 } , + { /* 16 */ 5 , tab24 } , + { /* 16 */ 6 , tab24 } , + { /* 16 */ 7 , tab24 } , + { /* 16 */ 8 , tab24 } , + { /* 16 */ 9 , tab24 } , + { /* 16 */ 11, tab24 } , + { /* 16 */ 13, tab24 } +}; + +static const struct newhuff htc[] = +{ + { /* 1 , 1 , */ 0 , tab_c0 } , + { /* 1 , 1 , */ 0 , tab_c1 } +}; + + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/icy.c b/node_modules/lame/deps/mpg123/src/libmpg123/icy.c new file mode 100644 index 0000000..dca2c5d --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/icy.c @@ -0,0 +1,32 @@ +/* + icy: Puny code to pretend for a serious ICY data structure. + + copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "icy.h" + +void init_icy(struct icy_meta *icy) +{ + icy->data = NULL; +} + +void clear_icy(struct icy_meta *icy) +{ + if(icy->data != NULL) free(icy->data); + init_icy(icy); +} + +void reset_icy(struct icy_meta *icy) +{ + clear_icy(icy); + init_icy(icy); +} +/*void set_icy(struct icy_meta *icy, char* new_data) +{ + if(icy->data) free(icy->data); + icy->data = new_data; + icy->changed = 1; +}*/ diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/icy.h b/node_modules/lame/deps/mpg123/src/libmpg123/icy.h new file mode 100644 index 0000000..a5fd64e --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/icy.h @@ -0,0 +1,38 @@ +/* + icy: support for SHOUTcast ICY meta info, an attempt to keep it organized + + copyright 2006-7 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis and modelled after patch by Honza +*/ +#ifndef MPG123_ICY_H +#define MPG123_ICY_H + +#ifndef NO_ICY + +#include "compat.h" +#include "mpg123.h" + +struct icy_meta +{ + char* data; + off_t interval; + off_t next; +}; + +void init_icy(struct icy_meta *); +void clear_icy(struct icy_meta *); +void reset_icy(struct icy_meta *); + +#else + +#undef init_icy +#define init_icy(a) +#undef clear_icy +#define clear_icy(a) +#undef reset_icy +#define reset_icy(a) + +#endif /* NO_ICY */ + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/icy2utf8.c b/node_modules/lame/deps/mpg123/src/libmpg123/icy2utf8.c new file mode 100644 index 0000000..4e72162 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/icy2utf8.c @@ -0,0 +1,438 @@ +/* mpg123 note: This is BSD-licensed code that is no problem for mpg123 usage under LGPL. + It's Free, understood? ;-) */ + +/* Another note: This code is basically written by Thorsten Glaser, + Thomas Orgis did just some rearrangements and comments. */ + +/*- + * Copyright (c) 2008 + * Thorsten Glaser + * + * Provided that these terms and disclaimer and all copyright notices + * are retained or reproduced in an accompanying document, permission + * is granted to deal in this work without restriction, including un- + * limited rights to use, publicly perform, distribute, sell, modify, + * merge, give away, or sublicence. + * + * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to + * the utmost extent permitted by applicable law, neither express nor + * implied; without malicious intent or gross negligence. In no event + * may a licensor, author or contributor be held liable for indirect, + * direct, other damage, loss, or other issues arising in any way out + * of dealing in the work, even if advised of the possibility of such + * damage or existence of a defect, except proven that it results out + * of said person's immediate fault when using the work as intended. + *- + * Convert from ICY encoding (windows-1252 codepage) to UTF-8 + */ + +/* Includes string and stdlib headers... */ +#include "compat.h" + +/* ThOr: too lazy for this type check; also we use char/short all around anyway. + Of cource, it would be the proper way to use _these_ kind of types all around. */ +#define uint8_t unsigned char +#define uint16_t unsigned short + +static const uint8_t cp1252_utf8[] = { + /* 0x00 @ 0 */ 0x00, + /* 0x01 @ 1 */ 0x01, + /* 0x02 @ 2 */ 0x02, + /* 0x03 @ 3 */ 0x03, + /* 0x04 @ 4 */ 0x04, + /* 0x05 @ 5 */ 0x05, + /* 0x06 @ 6 */ 0x06, + /* 0x07 @ 7 */ 0x07, + /* 0x08 @ 8 */ 0x08, + /* 0x09 @ 9 */ 0x09, + /* 0x0A @ 10 */ 0x0A, + /* 0x0B @ 11 */ 0x0B, + /* 0x0C @ 12 */ 0x0C, + /* 0x0D @ 13 */ 0x0D, + /* 0x0E @ 14 */ 0x0E, + /* 0x0F @ 15 */ 0x0F, + /* 0x10 @ 16 */ 0x10, + /* 0x11 @ 17 */ 0x11, + /* 0x12 @ 18 */ 0x12, + /* 0x13 @ 19 */ 0x13, + /* 0x14 @ 20 */ 0x14, + /* 0x15 @ 21 */ 0x15, + /* 0x16 @ 22 */ 0x16, + /* 0x17 @ 23 */ 0x17, + /* 0x18 @ 24 */ 0x18, + /* 0x19 @ 25 */ 0x19, + /* 0x1A @ 26 */ 0x1A, + /* 0x1B @ 27 */ 0x1B, + /* 0x1C @ 28 */ 0x1C, + /* 0x1D @ 29 */ 0x1D, + /* 0x1E @ 30 */ 0x1E, + /* 0x1F @ 31 */ 0x1F, + /* 0x20 @ 32 */ 0x20, + /* 0x21 @ 33 */ 0x21, + /* 0x22 @ 34 */ 0x22, + /* 0x23 @ 35 */ 0x23, + /* 0x24 @ 36 */ 0x24, + /* 0x25 @ 37 */ 0x25, + /* 0x26 @ 38 */ 0x26, + /* 0x27 @ 39 */ 0x27, + /* 0x28 @ 40 */ 0x28, + /* 0x29 @ 41 */ 0x29, + /* 0x2A @ 42 */ 0x2A, + /* 0x2B @ 43 */ 0x2B, + /* 0x2C @ 44 */ 0x2C, + /* 0x2D @ 45 */ 0x2D, + /* 0x2E @ 46 */ 0x2E, + /* 0x2F @ 47 */ 0x2F, + /* 0x30 @ 48 */ 0x30, + /* 0x31 @ 49 */ 0x31, + /* 0x32 @ 50 */ 0x32, + /* 0x33 @ 51 */ 0x33, + /* 0x34 @ 52 */ 0x34, + /* 0x35 @ 53 */ 0x35, + /* 0x36 @ 54 */ 0x36, + /* 0x37 @ 55 */ 0x37, + /* 0x38 @ 56 */ 0x38, + /* 0x39 @ 57 */ 0x39, + /* 0x3A @ 58 */ 0x3A, + /* 0x3B @ 59 */ 0x3B, + /* 0x3C @ 60 */ 0x3C, + /* 0x3D @ 61 */ 0x3D, + /* 0x3E @ 62 */ 0x3E, + /* 0x3F @ 63 */ 0x3F, + /* 0x40 @ 64 */ 0x40, + /* 0x41 @ 65 */ 0x41, + /* 0x42 @ 66 */ 0x42, + /* 0x43 @ 67 */ 0x43, + /* 0x44 @ 68 */ 0x44, + /* 0x45 @ 69 */ 0x45, + /* 0x46 @ 70 */ 0x46, + /* 0x47 @ 71 */ 0x47, + /* 0x48 @ 72 */ 0x48, + /* 0x49 @ 73 */ 0x49, + /* 0x4A @ 74 */ 0x4A, + /* 0x4B @ 75 */ 0x4B, + /* 0x4C @ 76 */ 0x4C, + /* 0x4D @ 77 */ 0x4D, + /* 0x4E @ 78 */ 0x4E, + /* 0x4F @ 79 */ 0x4F, + /* 0x50 @ 80 */ 0x50, + /* 0x51 @ 81 */ 0x51, + /* 0x52 @ 82 */ 0x52, + /* 0x53 @ 83 */ 0x53, + /* 0x54 @ 84 */ 0x54, + /* 0x55 @ 85 */ 0x55, + /* 0x56 @ 86 */ 0x56, + /* 0x57 @ 87 */ 0x57, + /* 0x58 @ 88 */ 0x58, + /* 0x59 @ 89 */ 0x59, + /* 0x5A @ 90 */ 0x5A, + /* 0x5B @ 91 */ 0x5B, + /* 0x5C @ 92 */ 0x5C, + /* 0x5D @ 93 */ 0x5D, + /* 0x5E @ 94 */ 0x5E, + /* 0x5F @ 95 */ 0x5F, + /* 0x60 @ 96 */ 0x60, + /* 0x61 @ 97 */ 0x61, + /* 0x62 @ 98 */ 0x62, + /* 0x63 @ 99 */ 0x63, + /* 0x64 @ 100 */ 0x64, + /* 0x65 @ 101 */ 0x65, + /* 0x66 @ 102 */ 0x66, + /* 0x67 @ 103 */ 0x67, + /* 0x68 @ 104 */ 0x68, + /* 0x69 @ 105 */ 0x69, + /* 0x6A @ 106 */ 0x6A, + /* 0x6B @ 107 */ 0x6B, + /* 0x6C @ 108 */ 0x6C, + /* 0x6D @ 109 */ 0x6D, + /* 0x6E @ 110 */ 0x6E, + /* 0x6F @ 111 */ 0x6F, + /* 0x70 @ 112 */ 0x70, + /* 0x71 @ 113 */ 0x71, + /* 0x72 @ 114 */ 0x72, + /* 0x73 @ 115 */ 0x73, + /* 0x74 @ 116 */ 0x74, + /* 0x75 @ 117 */ 0x75, + /* 0x76 @ 118 */ 0x76, + /* 0x77 @ 119 */ 0x77, + /* 0x78 @ 120 */ 0x78, + /* 0x79 @ 121 */ 0x79, + /* 0x7A @ 122 */ 0x7A, + /* 0x7B @ 123 */ 0x7B, + /* 0x7C @ 124 */ 0x7C, + /* 0x7D @ 125 */ 0x7D, + /* 0x7E @ 126 */ 0x7E, + /* 0x7F @ 127 */ 0x7F, + /* 0x80 @ 128 */ 0xE2, 0x82, 0xAC, + /* 0x81 @ 131 */ 0xEF, 0xBF, 0xBD, + /* 0x82 @ 134 */ 0xE2, 0x80, 0x9A, + /* 0x83 @ 137 */ 0xC6, 0x92, + /* 0x84 @ 139 */ 0xE2, 0x80, 0x9E, + /* 0x85 @ 142 */ 0xE2, 0x80, 0xA6, + /* 0x86 @ 145 */ 0xE2, 0x80, 0xA0, + /* 0x87 @ 148 */ 0xE2, 0x80, 0xA1, + /* 0x88 @ 151 */ 0xCB, 0x86, + /* 0x89 @ 153 */ 0xE2, 0x80, 0xB0, + /* 0x8A @ 156 */ 0xC5, 0xA0, + /* 0x8B @ 158 */ 0xE2, 0x80, 0xB9, + /* 0x8C @ 161 */ 0xC5, 0x92, + /* 0x8D @ 163 */ 0xEF, 0xBF, 0xBD, + /* 0x8E @ 166 */ 0xC5, 0xBD, + /* 0x8F @ 168 */ 0xEF, 0xBF, 0xBD, + /* 0x90 @ 171 */ 0xEF, 0xBF, 0xBD, + /* 0x91 @ 174 */ 0xE2, 0x80, 0x98, + /* 0x92 @ 177 */ 0xE2, 0x80, 0x99, + /* 0x93 @ 180 */ 0xE2, 0x80, 0x9C, + /* 0x94 @ 183 */ 0xE2, 0x80, 0x9D, + /* 0x95 @ 186 */ 0xE2, 0x80, 0xA2, + /* 0x96 @ 189 */ 0xE2, 0x80, 0x93, + /* 0x97 @ 192 */ 0xE2, 0x80, 0x94, + /* 0x98 @ 195 */ 0xCB, 0x9C, + /* 0x99 @ 197 */ 0xE2, 0x84, 0xA2, + /* 0x9A @ 200 */ 0xC5, 0xA1, + /* 0x9B @ 202 */ 0xE2, 0x80, 0xBA, + /* 0x9C @ 205 */ 0xC5, 0x93, + /* 0x9D @ 207 */ 0xEF, 0xBF, 0xBD, + /* 0x9E @ 210 */ 0xC5, 0xBE, + /* 0x9F @ 212 */ 0xC5, 0xB8, + /* 0xA0 @ 214 */ 0xC2, 0xA0, + /* 0xA1 @ 216 */ 0xC2, 0xA1, + /* 0xA2 @ 218 */ 0xC2, 0xA2, + /* 0xA3 @ 220 */ 0xC2, 0xA3, + /* 0xA4 @ 222 */ 0xC2, 0xA4, + /* 0xA5 @ 224 */ 0xC2, 0xA5, + /* 0xA6 @ 226 */ 0xC2, 0xA6, + /* 0xA7 @ 228 */ 0xC2, 0xA7, + /* 0xA8 @ 230 */ 0xC2, 0xA8, + /* 0xA9 @ 232 */ 0xC2, 0xA9, + /* 0xAA @ 234 */ 0xC2, 0xAA, + /* 0xAB @ 236 */ 0xC2, 0xAB, + /* 0xAC @ 238 */ 0xC2, 0xAC, + /* 0xAD @ 240 */ 0xC2, 0xAD, + /* 0xAE @ 242 */ 0xC2, 0xAE, + /* 0xAF @ 244 */ 0xC2, 0xAF, + /* 0xB0 @ 246 */ 0xC2, 0xB0, + /* 0xB1 @ 248 */ 0xC2, 0xB1, + /* 0xB2 @ 250 */ 0xC2, 0xB2, + /* 0xB3 @ 252 */ 0xC2, 0xB3, + /* 0xB4 @ 254 */ 0xC2, 0xB4, + /* 0xB5 @ 256 */ 0xC2, 0xB5, + /* 0xB6 @ 258 */ 0xC2, 0xB6, + /* 0xB7 @ 260 */ 0xC2, 0xB7, + /* 0xB8 @ 262 */ 0xC2, 0xB8, + /* 0xB9 @ 264 */ 0xC2, 0xB9, + /* 0xBA @ 266 */ 0xC2, 0xBA, + /* 0xBB @ 268 */ 0xC2, 0xBB, + /* 0xBC @ 270 */ 0xC2, 0xBC, + /* 0xBD @ 272 */ 0xC2, 0xBD, + /* 0xBE @ 274 */ 0xC2, 0xBE, + /* 0xBF @ 276 */ 0xC2, 0xBF, + /* 0xC0 @ 278 */ 0xC3, 0x80, + /* 0xC1 @ 280 */ 0xC3, 0x81, + /* 0xC2 @ 282 */ 0xC3, 0x82, + /* 0xC3 @ 284 */ 0xC3, 0x83, + /* 0xC4 @ 286 */ 0xC3, 0x84, + /* 0xC5 @ 288 */ 0xC3, 0x85, + /* 0xC6 @ 290 */ 0xC3, 0x86, + /* 0xC7 @ 292 */ 0xC3, 0x87, + /* 0xC8 @ 294 */ 0xC3, 0x88, + /* 0xC9 @ 296 */ 0xC3, 0x89, + /* 0xCA @ 298 */ 0xC3, 0x8A, + /* 0xCB @ 300 */ 0xC3, 0x8B, + /* 0xCC @ 302 */ 0xC3, 0x8C, + /* 0xCD @ 304 */ 0xC3, 0x8D, + /* 0xCE @ 306 */ 0xC3, 0x8E, + /* 0xCF @ 308 */ 0xC3, 0x8F, + /* 0xD0 @ 310 */ 0xC3, 0x90, + /* 0xD1 @ 312 */ 0xC3, 0x91, + /* 0xD2 @ 314 */ 0xC3, 0x92, + /* 0xD3 @ 316 */ 0xC3, 0x93, + /* 0xD4 @ 318 */ 0xC3, 0x94, + /* 0xD5 @ 320 */ 0xC3, 0x95, + /* 0xD6 @ 322 */ 0xC3, 0x96, + /* 0xD7 @ 324 */ 0xC3, 0x97, + /* 0xD8 @ 326 */ 0xC3, 0x98, + /* 0xD9 @ 328 */ 0xC3, 0x99, + /* 0xDA @ 330 */ 0xC3, 0x9A, + /* 0xDB @ 332 */ 0xC3, 0x9B, + /* 0xDC @ 334 */ 0xC3, 0x9C, + /* 0xDD @ 336 */ 0xC3, 0x9D, + /* 0xDE @ 338 */ 0xC3, 0x9E, + /* 0xDF @ 340 */ 0xC3, 0x9F, + /* 0xE0 @ 342 */ 0xC3, 0xA0, + /* 0xE1 @ 344 */ 0xC3, 0xA1, + /* 0xE2 @ 346 */ 0xC3, 0xA2, + /* 0xE3 @ 348 */ 0xC3, 0xA3, + /* 0xE4 @ 350 */ 0xC3, 0xA4, + /* 0xE5 @ 352 */ 0xC3, 0xA5, + /* 0xE6 @ 354 */ 0xC3, 0xA6, + /* 0xE7 @ 356 */ 0xC3, 0xA7, + /* 0xE8 @ 358 */ 0xC3, 0xA8, + /* 0xE9 @ 360 */ 0xC3, 0xA9, + /* 0xEA @ 362 */ 0xC3, 0xAA, + /* 0xEB @ 364 */ 0xC3, 0xAB, + /* 0xEC @ 366 */ 0xC3, 0xAC, + /* 0xED @ 368 */ 0xC3, 0xAD, + /* 0xEE @ 370 */ 0xC3, 0xAE, + /* 0xEF @ 372 */ 0xC3, 0xAF, + /* 0xF0 @ 374 */ 0xC3, 0xB0, + /* 0xF1 @ 376 */ 0xC3, 0xB1, + /* 0xF2 @ 378 */ 0xC3, 0xB2, + /* 0xF3 @ 380 */ 0xC3, 0xB3, + /* 0xF4 @ 382 */ 0xC3, 0xB4, + /* 0xF5 @ 384 */ 0xC3, 0xB5, + /* 0xF6 @ 386 */ 0xC3, 0xB6, + /* 0xF7 @ 388 */ 0xC3, 0xB7, + /* 0xF8 @ 390 */ 0xC3, 0xB8, + /* 0xF9 @ 392 */ 0xC3, 0xB9, + /* 0xFA @ 394 */ 0xC3, 0xBA, + /* 0xFB @ 396 */ 0xC3, 0xBB, + /* 0xFC @ 398 */ 0xC3, 0xBC, + /* 0xFD @ 400 */ 0xC3, 0xBD, + /* 0xFE @ 402 */ 0xC3, 0xBE, + /* 0xFF @ 404 */ 0xC3, 0xBF, +}; + +static const uint16_t tblofs[257] = { + /* 0x00 */ 0, 1, 2, 3, 4, 5, 6, 7, + /* 0x08 */ 8, 9, 10, 11, 12, 13, 14, 15, + /* 0x10 */ 16, 17, 18, 19, 20, 21, 22, 23, + /* 0x18 */ 24, 25, 26, 27, 28, 29, 30, 31, + /* 0x20 */ 32, 33, 34, 35, 36, 37, 38, 39, + /* 0x28 */ 40, 41, 42, 43, 44, 45, 46, 47, + /* 0x30 */ 48, 49, 50, 51, 52, 53, 54, 55, + /* 0x38 */ 56, 57, 58, 59, 60, 61, 62, 63, + /* 0x40 */ 64, 65, 66, 67, 68, 69, 70, 71, + /* 0x48 */ 72, 73, 74, 75, 76, 77, 78, 79, + /* 0x50 */ 80, 81, 82, 83, 84, 85, 86, 87, + /* 0x58 */ 88, 89, 90, 91, 92, 93, 94, 95, + /* 0x60 */ 96, 97, 98, 99, 100, 101, 102, 103, + /* 0x68 */ 104, 105, 106, 107, 108, 109, 110, 111, + /* 0x70 */ 112, 113, 114, 115, 116, 117, 118, 119, + /* 0x78 */ 120, 121, 122, 123, 124, 125, 126, 127, + /* 0x80 */ 128, 131, 134, 137, 139, 142, 145, 148, + /* 0x88 */ 151, 153, 156, 158, 161, 163, 166, 168, + /* 0x90 */ 171, 174, 177, 180, 183, 186, 189, 192, + /* 0x98 */ 195, 197, 200, 202, 205, 207, 210, 212, + /* 0xA0 */ 214, 216, 218, 220, 222, 224, 226, 228, + /* 0xA8 */ 230, 232, 234, 236, 238, 240, 242, 244, + /* 0xB0 */ 246, 248, 250, 252, 254, 256, 258, 260, + /* 0xB8 */ 262, 264, 266, 268, 270, 272, 274, 276, + /* 0xC0 */ 278, 280, 282, 284, 286, 288, 290, 292, + /* 0xC8 */ 294, 296, 298, 300, 302, 304, 306, 308, + /* 0xD0 */ 310, 312, 314, 316, 318, 320, 322, 324, + /* 0xD8 */ 326, 328, 330, 332, 334, 336, 338, 340, + /* 0xE0 */ 342, 344, 346, 348, 350, 352, 354, 356, + /* 0xE8 */ 358, 360, 362, 364, 366, 368, 370, 372, + /* 0xF0 */ 374, 376, 378, 380, 382, 384, 386, 388, + /* 0xF8 */ 390, 392, 394, 396, 398, 400, 402, 404, + /* sizeof (cp1252_utf8) */ 406 +}; + +/* Check if a string qualifies as UTF-8. */ +static int +is_utf8(const char* src) +{ + uint8_t ch; + size_t i; + const uint8_t* s = (const uint8_t*) src; + + /* We make a loop over every character, until we find a null one. + Remember: The string is supposed to end with a NUL, so ahead checks are safe. */ + while ((ch = *s++)) { + /* Ye olde 7bit ASCII chars 'rr fine for anything */ + if(ch < 0x80) continue; + + /* Now, we watch out for non-UTF conform sequences. */ + else if ((ch < 0xC2) || (ch > 0xFD)) + return 0; + /* check for some misformed sequences */ + if (((ch == 0xC2) && (s[0] < 0xA0)) || + ((ch == 0xEF) && (s[0] == 0xBF) && (s[1] > 0xBD))) + /* XXX add more for outside the BMP */ + return 0; + + /* Check the continuation bytes. */ + if (ch < 0xE0) i = 1; + else if (ch < 0xF0) i = 2; + else if (ch < 0xF8) i = 3; + else if (ch < 0xFC) i = 4; + else + i = 5; + + while (i--) + if ((*s++ & 0xC0) != 0x80) + return 0; + } + + /* If no check failed, the string indeed looks like valid UTF-8. */ + return 1; +} + +/* The main conversion routine. + ICY in CP-1252 (or UTF-8 alreay) to UTF-8 encoded string. + If force is applied, it will always encode to UTF-8, without checking. */ +char * +icy2utf8(const char *src, int force) +{ + const uint8_t *s = (const uint8_t *)src; + size_t srclen, dstlen, i, k; + uint8_t ch, *d; + char *dst; + + /* Some funny streams from Apple/iTunes give ICY info in UTF-8 already. + So, be prepared and don't try to re-encode such. Unless forced. */ + if(!force && is_utf8(src)) return (strdup(src)); + + srclen = strlen(src) + 1; + /* allocate conservatively */ + if ((d = malloc(srclen * 3)) == NULL) + return (NULL); + + i = 0; + dstlen = 0; + while (i < srclen) { + ch = s[i++]; + k = tblofs[ch]; + while (k < tblofs[ch + 1]) + d[dstlen++] = cp1252_utf8[k++]; + } + + /* dstlen includes trailing NUL since srclen also does */ + if ((dst = realloc(d, dstlen)) == NULL) { + free(d); + return (NULL); + } + return (dst); +} + +/* This stuff is for testing only. */ +#ifdef TEST +static const char intext[] = "\225 Gr\374\337e kosten 0,55 \200\205"; + +#include + +int +main(void) +{ + char *t, *t2; + + if ((t = icy2utf8(intext, 0)) == NULL) { + fprintf(stderr, "out of memory\n"); + return (1); + } + + /* make sure it won't be converted twice */ + if ((t2 = icy2utf8(t), 0) == NULL) { + fprintf(stderr, "out of memory\n"); + return (1); + } + + printf("Result is:\t\343\200\214%s\343\200\215\n" + "\t\t\343\200\214%s\343\200\215\n", t, t2); + + free(t); + free(t2); + return (0); +} +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/icy2utf8.h b/node_modules/lame/deps/mpg123/src/libmpg123/icy2utf8.h new file mode 100644 index 0000000..aeec012 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/icy2utf8.h @@ -0,0 +1,10 @@ +/* You expect a license plate for _this_ file? */ +#ifndef MPG123_ICY2UTF_H +#define MPG123_ICY2UTF_H + +#ifndef NO_ICY +/* (string, force conversion) */ +char *icy2utf8(const char *, int); +#endif + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/id3.c b/node_modules/lame/deps/mpg123/src/libmpg123/id3.c new file mode 100644 index 0000000..a2183aa --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/id3.c @@ -0,0 +1,999 @@ +/* + id3: ID3v2.3 and ID3v2.4 parsing (a relevant subset) + + copyright 2006-2008 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "mpg123lib_intern.h" +#include "id3.h" +#include "debug.h" + +#ifndef NO_ID3V2 /* Only the main parsing routine will always be there. */ + +/* We know the usual text frames plus some specifics. */ +#define KNOWN_FRAMES 4 +static const char frame_type[KNOWN_FRAMES][5] = { "COMM", "TXXX", "RVA2", "USLT" }; +enum frame_types { unknown = -2, text = -1, comment, extra, rva2, uslt }; + +/* UTF support definitions */ + +typedef void (*text_converter)(mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet); + +static void convert_latin1 (mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet); +static void convert_utf16bom(mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet); +static void convert_utf8 (mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet); + +static const text_converter text_converters[4] = +{ + convert_latin1, + /* We always check for (multiple) BOM in 16bit unicode. Without BOM, UTF16 BE is the default. + Errors in encoding are detected anyway. */ + convert_utf16bom, + convert_utf16bom, + convert_utf8 +}; + +static const unsigned int encoding_widths[4] = { 1, 2, 2, 1 }; + +/* the code starts here... */ + +static void null_id3_links(mpg123_handle *fr) +{ + fr->id3v2.title = NULL; + fr->id3v2.artist = NULL; + fr->id3v2.album = NULL; + fr->id3v2.year = NULL; + fr->id3v2.genre = NULL; + fr->id3v2.comment = NULL; +} + +void init_id3(mpg123_handle *fr) +{ + fr->id3v2.version = 0; /* nothing there */ + null_id3_links(fr); + fr->id3v2.comments = 0; + fr->id3v2.comment_list = NULL; + fr->id3v2.texts = 0; + fr->id3v2.text = NULL; + fr->id3v2.extras = 0; + fr->id3v2.extra = NULL; +} + +/* Managing of the text, comment and extra lists. */ + +/* Initialize one element. */ +static void init_mpg123_text(mpg123_text *txt) +{ + mpg123_init_string(&txt->text); + mpg123_init_string(&txt->description); + txt->id[0] = 0; + txt->id[1] = 0; + txt->id[2] = 0; + txt->id[3] = 0; + txt->lang[0] = 0; + txt->lang[1] = 0; + txt->lang[2] = 0; +} + +/* Free memory of one element. */ +static void free_mpg123_text(mpg123_text *txt) +{ + mpg123_free_string(&txt->text); + mpg123_free_string(&txt->description); +} + +/* Free memory of whole list. */ +#define free_comment(mh) free_id3_text(&((mh)->id3v2.comment_list), &((mh)->id3v2.comments)) +#define free_text(mh) free_id3_text(&((mh)->id3v2.text), &((mh)->id3v2.texts)) +#define free_extra(mh) free_id3_text(&((mh)->id3v2.extra), &((mh)->id3v2.extras)) +static void free_id3_text(mpg123_text **list, size_t *size) +{ + size_t i; + for(i=0; i<*size; ++i) free_mpg123_text(&((*list)[i])); + + free(*list); + *list = NULL; + *size = 0; +} + +/* Add items to the list. */ +#define add_comment(mh) add_id3_text(&((mh)->id3v2.comment_list), &((mh)->id3v2.comments)) +#define add_text(mh) add_id3_text(&((mh)->id3v2.text), &((mh)->id3v2.texts)) +#define add_extra(mh) add_id3_text(&((mh)->id3v2.extra), &((mh)->id3v2.extras)) +static mpg123_text *add_id3_text(mpg123_text **list, size_t *size) +{ + mpg123_text *x = safe_realloc(*list, sizeof(mpg123_text)*(*size+1)); + if(x == NULL) return NULL; /* bad */ + + *list = x; + *size += 1; + init_mpg123_text(&((*list)[*size-1])); + + return &((*list)[*size-1]); /* Return pointer to the added text. */ +} + +/* Remove the last item. */ +#define pop_comment(mh) pop_id3_text(&((mh)->id3v2.comment_list), &((mh)->id3v2.comments)) +#define pop_text(mh) pop_id3_text(&((mh)->id3v2.text), &((mh)->id3v2.texts)) +#define pop_extra(mh) pop_id3_text(&((mh)->id3v2.extra), &((mh)->id3v2.extras)) +static void pop_id3_text(mpg123_text **list, size_t *size) +{ + mpg123_text *x; + if(*size < 1) return; + + free_mpg123_text(&((*list)[*size-1])); + if(*size > 1) + { + x = safe_realloc(*list, sizeof(mpg123_text)*(*size-1)); + if(x != NULL){ *list = x; *size -= 1; } + } + else + { + free(*list); + *list = NULL; + *size = 0; + } +} + +/* OK, back t the higher level functions. */ + +void exit_id3(mpg123_handle *fr) +{ + free_comment(fr); + free_extra(fr); + free_text(fr); +} + +void reset_id3(mpg123_handle *fr) +{ + exit_id3(fr); + init_id3(fr); +} + +/* Set the id3v2.artist id3v2.title ... links to elements of the array. */ +void id3_link(mpg123_handle *fr) +{ + size_t i; + mpg123_id3v2 *v2 = &fr->id3v2; + debug("linking ID3v2"); + null_id3_links(fr); + for(i=0; itexts; ++i) + { + mpg123_text *entry = &v2->text[i]; + if (!strncmp("TIT2", entry->id, 4)) v2->title = &entry->text; + else if(!strncmp("TALB", entry->id, 4)) v2->album = &entry->text; + else if(!strncmp("TPE1", entry->id, 4)) v2->artist = &entry->text; + else if(!strncmp("TYER", entry->id, 4)) v2->year = &entry->text; + else if(!strncmp("TCON", entry->id, 4)) v2->genre = &entry->text; + } + for(i=0; icomments; ++i) + { + mpg123_text *entry = &v2->comment_list[i]; + if(entry->description.fill == 0 || entry->description.p[0] == 0) + v2->comment = &entry->text; + } + /* When no generic comment found, use the last non-generic one. */ + if(v2->comment == NULL && v2->comments > 0) + v2->comment = &v2->comment_list[v2->comments-1].text; +} + +/* + Store ID3 text data in an mpg123_string; either verbatim copy or everything translated to UTF-8 encoding. + Preserve the zero string separator (I don't need strlen for the total size). + + ID3v2 standard says that there should be one text frame of specific type per tag, and subsequent tags overwrite old values. + So, I always replace the text that may be stored already (perhaps with a list of zero-separated strings, though). +*/ +static void store_id3_text(mpg123_string *sb, char *source, size_t source_size, const int noquiet, const int notranslate) +{ + if(!source_size) + { + debug("Empty id3 data!"); + return; + } + + /* We shall just copy the data. Client wants to decode itself. */ + if(notranslate) + { + /* Future: Add a path for ID3 errors. */ + if(!mpg123_resize_string(sb, source_size)) + { + if(noquiet) error("Cannot resize target string, out of memory?"); + return; + } + memcpy(sb->p, source, source_size); + sb->fill = source_size; + debug1("stored undecoded ID3 text of size %"SIZE_P, (size_p)source_size); + return; + } + + id3_to_utf8(sb, ((unsigned char *)source)[0], (unsigned char*)source+1, source_size-1, noquiet); + + if(sb->fill) debug1("UTF-8 string (the first one): %s", sb->p); + else if(noquiet) error("unable to convert string to UTF-8 (out of memory, junk input?)!"); +} + +/* On error, sb->size is 0. */ +void id3_to_utf8(mpg123_string *sb, unsigned char encoding, const unsigned char *source, size_t source_size, int noquiet) +{ + unsigned int bwidth; + debug1("encoding: %u", encoding); + /* A note: ID3v2.3 uses UCS-2 non-variable 16bit encoding, v2.4 uses UTF16. + UTF-16 uses a reserved/private range in UCS-2 to add the magic, so we just always treat it as UTF. */ + if(encoding > mpg123_id3_enc_max) + { + if(noquiet) error1("Unknown text encoding %u, I take no chances, sorry!", encoding); + + mpg123_free_string(sb); + return; + } + bwidth = encoding_widths[encoding]; + /* Hack! I've seen a stray zero byte before BOM. Is that supposed to happen? */ + if(encoding != mpg123_id3_utf16be) /* UTF16be _can_ beging with a null byte! */ + while(source_size > bwidth && source[0] == 0) + { + --source_size; + ++source; + debug("skipped leading zero"); + } + if(source_size % bwidth) + { + /* When we need two bytes for a character, it's strange to have an uneven bytestream length. */ + if(noquiet) warning2("Weird tag size %d for encoding %u - I will probably trim too early or something but I think the MP3 is broken.", (int)source_size, encoding); + source_size -= source_size % bwidth; + } + text_converters[encoding](sb, source, source_size, noquiet); +} + +static char *next_text(char* prev, int encoding, size_t limit) +{ + char *text = prev; + size_t width = encoding_widths[encoding]; + + /* So I go lengths to find zero or double zero... + Remember bug 2834636: Only check for aligned NULLs! */ + while(text-prev < (ssize_t)limit) + { + if(text[0] == 0) + { + if(width <= limit-(text-prev)) + { + size_t i = 1; + for(; i= limit) text = NULL; + + return text; +} + +static const char *enc_name(int enc) +{ + switch(enc) + { + case 0: return "Latin 1"; + case 1: return "UTF-16 BOM"; + case 2: return "UTF-16 BE"; + case 3: return "UTF-8"; + default: return "unknown!"; + } +} + +static void process_text(mpg123_handle *fr, char *realdata, size_t realsize, char *id) +{ + /* Text encoding $xx */ + /* The text (encoded) ... */ + mpg123_text *t = add_text(fr); + if(VERBOSE4) fprintf(stderr, "Note: Storing text from %s encoding\n", enc_name(realdata[0])); + if(t == NULL) + { + if(NOQUIET) error("Unable to attach new text!"); + return; + } + memcpy(t->id, id, 4); + store_id3_text(&t->text, realdata, realsize, NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT); + if(VERBOSE4) fprintf(stderr, "Note: ID3v2 %c%c%c%c text frame: %s\n", id[0], id[1], id[2], id[3], t->text.p); +} + +/* Store a new comment that perhaps is a RVA / RVA_ALBUM/AUDIOPHILE / RVA_MIX/RADIO one + Special gimmik: It also stores USLT to the texts. Stucture is the same as for comments. */ +static void process_comment(mpg123_handle *fr, enum frame_types tt, char *realdata, size_t realsize, int rva_level, char *id) +{ + /* Text encoding $xx */ + /* Language $xx xx xx */ + /* Short description (encoded!) $00 (00) */ + /* Then the comment text (encoded) ... */ + char encoding = realdata[0]; + char *lang = realdata+1; /* I'll only use the 3 bytes! */ + char *descr = realdata+4; + char *text = NULL; + mpg123_text *xcom = NULL; + mpg123_text localcom; /* UTF-8 variant for local processing. */ + + if((int)realsize < descr-realdata) + { + if(NOQUIET) error1("Invalid frame size of %lu (too small for anything).", (unsigned long)realsize); + return; + } + xcom = (tt == uslt ? add_text(fr) : add_comment(fr)); + if(VERBOSE4) fprintf(stderr, "Note: Storing comment from %s encoding\n", enc_name(realdata[0])); + if(xcom == NULL) + { + if(NOQUIET) error("Unable to attach new comment!"); + return; + } + memcpy(xcom->lang, lang, 3); + memcpy(xcom->id, id, 4); + /* Now I can abuse a byte from lang for the encoding. */ + descr[-1] = encoding; + /* Be careful with finding the end of description, I have to honor encoding here. */ + text = next_text(descr, encoding, realsize-(descr-realdata)); + if(text == NULL) + { + if(NOQUIET) error("No comment text / valid description?"); + pop_comment(fr); + return; + } + + init_mpg123_text(&localcom); + /* Store the text, without translation to UTF-8, but for comments always a local copy in UTF-8. + Reminder: No bailing out from here on without freeing the local comment data! */ + store_id3_text(&xcom->description, descr-1, text-descr+1, NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT); + if(tt == comment) + store_id3_text(&localcom.description, descr-1, text-descr+1, NOQUIET, 0); + + text[-1] = encoding; /* Byte abusal for encoding... */ + store_id3_text(&xcom->text, text-1, realsize+1-(text-realdata), NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT); + /* Remember: I will probably decode the above (again) for rva comment checking. So no messing around, please. */ + + if(VERBOSE4) /* Do _not_ print the verbatim text: The encoding might be funny! */ + { + fprintf(stderr, "Note: ID3 comm/uslt desc of length %"SIZE_P".\n", (size_p)xcom->description.fill); + fprintf(stderr, "Note: ID3 comm/uslt text of length %"SIZE_P".\n", (size_p)xcom->text.fill); + } + /* Look out for RVA info only when we really deal with a straight comment. */ + if(tt == comment && localcom.description.fill > 0) + { + int rva_mode = -1; /* mix / album */ + if( !strcasecmp(localcom.description.p, "rva") + || !strcasecmp(localcom.description.p, "rva_mix") + || !strcasecmp(localcom.description.p, "rva_track") + || !strcasecmp(localcom.description.p, "rva_radio") ) + rva_mode = 0; + else if( !strcasecmp(localcom.description.p, "rva_album") + || !strcasecmp(localcom.description.p, "rva_audiophile") + || !strcasecmp(localcom.description.p, "rva_user") ) + rva_mode = 1; + if((rva_mode > -1) && (fr->rva.level[rva_mode] <= rva_level)) + { + /* Only translate the contents in here where we really need them. */ + store_id3_text(&localcom.text, text-1, realsize+1-(text-realdata), NOQUIET, 0); + if(localcom.text.fill > 0) + { + fr->rva.gain[rva_mode] = (float) atof(localcom.text.p); + if(VERBOSE3) fprintf(stderr, "Note: RVA value %fdB\n", fr->rva.gain[rva_mode]); + fr->rva.peak[rva_mode] = 0; + fr->rva.level[rva_mode] = rva_level; + } + } + } + /* Make sure to free the local memory... */ + free_mpg123_text(&localcom); +} + +static void process_extra(mpg123_handle *fr, char* realdata, size_t realsize, int rva_level, char *id) +{ + /* Text encoding $xx */ + /* Description ... $00 (00) */ + /* Text ... */ + char encoding = realdata[0]; + char *descr = realdata+1; /* remember, the encoding is descr[-1] */ + char *text; + mpg123_text *xex; + mpg123_text localex; + + if((int)realsize < descr-realdata) + { + if(NOQUIET) error1("Invalid frame size of %lu (too small for anything).", (unsigned long)realsize); + return; + } + text = next_text(descr, encoding, realsize-(descr-realdata)); + if(VERBOSE4) fprintf(stderr, "Note: Storing extra from %s encoding\n", enc_name(realdata[0])); + if(text == NULL) + { + if(NOQUIET) error("No extra frame text / valid description?"); + return; + } + xex = add_extra(fr); + if(xex == NULL) + { + if(NOQUIET) error("Unable to attach new extra text!"); + return; + } + memcpy(xex->id, id, 4); + init_mpg123_text(&localex); /* For our local copy. */ + + /* The outside storage gets reencoded to UTF-8 only if not requested otherwise. + Remember that we really need the -1 here to hand in the encoding byte!*/ + store_id3_text(&xex->description, descr-1, text-descr+1, NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT); + /* Our local copy is always stored in UTF-8! */ + store_id3_text(&localex.description, descr-1, text-descr+1, NOQUIET, 0); + /* At first, only store the outside copy of the payload. We may not need the local copy. */ + text[-1] = encoding; + store_id3_text(&xex->text, text-1, realsize-(text-realdata)+1, NOQUIET, fr->p.flags & MPG123_PLAIN_ID3TEXT); + + /* Now check if we would like to interpret this extra info for RVA. */ + if(localex.description.fill > 0) + { + int is_peak = 0; + int rva_mode = -1; /* mix / album */ + + if(!strncasecmp(localex.description.p, "replaygain_track_",17)) + { + if(VERBOSE3) fprintf(stderr, "Note: RVA ReplayGain track gain/peak\n"); + + rva_mode = 0; + if(!strcasecmp(localex.description.p, "replaygain_track_peak")) is_peak = 1; + else if(strcasecmp(localex.description.p, "replaygain_track_gain")) rva_mode = -1; + } + else + if(!strncasecmp(localex.description.p, "replaygain_album_",17)) + { + if(VERBOSE3) fprintf(stderr, "Note: RVA ReplayGain album gain/peak\n"); + + rva_mode = 1; + if(!strcasecmp(localex.description.p, "replaygain_album_peak")) is_peak = 1; + else if(strcasecmp(localex.description.p, "replaygain_album_gain")) rva_mode = -1; + } + if((rva_mode > -1) && (fr->rva.level[rva_mode] <= rva_level)) + { + /* Now we need the translated copy of the data. */ + store_id3_text(&localex.text, text-1, realsize-(text-realdata)+1, NOQUIET, 0); + if(localex.text.fill > 0) + { + if(is_peak) + { + fr->rva.peak[rva_mode] = (float) atof(localex.text.p); + if(VERBOSE3) fprintf(stderr, "Note: RVA peak %f\n", fr->rva.peak[rva_mode]); + } + else + { + fr->rva.gain[rva_mode] = (float) atof(localex.text.p); + if(VERBOSE3) fprintf(stderr, "Note: RVA gain %fdB\n", fr->rva.gain[rva_mode]); + } + fr->rva.level[rva_mode] = rva_level; + } + } + } + + free_mpg123_text(&localex); +} + +/* Make a ID3v2.3+ 4-byte ID from a ID3v2.2 3-byte ID + Note that not all frames survived to 2.4; the mapping goes to 2.3 . + A notable miss is the old RVA frame, which is very unspecific anyway. + This function returns -1 when a not known 3 char ID was encountered, 0 otherwise. */ +static int promote_framename(mpg123_handle *fr, char *id) /* fr because of VERBOSE macros */ +{ + size_t i; + char *old[] = + { + "COM", "TAL", "TBP", "TCM", "TCO", "TCR", "TDA", "TDY", "TEN", "TFT", + "TIM", "TKE", "TLA", "TLE", "TMT", "TOA", "TOF", "TOL", "TOR", "TOT", + "TP1", "TP2", "TP3", "TP4", "TPA", "TPB", "TRC", "TDA", "TRK", "TSI", + "TSS", "TT1", "TT2", "TT3", "TXT", "TXX", "TYE" + }; + char *new[] = + { + "COMM", "TALB", "TBPM", "TCOM", "TCON", "TCOP", "TDAT", "TDLY", "TENC", "TFLT", + "TIME", "TKEY", "TLAN", "TLEN", "TMED", "TOPE", "TOFN", "TOLY", "TORY", "TOAL", + "TPE1", "TPE2", "TPE3", "TPE4", "TPOS", "TPUB", "TSRC", "TRDA", "TRCK", "TSIZ", + "TSSE", "TIT1", "TIT2", "TIT3", "TEXT", "TXXX", "TYER" + }; + for(i=0; ird->read_frame_body(fr, buf, 6)) < 0) /* read more header information */ + return ret2; + + if(buf[0] == 0xff) return 0; /* Revision, will never be 0xff. */ + + /* second new byte are some nice flags, if these are invalid skip the whole thing */ + flags = buf[1]; + debug1("ID3v2: flags 0x%08x", flags); + /* use 4 bytes from buf to construct 28bit uint value and return 1; return 0 if bytes are not synchsafe */ + #define synchsafe_to_long(buf,res) \ + ( \ + (((buf)[0]|(buf)[1]|(buf)[2]|(buf)[3]) & 0x80) ? 0 : \ + (res = (((unsigned long) (buf)[0]) << 21) \ + | (((unsigned long) (buf)[1]) << 14) \ + | (((unsigned long) (buf)[2]) << 7) \ + | ((unsigned long) (buf)[3]) \ + ,1) \ + ) + /* id3v2.3 does not store synchsafe frame sizes, but synchsafe tag size - doh! */ + #define bytes_to_long(buf,res) \ + ( \ + major == 3 ? \ + (res = (((unsigned long) (buf)[0]) << 24) \ + | (((unsigned long) (buf)[1]) << 16) \ + | (((unsigned long) (buf)[2]) << 8) \ + | ((unsigned long) (buf)[3]) \ + ,1) : synchsafe_to_long(buf,res) \ + ) + /* for id3v2.2 only */ + #define threebytes_to_long(buf,res) \ + ( \ + res = (((unsigned long) (buf)[0]) << 16) \ + | (((unsigned long) (buf)[1]) << 8) \ + | ((unsigned long) (buf)[2]) \ + ,1 \ + ) + + /* length-10 or length-20 (footer present); 4 synchsafe integers == 28 bit number */ + /* we have already read 10 bytes, so left are length or length+10 bytes belonging to tag */ + if(!synchsafe_to_long(buf+2,length)) + { + if(NOQUIET) error4("Bad tag length (not synchsafe): 0x%02x%02x%02x%02x; You got a bad ID3 tag here.", buf[2],buf[3],buf[4],buf[5]); + return 0; + } + debug1("ID3v2: tag data length %lu", length); +#ifndef NO_ID3V2 + if(VERBOSE2) fprintf(stderr,"Note: ID3v2.%i rev %i tag of %lu bytes\n", major, buf[0], length); + /* skip if unknown version/scary flags, parse otherwise */ + if(fr->p.flags & MPG123_SKIP_ID3V2 || ((flags & UNKNOWN_FLAGS) || (major > 4) || (major < 2))) + { + if(NOQUIET) + { + if(fr->p.flags & MPG123_SKIP_ID3V2) + { + if(VERBOSE3) fprintf(stderr, "Note: Skipping ID3v2 tag per user request.\n"); + } + else /* Must be because of scary Tag properties. */ + warning2("ID3v2: Won't parse the ID3v2 tag with major version %u and flags 0x%xu - some extra code may be needed", major, flags); + } +#endif + if((ret2 = fr->rd->skip_bytes(fr,length)) < 0) /* will not store data in backbuff! */ + ret = ret2; +#ifndef NO_ID3V2 + } + else + { + unsigned char* tagdata = NULL; + fr->id3v2.version = major; + /* try to interpret that beast */ + if((tagdata = (unsigned char*) malloc(length+1)) != NULL) + { + debug("ID3v2: analysing frames..."); + if((ret2 = fr->rd->read_frame_body(fr,tagdata,length)) > 0) + { + unsigned long tagpos = 0; + debug1("ID3v2: have read at all %lu bytes for the tag now", (unsigned long)length+6); + /* going to apply strlen for strings inside frames, make sure that it doesn't overflow! */ + tagdata[length] = 0; + if(flags & EXTHEAD_FLAG) + { + debug("ID3v2: skipping extended header"); + if(!bytes_to_long(tagdata, tagpos)) + { + ret = 0; + if(NOQUIET) error4("Bad (non-synchsafe) tag offset: 0x%02x%02x%02x%02x", tagdata[0], tagdata[1], tagdata[2], tagdata[3]); + } + } + if(ret > 0) + { + char id[5]; + unsigned long framesize; + unsigned long fflags; /* need 16 bits, actually */ + id[4] = 0; + /* pos now advanced after ext head, now a frame has to follow */ + while(tagpos < length-10) /* I want to read at least a full header */ + { + int i = 0; + unsigned long pos = tagpos; + int head_part = fr->id3v2.version == 2 ? 3 : 4; /* bytes of frame title and of framesize value */ + /* level 1,2,3 - 0 is info from lame/info tag! */ + /* rva tags with ascending significance, then general frames */ + enum frame_types tt = unknown; + /* we may have entered the padding zone or any other strangeness: check if we have valid frame id characters */ + for(i=0; i< head_part; ++i) + if( !( ((tagdata[tagpos+i] > 47) && (tagdata[tagpos+i] < 58)) + || ((tagdata[tagpos+i] > 64) && (tagdata[tagpos+i] < 91)) ) ) + { + debug5("ID3v2: real tag data apparently ended after %lu bytes with 0x%02x%02x%02x%02x", tagpos, tagdata[tagpos], tagdata[tagpos+1], tagdata[tagpos+2], tagdata[tagpos+3]); + /* This is no hard error... let's just hope that we got something meaningful already (ret==1 in that case). */ + goto tagparse_cleanup; /* Need to escape two loops here. */ + } + if(ret > 0) + { + /* 4 or 3 bytes id */ + strncpy(id, (char*) tagdata+pos, head_part); + id[head_part] = 0; /* terminate for 3 or 4 bytes */ + pos += head_part; + tagpos += head_part; + /* size as 32 bits or 28 bits */ + if(fr->id3v2.version == 2) threebytes_to_long(tagdata+pos, framesize); + else + if(!bytes_to_long(tagdata+pos, framesize)) + { + /* Just assume that up to now there was some good data. */ + if(NOQUIET) error1("ID3v2: non-syncsafe size of %s frame, skipping the remainder of tag", id); + break; + } + if(VERBOSE3) fprintf(stderr, "Note: ID3v2 %s frame of size %lu\n", id, framesize); + tagpos += head_part + framesize; /* the important advancement in whole tag */ + if(tagpos > length) + { + if(NOQUIET) error("Whoa! ID3v2 frame claims to be larger than the whole rest of the tag."); + break; + } + pos += head_part; + if(fr->id3v2.version > 2) + { + fflags = (((unsigned long) tagdata[pos]) << 8) | ((unsigned long) tagdata[pos+1]); + pos += 2; + tagpos += 2; + } + else fflags = 0; + /* for sanity, after full parsing tagpos should be == pos */ + /* debug4("ID3v2: found %s frame, size %lu (as bytes: 0x%08lx), flags 0x%016lx", id, framesize, framesize, fflags); */ + /* %0abc0000 %0h00kmnp */ + #define BAD_FFLAGS (unsigned long) 36784 + #define PRES_TAG_FFLAG 16384 + #define PRES_FILE_FFLAG 8192 + #define READ_ONLY_FFLAG 4096 + #define GROUP_FFLAG 64 + #define COMPR_FFLAG 8 + #define ENCR_FFLAG 4 + #define UNSYNC_FFLAG 2 + #define DATLEN_FFLAG 1 + if(head_part < 4 && promote_framename(fr, id) != 0) continue; + + /* shall not or want not handle these */ + if(fflags & (BAD_FFLAGS | COMPR_FFLAG | ENCR_FFLAG)) + { + if(NOQUIET) warning("ID3v2: skipping invalid/unsupported frame"); + continue; + } + + for(i = 0; i < KNOWN_FRAMES; ++i) + if(!strncmp(frame_type[i], id, 4)){ tt = i; break; } + + if(id[0] == 'T' && tt != extra) tt = text; + + if(tt != unknown) + { + int rva_mode = -1; /* mix / album */ + unsigned long realsize = framesize; + unsigned char* realdata = tagdata+pos; + if((flags & UNSYNC_FLAG) || (fflags & UNSYNC_FFLAG)) + { + unsigned long ipos = 0; + unsigned long opos = 0; + debug("Id3v2: going to de-unsync the frame data"); + /* de-unsync: FF00 -> FF; real FF00 is simply represented as FF0000 ... */ + /* damn, that means I have to delete bytes from withing the data block... thus need temporal storage */ + /* standard mandates that de-unsync should always be safe if flag is set */ + realdata = (unsigned char*) malloc(framesize); /* will need <= bytes */ + if(realdata == NULL) + { + if(NOQUIET) error("ID3v2: unable to allocate working buffer for de-unsync"); + continue; + } + /* now going byte per byte through the data... */ + realdata[0] = tagdata[pos]; + opos = 1; + for(ipos = pos+1; ipos < pos+framesize; ++ipos) + { + if(!((tagdata[ipos] == 0) && (tagdata[ipos-1] == 0xff))) + { + realdata[opos++] = tagdata[ipos]; + } + } + realsize = opos; + debug2("ID3v2: de-unsync made %lu out of %lu bytes", realsize, framesize); + } + pos = 0; /* now at the beginning again... */ + switch(tt) + { + case comment: + case uslt: + process_comment(fr, tt, (char*)realdata, realsize, comment+1, id); + break; + case extra: /* perhaps foobar2000's work */ + process_extra(fr, (char*)realdata, realsize, extra+1, id); + break; + case rva2: /* "the" RVA tag */ + { + /* starts with null-terminated identification */ + if(VERBOSE3) fprintf(stderr, "Note: RVA2 identification \"%s\"\n", realdata); + /* default: some individual value, mix mode */ + rva_mode = 0; + if( !strncasecmp((char*)realdata, "album", 5) + || !strncasecmp((char*)realdata, "audiophile", 10) + || !strncasecmp((char*)realdata, "user", 4)) + rva_mode = 1; + if(fr->rva.level[rva_mode] <= rva2+1) + { + pos += strlen((char*) realdata) + 1; + if(realdata[pos] == 1) + { + ++pos; + /* only handle master channel */ + debug("ID3v2: it is for the master channel"); + /* two bytes adjustment, one byte for bits representing peak - n bytes, eh bits, for peak */ + /* 16 bit signed integer = dB * 512 ... the double cast is needed to preserve the sign of negative values! */ + fr->rva.gain[rva_mode] = (float) ( (((short)((signed char)realdata[pos])) << 8) | realdata[pos+1] ) / 512; + pos += 2; + if(VERBOSE3) fprintf(stderr, "Note: RVA value %fdB\n", fr->rva.gain[rva_mode]); + /* heh, the peak value is represented by a number of bits - but in what manner? Skipping that part */ + fr->rva.peak[rva_mode] = 0; + fr->rva.level[rva_mode] = rva2+1; + } + } + } + break; + /* non-rva metainfo, simply store... */ + case text: + process_text(fr, (char*)realdata, realsize, id); + break; + default: if(NOQUIET) error1("ID3v2: unknown frame type %i", tt); + } + if((flags & UNSYNC_FLAG) || (fflags & UNSYNC_FFLAG)) free(realdata); + } + #undef BAD_FFLAGS + #undef PRES_TAG_FFLAG + #undef PRES_FILE_FFLAG + #undef READ_ONLY_FFLAG + #undef GROUP_FFLAG + #undef COMPR_FFLAG + #undef ENCR_FFLAG + #undef UNSYNC_FFLAG + #undef DATLEN_FFLAG + } + else break; + #undef KNOWN_FRAMES + } + } + } + else + { + /* There are tags with zero length. Strictly not an error, then. */ + if(length > 0 && NOQUIET && ret2 != MPG123_NEED_MORE) error("ID3v2: Duh, not able to read ID3v2 tag data."); + ret = ret2; + } +tagparse_cleanup: + free(tagdata); + } + else + { + if(NOQUIET) error1("ID3v2: Arrg! Unable to allocate %lu bytes for interpreting ID3v2 data - trying to skip instead.", length); + if((ret2 = fr->rd->skip_bytes(fr,length)) < 0) ret = ret2; /* will not store data in backbuff! */ + else ret = 0; + } + } +#endif /* NO_ID3V2 */ + /* skip footer if present */ + if((ret > 0) && (flags & FOOTER_FLAG) && ((ret2 = fr->rd->skip_bytes(fr,length)) < 0)) ret = ret2; + + return ret; + #undef UNSYNC_FLAG + #undef EXTHEAD_FLAG + #undef EXP_FLAG + #undef FOOTER_FLAG + #undef UNKOWN_FLAGS +} + +#ifndef NO_ID3V2 /* Disabling all the rest... */ + +static void convert_latin1(mpg123_string *sb, const unsigned char* s, size_t l, const int noquiet) +{ + size_t length = l; + size_t i; + unsigned char *p; + /* determine real length, a latin1 character can at most take 2 in UTF8 */ + for(i=0; i= 0x80) ++length; + + debug1("UTF-8 length: %lu", (unsigned long)length); + /* one extra zero byte for paranoia */ + if(!mpg123_resize_string(sb, length+1)){ mpg123_free_string(sb); return ; } + + p = (unsigned char*) sb->p; /* Signedness doesn't matter but it shows I thought about the non-issue */ + for(i=0; i>6); + *(p+1) = 0x80 | (s[i] & 0x3f); + p+=2; + } + + sb->p[length] = 0; + sb->fill = length+1; +} + +/* + Check if we have a byte oder mark(s) there, return: + -1: little endian + 0: no BOM + 1: big endian + + This modifies source and len to indicate the data _after_ the BOM(s). + Note on nasty data: The last encountered BOM determines the endianness. + I have seen data with multiple BOMS, namely from "the" id3v2 program. + Not nice, but what should I do? +*/ +static int check_bom(const unsigned char** source, size_t *len) +{ + int this_bom = 0; + int further_bom = 0; + + if(*len < 2) return 0; + + if((*source)[0] == 0xff && (*source)[1] == 0xfe) + this_bom = -1; + + if((*source)[0] == 0xfe && (*source)[1] == 0xff) + this_bom = 1; + + /* Skip the detected BOM. */ + if(this_bom != 0) + { + *source += 2; + *len -= 2; + /* Check for following BOMs. The last one wins! */ + further_bom = check_bom(source, len); + if(further_bom == 0) return this_bom; /* End of the recursion. */ + else return further_bom; + } + else return 0; +} + +#define FULLPOINT(f,s) ( (((f)&0x3ff)<<10) + ((s)&0x3ff) + 0x10000 ) +/* Remember: There's a limit at 0x1ffff. */ +#define UTF8LEN(x) ( (x)<0x80 ? 1 : ((x)<0x800 ? 2 : ((x)<0x10000 ? 3 : 4))) +static void convert_utf16bom(mpg123_string *sb, const unsigned char* s, size_t l, const int noquiet) +{ + size_t i; + size_t n; /* number bytes that make up full pairs */ + unsigned char *p; + size_t length = 0; /* the resulting UTF-8 length */ + /* Determine real length... extreme case can be more than utf-16 length. */ + size_t high = 0; + size_t low = 1; + int bom_endian; + + debug1("convert_utf16 with length %lu", (unsigned long)l); + + bom_endian = check_bom(&s, &l); + debug1("UTF16 endianness check: %i", bom_endian); + + if(bom_endian == -1) /* little-endian */ + { + high = 1; /* The second byte is the high byte. */ + low = 0; /* The first byte is the low byte. */ + } + + n = (l/2)*2; /* number bytes that make up full pairs */ + + /* first: get length, check for errors -- stop at first one */ + for(i=0; i < n; i+=2) + { + unsigned long point = ((unsigned long) s[i+high]<<8) + s[i+low]; + if((point & 0xd800) == 0xd800) /* lead surrogate */ + { + unsigned short second = (i+3 < l) ? (s[i+2+high]<<8) + s[i+2+low] : 0; + if((second & 0xdc00) == 0xdc00) /* good... */ + { + point = FULLPOINT(point,second); + length += UTF8LEN(point); /* possibly 4 bytes */ + i+=2; /* We overstepped one word. */ + } + else /* if no valid pair, break here */ + { + if(noquiet) error2("Invalid UTF16 surrogate pair at %li (0x%04lx).", (unsigned long)i, point); + n = i; /* Forget the half pair, END! */ + break; + } + } + else length += UTF8LEN(point); /* 1,2 or 3 bytes */ + } + + if(!mpg123_resize_string(sb, length+1)){ mpg123_free_string(sb); return ; } + + /* Now really convert, skip checks as these have been done just before. */ + p = (unsigned char*) sb->p; /* Signedness doesn't matter but it shows I thought about the non-issue */ + for(i=0; i < n; i+=2) + { + unsigned long codepoint = ((unsigned long) s[i+high]<<8) + s[i+low]; + if((codepoint & 0xd800) == 0xd800) /* lead surrogate */ + { + unsigned short second = (s[i+2+high]<<8) + s[i+2+low]; + codepoint = FULLPOINT(codepoint,second); + i+=2; /* We overstepped one word. */ + } + if(codepoint < 0x80) *p++ = (unsigned char) codepoint; + else if(codepoint < 0x800) + { + *p++ = (unsigned char) (0xc0 | (codepoint>>6)); + *p++ = (unsigned char) (0x80 | (codepoint & 0x3f)); + } + else if(codepoint < 0x10000) + { + *p++ = (unsigned char) (0xe0 | (codepoint>>12)); + *p++ = 0x80 | ((codepoint>>6) & 0x3f); + *p++ = 0x80 | (codepoint & 0x3f); + } + else if (codepoint < 0x200000) + { + *p++ = (unsigned char) (0xf0 | codepoint>>18); + *p++ = (unsigned char) (0x80 | ((codepoint>>12) & 0x3f)); + *p++ = (unsigned char) (0x80 | ((codepoint>>6) & 0x3f)); + *p++ = (unsigned char) (0x80 | (codepoint & 0x3f)); + } /* ignore bigger ones (that are not possible here anyway) */ + } + sb->p[sb->size-1] = 0; /* paranoia... */ + sb->fill = sb->size; +} +#undef UTF8LEN +#undef FULLPOINT + +static void convert_utf8(mpg123_string *sb, const unsigned char* source, size_t len, const int noquiet) +{ + if(mpg123_resize_string(sb, len+1)) + { + memcpy(sb->p, source, len); + sb->p[len] = 0; + sb->fill = len+1; + } + else mpg123_free_string(sb); +} + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/id3.h b/node_modules/lame/deps/mpg123/src/libmpg123/id3.h new file mode 100644 index 0000000..3a56694 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/id3.h @@ -0,0 +1,43 @@ +/* + id3: ID3v2.3 and ID3v2.4 parsing (a relevant subset) + + copyright 2006-2007 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#ifndef MPG123_ID3_H +#define MPG123_ID3_H + +/* really need it _here_! */ +#include "frame.h" + +#ifdef NO_ID3V2 +# ifdef init_id3 +# undef init_id3 +# endif +# define init_id3(fr) +# ifdef exit_id3 +# undef exit_id3 +# endif +# define exit_id3(fr) +# ifdef reset_id3 +# undef reset_id3 +# endif +# define reset_id3(fr) +# ifdef id3_link +# undef id3_link +# endif +# define id3_link(fr) +#else +void init_id3(mpg123_handle *fr); +void exit_id3(mpg123_handle *fr); +void reset_id3(mpg123_handle *fr); +void id3_link(mpg123_handle *fr); +#endif +int parse_new_id3(mpg123_handle *fr, unsigned long first4bytes); +/* Convert text from some ID3 encoding to UTf-8. + On error, sb->fill is 0. The noquiet flag enables warning/error messages. */ +void id3_to_utf8(mpg123_string *sb, unsigned char encoding, const unsigned char *source, size_t source_size, int noquiet); + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/index.c b/node_modules/lame/deps/mpg123/src/libmpg123/index.c new file mode 100644 index 0000000..bb5af32 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/index.c @@ -0,0 +1,134 @@ +/* + index: frame index data structure and functions + + copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "index.h" +#include "debug.h" + +/* The next expected frame offset, one step ahead. */ +static off_t fi_next(struct frame_index *fi) +{ + return (off_t)fi->fill*fi->step; +} + +/* Shrink down the used index to the half. + Be careful with size = 1 ... there's no shrinking possible there. */ +static void fi_shrink(struct frame_index *fi) +{ + if(fi->fill < 2) return; /* Won't shrink below 1. */ + else + { /* Double the step, half the fill. Should work as well for fill%2 = 1 */ + size_t c; + debug2("shrink index with fill %lu and step %lu", (unsigned long)fi->fill, (unsigned long)fi->step); + fi->step *= 2; + fi->fill /= 2; + /* Move the data down. */ + for(c = 0; c < fi->fill; ++c) + fi->data[c] = fi->data[2*c]; + } + + fi->next = fi_next(fi); +} + +void fi_init(struct frame_index *fi) +{ + fi->data = NULL; + fi->step = 1; + fi->fill = 0; + fi->size = 0; + fi->grow_size = 0; + fi->next = fi_next(fi); +} + +void fi_exit(struct frame_index *fi) +{ + debug2("fi_exit: %p and %lu", (void*)fi->data, (unsigned long)fi->size); + if(fi->size && fi->data != NULL) free(fi->data); + + fi_init(fi); /* Be prepared for further fun, still. */ +} + +int fi_resize(struct frame_index *fi, size_t newsize) +{ + off_t *newdata = NULL; + if(newsize == fi->size) return 0; + + if(newsize > 0 && newsize < fi->size) + { /* When we reduce buffer size a bit, shrink stuff. */ + while(fi->fill > newsize){ fi_shrink(fi); } + } + + newdata = safe_realloc(fi->data, newsize*sizeof(off_t)); + if(newsize == 0 || newdata != NULL) + { + fi->data = newdata; + fi->size = newsize; + if(fi->fill > fi->size) fi->fill = fi->size; + + fi->next = fi_next(fi); + debug2("new index of size %lu at %p", (unsigned long)fi->size, (void*)fi->data); + return 0; + } + else + { + error("failed to resize index!"); + return -1; + } +} + +void fi_add(struct frame_index *fi, off_t pos) +{ + debug3("wanting to add to fill %lu, step %lu, size %lu", (unsigned long)fi->fill, (unsigned long)fi->step, (unsigned long)fi->size); + if(fi->fill == fi->size) + { /* Index is full, we need to shrink... or grow. */ + /* Store the current frame number to check later if we still want it. */ + off_t framenum = fi->fill*fi->step; + /* If we want not / cannot grow, we shrink. */ + if( !(fi->grow_size && fi_resize(fi, fi->size+fi->grow_size)==0) ) + fi_shrink(fi); + + /* Now check if we still want to add this frame (could be that not, because of changed step). */ + if(fi->next != framenum) return; + } + /* When we are here, we want that frame. */ + if(fi->fill < fi->size) /* safeguard for size=1, or just generally */ + { + debug1("adding to index at %p", (void*)(fi->data+fi->fill)); + fi->data[fi->fill] = pos; + ++fi->fill; + fi->next = fi_next(fi); + debug3("added pos %li to index with fill %lu and step %lu", (long) pos, (unsigned long)fi->fill, (unsigned long)fi->step); + } +} + +int fi_set(struct frame_index *fi, off_t *offsets, off_t step, size_t fill) +{ + if(fi_resize(fi, fill) == -1) return -1; + fi->step = step; + if(offsets != NULL) + { + memcpy(fi->data, offsets, fill*sizeof(off_t)); + fi->fill = fill; + } + else + { + /* allocation only, no entries in index yet */ + fi->fill = 0; + } + fi->next = fi_next(fi); + debug3("set new index of fill %lu, size %lu at %p", + (unsigned long)fi->fill, (unsigned long)fi->size, (void*)fi->data); + return 0; +} + +void fi_reset(struct frame_index *fi) +{ + debug1("reset with size %"SIZE_P, (size_p)fi->size); + fi->fill = 0; + fi->step = 1; + fi->next = fi_next(fi); +} diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/index.h b/node_modules/lame/deps/mpg123/src/libmpg123/index.h new file mode 100644 index 0000000..3e1ca64 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/index.h @@ -0,0 +1,59 @@ +#ifndef MPG123_H_INDEX +#define MPG123_H_INDEX + +/* + index: frame index data structure and functions + + This is for keeping track of frame positions for accurate seeking. + Now in it's own file, with initial code from frame.c and parse.c . + + The idea of the index with a certain amount of entries is to cover + all yet-encountered frame positions with minimal coarseness. + Meaning: At first every frame position is recorded, then, when + the index is full, every second position is trown away to make + space. Next time it is full, the same happens. And so on. + In this manner we maintain a good resolution with the given + maximum index size while covering the whole stream. + + copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis +*/ + +#include "config.h" +#include "compat.h" + +struct frame_index +{ + off_t *data; /* actual data, the frame positions */ + off_t step; /* advancement in frame number per index point */ + off_t next; /* frame offset supposed to come next into the index */ + size_t size; /* total number of possible entries */ + size_t fill; /* number of used entries */ + size_t grow_size; /* if > 0: index allowed to grow on need with these steps, instead of lowering resolution */ +}; + +/* The condition for a framenum to be appended to the index. + if(FI_NEXT(fr->index, fr->num)) fi_add(offset); */ +#define FI_NEXT(fi, framenum) ((fi).size && framenum == (fi).next) + +/* Initialize stuff, set things to zero and NULL... */ +void fi_init(struct frame_index *fi); +/* Deallocate/zero things. */ +void fi_exit(struct frame_index *fi); + +/* Prepare a given size, preserving current fill, if possible. + If the new size is smaller than fill, the entry density is reduced. + Return 0 on success. */ +int fi_resize(struct frame_index *fi, size_t newsize); + +/* Append a frame position, reducing index density if needed. */ +void fi_add(struct frame_index *fi, off_t pos); + +/* Replace the frame index */ +int fi_set(struct frame_index *fi, off_t *offsets, off_t step, size_t fill); + +/* Empty the index (setting fill=0 and step=1), but keep current size. */ +void fi_reset(struct frame_index *fi); + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/intsym.h b/node_modules/lame/deps/mpg123/src/libmpg123/intsym.h new file mode 100644 index 0000000..f4ed46c --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/intsym.h @@ -0,0 +1,256 @@ +#ifndef MPG123_INTMAP_H +#define MPG123_INTMAP_H +/* Mapping of internal mpg123 symbols to something that is less likely to conflict in case of static linking. */ +#define COS9 INT123_COS9 +#define tfcos36 INT123_tfcos36 +#define pnts INT123_pnts +#define safe_realloc INT123_safe_realloc +#define compat_open INT123_compat_open +#define compat_close INT123_compat_close +#define win32_wide_utf8 INT123_win32_wide_utf8 +#define win32_utf8_wide INT123_win32_utf8_wide +#define ntom_set_ntom INT123_ntom_set_ntom +#define synth_1to1 INT123_synth_1to1 +#define synth_1to1_dither INT123_synth_1to1_dither +#define synth_1to1_i386 INT123_synth_1to1_i386 +#define synth_1to1_i586 INT123_synth_1to1_i586 +#define synth_1to1_i586_dither INT123_synth_1to1_i586_dither +#define synth_1to1_mmx INT123_synth_1to1_mmx +#define synth_1to1_3dnow INT123_synth_1to1_3dnow +#define synth_1to1_sse INT123_synth_1to1_sse +#define synth_1to1_stereo_sse INT123_synth_1to1_stereo_sse +#define synth_1to1_3dnowext INT123_synth_1to1_3dnowext +#define synth_1to1_altivec INT123_synth_1to1_altivec +#define synth_1to1_stereo_altivec INT123_synth_1to1_stereo_altivec +#define synth_1to1_x86_64 INT123_synth_1to1_x86_64 +#define synth_1to1_stereo_x86_64 INT123_synth_1to1_stereo_x86_64 +#define synth_1to1_arm INT123_synth_1to1_arm +#define synth_1to1_neon INT123_synth_1to1_neon +#define synth_1to1_stereo_neon INT123_synth_1to1_stereo_neon +#define absynth_1to1_i486 INT123_absynth_1to1_i486 +#define synth_1to1_mono INT123_synth_1to1_mono +#define synth_1to1_m2s INT123_synth_1to1_m2s +#define synth_2to1 INT123_synth_2to1 +#define synth_2to1_dither INT123_synth_2to1_dither +#define synth_2to1_i386 INT123_synth_2to1_i386 +#define synth_2to1_mono INT123_synth_2to1_mono +#define synth_2to1_m2s INT123_synth_2to1_m2s +#define synth_4to1 INT123_synth_4to1 +#define synth_4to1_dither INT123_synth_4to1_dither +#define synth_4to1_i386 INT123_synth_4to1_i386 +#define synth_4to1_mono INT123_synth_4to1_mono +#define synth_4to1_m2s INT123_synth_4to1_m2s +#define synth_ntom INT123_synth_ntom +#define synth_ntom_mono INT123_synth_ntom_mono +#define synth_ntom_m2s INT123_synth_ntom_m2s +#define synth_1to1_8bit INT123_synth_1to1_8bit +#define synth_1to1_8bit_i386 INT123_synth_1to1_8bit_i386 +#define synth_1to1_8bit_wrap INT123_synth_1to1_8bit_wrap +#define synth_1to1_8bit_mono INT123_synth_1to1_8bit_mono +#define synth_1to1_8bit_m2s INT123_synth_1to1_8bit_m2s +#define synth_1to1_8bit_wrap_mono INT123_synth_1to1_8bit_wrap_mono +#define synth_1to1_8bit_wrap_m2s INT123_synth_1to1_8bit_wrap_m2s +#define synth_2to1_8bit INT123_synth_2to1_8bit +#define synth_2to1_8bit_i386 INT123_synth_2to1_8bit_i386 +#define synth_2to1_8bit_mono INT123_synth_2to1_8bit_mono +#define synth_2to1_8bit_m2s INT123_synth_2to1_8bit_m2s +#define synth_4to1_8bit INT123_synth_4to1_8bit +#define synth_4to1_8bit_i386 INT123_synth_4to1_8bit_i386 +#define synth_4to1_8bit_mono INT123_synth_4to1_8bit_mono +#define synth_4to1_8bit_m2s INT123_synth_4to1_8bit_m2s +#define synth_ntom_8bit INT123_synth_ntom_8bit +#define synth_ntom_8bit_mono INT123_synth_ntom_8bit_mono +#define synth_ntom_8bit_m2s INT123_synth_ntom_8bit_m2s +#define synth_1to1_real INT123_synth_1to1_real +#define synth_1to1_real_i386 INT123_synth_1to1_real_i386 +#define synth_1to1_real_sse INT123_synth_1to1_real_sse +#define synth_1to1_real_stereo_sse INT123_synth_1to1_real_stereo_sse +#define synth_1to1_real_x86_64 INT123_synth_1to1_real_x86_64 +#define synth_1to1_real_stereo_x86_64 INT123_synth_1to1_real_stereo_x86_64 +#define synth_1to1_real_altivec INT123_synth_1to1_real_altivec +#define synth_1to1_real_stereo_altivec INT123_synth_1to1_real_stereo_altivec +#define synth_1to1_real_neon INT123_synth_1to1_real_neon +#define synth_1to1_real_stereo_neon INT123_synth_1to1_real_stereo_neon +#define synth_1to1_real_mono INT123_synth_1to1_real_mono +#define synth_1to1_real_m2s INT123_synth_1to1_real_m2s +#define synth_2to1_real INT123_synth_2to1_real +#define synth_2to1_real_i386 INT123_synth_2to1_real_i386 +#define synth_2to1_real_mono INT123_synth_2to1_real_mono +#define synth_2to1_real_m2s INT123_synth_2to1_real_m2s +#define synth_4to1_real INT123_synth_4to1_real +#define synth_4to1_real_i386 INT123_synth_4to1_real_i386 +#define synth_4to1_real_mono INT123_synth_4to1_real_mono +#define synth_4to1_real_m2s INT123_synth_4to1_real_m2s +#define synth_ntom_real INT123_synth_ntom_real +#define synth_ntom_real_mono INT123_synth_ntom_real_mono +#define synth_ntom_real_m2s INT123_synth_ntom_real_m2s +#define synth_1to1_s32 INT123_synth_1to1_s32 +#define synth_1to1_s32_i386 INT123_synth_1to1_s32_i386 +#define synth_1to1_s32_sse INT123_synth_1to1_s32_sse +#define synth_1to1_s32_stereo_sse INT123_synth_1to1_s32_stereo_sse +#define synth_1to1_s32_x86_64 INT123_synth_1to1_s32_x86_64 +#define synth_1to1_s32_stereo_x86_64 INT123_synth_1to1_s32_stereo_x86_64 +#define synth_1to1_s32_altivec INT123_synth_1to1_s32_altivec +#define synth_1to1_s32_stereo_altivec INT123_synth_1to1_s32_stereo_altivec +#define synth_1to1_s32_neon INT123_synth_1to1_s32_neon +#define synth_1to1_s32_stereo_neon INT123_synth_1to1_s32_stereo_neon +#define synth_1to1_s32_mono INT123_synth_1to1_s32_mono +#define synth_1to1_s32_m2s INT123_synth_1to1_s32_m2s +#define synth_2to1_s32 INT123_synth_2to1_s32 +#define synth_2to1_s32_i386 INT123_synth_2to1_s32_i386 +#define synth_2to1_s32_mono INT123_synth_2to1_s32_mono +#define synth_2to1_s32_m2s INT123_synth_2to1_s32_m2s +#define synth_4to1_s32 INT123_synth_4to1_s32 +#define synth_4to1_s32_i386 INT123_synth_4to1_s32_i386 +#define synth_4to1_s32_mono INT123_synth_4to1_s32_mono +#define synth_4to1_s32_m2s INT123_synth_4to1_s32_m2s +#define synth_ntom_s32 INT123_synth_ntom_s32 +#define synth_ntom_s32_mono INT123_synth_ntom_s32_mono +#define synth_ntom_s32_m2s INT123_synth_ntom_s32_m2s +#define dct64 INT123_dct64 +#define dct64_i386 INT123_dct64_i386 +#define dct64_altivec INT123_dct64_altivec +#define dct64_i486 INT123_dct64_i486 +#define dct36 INT123_dct36 +#define dct36_3dnow INT123_dct36_3dnow +#define dct36_3dnowext INT123_dct36_3dnowext +#define synth_ntom_set_step INT123_synth_ntom_set_step +#define ntom_val INT123_ntom_val +#define ntom_frame_outsamples INT123_ntom_frame_outsamples +#define ntom_frmouts INT123_ntom_frmouts +#define ntom_ins2outs INT123_ntom_ins2outs +#define ntom_frameoff INT123_ntom_frameoff +#define init_layer3 INT123_init_layer3 +#define init_layer3_gainpow2 INT123_init_layer3_gainpow2 +#define init_layer3_stuff INT123_init_layer3_stuff +#define init_layer12 INT123_init_layer12 +#define init_layer12_table INT123_init_layer12_table +#define init_layer12_stuff INT123_init_layer12_stuff +#define prepare_decode_tables INT123_prepare_decode_tables +#define make_decode_tables INT123_make_decode_tables +#define make_decode_tables_mmx INT123_make_decode_tables_mmx +#define init_layer3_gainpow2_mmx INT123_init_layer3_gainpow2_mmx +#define init_layer12_table_mmx INT123_init_layer12_table_mmx +#define make_conv16to8_table INT123_make_conv16to8_table +#define do_layer3 INT123_do_layer3 +#define do_layer2 INT123_do_layer2 +#define do_layer1 INT123_do_layer1 +#define do_equalizer INT123_do_equalizer +#define dither_table_init INT123_dither_table_init +#define frame_dither_init INT123_frame_dither_init +#define invalidate_format INT123_invalidate_format +#define frame_init INT123_frame_init +#define frame_init_par INT123_frame_init_par +#define frame_outbuffer INT123_frame_outbuffer +#define frame_output_format INT123_frame_output_format +#define frame_buffers INT123_frame_buffers +#define frame_reset INT123_frame_reset +#define frame_buffers_reset INT123_frame_buffers_reset +#define frame_exit INT123_frame_exit +#define frame_index_find INT123_frame_index_find +#define frame_index_setup INT123_frame_index_setup +#define do_volume INT123_do_volume +#define do_rva INT123_do_rva +#define frame_gapless_init INT123_frame_gapless_init +#define frame_gapless_realinit INT123_frame_gapless_realinit +#define frame_gapless_update INT123_frame_gapless_update +#define frame_gapless_bytify INT123_frame_gapless_bytify +#define frame_gapless_ignore INT123_frame_gapless_ignore +#define frame_expect_outsamples INT123_frame_expect_outsamples +#define frame_skip INT123_frame_skip +#define frame_ins2outs INT123_frame_ins2outs +#define frame_outs INT123_frame_outs +#define frame_expect_outsampels INT123_frame_expect_outsampels +#define frame_offset INT123_frame_offset +#define frame_set_frameseek INT123_frame_set_frameseek +#define frame_set_seek INT123_frame_set_seek +#define frame_tell_seek INT123_frame_tell_seek +#define frame_fill_toc INT123_frame_fill_toc +#define getbits INT123_getbits +#define getcpuflags INT123_getcpuflags +#define icy2utf8 INT123_icy2utf8 +#define init_icy INT123_init_icy +#define clear_icy INT123_clear_icy +#define reset_icy INT123_reset_icy +#define init_id3 INT123_init_id3 +#define exit_id3 INT123_exit_id3 +#define reset_id3 INT123_reset_id3 +#define id3_link INT123_id3_link +#define parse_new_id3 INT123_parse_new_id3 +#define id3_to_utf8 INT123_id3_to_utf8 +#define fi_init INT123_fi_init +#define fi_exit INT123_fi_exit +#define fi_resize INT123_fi_resize +#define fi_add INT123_fi_add +#define fi_set INT123_fi_set +#define fi_reset INT123_fi_reset +#define double_to_long_rounded INT123_double_to_long_rounded +#define scale_rounded INT123_scale_rounded +#define decode_update INT123_decode_update +#define samples_to_bytes INT123_samples_to_bytes +#define bytes_to_samples INT123_bytes_to_samples +#define frame_cpu_opt INT123_frame_cpu_opt +#define set_synth_functions INT123_set_synth_functions +#define dectype INT123_dectype +#define defdec INT123_defdec +#define decclass INT123_decclass +#define check_decoders INT123_check_decoders +#define read_frame_init INT123_read_frame_init +#define frame_bitrate INT123_frame_bitrate +#define frame_freq INT123_frame_freq +#define read_frame_recover INT123_read_frame_recover +#define read_frame INT123_read_frame +#define set_pointer INT123_set_pointer +#define position_info INT123_position_info +#define compute_bpf INT123_compute_bpf +#define time_to_frame INT123_time_to_frame +#define get_songlen INT123_get_songlen +#define open_stream INT123_open_stream +#define open_stream_handle INT123_open_stream_handle +#define open_feed INT123_open_feed +#define feed_more INT123_feed_more +#define feed_forget INT123_feed_forget +#define feed_set_pos INT123_feed_set_pos +#define open_bad INT123_open_bad +#define dct64_3dnow INT123_dct64_3dnow +#define dct64_3dnowext INT123_dct64_3dnowext +#define dct64_mmx INT123_dct64_mmx +#define dct64_MMX INT123_dct64_MMX +#define dct64_sse INT123_dct64_sse +#define dct64_real_sse INT123_dct64_real_sse +#define dct64_x86_64 INT123_dct64_x86_64 +#define dct64_real_x86_64 INT123_dct64_real_x86_64 +#define dct64_neon INT123_dct64_neon +#define dct64_real_neon INT123_dct64_real_neon +#define do_equalizer_3dnow INT123_do_equalizer_3dnow +#define synth_1to1_3dnow_asm INT123_synth_1to1_3dnow_asm +#define synth_1to1_arm_asm INT123_synth_1to1_arm_asm +#define synth_1to1_arm_accurate_asm INT123_synth_1to1_arm_accurate_asm +#define synth_1to1_i586_asm INT123_synth_1to1_i586_asm +#define synth_1to1_i586_asm_dither INT123_synth_1to1_i586_asm_dither +#define synth_1to1_MMX INT123_synth_1to1_MMX +#define synth_1to1_sse_accurate_asm INT123_synth_1to1_sse_accurate_asm +#define synth_1to1_real_sse_asm INT123_synth_1to1_real_sse_asm +#define synth_1to1_s32_sse_asm INT123_synth_1to1_s32_sse_asm +#define synth_1to1_s_sse_accurate_asm INT123_synth_1to1_s_sse_accurate_asm +#define synth_1to1_real_s_sse_asm INT123_synth_1to1_real_s_sse_asm +#define synth_1to1_s32_s_sse_asm INT123_synth_1to1_s32_s_sse_asm +#define synth_1to1_s_x86_64_asm INT123_synth_1to1_s_x86_64_asm +#define synth_1to1_s_x86_64_accurate_asm INT123_synth_1to1_s_x86_64_accurate_asm +#define synth_1to1_real_s_x86_64_asm INT123_synth_1to1_real_s_x86_64_asm +#define synth_1to1_s32_s_x86_64_asm INT123_synth_1to1_s32_s_x86_64_asm +#define synth_1to1_x86_64_asm INT123_synth_1to1_x86_64_asm +#define synth_1to1_x86_64_accurate_asm INT123_synth_1to1_x86_64_accurate_asm +#define synth_1to1_real_x86_64_asm INT123_synth_1to1_real_x86_64_asm +#define synth_1to1_s32_x86_64_asm INT123_synth_1to1_s32_x86_64_asm +#define synth_1to1_neon_asm INT123_synth_1to1_neon_asm +#define synth_1to1_neon_accurate_asm INT123_synth_1to1_neon_accurate_asm +#define synth_1to1_real_neon_asm INT123_synth_1to1_real_neon_asm +#define synth_1to1_s32_neon_asm INT123_synth_1to1_s32_neon_asm +#define synth_1to1_s_neon_asm INT123_synth_1to1_s_neon_asm +#define synth_1to1_s_neon_accurate_asm INT123_synth_1to1_s_neon_accurate_asm +#define synth_1to1_real_s_neon_asm INT123_synth_1to1_real_s_neon_asm +#define synth_1to1_s32_s_neon_asm INT123_synth_1to1_s32_s_neon_asm +#define costab_mmxsse INT123_costab_mmxsse +#define make_decode_tables_mmx_asm INT123_make_decode_tables_mmx_asm +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/l12_integer_tables.h b/node_modules/lame/deps/mpg123/src/libmpg123/l12_integer_tables.h new file mode 100644 index 0000000..e306fa9 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/l12_integer_tables.h @@ -0,0 +1,278 @@ +/* + l12_integer_tables.h: Layer1/2 Constant tables for integer decoders + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#ifndef MPG123_L12_INTEGER_TABLES_H +#define MPG123_L12_INTEGER_TABLES_H + +static const real layer12_table[27][64] = +{ + { + }, + { + -1431655765,-1136305934,-901886617,-715827883,-568152967,-450943309,-357913941,-284076483, + -225471654,-178956971,-142038242,-112735827,-89478485,-71019121,-56367914,-44739243, + -35509560,-28183957,-22369621,-17754780,-14091978,-11184811,-8877390,-7045989, + -5592405,-4438695,-3522995,-2796203,-2219348,-1761497,-1398101,-1109674, + -880749,-699051,-554837,-440374,-349525,-277418,-220187,-174763, + -138709,-110094,-87381,-69355,-55047,-43691,-34677,-27523, + -21845,-17339,-13762,-10923,-8669,-6881,-5461,-4335, + -3440,-2731,-2167,-1720,-1365,-1084,-860,0 + }, + { + 1431655765,1136305934,901886617,715827883,568152967,450943309,357913941,284076483, + 225471654,178956971,142038242,112735827,89478485,71019121,56367914,44739243, + 35509560,28183957,22369621,17754780,14091978,11184811,8877390,7045989, + 5592405,4438695,3522995,2796203,2219348,1761497,1398101,1109674, + 880749,699051,554837,440374,349525,277418,220187,174763, + 138709,110094,87381,69355,55047,43691,34677,27523, + 21845,17339,13762,10923,8669,6881,5461,4335, + 3440,2731,2167,1720,1365,1084,860,0 + }, + { + 613566757,486988257,386522836,306783378,243494129,193261418,153391689,121747064, + 96630709,76695845,60873532,48315355,38347922,30436766,24157677,19173961, + 15218383,12078839,9586981,7609192,6039419,4793490,3804596,3019710, + 2396745,1902298,1509855,1198373,951149,754927,599186,475574, + 377464,299593,237787,188732,149797,118894,94366,74898, + 59447,47183,37449,29723,23591,18725,14862,11796, + 9362,7431,5898,4681,3715,2949,2341,1858, + 1474,1170,929,737,585,464,369,0 + }, + { + 286331153,227261187,180377323,143165577,113630593,90188662,71582788,56815297, + 45094331,35791394,28407648,22547165,17895697,14203824,11273583,8947849, + 7101912,5636791,4473924,3550956,2818396,2236962,1775478,1409198, + 1118481,887739,704599,559241,443870,352299,279620,221935, + 176150,139810,110967,88075,69905,55484,44037,34953, + 27742,22019,17476,13871,11009,8738,6935,5505, + 4369,3468,2752,2185,1734,1376,1092,867, + 688,546,433,344,273,217,172,0 + }, + { + 138547332,109965090,87279350,69273666,54982545,43639675,34636833,27491273, + 21819838,17318417,13745636,10909919,8659208,6872818,5454959,4329604, + 3436409,2727480,2164802,1718205,1363740,1082401,859102,681870, + 541201,429551,340935,270600,214776,170467,135300,107388, + 85234,67650,53694,42617,33825,26847,21308,16913, + 13423,10654,8456,6712,5327,4228,3356,2664, + 2114,1678,1332,1057,839,666,529,419, + 333,264,210,166,132,105,83,0 + }, + { + 68174084,54109806,42946982,34087042,27054903,21473491,17043521,13527452, + 10736745,8521761,6763726,5368373,4260880,3381863,2684186,2130440, + 1690931,1342093,1065220,845466,671047,532610,422733,335523, + 266305,211366,167762,133153,105683,83881,66576,52842, + 41940,33288,26421,20970,16644,13210,10485,8322, + 6605,5243,4161,3303,2621,2081,1651,1311, + 1040,826,655,520,413,328,260,206, + 164,130,103,82,65,52,41,0 + }, + { + 33818640,26841872,21304408,16909320,13420936,10652204,8454660,6710468, + 5326102,4227330,3355234,2663051,2113665,1677617,1331526,1056833, + 838809,665763,528416,419404,332881,264208,209702,166441, + 132104,104851,83220,66052,52426,41610,33026,26213, + 20805,16513,13106,10403,8257,6553,5201,4128, + 3277,2601,2064,1638,1300,1032,819,650, + 516,410,325,258,205,163,129,102, + 81,65,51,41,32,26,20,0 + }, + { + 16843009,13368305,10610431,8421505,6684153,5305215,4210752,3342076, + 2652608,2105376,1671038,1326304,1052688,835519,663152,526344, + 417760,331576,263172,208880,165788,131586,104440,82894, + 65793,52220,41447,32897,26110,20723,16448,13055, + 10362,8224,6527,5181,4112,3264,2590,2056, + 1632,1295,1028,816,648,514,408,324, + 257,204,162,129,102,81,64,51, + 40,32,25,20,16,13,10,0 + }, + { + 8405024,6671072,5294833,4202512,3335536,2647417,2101256,1667768, + 1323708,1050628,833884,661854,525314,416942,330927,262657, + 208471,165464,131329,104236,82732,65664,52118,41366, + 32832,26059,20683,16416,13029,10341,8208,6515, + 5171,4104,3257,2585,2052,1629,1293,1026, + 814,646,513,407,323,257,204,162, + 128,102,81,64,51,40,32,25, + 20,16,13,10,8,6,5,0 + }, + { + 4198404,3332275,2644829,2099202,1666138,1322414,1049601,833069, + 661207,524801,416534,330604,262400,208267,165302,131200, + 104134,82651,65600,52067,41325,32800,26033,20663, + 16400,13017,10331,8200,6508,5166,4100,3254, + 2583,2050,1627,1291,1025,814,646,513, + 407,323,256,203,161,128,102,81, + 64,51,40,32,25,20,16,13, + 10,8,6,5,4,3,3,0 + }, + { + 2098177,1665324,1321768,1049088,832662,660884,524544,416331, + 330442,262272,208165,165221,131136,104083,82611,65568, + 52041,41305,32784,26021,20653,16392,13010,10326, + 8196,6505,5163,4098,3253,2582,2049,1626, + 1291,1025,813,645,512,407,323,256, + 203,161,128,102,81,64,51,40, + 32,25,20,16,13,10,8,6, + 5,4,3,3,2,2,1,0 + }, + { + 1048832,832459,660723,524416,416229,330361,262208,208115, + 165181,131104,104057,82590,65552,52029,41295,32776, + 26014,20648,16388,13007,10324,8194,6504,5162, + 4097,3252,2581,2049,1626,1290,1024,813, + 645,512,406,323,256,203,161,128, + 102,81,64,51,40,32,25,20, + 16,13,10,8,6,5,4,3, + 3,2,2,1,1,1,1,0 + }, + { + 524352,416178,330321,262176,208089,165161,131088,104045, + 82580,65544,52022,41290,32772,26011,20645,16386, + 13006,10323,8193,6503,5161,4097,3251,2581, + 2048,1626,1290,1024,813,645,512,406, + 323,256,203,161,128,102,81,64, + 51,40,32,25,20,16,13,10, + 8,6,5,4,3,3,2,2, + 1,1,1,1,1,0,0,0 + }, + { + 262160,208077,165150,131080,104038,82575,65540,52019, + 41288,32770,26010,20644,16385,13005,10322,8193, + 6502,5161,4096,3251,2580,2048,1626,1290, + 1024,813,645,512,406,323,256,203, + 161,128,102,81,64,51,40,32, + 25,20,16,13,10,8,6,5, + 4,3,3,2,2,1,1,1, + 1,1,0,0,0,0,0,0 + }, + { + 131076,104035,82573,65538,52018,41286,32769,26009, + 20643,16385,13004,10322,8192,6502,5161,4096, + 3251,2580,2048,1626,1290,1024,813,645, + 512,406,323,256,203,161,128,102, + 81,64,51,40,32,25,20,16, + 13,10,8,6,5,4,3,3, + 2,2,1,1,1,1,1,0, + 0,0,0,0,0,0,0,0 + }, + { + 65537,52017,41286,32769,26008,20643,16384,13004, + 10321,8192,6502,5161,4096,3251,2580,2048, + 1626,1290,1024,813,645,512,406,323, + 256,203,161,128,102,81,64,51, + 40,32,25,20,16,13,10,8, + 6,5,4,3,3,2,2,1, + 1,1,1,1,0,0,0,0, + 0,0,0,0,0,0,0,0 + }, + { + -1717986918,-1363567121,-1082263941,-858993459,-681783560,-541131970,-429496730,-340891780, + -270565985,-214748365,-170445890,-135282993,-107374182,-85222945,-67641496,-53687091, + -42611473,-33820748,-26843546,-21305736,-16910374,-13421773,-10652868,-8455187, + -6710886,-5326434,-4227594,-3355443,-2663217,-2113797,-1677722,-1331609, + -1056898,-838861,-665804,-528449,-419430,-332902,-264225,-209715, + -166451,-132112,-104858,-83226,-66056,-52429,-41613,-33028, + -26214,-20806,-16514,-13107,-10403,-8257,-6554,-5202, + -4129,-3277,-2601,-2064,-1638,-1300,-1032,0 + }, + { + -858993459,-681783560,-541131970,-429496730,-340891780,-270565985,-214748365,-170445890, + -135282993,-107374182,-85222945,-67641496,-53687091,-42611473,-33820748,-26843546, + -21305736,-16910374,-13421773,-10652868,-8455187,-6710886,-5326434,-4227594, + -3355443,-2663217,-2113797,-1677722,-1331609,-1056898,-838861,-665804, + -528449,-419430,-332902,-264225,-209715,-166451,-132112,-104858, + -83226,-66056,-52429,-41613,-33028,-26214,-20806,-16514, + -13107,-10403,-8257,-6554,-5202,-4129,-3277,-2601, + -2064,-1638,-1300,-1032,-819,-650,-516,0 + }, + { + 858993459,681783560,541131970,429496730,340891780,270565985,214748365,170445890, + 135282993,107374182,85222945,67641496,53687091,42611473,33820748,26843546, + 21305736,16910374,13421773,10652868,8455187,6710886,5326434,4227594, + 3355443,2663217,2113797,1677722,1331609,1056898,838861,665804, + 528449,419430,332902,264225,209715,166451,132112,104858, + 83226,66056,52429,41613,33028,26214,20806,16514, + 13107,10403,8257,6554,5202,4129,3277,2601, + 2064,1638,1300,1032,819,650,516,0 + }, + { + 1717986918,1363567121,1082263941,858993459,681783560,541131970,429496730,340891780, + 270565985,214748365,170445890,135282993,107374182,85222945,67641496,53687091, + 42611473,33820748,26843546,21305736,16910374,13421773,10652868,8455187, + 6710886,5326434,4227594,3355443,2663217,2113797,1677722,1331609, + 1056898,838861,665804,528449,419430,332902,264225,209715, + 166451,132112,104858,83226,66056,52429,41613,33028, + 26214,20806,16514,13107,10403,8257,6554,5202, + 4129,3277,2601,2064,1638,1300,1032,0 + }, + { + -1908874354,-1515074579,-1202515490,-954437177,-757537289,-601257745,-477218588,-378768645, + -300628872,-238609294,-189384322,-150314436,-119304647,-94692161,-75157218,-59652324, + -47346081,-37578609,-29826162,-23673040,-18789305,-14913081,-11836520,-9394652, + -7456540,-5918260,-4697326,-3728270,-2959130,-2348663,-1864135,-1479565, + -1174332,-932068,-739783,-587166,-466034,-369891,-293583,-233017, + -184946,-146791,-116508,-92473,-73396,-58254,-46236,-36698, + -29127,-23118,-18349,-14564,-11559,-9174,-7282,-5780, + -4587,-3641,-2890,-2294,-1820,-1445,-1147,0 + }, + { + -954437177,-757537289,-601257745,-477218588,-378768645,-300628872,-238609294,-189384322, + -150314436,-119304647,-94692161,-75157218,-59652324,-47346081,-37578609,-29826162, + -23673040,-18789305,-14913081,-11836520,-9394652,-7456540,-5918260,-4697326, + -3728270,-2959130,-2348663,-1864135,-1479565,-1174332,-932068,-739783, + -587166,-466034,-369891,-293583,-233017,-184946,-146791,-116508, + -92473,-73396,-58254,-46236,-36698,-29127,-23118,-18349, + -14564,-11559,-9174,-7282,-5780,-4587,-3641,-2890, + -2294,-1820,-1445,-1147,-910,-722,-573,0 + }, + { + -477218588,-378768645,-300628872,-238609294,-189384322,-150314436,-119304647,-94692161, + -75157218,-59652324,-47346081,-37578609,-29826162,-23673040,-18789305,-14913081, + -11836520,-9394652,-7456540,-5918260,-4697326,-3728270,-2959130,-2348663, + -1864135,-1479565,-1174332,-932068,-739783,-587166,-466034,-369891, + -293583,-233017,-184946,-146791,-116508,-92473,-73396,-58254, + -46236,-36698,-29127,-23118,-18349,-14564,-11559,-9174, + -7282,-5780,-4587,-3641,-2890,-2294,-1820,-1445, + -1147,-910,-722,-573,-455,-361,-287,0 + }, + { + 477218588,378768645,300628872,238609294,189384322,150314436,119304647,94692161, + 75157218,59652324,47346081,37578609,29826162,23673040,18789305,14913081, + 11836520,9394652,7456540,5918260,4697326,3728270,2959130,2348663, + 1864135,1479565,1174332,932068,739783,587166,466034,369891, + 293583,233017,184946,146791,116508,92473,73396,58254, + 46236,36698,29127,23118,18349,14564,11559,9174, + 7282,5780,4587,3641,2890,2294,1820,1445, + 1147,910,722,573,455,361,287,0 + }, + { + 954437177,757537289,601257745,477218588,378768645,300628872,238609294,189384322, + 150314436,119304647,94692161,75157218,59652324,47346081,37578609,29826162, + 23673040,18789305,14913081,11836520,9394652,7456540,5918260,4697326, + 3728270,2959130,2348663,1864135,1479565,1174332,932068,739783, + 587166,466034,369891,293583,233017,184946,146791,116508, + 92473,73396,58254,46236,36698,29127,23118,18349, + 14564,11559,9174,7282,5780,4587,3641,2890, + 2294,1820,1445,1147,910,722,573,0 + }, + { + 1908874354,1515074579,1202515490,954437177,757537289,601257745,477218588,378768645, + 300628872,238609294,189384322,150314436,119304647,94692161,75157218,59652324, + 47346081,37578609,29826162,23673040,18789305,14913081,11836520,9394652, + 7456540,5918260,4697326,3728270,2959130,2348663,1864135,1479565, + 1174332,932068,739783,587166,466034,369891,293583,233017, + 184946,146791,116508,92473,73396,58254,46236,36698, + 29127,23118,18349,14564,11559,9174,7282,5780, + 4587,3641,2890,2294,1820,1445,1147,0 + }, +}; + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/l2tables.h b/node_modules/lame/deps/mpg123/src/libmpg123/l2tables.h new file mode 100644 index 0000000..23ed2ab --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/l2tables.h @@ -0,0 +1,164 @@ +/* + l2tables.h: Layer 2 Alloc tables + + copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + most other tables are calculated on program start (which is (of course) not ISO-conform) + Layer-3 huffman table is in huffman.h +*/ + + +#ifndef _MPG123_L2TABLES_H_ +#define _MPG123_L2TABLES_H_ + +static const struct al_table alloc_0[] = { + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767} }; + +static const struct al_table alloc_1[] = { + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511}, + {11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767}, + {2,0},{5,3},{7,5},{16,-32767} }; + +static const struct al_table alloc_2[] = { + {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255}, + {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383}, + {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255}, + {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} }; + +static const struct al_table alloc_3[] = { + {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255}, + {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383}, + {4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255}, + {10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} }; + +static const struct al_table alloc_4[] = { + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191}, + {4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127}, + {9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9}, + {2,0},{5,3},{7,5},{10,9} }; + +#endif + diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/l3_integer_tables.h b/node_modules/lame/deps/mpg123/src/libmpg123/l3_integer_tables.h new file mode 100644 index 0000000..f600c31 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/l3_integer_tables.h @@ -0,0 +1,1002 @@ +/* + l3_integer_tables.h: Layer3 Constant tables for integer decoders + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Taihei Monma +*/ + +#ifndef MPG123_L3_INTEGER_TABLES_H +#define MPG123_L3_INTEGER_TABLES_H + +#ifdef PRECALC_TABLES +static const real ispow[8207] = +{ + 0,8192,20643,35445,52016,70041,89315,109695,131072,153360, + 176491,200407,225060,250408,276414,303048,330281,358087,386444,415331, + 444730,474623,504995,535830,567116,598839,630988,663552,696521,729884, + 763633,797760,832255,867112,902323,937880,973778,1010010,1046569,1083451, + 1120650,1158160,1195976,1234093,1272507,1311213,1350207,1389485,1429042,1468875, + 1508979,1549352,1589990,1630889,1672046,1713458,1755122,1797035,1839193,1881594, + 1924236,1967115,2010229,2053576,2097152,2140956,2184985,2229238,2273710,2318402, + 2363310,2408432,2453767,2499312,2545065,2591025,2637190,2683558,2730126,2776895, + 2823861,2871023,2918379,2965929,3013670,3061600,3109719,3158025,3206517,3255192, + 3304050,3353089,3402309,3451707,3501282,3551033,3600960,3651060,3701332,3751776, + 3802390,3853172,3904123,3955241,4006524,4057972,4109583,4161357,4213293,4265389, + 4317644,4370058,4422630,4475359,4528243,4581282,4634476,4687822,4741320,4794970, + 4848770,4902720,4956819,5011066,5065460,5120000,5174686,5229517,5284492,5339610, + 5394871,5450274,5505818,5561502,5617327,5673290,5729391,5785631,5842007,5898519, + 5955168,6011951,6068869,6125920,6183105,6240422,6297871,6355451,6413162,6471004, + 6528974,6587074,6645302,6703658,6762141,6820751,6879487,6938349,6997336,7056447, + 7115683,7175042,7234524,7294129,7353855,7413703,7473672,7533762,7593972,7654301, + 7714750,7775317,7836002,7896805,7957725,8018762,8079916,8141185,8202570,8264070, + 8325685,8387413,8449256,8511212,8573281,8635462,8697756,8760161,8822678,8885305, + 8948043,9010892,9073850,9136917,9200094,9263379,9326772,9390274,9453882,9517598, + 9581421,9645351,9709386,9773527,9837774,9902125,9966582,10031143,10095807,10160576, + 10225448,10290423,10355500,10420681,10485963,10551347,10616832,10682419,10748106,10813894, + 10879782,10945770,11011857,11078044,11144330,11210715,11277198,11343779,11410458,11477234, + 11544108,11611079,11678147,11745311,11812571,11879927,11947378,12014925,12082567,12150304, + 12218135,12286061,12354081,12422194,12490401,12558701,12627094,12695580,12764158,12832829, + 12901592,12970446,13039392,13108429,13177557,13246776,13316085,13385485,13454975,13524554, + 13594224,13663982,13733830,13803767,13873792,13943906,14014108,14084398,14154776,14225242, + 14295794,14366435,14437162,14507975,14578876,14649862,14720935,14792093,14863337,14934667, + 15006082,15077582,15149167,15220837,15292591,15364429,15436351,15508358,15580448,15652621, + 15724878,15797217,15869640,15942146,16014734,16087404,16160156,16232991,16305907,16378905, + 16451984,16525145,16598386,16671709,16745112,16818596,16892160,16965804,17039528,17113332, + 17187216,17261179,17335222,17409343,17483544,17557824,17632182,17706618,17781133,17855726, + 17930397,18005146,18079973,18154877,18229858,18304917,18380052,18455265,18530554,18605920, + 18681362,18756880,18832475,18908145,18983891,19059713,19135610,19211583,19287630,19363753, + 19439951,19516223,19592571,19668992,19745488,19822058,19898702,19975420,20052211,20129076, + 20206015,20283027,20360112,20437270,20514501,20591805,20669181,20746630,20824151,20901745, + 20979410,21057148,21134957,21212838,21290791,21368815,21446910,21525076,21603314,21681622, + 21760001,21838451,21916971,21995561,22074222,22152953,22231754,22310625,22389566,22468576, + 22547656,22626806,22706024,22785312,22864669,22944094,23023589,23103152,23182783,23262484, + 23342252,23422089,23501993,23581966,23662007,23742115,23822291,23902534,23982845,24063223, + 24143669,24224181,24304761,24385407,24466120,24546899,24627745,24708658,24789637,24870682, + 24951793,25032970,25114213,25195521,25276895,25358335,25439841,25521411,25603047,25684748, + 25766514,25848345,25930241,26012201,26094226,26176316,26258469,26340688,26422970,26505317, + 26587727,26670202,26752740,26835342,26918008,27000737,27083530,27166386,27249305,27332287, + 27415332,27498440,27581611,27664845,27748142,27831501,27914922,27998406,28081952,28165561, + 28249231,28332963,28416758,28500614,28584532,28668511,28752552,28836655,28920819,29005044, + 29089330,29173677,29258086,29342555,29427085,29511676,29596328,29681040,29765813,29850646, + 29935539,30020493,30105507,30190581,30275714,30360908,30446162,30531475,30616848,30702280, + 30787772,30873323,30958934,31044604,31130332,31216120,31301967,31387873,31473838,31559862, + 31645944,31732084,31818284,31904541,31990857,32077231,32163664,32250154,32336703,32423309, + 32509974,32596696,32683476,32770313,32857208,32944161,33031171,33118238,33205363,33292544, + 33379783,33467079,33554432,33641842,33729308,33816832,33904412,33992048,34079741,34167491, + 34255297,34343159,34431078,34519052,34607083,34695170,34783312,34871511,34959765,35048075, + 35136441,35224862,35313339,35401872,35490459,35579102,35667801,35756554,35845363,35934226, + 36023145,36112118,36201147,36290230,36379367,36468560,36557807,36647108,36736464,36825875, + 36915339,37004858,37094431,37184058,37273739,37363474,37453263,37543106,37633003,37722953, + 37812957,37903015,37993126,38083291,38173509,38263780,38354105,38444483,38534914,38625398, + 38715935,38806525,38897168,38987864,39078612,39169414,39260268,39351174,39442133,39533145, + 39624209,39715325,39806494,39897714,39988987,40080312,40171690,40263119,40354600,40446133, + 40537718,40629354,40721042,40812782,40904574,40996417,41088311,41180257,41272254,41364303, + 41456402,41548553,41640755,41733008,41825313,41917668,42010074,42102530,42195038,42287596, + 42380205,42472865,42565575,42658336,42751147,42844009,42936921,43029883,43122895,43215958, + 43309070,43402233,43495446,43588709,43682022,43775384,43868797,43962259,44055771,44149332, + 44242943,44336604,44430314,44524073,44617882,44711741,44805648,44899605,44993611,45087666, + 45181770,45275923,45370126,45464377,45558677,45653025,45747423,45841869,45936364,46030908, + 46125500,46220141,46314830,46409567,46504353,46599187,46694070,46789001,46883980,46979007, + 47074082,47169205,47264376,47359595,47454862,47550177,47645540,47740950,47836408,47931914, + 48027467,48123068,48218716,48314412,48410155,48505945,48601783,48697668,48793601,48889580, + 48985607,49081681,49177802,49273969,49370184,49466446,49562754,49659109,49755511,49851960, + 49948456,50044998,50141586,50238222,50334903,50431631,50528406,50625227,50722094,50819007, + 50915967,51012973,51110025,51207123,51304267,51401457,51498694,51595976,51693304,51790677, + 51888097,51985562,52083073,52180630,52278232,52375880,52473573,52571312,52669097,52766926, + 52864801,52962722,53060688,53158699,53256755,53354856,53453002,53551194,53649430,53747712, + 53846038,53944410,54042826,54141287,54239793,54338344,54436939,54535579,54634263,54732993, + 54831766,54930585,55029447,55128354,55227306,55326302,55425342,55524426,55623555,55722728, + 55821945,55921206,56020511,56119860,56219253,56318690,56418171,56517696,56617265,56716877, + 56816534,56916234,57015977,57115764,57215595,57315470,57415388,57515349,57615354,57715403, + 57815494,57915629,58015808,58116029,58216294,58316602,58416954,58517348,58617785,58718266, + 58818789,58919356,59019965,59120617,59221312,59322050,59422831,59523654,59624521,59725429, + 59826381,59927375,60028412,60129491,60230613,60331777,60432983,60534232,60635524,60736857, + 60838233,60939651,61041112,61142614,61244159,61345746,61447375,61549046,61650759,61752513, + 61854310,61956149,62058030,62159952,62261916,62363922,62465970,62568059,62670191,62772363, + 62874578,62976833,63079131,63181470,63283850,63386272,63488735,63591239,63693785,63796372, + 63899001,64001670,64104381,64207133,64309926,64412760,64515636,64618552,64721509,64824507, + 64927546,65030627,65133747,65236909,65340112,65443355,65546639,65649964,65753329,65856735, + 65960182,66063669,66167197,66270765,66374374,66478023,66581713,66685443,66789213,66893024, + 66996875,67100766,67204698,67308669,67412681,67516733,67620825,67724957,67829130,67933342, + 68037594,68141886,68246218,68350590,68455002,68559454,68663945,68768476,68873047,68977658, + 69082308,69186998,69291728,69396497,69501306,69606154,69711042,69815969,69920936,70025942, + 70130987,70236072,70341196,70446360,70551562,70656804,70762085,70867406,70972765,71078164, + 71183601,71289078,71394594,71500149,71605742,71711375,71817046,71922757,72028506,72134294, + 72240121,72345987,72451891,72557835,72663817,72769837,72875896,72981994,73088130,73194305, + 73300519,73406770,73513061,73619389,73725757,73832162,73938606,74045088,74151609,74258168, + 74364765,74471400,74578073,74684785,74791535,74898323,75005149,75112012,75218914,75325854, + 75432832,75539848,75646902,75753994,75861123,75968291,76075496,76182739,76290020,76397338, + 76504694,76612088,76719520,76826989,76934495,77042040,77149622,77257241,77364898,77472592, + 77580324,77688093,77795899,77903743,78011625,78119543,78227499,78335492,78443522,78551590, + 78659695,78767836,78876015,78984232,79092485,79200775,79309102,79417467,79525868,79634306, + 79742781,79851293,79959842,80068428,80177050,80285710,80394406,80503139,80611908,80720715, + 80829558,80938438,81047354,81156307,81265296,81374322,81483385,81592484,81701620,81810792, + 81920000,82029245,82138526,82247844,82357198,82466588,82576014,82685477,82794976,82904512, + 83014083,83123691,83233334,83343014,83452730,83562482,83672271,83782095,83891955,84001851, + 84111783,84221751,84331755,84441795,84551870,84661982,84772129,84882312,84992531,85102786, + 85213076,85323402,85433764,85544161,85654594,85765063,85875567,85986107,86096682,86207293, + 86317939,86428621,86539338,86650091,86760879,86871702,86982561,87093455,87204384,87315349, + 87426349,87537384,87648455,87759560,87870701,87981877,88093088,88204334,88315616,88426932, + 88538283,88649670,88761091,88872548,88984039,89095565,89207126,89318723,89430353,89542019, + 89653720,89765455,89877226,89989030,90100870,90212745,90324654,90436598,90548576,90660589, + 90772637,90884719,90996836,91108987,91221173,91333394,91445648,91557938,91670262,91782620, + 91895012,92007439,92119901,92232396,92344926,92457491,92570089,92682722,92795389,92908090, + 93020826,93133595,93246399,93359237,93472109,93585015,93697955,93810929,93923937,94036980, + 94150056,94263166,94376310,94489488,94602700,94715946,94829225,94942539,95055886,95169267, + 95282682,95396131,95509613,95623129,95736679,95850263,95963880,96077530,96191215,96304933, + 96418684,96532470,96646288,96760140,96874026,96987945,97101898,97215884,97329904,97443956, + 97558043,97672162,97786315,97900502,98014721,98128974,98243260,98357580,98471933,98586318, + 98700737,98815190,98929675,99044194,99158745,99273330,99387948,99502598,99617282,99731999, + 99846749,99961532,100076348,100191197,100306078,100420993,100535940,100650921,100765934,100880980, + 100996059,101111170,101226315,101341492,101456702,101571944,101687220,101802528,101917868,102033241, + 102148647,102264086,102379557,102495061,102610597,102726166,102841767,102957401,103073067,103188765, + 103304497,103420260,103536056,103651884,103767745,103883638,103999563,104115521,104231511,104347533, + 104463588,104579675,104695794,104811945,104928128,105044344,105160592,105276871,105393183,105509527, + 105625904,105742312,105858752,105975224,106091729,106208265,106324833,106441433,106558066,106674730, + 106791426,106908154,107024913,107141705,107258528,107375384,107492271,107609190,107726140,107843123, + 107960137,108077182,108194260,108311369,108428510,108545683,108662887,108780122,108897390,109014689, + 109132019,109249381,109366775,109484200,109601656,109719144,109836664,109954215,110071797,110189411, + 110307056,110424733,110542441,110660180,110777950,110895752,111013585,111131450,111249346,111367273, + 111485231,111603220,111721241,111839292,111957375,112075489,112193635,112311811,112430018,112548257, + 112666526,112784827,112903159,113021521,113139915,113258339,113376795,113495282,113613799,113732347, + 113850927,113969537,114088178,114206850,114325552,114444286,114563050,114681845,114800671,114919528, + 115038415,115157333,115276282,115395262,115514272,115633313,115752384,115871486,115990619,116109783, + 116228976,116348201,116467456,116586742,116706058,116825404,116944781,117064189,117183627,117303095, + 117422594,117542124,117661683,117781273,117900894,118020545,118140226,118259937,118379679,118499451, + 118619253,118739086,118858948,118978842,119098765,119218718,119338702,119458716,119578759,119698834, + 119818938,119939072,120059236,120179431,120299655,120419910,120540194,120660509,120780854,120901228, + 121021633,121142067,121262532,121383026,121503550,121624105,121744689,121865303,121985946,122106620, + 122227323,122348057,122468820,122589613,122710435,122831287,122952170,123073081,123194023,123314994, + 123435995,123557025,123678085,123799175,123920295,124041444,124162622,124283830,124405068,124526335, + 124647632,124768959,124890314,125011700,125133114,125254559,125376032,125497536,125619068,125740630, + 125862221,125983842,126105492,126227171,126348880,126470618,126592386,126714182,126836008,126957863, + 127079748,127201661,127323604,127445576,127567578,127689608,127811668,127933756,128055874,128178021, + 128300197,128422403,128544637,128666900,128789193,128911514,129033865,129156244,129278652,129401090, + 129523556,129646052,129768576,129891129,130013711,130136323,130258963,130381631,130504329,130627056, + 130749811,130872595,130995408,131118250,131241120,131364020,131486948,131609905,131732890,131855904, + 131978947,132102019,132225119,132348248,132471406,132594592,132717807,132841050,132964323,133087623, + 133210952,133334310,133457696,133581111,133704554,133828026,133951527,134075055,134198613,134322198, + 134445812,134569455,134693126,134816825,134940553,135064309,135188094,135311906,135435747,135559617, + 135683515,135807441,135931395,136055378,136179388,136303427,136427495,136551590,136675714,136799866, + 136924046,137048254,137172490,137296755,137421048,137545368,137669717,137794094,137918499,138042932, + 138167393,138291882,138416400,138540945,138665518,138790119,138914748,139039405,139164090,139288803, + 139413544,139538313,139663110,139787934,139912787,140037667,140162575,140287511,140412475,140537467, + 140662486,140787533,140912608,141037711,141162842,141288000,141413186,141538399,141663641,141788910, + 141914207,142039531,142164883,142290263,142415670,142541105,142666567,142792057,142917575,143043120, + 143168693,143294294,143419921,143545577,143671260,143796970,143922708,144048473,144174266,144300086, + 144425934,144551809,144677712,144803641,144929599,145055583,145181595,145307635,145433701,145559795, + 145685917,145812065,145938241,146064445,146190675,146316933,146443218,146569530,146695869,146822236, + 146948630,147075051,147201499,147327974,147454477,147581007,147707563,147834147,147960758,148087396, + 148214061,148340754,148467473,148594219,148720993,148847793,148974620,149101475,149228356,149355264, + 149482200,149609162,149736151,149863167,149990210,150117280,150244377,150371501,150498652,150625829, + 150753033,150880265,151007523,151134807,151262119,151389457,151516823,151644215,151771633,151899079, + 152026551,152154050,152281576,152409128,152536707,152664313,152791945,152919604,153047290,153175002, + 153302741,153430507,153558299,153686118,153813963,153941835,154069734,154197659,154325610,154453588, + 154581593,154709624,154837682,154965766,155093876,155222013,155350177,155478367,155606583,155734826, + 155863095,155991391,156119713,156248061,156376436,156504837,156633264,156761718,156890198,157018704, + 157147237,157275796,157404381,157532993,157661630,157790294,157918985,158047701,158176444,158305212, + 158434008,158562829,158691676,158820550,158949449,159078375,159207327,159336305,159465310,159594340, + 159723396,159852479,159981587,160110722,160239882,160369069,160498282,160627520,160756785,160886076, + 161015392,161144735,161274103,161403498,161532918,161662365,161791837,161921335,162050859,162180409, + 162309985,162439587,162569215,162698868,162828547,162958252,163087983,163217740,163347523,163477331, + 163607165,163737025,163866910,163996822,164126759,164256722,164386710,164516724,164646764,164776830, + 164906921,165037038,165167181,165297349,165427543,165557762,165688007,165818278,165948574,166078896, + 166209243,166339616,166470015,166600439,166730888,166861363,166991864,167122390,167252942,167383519, + 167514122,167644750,167775403,167906082,168036786,168167516,168298271,168429052,168559858,168690689, + 168821546,168952428,169083335,169214268,169345226,169476210,169607219,169738253,169869312,170000397, + 170131507,170262642,170393802,170524988,170656199,170787435,170918696,171049983,171181295,171312632, + 171443994,171575381,171706793,171838231,171969694,172101182,172232695,172364233,172495796,172627384, + 172758997,172890636,173022299,173153988,173285702,173417440,173549204,173680993,173812806,173944645, + 174076509,174208397,174340311,174472249,174604213,174736201,174868215,175000253,175132316,175264404, + 175396517,175528655,175660818,175793005,175925218,176057455,176189717,176322004,176454316,176586653, + 176719014,176851400,176983811,177116247,177248708,177381193,177513703,177646237,177778797,177911381, + 178043990,178176624,178309282,178441965,178574672,178707405,178840162,178972943,179105749,179238580, + 179371435,179504316,179637220,179770149,179903103,180036082,180169084,180302112,180435164,180568240, + 180701342,180834467,180967617,181100792,181233991,181367214,181500462,181633735,181767032,181900353, + 182033699,182167069,182300464,182433883,182567326,182700794,182834286,182967803,183101344,183234909, + 183368499,183502113,183635751,183769414,183903101,184036812,184170548,184304307,184438092,184571900, + 184705732,184839589,184973470,185107376,185241305,185375259,185509237,185643239,185777266,185911316, + 186045391,186179490,186313613,186447760,186581931,186716126,186850346,186984590,187118857,187253149, + 187387465,187521805,187656169,187790557,187924969,188059405,188193866,188328350,188462858,188597390, + 188731946,188866527,189001131,189135759,189270411,189405087,189539787,189674511,189809259,189944031, + 190078827,190213646,190348490,190483357,190618249,190753164,190888103,191023066,191158052,191293063, + 191428097,191563155,191698237,191833343,191968473,192103626,192238803,192374004,192509229,192644477, + 192779749,192915045,193050365,193185708,193321075,193456466,193591881,193727319,193862781,193998266, + 194133775,194269308,194404864,194540444,194676048,194811675,194947326,195083001,195218699,195354421, + 195490166,195625935,195761727,195897543,196033383,196169246,196305132,196441042,196576976,196712933, + 196848914,196984918,197120945,197256996,197393071,197529169,197665290,197801435,197937603,198073795, + 198210010,198346249,198482510,198618796,198755104,198891437,199027792,199164171,199300573,199436998, + 199573447,199709919,199846415,199982934,200119476,200256041,200392630,200529242,200665877,200802535, + 200939217,201075922,201212650,201349402,201486176,201622974,201759795,201896639,202033507,202170398, + 202307311,202444248,202581209,202718192,202855198,202992228,203129281,203266357,203403456,203540578, + 203677723,203814891,203952082,204089297,204226534,204363795,204501078,204638385,204775715,204913067, + 205050443,205187842,205325264,205462708,205600176,205737667,205875180,206012717,206150277,206287859, + 206425465,206563093,206700745,206838419,206976116,207113836,207251579,207389345,207527134,207664946, + 207802780,207940638,208078518,208216421,208354347,208492295,208630267,208768261,208906279,209044319, + 209182381,209320467,209458575,209596706,209734860,209873037,210011236,210149458,210287703,210425971, + 210564261,210702574,210840910,210979268,211117649,211256053,211394480,211532929,211671400,211809895, + 211948412,212086952,212225514,212364099,212502706,212641337,212779989,212918665,213057363,213196083, + 213334826,213473592,213612380,213751191,213890024,214028880,214167758,214306659,214445582,214584528, + 214723497,214862488,215001501,215140537,215279595,215418676,215557779,215696904,215836053,215975223, + 216114416,216253631,216392869,216532129,216671412,216810717,216950044,217089394,217228766,217368160, + 217507577,217647016,217786477,217925961,218065467,218204996,218344546,218484119,218623715,218763332, + 218902972,219042634,219182319,219322026,219461754,219601506,219741279,219881075,220020893,220160733, + 220300595,220440479,220580386,220720315,220860266,221000239,221140235,221280252,221420292,221560354, + 221700438,221840544,221980672,222120823,222260995,222401190,222541406,222681645,222821906,222962189, + 223102494,223242821,223383170,223523541,223663934,223804350,223944787,224085246,224225728,224366231, + 224506756,224647303,224787873,224928464,225069077,225209712,225350370,225491049,225631750,225772473, + 225913218,226053985,226194773,226335584,226476417,226617271,226758148,226899046,227039966,227180908, + 227321872,227462858,227603865,227744895,227885946,228027019,228168114,228309231,228450369,228591529, + 228732712,228873916,229015141,229156389,229297658,229438949,229580262,229721596,229862953,230004331, + 230145730,230287152,230428595,230570060,230711546,230853055,230994585,231136136,231277709,231419304, + 231560921,231702559,231844219,231985901,232127604,232269329,232411076,232552844,232694633,232836445, + 232978278,233120132,233262008,233403906,233545825,233687766,233829728,233971712,234113717,234255744, + 234397793,234539863,234681954,234824068,234966202,235108358,235250536,235392735,235534955,235677197, + 235819461,235961746,236104052,236246380,236388729,236531100,236673492,236815905,236958340,237100797, + 237243274,237385774,237528294,237670836,237813399,237955984,238098590,238241217,238383866,238526536, + 238669228,238811940,238954674,239097430,239240207,239383005,239525824,239668664,239811526,239954409, + 240097314,240240240,240383187,240526155,240669144,240812155,240955187,241098240,241241314,241384410, + 241527527,241670665,241813824,241957005,242100206,242243429,242386673,242529938,242673224,242816532, + 242959860,243103210,243246581,243389973,243533386,243676820,243820276,243963752,244107249,244250768, + 244394308,244537869,244681450,244825053,244968677,245112322,245255989,245399676,245543384,245687113, + 245830863,245974635,246118427,246262240,246406074,246549930,246693806,246837703,246981621,247125560, + 247269521,247413502,247557504,247701527,247845571,247989635,248133721,248277828,248421956,248566104, + 248710273,248854464,248998675,249142907,249287160,249431434,249575729,249720044,249864381,250008738, + 250153116,250297515,250441935,250586375,250730837,250875319,251019822,251164346,251308890,251453456, + 251598042,251742649,251887277,252031925,252176594,252321284,252465995,252610727,252755479,252900252, + 253045045,253189860,253334695,253479551,253624427,253769324,253914242,254059181,254204140,254349120, + 254494121,254639142,254784184,254929246,255074329,255219433,255364558,255509703,255654868,255800054, + 255945261,256090489,256235737,256381006,256526295,256671605,256816935,256962286,257107657,257253049, + 257398462,257543895,257689349,257834823,257980318,258125833,258271369,258416925,258562502,258708099, + 258853717,258999355,259145014,259290693,259436392,259582112,259727853,259873614,260019395,260165197, + 260311019,260456862,260602725,260748609,260894513,261040437,261186382,261332347,261478333,261624339, + 261770365,261916411,262062478,262208566,262354674,262500802,262646950,262793119,262939308,263085517, + 263231747,263377997,263524267,263670558,263816869,263963200,264109551,264255923,264402315,264548728, + 264695160,264841613,264988086,265134579,265281093,265427627,265574181,265720755,265867349,266013964, + 266160599,266307254,266453929,266600625,266747340,266894076,267040832,267187608,267334404,267481221, + 267628057,267774914,267921791,268068688,268215605,268362542,268509500,268656477,268803475,268950493, + 269097530,269244588,269391666,269538764,269685882,269833021,269980179,270127357,270274555,270421774, + 270569012,270716271,270863549,271010848,271158166,271305505,271452863,271600242,271747640,271895059, + 272042497,272189956,272337434,272484933,272632451,272779990,272927548,273075126,273222724,273370342, + 273517981,273665639,273813316,273961014,274108732,274256470,274404227,274552005,274699802,274847619, + 274995456,275143313,275291190,275439087,275587003,275734940,275882896,276030872,276178868,276326884, + 276474919,276622975,276771050,276919145,277067260,277215394,277363549,277511723,277659917,277808130, + 277956364,278104617,278252890,278401183,278549496,278697828,278846180,278994552,279142943,279291354, + 279439785,279588236,279736706,279885196,280033706,280182236,280330785,280479353,280627942,280776550, + 280925178,281073825,281222493,281371179,281519886,281668612,281817358,281966123,282114908,282263713, + 282412537,282561381,282710244,282859127,283008030,283156952,283305894,283454855,283603836,283752836, + 283901856,284050896,284199955,284349034,284498132,284647250,284796387,284945544,285094721,285243917, + 285393132,285542367,285691621,285840895,285990189,286139502,286288834,286438186,286587557,286736948, + 286886358,287035788,287185237,287334706,287484194,287633701,287783228,287932774,288082340,288231925, + 288381530,288531154,288680797,288830460,288980142,289129844,289279565,289429305,289579065,289728844, + 289878642,290028460,290178297,290328153,290478029,290627924,290777839,290927773,291077726,291227698, + 291377690,291527701,291677731,291827781,291977850,292127938,292278045,292428172,292578318,292728484, + 292878668,293028872,293179095,293329337,293479599,293629880,293780180,293930499,294080837,294231195, + 294381572,294531968,294682383,294832818,294983272,295133744,295284237,295434748,295585278,295735828, + 295886396,296036984,296187591,296338218,296488863,296639527,296790211,296940914,297091636,297242377, + 297393137,297543916,297694714,297845532,297996368,298147224,298298098,298448992,298599905,298750837, + 298901788,299052758,299203747,299354755,299505782,299656829,299807894,299958978,300110081,300261204, + 300412345,300563505,300714685,300865883,301017101,301168337,301319592,301470867,301622160,301773472, + 301924804,302076154,302227523,302378911,302530318,302681744,302833189,302984653,303136136,303287638, + 303439159,303590698,303742257,303893834,304045431,304197046,304348680,304500333,304652005,304803696, + 304955405,305107134,305258881,305410648,305562433,305714237,305866060,306017901,306169762,306321641, + 306473539,306625456,306777392,306929347,307081320,307233312,307385323,307537353,307689402,307841469, + 307993555,308145660,308297784,308449927,308602088,308754268,308906467,309058684,309210921,309363176, + 309515449,309667742,309820053,309972383,310124732,310277099,310429485,310581890,310734313,310886755, + 311039216,311191696,311344194,311496711,311649247,311801801,311954374,312106965,312259575,312412204, + 312564852,312717518,312870203,313022906,313175628,313328369,313481128,313633906,313786703,313939518, + 314092351,314245204,314398074,314550964,314703872,314856799,315009744,315162708,315315690,315468691, + 315621710,315774748,315927805,316080880,316233973,316387086,316540216,316693365,316846533,316999719, + 317152924,317306147,317459389,317612649,317765928,317919225,318072541,318225875,318379228,318532599, + 318685988,318839396,318992823,319146268,319299731,319453213,319606713,319760232,319913769,320067324, + 320220898,320374491,320528101,320681731,320835378,320989044,321142729,321296431,321450153,321603892, + 321757650,321911426,322065221,322219034,322372865,322526715,322680583,322834470,322988374,323142297, + 323296239,323450199,323604177,323758173,323912188,324066221,324220272,324374342,324528430,324682536, + 324836660,324990803,325144964,325299144,325453341,325607557,325761791,325916044,326070314,326224603, + 326378910,326533236,326687579,326841941,326996321,327150720,327305136,327459571,327614024,327768495, + 327922984,328077492,328232018,328386562,328541124,328695704,328850302,329004919,329159554,329314207, + 329468878,329623567,329778275,329933000,330087744,330242506,330397286,330552084,330706900,330861735, + 331016587,331171458,331326347,331481254,331636178,331791121,331946083,332101062,332256059,332411074, + 332566108,332721159,332876229,333031317,333186422,333341546,333496688,333651848,333807026,333962221, + 334117435,334272667,334427917,334583185,334738471,334893776,335049098,335204438,335359796,335515172, + 335670566,335825978,335981408,336136856,336292322,336447806,336603308,336758828,336914365,337069921, + 337225495,337381087,337536696,337692324,337847969,338003633,338159314,338315013,338470730,338626465, + 338782218,338937989,339093778,339249585,339405409,339561252,339717112,339872990,340028886,340184800, + 340340732,340496682,340652650,340808635,340964638,341120659,341276698,341432755,341588830,341744922, + 341901032,342057161,342213306,342369470,342525652,342681851,342838068,342994303,343150556,343306826, + 343463115,343619421,343775745,343932086,344088446,344244823,344401218,344557631,344714061,344870509, + 345026975,345183459,345339960,345496480,345653016,345809571,345966143,346122733,346279341,346435967, + 346592610,346749271,346905949,347062646,347219359,347376091,347532840,347689607,347846392,348003194, + 348160014,348316852,348473707,348630580,348787471,348944379,349101305,349258249,349415210,349572189, + 349729185,349886199,350043231,350200280,350357347,350514432,350671534,350828653,350985791,351142946, + 351300118,351457308,351614516,351771741,351928984,352086244,352243522,352400817,352558130,352715461, + 352872809,353030175,353187558,353344959,353502377,353659813,353817266,353974737,354132225,354289731, + 354447254,354604795,354762354,354919929,355077523,355235134,355392762,355550408,355708071,355865752, + 356023450,356181166,356338899,356496649,356654418,356812203,356970006,357127826,357285664,357443520, + 357601392,357759282,357917190,358075115,358233057,358391017,358548994,358706989,358865001,359023030, + 359181077,359339141,359497223,359655322,359813438,359971572,360129723,360287891,360446077,360604280, + 360762501,360920738,361078994,361237266,361395556,361553863,361712188,361870530,362028889,362187265, + 362345659,362504070,362662499,362820944,362979407,363137888,363296385,363454900,363613432,363771982, + 363930549,364089133,364247734,364406353,364564988,364723642,364882312,365041000,365199704,365358426, + 365517166,365675922,365834696,365993487,366152296,366311121,366469964,366628824,366787701,366946595, + 367105507,367264435,367423381,367582344,367741325,367900322,368059337,368218369,368377418,368536484, + 368695567,368854668,369013785,369172920,369332072,369491241,369650428,369809631,369968852,370128089, + 370287344,370446616,370605905,370765211,370924535,371083875,371243232,371402607,371561999,371721408, + 371880833,372040276,372199737,372359214,372518708,372678219,372837748,372997293,373156856,373316435, + 373476032,373635645,373795276,373954924,374114589,374274270,374433969,374593685,374753418,374913168, + 375072935,375232719,375392520,375552338,375712173,375872025,376031894,376191780,376351683,376511603, + 376671540,376831494,376991465,377151453,377311458,377471479,377631518,377791574,377951647,378111736, + 378271843,378431966,378592107,378752264,378912439,379072630,379232838,379393063,379553305,379713564, + 379873840,380034133,380194443,380354769,380515113,380675473,380835850,380996244,381156655,381317083, + 381477528,381637990,381798468,381958964,382119476,382280005,382440551,382601114,382761694,382922290, + 383082903,383243534,383404181,383564844,383725525,383886223,384046937,384207668,384368416,384529181, + 384689962,384850761,385011576,385172408,385333256,385494122,385655004,385815903,385976819,386137752, + 386298701,386459667,386620650,386781650,386942667,387103700,387264750,387425816,387586900,387748000, + 387909117,388070251,388231401,388392568,388553752,388714952,388876170,389037404,389198654,389359922, + 389521206,389682507,389843824,390005158,390166509,390327877,390489261,390650662,390812079,390973513, + 391134964,391296432,391457916,391619417,391780934,391942469,392104019,392265587,392427171,392588772, + 392750389,392912023,393073674,393235341,393397025,393558725,393720442,393882176,394043926,394205693, + 394367477,394529277,394691093,394852927,395014776,395176643,395338526,395500425,395662342,395824274, + 395986224,396148189,396310172,396472171,396634186,396796218,396958267,397120332,397282414,397444512, + 397606627,397768758,397930906,398093070,398255251,398417448,398579662,398741892,398904139,399066402, + 399228682,399390979,399553291,399715621,399877966,400040329,400202707,400365103,400527514,400689943, + 400852387,401014848,401177326,401339820,401502330,401664857,401827400,401989960,402152536,402315129, + 402477738,402640363,402803005,402965664,403128338,403291030,403453737,403616461,403779201,403941958, + 404104731,404267521,404430327,404593149,404755988,404918843,405081715,405244602,405407507,405570427, + 405733364,405896317,406059287,406222273,406385275,406548294,406711329,406874381,407037448,407200532, + 407363633,407526750,407689883,407853032,408016198,408179380,408342578,408505793,408669024,408832271, + 408995534,409158814,409322110,409485423,409648751,409812096,409975457,410138835,410302229,410465639, + 410629065,410792508,410955967,411119442,411282933,411446441,411609964,411773505,411937061,412100633, + 412264222,412427827,412591449,412755086,412918740,413082410,413246096,413409798,413573517,413737251, + 413901002,414064769,414228553,414392352,414556168,414720000,414883848,415047712,415211593,415375489, + 415539402,415703331,415867276,416031238,416195215,416359209,416523218,416687244,416851286,417015344, + 417179419,417343509,417507616,417671738,417835877,418000032,418164203,418328390,418492594,418656813, + 418821048,418985300,419149568,419313852,419478151,419642467,419806800,419971148,420135512,420299892, + 420464289,420628701,420793130,420957574,421122035,421286511,421451004,421615513,421780038,421944579, + 422109136,422273709,422438298,422602903,422767524,422932161,423096814,423261483,423426168,423590870, + 423755587,423920320,424085069,424249834,424414616,424579413,424744226,424909055,425073900,425238762, + 425403639,425568532,425733441,425898366,426063307,426228264,426393237,426558226,426723231,426888252, + 427053288,427218341,427383410,427548494,427713595,427878711,428043844,428208992,428374156,428539337, + 428704533,428869745,429034973,429200217,429365476,429530752,429696043,429861351,430026674,430192013, + 430357369,430522740,430688126,430853529,431018948,431184382,431349833,431515299,431680781,431846279, + 432011793,432177323,432342868,432508430,432674007,432839600,433005209,433170834,433336474,433502131, + 433667803,433833491,433999195,434164914,434330650,434496401,434662168,434827951,434993750,435159565, + 435325395,435491241,435657103,435822981,435988874,436154784,436320709,436486650,436652606,436818579, + 436984567,437150571,437316590,437482626,437648677,437814744,437980827,438146925,438313039,438479169, + 438645315,438811476,438977653,439143846,439310055,439476279,439642519,439808775,439975046,440141333, + 440307636,440473955,440640289,440806639,440973005,441139386,441305783,441472196,441638624,441805068, + 441971528,442138004,442304495,442471002,442637524,442804062,442970616,443137185,443303770,443470371, + 443636988,443803620,443970267,444136931,444303610,444470304,444637014,444803740,444970482,445137239, + 445304012,445470800,445637604,445804423,445971259,446138109,446304976,446471858,446638755,446805668, + 446972597,447139542,447306501,447473477,447640468,447807475,447974497,448141535,448308588,448475657, + 448642742,448809842,448976957,449144088,449311235,449478397,449645575,449812768,449979977,450147202, + 450314442,450481697,450648968,450816255,450983557,451150874,451318207,451485556,451652920,451820300, + 451987695,452155105,452322531,452489973,452657430,452824903,452992391,453159894,453327413,453494948, + 453662498,453830063,453997644,454165240,454332852,454500480,454668122,454835781,455003454,455171143, + 455338848,455506568,455674303,455842054,456009821,456177602,456345399,456513212,456681040,456848884, + 457016742,457184617,457352506,457520411,457688332,457856268,458024219,458192186,458360168,458528165, + 458696178,458864207,459032250,459200309,459368384,459536474,459704579,459872699,460040835,460208986, + 460377153,460545335,460713532,460881745,461049973,461218216,461386475,461554749,461723039,461891343, + 462059663,462227999,462396350,462564716,462733097,462901494,463069906,463238333,463406776,463575234, + 463743707,463912196,464080699,464249219,464417753,464586303,464754868,464923448,465092044,465260655, + 465429281,465597922,465766579,465935251,466103938,466272641,466441358,466610091,466778840,466947603, + 467116382,467285176,467453985,467622810,467791650,467960505,468129375,468298260,468467161,468636077, + 468805008,468973954,469142916,469311893,469480885,469649892,469818914,469987952,470157005,470326073, + 470495156,470664254,470833368,471002497,471171641,471340800,471509974,471679164,471848368,472017588, + 472186823,472356073,472525339,472694619,472863915,473033226,473202552,473371893,473541249,473710620, + 473880007,474049409,474218825,474388257,474557704,474727167,474896644,475066136,475235644,475405167, + 475574704,475744257,475913825,476083408,476253007,476422620,476592248,476761892,476931550,477101224, + 477270913,477440617,477610336,477780070,477949819,478119583,478289362,478459157,478628966,478798790, + 478968630,479138484,479308354,479478239,479648138,479818053,479987983,480157928,480327888,480497863, + 480667853,480837858,481007878,481177913,481347963,481518028,481688108,481858203,482028313,482198438, + 482368578,482538734,482708904,482879089,483049289,483219504,483389734,483559979,483730240,483900515, + 484070805,484241110,484411430,484581765,484752115,484922480,485092860,485263254,485433664,485604089, + 485774529,485944983,486115453,486285938,486456437,486626952,486797481,486968025,487138585,487309159, + 487479748,487650352,487820971,487991605,488162254,488332917,488503596,488674290,488844998,489015721, + 489186460,489357213,489527981,489698764,489869562,490040374,490211202,490382044,490552902,490723774, + 490894661,491065563,491236480,491407412,491578358,491749320,491920296,492091287,492262294,492433314, + 492604350,492775401,492946466,493117547,493288642,493459752,493630876,493802016,493973171,494144340, + 494315524,494486723,494657937,494829165,495000409,495171667,495342940,495514228,495685530,495856848, + 496028180,496199527,496370889,496542265,496713657,496885063,497056484,497227919,497399370,497570835, + 497742315,497913810,498085320,498256844,498428383,498599937,498771506,498943089,499114687,499286300, + 499457928,499629570,499801227,499972899,500144586,500316287,500488003,500659734,500831480,501003240, + 501175015,501346805,501518609,501690428,501862262,502034111,502205974,502377852,502549745,502721652, + 502893574,503065511,503237462,503409429,503581409,503753405,503925415,504097440,504269480,504441534, + 504613603,504785686,504957785,505129897,505302025,505474167,505646324,505818496,505990682,506162883, + 506335098,506507328,506679573,506851833,507024107,507196395,507368699,507541017,507713349,507885697, + 508058058,508230435,508402826,508575232,508747652,508920087,509092536,509265000,509437479,509609972, + 509782480,509955003,510127540,510300092,510472658,510645239,510817834,510990444,511163069,511335708, + 511508362,511681030,511853713,512026411,512199123,512371849,512544590,512717346,512890116,513062901, + 513235701,513408514,513581343,513754186,513927043,514099916,514272802,514445703,514618619,514791549, + 514964494,515137453,515310427,515483415,515656418,515829435,516002467,516175513,516348574,516521649, + 516694739,516867844,517040962,517214096,517387243,517560406,517733582,517906774,518079979,518253200, + 518426434,518599683,518772947,518946225,519119518,519292825,519466146,519639482,519812833,519986197, + 520159577,520332970,520506379,520679801,520853238,521026690,521200156,521373636,521547131,521720640, + 521894164,522067702,522241255,522414822,522588403,522761999,522935609,523109234,523282873,523456526, + 523630194,523803876,523977573,524151284,524325009,524498749,524672503,524846272,525020055,525193852, + 525367664,525541490,525715330,525889185,526063054,526236938,526410836,526584748,526758675,526932616, + 527106571,527280541,527454525,527628524,527802536,527976563,528150605,528324661,528498731,528672815, + 528846914,529021027,529195155,529369297,529543453,529717623,529891808,530066007,530240220,530414448, + 530588690,530762946,530937217,531111502,531285801,531460115,531634442,531808785,531983141,532157512, + 532331897,532506296,532680709,532855137,533029579,533204036,533378506,533552991,533727490,533902004, + 534076531,534251073,534425630,534600200,534774785,534949384,535123997,535298624,535473266,535647922, + 535822592,535997276,536171975,536346688,536521415,536696156,536870912,537045682,537220466,537395264, + 537570076,537744903,537919744,538094599,538269468,538444352,538619249,538794161,538969087,539144028, + 539318982,539493951,539668934,539843931,540018942,540193967,540369007,540544060,540719128,540894210, + 541069307,541244417,541419542,541594680,541769833,541945000,542120182,542295377,542470587,542645810, + 542821048,542996300,543171566,543346846,543522141,543697449,543872772,544048109,544223460,544398825, + 544574204,544749597,544925004,545100426,545275862,545451311,545626775,545802253,545977745,546153251, + 546328772,546504306,546679854,546855417,547030994,547206584,547382189,547557808,547733441,547909088, + 548084749,548260425,548436114,548611817,548787535,548963266,549139012,549314771,549490545,549666333, + 549842135,550017950,550193780,550369624,550545482,550721354,550897241,551073141,551249055,551424983, + 551600925,551776882,551952852,552128836,552304835,552480847,552656873,552832914,553008968,553185037, + 553361119,553537215,553713326,553889450,554065589,554241741,554417908,554594088,554770283,554946491, + 555122714,555298950,555475201,555651465,555827743,556004036,556180342,556356662,556532997,556709345, + 556885707,557062083,557238473,557414877,557591295,557767727,557944173,558120633,558297107,558473595, + 558650097,558826612,559003142,559179686,559356243,559532814,559709400,559885999,560062612,560239240, + 560415881,560592536,560769205,560945887,561122584,561299295,561476019,561652758,561829510,562006276, + 562183057,562359851,562536659,562713480,562890316,563067166,563244029,563420907,563597798,563774703, + 563951622,564128555,564305502,564482463,564659437,564836426,565013428,565190444,565367474,565544518, + 565721576,565898647,566075733,566252832,566429945,566607072,566784213,566961368,567138536,567315719, + 567492915,567670125,567847349,568024586,568201838,568379103,568556382,568733675,568910982,569088303, + 569265637,569442985,569620347,569797723,569975113,570152516,570329933,570507365,570684809,570862268, + 571039740,571217227,571394727,571572240,571749768,571927309,572104865,572282433,572460016,572637613, + 572815223,572992847,573170485,573348136,573525802,573703481,573881173,574058880,574236600,574414334, + 574592082,574769844,574947619,575125408,575303211,575481028,575658858,575836702,576014560,576192431, + 576370316,576548215,576726128,576904054,577081994,577259948,577437916,577615897,577793892,577971901, + 578149923,578327959,578506009,578684072,578862149,579040240,579218345,579396463,579574595,579752741, + 579930900,580109073,580287260,580465460,580643674,580821902,581000143,581178399,581356667,581534950, + 581713246,581891555,582069879,582248216,582426567,582604931,582783309,582961701,583140106,583318525, + 583496958,583675404,583853864,584032337,584210825,584389325,584567840,584746368,584924910,585103465, + 585282034,585460616,585639213,585817822,585996446,586175083,586353733,586532398,586711076,586889767, + 587068472,587247191,587425923,587604669,587783428,587962201,588140988,588319788,588498602,588677429, + 588856270,589035125,589213993,589392875,589571770,589750679,589929601,590108537,590287487,590466450, + 590645427,590824417,591003421,591182438,591361469,591540513,591719571,591898643,592077728,592256827, + 592435939,592615065,592794204,592973357,593152523,593331703,593510896,593690103,593869324,594048558, + 594227805,594407066,594586341,594765629,594944930,595124245,595303574,595482916,595662271,595841640, + 596021023,596200419,596379829,596559252,596738688,596918138,597097602,597277079,597456569,597636073, + 597815591,597995122,598174666,598354224,598533795,598713380,598892979,599072590,599252216,599431854, + 599611506,599791172,599970851,600150544,600330250,600509969,600689702,600869448,601049208,601228981, + 601408768,601588568,601768381,601948208,602128049,602307902,602487770,602667650,602847544,603027452, + 603207373,603387307,603567255,603747216,603927191,604107179,604287180,604467195,604647223,604827265, + 605007320,605187388,605367470,605547565,605727674,605907796,606087931,606268080,606448242,606628417, + 606808606,606988808,607169024,607349253,607529496,607709751,607890020,608070303,608250599,608430908, + 608611231,608791566,608971916,609152278,609332654,609513044,609693446,609873862,610054292,610234735, + 610415191,610595660,610776143,610956639,611137148,611317671,611498207,611678756,611859319,612039895, + 612220484,612401087,612581703,612762332,612942975,613123631,613304300,613484983,613665679,613846388, + 614027110,614207846,614388595,614569357,614750133,614930922,615111724,615292540,615473368,615654210, + 615835066,616015934,616196816,616377712,616558620,616739542,616920477,617101425,617282386,617463361, + 617644349,617825351,618006365,618187393,618368434,618549488,618730556,618911637,619092731,619273838, + 619454959,619636093,619817240,619998400,620179573,620360760,620541960,620723173,620904400,621085639, + 621266892,621448158,621629438,621810730,621992036,622173355,622354687,622536032,622717391,622898763, + 623080148,623261546,623442957,623624382,623805820,623987271,624168735,624350212,624531703,624713207, + 624894724,625076254,625257797,625439354,625620923,625802506,625984102,626165711,626347334,626528969, + 626710618,626892280,627073955,627255643,627437344,627619058,627800786,627982527,628164281,628346048, + 628527828,628709621,628891428,629073248,629255080,629436926,629618785,629800658,629982543,630164441, + 630346353,630528278,630710215,630892166,631074130,631256108,631438098,631620101,631802118,631984147, + 632166190,632348246,632530315,632712397,632894492,633076600,633258722,633440856,633623004,633805164, + 633987338,634169525,634351725,634533938,634716164,634898403,635080655,635262921,635445199,635627490, + 635809795,635992113,636174443,636356787,636539144,636721514,636903896,637086292,637268701,637451123, + 637633559,637816007,637998468,638180942,638363430,638545930,638728443,638910970,639093509,639276062, + 639458627,639641206,639823797,640006402,640189020,640371650,640554294,640736951,640919621,641102303, + 641284999,641467708,641650430,641833165,642015912,642198673,642381447,642564234,642747034,642929846, + 643112672,643295511,643478363,643661228,643844105,644026996,644209900,644392817,644575746,644758689, + 644941645,645124613,645307595,645490590,645673597,645856618,646039651,646222698,646405757,646588830, + 646771915,646955013,647138125,647321249,647504386,647687536,647870699,648053875,648237064,648420266, + 648603481,648786709,648969949,649153203,649336470,649519749,649703042,649886347,650069665,650252997, + 650436341,650619698,650803068,650986451,651169847,651353255,651536677,651720112,651903559,652087020, + 652270493,652453979,652637478,652820990,653004515,653188053,653371604,653555167,653738744,653922333, + 654105935,654289550,654473178,654656819,654840473,655024140,655207819,655391512,655575217,655758935, + 655942666,656126410,656310167,656493936,656677719,656861514,657045322,657229143,657412977,657596824, + 657780683,657964556,658148441,658332339,658516250,658700174,658884111,659068060,659252023,659435998, + 659619986,659803987,659988000,660172027,660356066,660540118,660724183,660908261,661092351,661276455, + 661460571,661644700,661828842,662012997,662197164,662381344,662565538,662749743,662933962,663118194, + 663302438,663486695,663670965,663855247,664039543,664223851,664408172,664592506,664776853,664961212, + 665145584,665329969,665514367,665698777,665883200,666067636,666252085,666436547,666621021,666805508, + 666990008,667174521,667359046,667543584,667728135,667912699,668097275,668281864,668466466,668651081, + 668835708,669020348,669205001,669389667,669574345,669759036,669943740,670128456,670313185,670497927, + 670682682,670867450,671052230,671237023,671421828,671606647,671791478,671976321,672161178,672346047, + 672530929,672715823,672900731,673085651,673270583,673455529,673640487,673825458,674010441,674195437, + 674380446,674565468,674750502,674935549,675120609,675305681,675490766,675675863,675860974,676046097, + 676231232,676416381,676601542,676786716,676971902,677157101,677342313,677527537,677712774,677898024, + 678083286,678268561,678453849,678639149,678824462,679009787,679195126,679380477,679565840,679751216, + 679936605,680122006,680307421,680492847,680678287,680863739,681049203,681234680,681420170,681605673, + 681791188,681976716,682162256,682347809,682533374,682718953,682904543,683090147,683275763,683461391, + 683647033,683832687,684018353,684204032,684389724,684575428,684761145,684946874,685132616,685318371, + 685504138,685689918,685875710,686061515,686247332,686433163,686619005,686804861,686990728,687176609, + 687362502,687548407,687734325,687920256,688106199,688292155,688478123,688664104,688850098,689036104, + 689222122,689408154,689594197,689780254,689966322,690152404,690338498,690524604,690710723,690896854, + 691082998,691269155,691455324,691641506,691827700,692013907,692200126,692386358,692572602,692758859, + 692945128,693131410,693317704,693504011,693690330,693876662,694063007,694249364,694435733,694622115, + 694808509,694994916,695181336,695367768,695554212,695740669,695927138,696113620,696300115,696486621, + 696673141,696859673,697046217,697232774,697419343,697605925,697792519,697979126,698165745,698352377, + 698539021,698725677,698912347,699099028,699285722,699472429,699659147,699845879,700032623,700219379, + 700406148,700592929,700779723,700966529,701153347,701340178,701527022,701713878,701900746,702087627, + 702274520,702461425,702648343,702835274,703022217,703209172,703396140,703583120,703770113,703957118, + 704144135,704331165,704518208,704705262,704892329,705079409,705266501,705453605,705640722,705827851, + 706014993,706202147,706389313,706576492,706763683,706950887,707138103,707325331,707512572,707699825, + 707887090,708074368,708261659,708448961,708636276,708823604,709010944,709198296,709385660,709573037, + 709760427,709947828,710135242,710322669,710510107,710697559,710885022,711072498,711259986,711447487, + 711635000,711822525,712010063,712197613,712385175,712572750,712760337,712947936,713135548,713323172, + 713510808,713698457,713886118,714073791,714261477,714449175,714636885,714824608,715012343,715200090, + 715387850,715575622,715763406,715951203,716139012,716326833,716514667,716702513,716890371,717078242, + 717266124,717454019,717641927,717829847,718017779,718205723,718393680,718581648,718769630,718957623, + 719145629,719333647,719521677,719709720,719897775,720085842,720273922,720462013,720650117,720838234, + 721026362,721214503,721402656,721590822,721778999,721967189,722155392,722343606,722531833,722720072, + 722908323,723096587,723284862,723473150,723661451,723849763,724038088,724226425,724414774,724603136, + 724791509,724979895,725168294,725356704,725545127,725733562,725922009,726110468,726298940,726487424, + 726675920,726864428,727052949,727241481,727430026,727618583,727807153,727995734,728184328,728372934, + 728561553,728750183,728938826,729127480,729316148,729504827,729693518,729882222,730070938,730259666, + 730448406,730637159,730825923,731014700,731203489,731392290,731581104,731769929,731958767,732147617, + 732336479,732525353,732714240,732903139,733092049,733280972,733469908,733658855,733847814,734036786, + 734225770,734414766,734603774,734792794,734981827,735170871,735359928,735548997,735738078,735927171, + 736116277,736305394,736494524,736683666,736872820,737061986,737251164,737440354,737629557,737818771, + 738007998,738197237,738386488,738575751,738765026,738954314,739143613,739332925,739522249,739711585, + 739900933,740090293,740279665,740469049,740658446,740847854,741037275,741226708,741416152,741605609, + 741795078,741984560,742174053,742363558,742553076,742742605,742932147,743121701,743311266,743500844, + 743690434,743880036,744069651,744259277,744448915,744638566,744828228,745017903,745207589,745397288, + 745586999,745776721,745966456,746156203,746345962,746535733,746725517,746915312,747105119,747294938, + 747484770,747674613,747864469,748054336,748244216,748434107,748624011,748813927,749003855,749193794, + 749383746,749573710,749763686,749953674,750143674,750333686,750523710,750713746,750903794,751093854, + 751283926,751474011,751664107,751854215,752044335,752234467,752424612,752614768,752804936,752995117, + 753185309,753375513,753565729,753755958,753946198,754136450,754326715,754516991,754707279,754897580, + 755087892,755278216,755468553,755658901,755849261,756039633,756230018,756420414,756610822,756801242, + 756991675,757182119,757372575,757563043,757753523,757944015,758134519,758325035,758515563,758706103, + 758896655,759087219,759277794,759468382,759658982,759849593,760040217,760230853,760421500,760612160, + 760802831,760993514,761184210,761374917,761565636,761756367,761947110,762137866,762328632,762519411, + 762710202,762901005,763091820,763282646,763473485,763664335,763855198,764046072,764236958,764427856, + 764618767,764809689,765000622,765191568,765382526,765573496,765764477,765955471,766146476,766337493, + 766528523,766719564,766910617,767101682,767292758,767483847,767674948,767866060,768057185,768248321, + 768439469,768630629,768821801,769012985,769204180,769395388,769586607,769777839,769969082,770160337, + 770351604,770542883,770734174,770925476,771116791,771308117,771499455,771690805,771882167,772073541, + 772264926,772456324,772647733,772839155,773030588,773222032,773413489,773604958,773796438,773987931, + 774179435,774370951,774562479,774754018,774945570,775137133,775328708,775520295,775711894,775903505, + 776095127,776286762,776478408,776670066,776861736,777053417,777245111,777436816,777628533,777820262, + 778012003,778203755,778395520,778587296,778779084,778970884,779162695,779354519,779546354,779738201, + 779930060,780121930,780313813,780505707,780697613,780889531,781081460,781273402,781465355,781657320, + 781849297,782041285,782233285,782425297,782617321,782809357,783001404,783193464,783385535,783577617, + 783769712,783961818,784153936,784346066,784538208,784730361,784922526,785114703,785306892,785499092, + 785691304,785883528,786075764,786268012,786460271,786652542,786844824,787037119,787229425,787421743, + 787614073,787806414,787998767,788191132,788383509,788575897,788768297,788960709,789153133,789345568, + 789538015,789730474,789922944,790115426,790307920,790500426,790692943,790885472,791078013,791270566, + 791463130,791655706,791848294,792040893,792233504,792426127,792618762,792811408,793004066,793196735, + 793389417,793582110,793774814,793967531,794160259,794352999,794545750,794738513,794931288,795124075, + 795316873,795509683,795702505,795895338,796088183,796281039,796473908,796666788,796859680,797052583, + 797245498,797438425,797631363,797824313,798017275,798210248,798403233,798596230,798789238,798982258, + 799175290,799368333,799561388,799754455,799947533,800140623,800333725,800526838,800719963,800913099, + 801106248,801299407,801492579,801685762,801878957,802072163,802265381,802458611,802651852,802845105, + 803038370,803231646,803424934,803618233,803811544,804004867,804198201,804391547,804584905,804778274, + 804971654,805165047,805358451,805551866,805745294,805938733,806132183,806325645,806519119,806712604, + 806906101,807099609,807293129,807486661,807680204,807873759,808067326,808260904,808454493,808648094, + 808841707,809035332,809228968,809422615,809616274,809809945,810003627,810197321,810391027,810584744, + 810778472,810972213,811165964,811359728,811553503,811747289,811941087,812134897,812328718,812522551, + 812716395,812910251,813104118,813297997,813491888,813685790,813879703,814073628,814267565,814461513, + 814655473,814849445,815043427,815237422,815431428,815625445,815819475,816013515,816207567,816401631, + 816595706,816789793,816983891,817178001,817372122,817566255,817760400,817954555,818148723,818342902, + 818537092,818731294,818925508,819119733,819313969,819508217,819702477,819896748,820091031,820285325, + 820479630,820673947,820868276,821062616,821256968,821451331,821645705,821840091,822034489,822228898, + 822423319,822617751,822812194,823006649,823201116,823395594,823590083,823784584,823979097,824173621, + 824368156,824562703,824757261,824951831,825146413,825341005,825535610,825730225,825924853,826119491, + 826314141,826508803,826703476,826898160,827092856,827287564,827482283,827677013,827871755,828066508, + 828261273,828456049,828650837,828845636,829040446,829235268,829430102,829624946,829819803,830014670, + 830209550,830404440,830599342,830794256,830989181,831184117,831379065,831574024,831768994,831963976, + 832158970,832353975,832548991,832744019,832939058,833134109,833329170,833524244,833719329,833914425, + 834109533,834304652,834499782,834694924,834890077,835085242,835280418,835475605,835670804,835866015, + 836061236,836256469,836451714,836646970,836842237,837037516,837232806,837428107,837623420,837818744, + 838014080,838209427,838404785,838600155,838795536,838990928,839186332,839381747,839577174,839772612, + 839968061,840163522,840358994,840554478,840749972,840945479,841140996,841336525,841532065,841727617, + 841923180,842118754,842314340,842509937,842705546,842901165,843096797,843292439,843488093,843683758, + 843879435,844075122,844270822,844466532,844662254,844857987,845053732,845249488,845445255,845641034, + 845836823,846032625,846228437,846424261,846620096,846815943,847011801,847207670,847403550,847599442, + 847795345,847991260,848187186,848383123,848579071,848775031,848971002,849166984,849362978,849558983, + 849754999,849951027,850147065,850343116,850539177,850735250,850931334,851127429,851323536,851519654, + 851715783,851911924,852108076,852304239,852500413,852696599,852892796,853089004,853285224,853481454, + 853677697,853873950,854070215,854266491,854462778,854659076,854855386,855051707,855248039,855444383, + 855640738,855837104,856033481,856229870,856426270,856622681,856819103,857015537,857211982,857408438, + 857604905,857801384,857997874,858194375,858390888,858587411,858783946,858980492,859177050,859373619, + 859570198,859766790,859963392,860160006,860356630,860553267,860749914,860946572,861143242,861339923, + 861536615,861733319,861930034,862126760,862323497,862520245,862717005,862913775,863110557,863307351, + 863504155,863700971,863897798,864094636,864291485,864488346,864685217,864882100,865078994,865275900, + 865472816,865669744,865866683,866063633,866260595,866457567,866654551,866851546,867048552,867245569, + 867442598,867639637,867836688,868033750,868230823,868427908,868625004,868822110,869019228,869216357, + 869413498,869610649,869807812,870004986,870202171,870399367,870596574,870793793,870991023,871188264, + 871385516,871582779,871780053,871977339,872174635,872371943,872569262,872766592,872963934,873161286, + 873358650,873556024,873753410,873950807,874148216,874345635,874543065,874740507,874937960,875135424, + 875332899,875530385,875727882,875925391,876122910,876320441,876517983,876715536,876913100,877110675, + 877308262,877505859,877703468,877901088,878098719,878296361,878494014,878691678,878889353,879087040, + 879284737,879482446,879680166,879877897,880075639,880273392,880471156,880668932,880866718,881064516, + 881262324,881460144,881657975,881855817,882053670,882251534,882449409,882647296,882845193,883043102, + 883241021,883438952,883636894,883834847,884032811,884230786,884428772,884626769,884824777,885022797, + 885220827,885418869,885616921,885814985,886013060,886211145,886409242,886607350,886805469,887003599, + 887201741,887399893,887598056,887796230,887994416,888192612,888390820,888589038,888787268,888985509, + 889183760,889382023,889580297,889778582,889976878,890175185,890373503,890571832,890770172,890968523, + 891166885,891365258,891563643,891762038,891960444,892158862,892357290,892555729,892754180,892952641, + 893151114,893349597,893548092,893746597,893945114,894143642,894342180,894540730,894739291,894937862, + 895136445,895335039,895533644,895732259,895930886,896129524,896328173,896526833,896725503,896924185, + 897122878,897321582,897520297,897719022,897917759,898116507,898315266,898514036,898712816,898911608, + 899110411,899309225,899508050,899706885,899905732,900104590,900303458,900502338,900701229,900900130, + 901099043,901297967,901496901,901695847,901894803,902093771,902292749,902491739,902690739,902889750, + 903088773,903287806,903486850,903685906,903884972,904084049,904283137,904482236,904681346,904880467, + 905079599,905278742,905477896,905677061,905876237,906075423,906274621,906473829,906673049,906872279, + 907071521,907270773,907470037,907669311,907868596,908067892,908267199,908466517,908665846,908865186, + 909064537,909263899,909463271,909662655,909862049,910061455,910260871,910460298,910659737,910859186, + 911058646,911258117,911457599,911657091,911856595,912056110,912255635,912455172,912654719,912854277, + 913053846,913253426,913453017,913652619,913852232,914051856,914251490,914451136,914650792,914850459, + 915050138,915249827,915449527,915649237,915848959,916048692,916248435,916448190,916647955,916847731, + 917047518,917247316,917447125,917646945,917846775,918046617,918246469,918446332,918646206,918846091, + 919045987,919245894,919445811,919645740,919845679,920045629,920245590,920445562,920645545,920845538, + 921045543,921245558,921445584,921645621,921845669,922045728,922245797,922445878,922645969,922846071, + 923046184,923246308,923446443,923646588,923846745,924046912,924247090,924447279,924647479,924847689, + 925047911,925248143,925448386,925648640,925848904,926049180,926249466,926449764,926650072,926850391, + 927050720,927251061,927451412,927651774,927852147,928052531,928252926,928453331,928653747,928854174, + 929054612,929255061,929455521,929655991,929856472,930056964,930257467,930457980,930658504,930859040, + 931059586,931260142,931460710,931661288,931861877,932062477,932263088,932463709,932664342,932864985, + 933065639,933266303,933466979,933667665,933868362,934069070,934269789,934470518,934671258,934872009, + 935072771,935273543,935474326,935675120,935875925,936076741,936277567,936478404,936679252,936880111, + 937080980,937281861,937482751,937683653,937884566,938085489,938286423,938487368,938688323,938889289, + 939090266,939291254,939492253,939693262,939894282,940095313,940296354,940497407,940698470,940899543, + 941100628,941301723,941502829,941703946,941905073,942106212,942307361,942508520,942709691,942910872, + 943112064,943313266,943514480,943715704,943916938,944118184,944319440,944520707,944721985,944923273, + 945124572,945325882,945527203,945728534,945929876,946131229,946332592,946533966,946735351,946936747, + 947138153,947339570,947540998,947742436,947943885,948145345,948346815,948548297,948749789,948951291, + 949152804,949354328,949555863,949757409,949958965,950160531,950362109,950563697,950765296,950966905, + 951168526,951370156,951571798,951773450,951975113,952176787,952378471,952580166,952781872,952983588, + 953185315,953387053,953588801,953790560,953992330,954194110,954395901,954597703,954799515,955001338, + 955203172,955405016,955606871,955808737,956010613,956212500,956414398,956616306,956818225,957020155, + 957222095,957424046,957626008,957827980,958029963,958231956,958433960,958635975,958838001,959040037, + 959242083,959444141,959646209,959848287,960050377,960252477,960454587,960656708,960858840,961060983, + 961263136,961465299,961667474,961869659,962071854,962274060,962476277,962678505,962880743,963082991, + 963285251,963487521,963689801,963892092,964094394,964296707,964499030,964701363,964903707,965106062, + 965308428,965510804,965713190,965915588,966117995,966320414,966522843,966725283,966927733,967130194, + 967332665,967535147,967737640,967940143,968142657,968345181,968547716,968750262,968952818,969155385, + 969357962,969560550,969763149,969965758,970168378,970371008,970573649,970776300,970978962,971181635, + 971384318,971587011,971789716,971992431,972195156,972397892,972600639,972803396,973006163,973208942, + 973411731,973614530,973817340,974020160,974222991,974425833,974628685,974831548,975034421,975237305, + 975440200,975643105,975846020,976048946,976251883,976454830,976657788,976860756,977063735,977266724, + 977469724,977672734,977875755,978078787,978281829,978484881,978687944,978891018,979094102,979297197, + 979500302,979703418,979906544,980109681,980312828,980515986,980719154,980922333,981125523,981328723, + 981531933,981735154,981938386,982141628,982344880,982548143,982751417,982954701,983157995,983361300, + 983564616,983767942,983971279,984174626,984377983,984581352,984784730,984988119,985191519,985394929, + 985598350,985801781,986005222,986208675,986412137,986615610,986819094,987022588,987226092,987429608, + 987633133,987836669,988040216,988243773,988447340,988650918,988854506,989058105,989261715,989465335, + 989668965,989872606,990076257,990279919,990483591,990687274,990890967,991094671,991298385,991502109, + 991705844,991909590,992113346,992317112,992520889,992724677,992928475,993132283,993336102,993539931, + 993743770,993947620,994151481,994355352,994559234,994763125,994967028,995170941,995374864,995578798, + 995782742,995986696,996190661,996394637,996598623,996802619,997006626,997210643,997414671,997618709, + 997822757,998026816,998230886,998434965,998639056,998843156,999047267,999251389,999455521,999659663, + 999863816,1000067979,1000272153,1000476337,1000680531,1000884736,1001088952,1001293177,1001497413,1001701660, + 1001905917,1002110184,1002314462,1002518750,1002723049,1002927358,1003131677,1003336007,1003540347,1003744698, + 1003949059,1004153430,1004357812,1004562204,1004766607,1004971020,1005175443,1005379877,1005584321,1005788776, + 1005993241,1006197716,1006402202,1006606698,1006811205,1007015722,1007220249,1007424787,1007629335,1007833893, + 1008038462,1008243041,1008447631,1008652231,1008856841,1009061462,1009266093,1009470734,1009675386,1009880048, + 1010084721,1010289404,1010494097,1010698801,1010903515,1011108239,1011312974,1011517719,1011722475,1011927241, + 1012132017,1012336803,1012541600,1012746407,1012951225,1013156053,1013360891,1013565740,1013770599,1013975469, + 1014180348,1014385238,1014590139,1014795050,1014999971,1015204902,1015409844,1015614796,1015819759,1016024732, + 1016229715,1016434708,1016639712,1016844726,1017049751,1017254786,1017459831,1017664886,1017869952,1018075028, + 1018280115,1018485212,1018690319,1018895436,1019100564,1019305702,1019510851,1019716009,1019921179,1020126358, + 1020331548,1020536748,1020741958,1020947179,1021152410,1021357651,1021562903,1021768165,1021973437,1022178719, + 1022384012,1022589315,1022794629,1022999953,1023205287,1023410631,1023615986,1023821351,1024026726,1024232111, + 1024437507,1024642913,1024848330,1025053757,1025259194,1025464641,1025670099,1025875566,1026081045,1026286533, + 1026492032,1026697541,1026903060,1027108590,1027314130,1027519680,1027725240,1027930811,1028136392,1028341984, + 1028547585,1028753197,1028958819,1029164451,1029370094,1029575747,1029781410,1029987084,1030192768,1030398462, + 1030604166,1030809880,1031015605,1031221340,1031427086,1031632841,1031838607,1032044383,1032250170,1032455966, + 1032661773,1032867590,1033073418,1033279255,1033485103,1033690961,1033896830,1034102708,1034308597,1034514496, + 1034720406,1034926325,1035132255,1035338195,1035544146,1035750106,1035956077,1036162058,1036368050,1036574051, + 1036780063,1036986085,1037192117,1037398160,1037604212,1037810275,1038016348,1038222432,1038428526,1038634629, + 1038840743,1039046868,1039253002,1039459147,1039665302,1039871467,1040077643,1040283828,1040490024,1040696230, + 1040902446,1041108673,1041314910,1041521157,1041727414,1041933681,1042139959,1042346246,1042552544,1042758852, + 1042965171,1043171499,1043377838,1043584187,1043790546,1043996916,1044203295,1044409685,1044616085,1044822495, + 1045028916,1045235346,1045441787,1045648238,1045854699,1046061170,1046267652,1046474144,1046680645,1046887158, + 1047093680,1047300212,1047506755,1047713308,1047919871,1048126444,1048333027,1048539621,1048746224,1048952838, + 1049159462,1049366097,1049572741,1049779396,1049986060,1050192735,1050399420,1050606116,1050812821,1051019537, + 1051226262,1051432998,1051639744,1051846500,1052053267,1052260043,1052466830,1052673627,1052880434,1053087251, + 1053294079,1053500916,1053707764,1053914622,1054121489,1054328368,1054535256,1054742154,1054949063,1055155981, + 1055362910,1055569849,1055776798,1055983758,1056190727,1056397707,1056604696,1056811696,1057018706,1057225726, + 1057432756,1057639797,1057846847,1058053908,1058260979,1058468059,1058675150,1058882252,1059089363,1059296484, + 1059503616,1059710757,1059917909,1060125071,1060332243,1060539425,1060746617,1060953820,1061161032,1061368255, + 1061575488,1061782730,1061989983,1062197246,1062404520,1062611803,1062819096,1063026400,1063233713,1063441037, + 1063648371,1063855715,1064063069,1064270433,1064477807,1064685192,1064892586,1065099990,1065307405,1065514830, + 1065722265,1065929709,1066137164,1066344630,1066552105,1066759590,1066967085,1067174591,1067382106,1067589632, + 1067797168,1068004714,1068212269,1068419835,1068627411,1068834998,1069042594,1069250200,1069457816,1069665443, + 1069873079,1070080726,1070288383,1070496049,1070703726,1070911413,1071119110,1071326817,1071534534,1071742261, + 1071949998,1072157746,1072365503,1072573270,1072781048,1072988835,1073196633,1073404441,1073612258,1073820086, + 1074027924,1074235772,1074443630,1074651498,1074859376,1075067264,1075275162,1075483070,1075690988,1075898917, + 1076106855,1076314803,1076522762,1076730730,1076938709,1077146697,1077354696,1077562705,1077770723,1077978752, + 1078186791,1078394839,1078602898,1078810967,1079019046,1079227135,1079435234,1079643343,1079851462,1080059591, + 1080267730,1080475879,1080684038,1080892207,1081100386,1081308576,1081516775,1081724984,1081933203,1082141432, + 1082349672,1082557921,1082766180,1082974450,1083182729,1083391018,1083599318,1083807627,1084015947,1084224276, + 1084432615,1084640965,1084849324,1085057694,1085266073,1085474462,1085682862,1085891271,1086099691,1086308120, + 1086516560,1086725009,1086933468,1087141938,1087350417,1087558907,1087767406,1087975915,1088184435,1088392964, + 1088601503,1088810053,1089018612,1089227181,1089435761,1089644350,1089852949,1090061559,1090270178,1090478807, + 1090687446,1090896095,1091104754,1091313424,1091522103,1091730792,1091939491,1092148200,1092356919,1092565648, + 1092774387,1092983136,1093191894,1093400663,1093609442,1093818231,1094027030,1094235838,1094444657,1094653486, + 1094862324,1095071173,1095280031,1095488900,1095697778,1095906666,1096115565,1096324473,1096533391,1096742319, + 1096951257,1097160206,1097369164,1097578132,1097787109,1097996097,1098205095,1098414103,1098623121,1098832148, + 1099041186,1099250233,1099459291,1099668358,1099877435,1100086523,1100295620,1100504727,1100713844,1100922971, + 1101132108,1101341255,1101550412,1101759578,1101968755,1102177942,1102387138,1102596345,1102805561,1103014787, + 1103224023,1103433270,1103642526,1103851792,1104061067,1104270353,1104479649,1104688955,1104898270,1105107596, + 1105316931,1105526276,1105735631,1105944997,1106154372,1106363756,1106573151,1106782556,1106991971,1107201395, + 1107410830,1107620274,1107829728,1108039192,1108248667,1108458150,1108667644,1108877148,1109086662,1109296185, + 1109505719,1109715262,1109924815,1110134378,1110343951,1110553534,1110763127,1110972730,1111182342,1111391965, + 1111601597,1111811239,1112020891,1112230553,1112440225,1112649907,1112859598,1113069300,1113279011,1113488733, + 1113698464,1113908205,1114117956,1114327716,1114537487,1114747267,1114957058,1115166858,1115376668,1115586488, + 1115796318,1116006157,1116216007,1116425866,1116635736,1116845615,1117055504,1117265403,1117475311,1117685230, + 1117895158,1118105097,1118315045,1118525003,1118734971,1118944948,1119154936,1119364933,1119574941,1119784958, + 1119994985,1120205022,1120415068,1120625125,1120835191,1121045267,1121255353,1121465449,1121675555,1121885670, + 1122095796,1122305931,1122516076,1122726231,1122936396,1123146570,1123356755,1123566949,1123777153,1123987367, + 1124197590,1124407824,1124618067,1124828321,1125038584,1125248856,1125459139,1125669432,1125879734,1126090046, + 1126300368,1126510700,1126721041,1126931393,1127141754,1127352125,1127562506,1127772897,1127983297,1128193707, + 1128404127,1128614557,1128824997,1129035447,1129245906,1129456375,1129666854,1129877343,1130087841,1130298350, + 1130508868,1130719396,1130929934,1131140481,1131351039,1131561606,1131772183,1131982769,1132193366,1132403972, + 1132614588,1132825214,1133035850,1133246496,1133457151,1133667816,1133878491,1134089176,1134299870,1134510574, + 1134721288,1134932012,1135142746,1135353489,1135564242,1135775005,1135985778,1136196560,1136407352,1136618154, + 1136828966,1137039788,1137250619,1137461460,1137672311,1137883172,1138094042,1138304922,1138515812,1138726712, + 1138937622,1139148541,1139359470,1139570409,1139781357,1139992315,1140203284,1140414261,1140625249,1140836246, + 1141047253,1141258270,1141469297,1141680333,1141891379,1142102435,1142313501,1142524576,1142735661,1142946756, + 1143157861,1143368975,1143580099,1143791233,1144002377,1144213530,1144424693,1144635866,1144847048,1145058241, + 1145269443,1145480655,1145691876,1145903107,1146114348,1146325599,1146536859,1146748130,1146959410,1147170699, + 1147381999,1147593308,1147804626,1148015955,1148227293,1148438641,1148649999,1148861367,1149072744,1149284131, + 1149495527,1149706934,1149918350,1150129775,1150341211,1150552656,1150764111,1150975576,1151187050,1151398534, + 1151610028,1151821531,1152033044,1152244567,1152456100,1152667642,1152879194,1153090756,1153302327,1153513909, + 1153725499,1153937100,1154148710,1154360330,1154571960,1154783599,1154995248,1155206907,1155418575,1155630253, + 1155841941,1156053639,1156265346,1156477063,1156688789,1156900526,1157112272,1157324027,1157535793,1157747568, + 1157959352,1158171147,1158382951,1158594765,1158806588,1159018421,1159230264,1159442116,1159653979,1159865850, + 1160077732,1160289623,1160501524,1160713435,1160925355,1161137285,1161349224,1161561173,1161773132,1161985101, + 1162197079,1162409067,1162621064,1162833072,1163045089,1163257115,1163469151,1163681197,1163893253,1164105318, + 1164317393,1164529477,1164741571,1164953675,1165165789,1165377912,1165590045,1165802187,1166014339,1166226501, + 1166438672,1166650853,1166863044,1167075244,1167287454,1167499674,1167711903,1167924142,1168136390,1168348649, + 1168560916,1168773194,1168985481,1169197778,1169410084,1169622400,1169834726,1170047061,1170259406,1170471761, + 1170684125,1170896499,1171108882,1171321275,1171533678,1171746090,1171958512,1172170944,1172383385,1172595836, + 1172808296,1173020766,1173233246,1173445735,1173658234,1173870743,1174083261,1174295789,1174508326,1174720873, + 1174933430,1175145996,1175358572,1175571158,1175783753,1175996357,1176208972,1176421596,1176634229,1176846872, + 1177059525,1177272187,1177484859,1177697541,1177910232,1178122933,1178335643,1178548363,1178761093,1178973832, + 1179186581,1179399339,1179612107,1179824884,1180037672,1180250468,1180463275,1180676090,1180888916,1181101751, + 1181314596,1181527450,1181740314,1181953187,1182166070,1182378963,1182591865,1182804777,1183017698,1183230629, + 1183443570,1183656520,1183869480,1184082449,1184295428,1184508416,1184721414,1184934422,1185147439,1185360465, + 1185573502,1185786548,1185999603,1186212668,1186425743,1186638827,1186851920,1187065024,1187278136,1187491259, + 1187704391,1187917532,1188130683,1188343844,1188557014,1188770194,1188983383,1189196582,1189409790,1189623008, + 1189836236,1190049473,1190262720,1190475976,1190689242,1190902517,1191115802,1191329096,1191542400,1191755713, + 1191969036,1192182369,1192395711,1192609063,1192822424,1193035795,1193249175,1193462565,1193675964,1193889373, + 1194102791,1194316219,1194529657,1194743104,1194956561,1195170027,1195383502,1195596987,1195810482,1196023986, + 1196237500,1196451023,1196664556,1196878099,1197091650,1197305212,1197518783,1197732363,1197945953,1198159553, + 1198373162,1198586780,1198800408,1199014046,1199227693,1199441349,1199655015,1199868691,1200082376,1200296071, + 1200509775,1200723489,1200937212,1201150944,1201364687,1201578438,1201792200,1202005970,1202219750,1202433540, + 1202647339,1202861148,1203074966,1203288794,1203502631,1203716478,1203930334,1204144200,1204358075,1204571960, + 1204785854,1204999758,1205213671,1205427594,1205641526,1205855467,1206069419,1206283379,1206497349,1206711329, + 1206925318,1207139317,1207353325,1207567342,1207781369,1207995406,1208209452,1208423507,1208637572,1208851647, + 1209065731,1209279824,1209493927,1209708039,1209922161,1210136293,1210350433,1210564584,1210778743,1210992912, + 1211207091,1211421279,1211635477,1211849684,1212063900,1212278126,1212492362,1212706607,1212920861,1213135125, + 1213349398,1213563681,1213777973,1213992275,1214206586,1214420907,1214635237,1214849576,1215063925,1215278284, + 1215492652,1215707029,1215921416,1216135812,1216350218,1216564633,1216779057,1216993491,1217207935,1217422388, + 1217636850,1217851322,1218065803,1218280294,1218494794,1218709304,1218923823,1219138351,1219352889,1219567436, + 1219781993,1219996559,1220211135,1220425720,1220640314,1220854918,1221069532,1221284154,1221498787,1221713428, + 1221928079,1222142740,1222357410,1222572089,1222786778,1223001476,1223216184,1223430901,1223645627,1223860363, + 1224075109,1224289863,1224504627,1224719401,1224934184,1225148976,1225363778,1225578589,1225793410,1226008240, + 1226223080,1226437928,1226652787,1226867654,1227082531,1227297418,1227512314,1227727219,1227942134,1228157058, + 1228371992,1228586934,1228801887,1229016849,1229231820,1229446800,1229661790,1229876789,1230091798,1230306816, + 1230521844,1230736881,1230951927,1231166983,1231382048,1231597122,1231812206,1232027299,1232242402,1232457514, + 1232672636,1232887766,1233102907,1233318056,1233533215,1233748383,1233963561,1234178748,1234393945,1234609151, + 1234824366,1235039590,1235254824,1235470068,1235685321,1235900583,1236115854,1236331135,1236546425,1236761725, + 1236977034,1237192352,1237407680,1237623017,1237838364,1238053719,1238269085,1238484459,1238699843,1238915236, + 1239130639,1239346051,1239561472,1239776903,1239992343,1240207793,1240423251,1240638720,1240854197,1241069684, + 1241285180,1241500686,1241716201,1241931725,1242147259,1242362802,1242578354,1242793916,1243009487,1243225067, + 1243440657,1243656256,1243871864,1244087482,1244303109,1244518745,1244734391,1244950046,1245165711,1245381385, + 1245597068,1245812760,1246028462,1246244173,1246459894,1246675623,1246891363,1247107111,1247322869,1247538636, + 1247754413,1247970198,1248185993,1248401798,1248617612,1248833435,1249049267,1249265109,1249480960,1249696820, + 1249912690,1250128569,1250344458,1250560355,1250776262,1250992179,1251208104,1251424039,1251639983,1251855937, + 1252071900,1252287872,1252503854,1252719845,1252935845,1253151854,1253367873,1253583901,1253799938,1254015985, + 1254232041,1254448106,1254664181,1254880265,1255096358,1255312461,1255528572,1255744693,1255960824,1256176964, + 1256393113,1256609271,1256825438,1257041615,1257257802,1257473997,1257690202,1257906416,1258122639,1258338872, + 1258555114,1258771365,1258987626,1259203895,1259420174,1259636463,1259852760,1260069067,1260285384,1260501709, + 1260718044,1260934388,1261150741,1261367104,1261583476,1261799857,1262016248,1262232647,1262449056,1262665475, + 1262881902,1263098339,1263314785,1263531241,1263747705,1263964179,1264180662,1264397155,1264613657,1264830168, + 1265046688,1265263217,1265479756,1265696304,1265912861,1266129428,1266346004,1266562589,1266779183,1266995787, + 1267212400,1267429022,1267645653,1267862294,1268078944,1268295603,1268512271,1268728949,1268945636,1269162332, + 1269379038,1269595752,1269812476,1270029209,1270245952,1270462703,1270679464,1270896234,1271113014,1271329802, + 1271546600,1271763407,1271980224,1272197049,1272413884,1272630728,1272847582,1273064444,1273281316,1273498197, + 1273715087,1273931987,1274148895,1274365813,1274582740,1274799677,1275016622,1275233577,1275450541,1275667515, + 1275884497,1276101489,1276318490,1276535500,1276752520,1276969548,1277186586,1277403633,1277620690,1277837755, + 1278054830,1278271914,1278489007,1278706110,1278923221,1279140342,1279357472,1279574611,1279791760,1280008918, + 1280226085,1280443261,1280660446,1280877641,1281094844,1281312057,1281529279,1281746511,1281963751,1282181001, + 1282398260,1282615528,1282832806,1283050092,1283267388,1283484693,1283702007,1283919331,1284136663,1284354005, + 1284571356,1284788716,1285006085,1285223464,1285440852,1285658249,1285875655,1286093070,1286310494,1286527928, + 1286745371,1286962823,1287180284,1287397755,1287615234,1287832723,1288050221,1288267728,1288485245,1288702770, + 1288920305,1289137849,1289355402,1289572964,1289790535,1290008116,1290225706,1290443305,1290660913,1290878530, + 1291096157,1291313792,1291531437,1291749091,1291966754,1292184426,1292402108,1292619799,1292837498,1293055207, + 1293272925,1293490653,1293708389,1293926135,1294143890,1294361654,1294579427,1294797209,1295015000,1295232801, + 1295450611,1295668430,1295886258,1296104095,1296321941,1296539797,1296757661,1296975535,1297193418,1297411310, + 1297629211,1297847122,1298065041,1298282970,1298500908,1298718855,1298936811,1299154776,1299372751,1299590734, + 1299808727,1300026729,1300244740,1300462760,1300680789,1300898828,1301116875,1301334932,1301552998,1301771072, + 1301989157,1302207250,1302425352,1302643464,1302861584,1303079714,1303297853,1303516001,1303734158,1303952324, + 1304170499,1304388684,1304606878,1304825080,1305043292,1305261513,1305479743,1305697982,1305916231,1306134488, + 1306352755,1306571030,1306789315,1307007609,1307225912,1307444224,1307662546,1307880876,1308099216,1308317564, + 1308535922,1308754289,1308972665,1309191050,1309409444,1309627847,1309846259,1310064681,1310283112,1310501551, + 1310720000,1310938458,1311156925,1311375401,1311593886,1311812380,1312030884,1312249396,1312467918,1312686449, + 1312904988,1313123537,1313342095,1313560662,1313779238,1313997824,1314216418,1314435021,1314653634,1314872255, + 1315090886,1315309526,1315528175,1315746833,1315965500,1316184176,1316402861,1316621555,1316840259,1317058971, + 1317277693,1317496423,1317715163,1317933912,1318152669,1318371436,1318590212,1318808997,1319027792,1319246595, + 1319465407,1319684228,1319903059,1320121898,1320340747,1320559605,1320778471,1320997347,1321216232,1321435126, + 1321654029,1321872941,1322091862,1322310792,1322529731,1322748679,1322967637,1323186603,1323405579,1323624563, + 1323843557,1324062559,1324281571,1324500592,1324719622,1324938661,1325157708,1325376765,1325595831,1325814906, + 1326033991,1326253084,1326472186,1326691297,1326910418,1327129547,1327348685,1327567833,1327786989,1328006155, + 1328225329,1328444513,1328663706,1328882907,1329102118,1329321338,1329540567,1329759804,1329979051,1330198307, + 1330417572,1330636846,1330856129,1331075421,1331294722,1331514033,1331733352,1331952680,1332172017,1332391363, + 1332610719,1332830083,1333049456,1333268839,1333488230,1333707630,1333927040,1334146458,1334365886,1334585322, + 1334804768,1335024222,1335243686,1335463158,1335682640,1335902131,1336121630,1336341139,1336560657,1336780183, + 1336999719,1337219264,1337438817,1337658380,1337877952,1338097532,1338317122,1338536721,1338756329,1338975945, + 1339195571,1339415206,1339634850,1339854503,1340074164,1340293835,1340513515,1340733204,1340952901,1341172608, + 1341392324,1341612049,1341831783,1342051525,1342271277,1342491038,1342710808,1342930586,1343150374,1343370171, + 1343589977,1343809791,1344029615,1344249448,1344469289,1344689140,1344909000,1345128868,1345348746,1345568633, + 1345788528,1346008433,1346228346,1346448269,1346668200,1346888141,1347108090,1347328049,1347548016,1347767993, + 1347987978,1348207972,1348427976,1348647988,1348868009,1349088040,1349308079,1349528127,1349748184,1349968250, + 1350188326,1350408410,1350628503,1350848605,1351068716,1351288836,1351508965,1351729102,1351949249,1352169405, + 1352389570,1352609744,1352829926,1353050118,1353270318,1353490528,1353710747,1353930974,1354151210,1354371456, + 1354591710,1354811973,1355032246,1355252527,1355472817,1355693116,1355913424, +}; + +static real aa_cs[8] = +{ + 14386344,14793176,15932125,16497281,16702017,16763133,16775525,16777101 +}; + +static real aa_ca[8] = +{ + -8631806,-7914349,-5257601,-3051997,-1586692,-687288,-238212,-62075 +}; + +static real win[4][36] = +{ + { + 541609,1798624,3379171,5462936,8388608,12881122,20824265,39123649,129925287,-141788570,-50986933,-32687548, + -24744405,-20251891,-17326219,-15242454,-13661907,-12404893,-11366990,-10483150,-9710514,-9019459,-8388608,-7801881, + -7246655,-6712557,-6190623,-5672661,-5150726,-4616628,-4061402,-3474675,-2843824,-2152769,-1380133,-496293 + }, + { + 541609,1798624,3379171,5462936,8388608,12881122,20824265,39123649,129925287,-141788570,-50986933,-32687548, + -24744405,-20251891,-17326219,-15242454,-13661907,-12404893,-11377819,-10573609,-9946281,-9457165,-9079764,-8795700, + -8518771,-7816938,-6661470,-5111526,-3237882,-1121518, + }, + { + 1798624,8388608,39123649,-50986933,-20251891,-13661907,-10483150,-8388608,-6712557,-5150726,-3474675,-1380133, + }, + { + 0,0,0,0,0,0,5058839,24594154,117073194,-152572757,-59375541,-38425694, + -27896396,-21920489,-18167045,-15612533,-13779795,-12416710,-11366990,-10483150,-9710514,-9019459,-8388608,-7801881, + -7246655,-6712557,-6190623,-5672661,-5150726,-4616628,-4061402,-3474675,-2843824,-2152769,-1380133,-496293 + } +}; + +const real COS9[9] = +{ + 16777216,16522332,15765426,14529495,12852093,10784187,8388608,5738146,2913333 +}; + +static const real COS6_1 = 14529495; + +static const real COS6_2 = 8388608; + +const real tfcos36[9] = +{ + 8420651,8684526,9255805,10240599,11863283,14625092,19849138,32411092,96248483 +}; + +static const real tfcos12[3] = +{ + 8684526,11863283,32411092 +}; + +#ifdef NEW_DCT9 +static const real cos9[3] = +{ + 15765426,-2913333,-12852093 +}; + +static const real cos18[3] = +{ + 16522332,-5738146,-10784187 +}; +#endif + +static const real tan1_1[16] = +{ + 0,6925,11994,16384,20774,25843,32768,44762,77530,2147483647,-44762,-11994,0,6925,11994,16384 +}; + +static const real tan2_1[16] = +{ + 32768,25843,20774,16384,11994,6925,0,-11994,-44762,2147483647,77530,44762,32768,25843,20774,16384 +}; + +static const real tan1_2[16] = +{ + 0,9793,16962,23170,29379,36548,46341,63303,109644,2147483647,-63303,-16962,0,9793,16962,23170 +}; + +static real tan2_2[16] = +{ + 46341,36548,29379,23170,16962,9793,0,-16962,-63303,2147483647,109644,63303,46341,36548,29379,23170 +}; + +static const real pow1_1[2][16] = +{ + {32768,27554,32768,23170,32768,19484,32768,16384,32768,13777,32768,11585,32768,9742,32768,8192}, + {32768,23170,32768,16384,32768,11585,32768,8192,32768,5793,32768,4096,32768,2896,32768,2048} +}; + +static const real pow2_1[2][16] = +{ + {32768,32768,27554,32768,23170,32768,19484,32768,16384,32768,13777,32768,11585,32768,9742,32768}, + {32768,32768,23170,32768,16384,32768,11585,32768,8192,32768,5793,32768,4096,32768,2896,32768} +}; + +static const real pow1_2[2][16] = +{ + {46341,38968,46341,32768,46341,27554,46341,23170,46341,19484,46341,16384,46341,13777,46341,11585}, + {46341,32768,46341,23170,46341,16384,46341,11585,46341,8192,46341,5793,46341,4096,46341,2896} +}; + +static const real pow2_2[2][16] = +{ + {46341,46341,38968,46341,32768,46341,27554,46341,23170,46341,19484,46341,16384,46341,13777,46341}, + {46341,46341,32768,46341,23170,46341,16384,46341,11585,46341,8192,46341,5793,46341,4096,46341} +}; + +static const real gainpow2[256+118+4] = +{ + 1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417, + 1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301, + 1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417, + 1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301, + 1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417, + 1073741824,1805811301,1518500250,1276901417,1073741824,1805811301,1518500250,1276901417,1073741824,1805811301, + 1518500250,1276901417,1073741824,902905651,759250125,638450708,536870912,451452825,379625062,319225354, + 268435456,225726413,189812531,159612677,134217728,112863206,94906266,79806339,67108864,56431603, + 47453133,39903169,33554432,28215802,23726566,19951585,16777216,14107901,11863283,9975792, + 8388608,7053950,5931642,4987896,4194304,3526975,2965821,2493948,2097152,1763488, + 1482910,1246974,1048576,881744,741455,623487,524288,440872,370728,311744, + 262144,220436,185364,155872,131072,110218,92682,77936,65536,55109, + 46341,38968,32768,27554,23170,19484,16384,13777,11585,9742, + 8192,6889,5793,4871,4096,3444,2896,2435,2048,1722, + 1448,1218,1024,861,724,609,512,431,362,304, + 256,215,181,152,128,108,91,76,64,54, + 45,38,32,27,23,19,16,13,11,10, + 8,7,6,5,4,3,3,2,2,2, + 1,1,1,1,1,1,1, +}; + +#else +static real ispow[8207]; +static real aa_ca[8],aa_cs[8]; +static real win[4][36]; +static real win1[4][36]; +real COS9[9]; /* dct36_3dnow wants to use that */ +static real COS6_1,COS6_2; +real tfcos36[9]; /* dct36_3dnow wants to use that */ +static real tfcos12[3]; +#ifdef NEW_DCT9 +static real cos9[3],cos18[3]; +static real tan1_1[16],tan2_1[16],tan1_2[16],tan2_2[16]; +static real pow1_1[2][16],pow2_1[2][16],pow1_2[2][16],pow2_2[2][16]; +#endif +#endif + +static real win1[4][36]; + +static const char gainpow2_scale[256+118+4+1] = +{ + 19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27, + 27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34, + 34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,0 +}; + +#endif diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/layer1.c b/node_modules/lame/deps/mpg123/src/libmpg123/layer1.c new file mode 100644 index 0000000..4b3b418 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/layer1.c @@ -0,0 +1,155 @@ +/* + layer1.c: the layer 1 decoder + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + may have a few bugs after last optimization ... +*/ + +#include "mpg123lib_intern.h" +#include "getbits.h" + +static void I_step_one(unsigned int balloc[], unsigned int scale_index[2][SBLIMIT],mpg123_handle *fr) +{ + unsigned int *ba=balloc; + unsigned int *sca = (unsigned int *) scale_index; + + if(fr->stereo == 2) + { + int i; + int jsbound = fr->jsbound; + for(i=0;istereo == 2) + { + int jsbound = fr->jsbound; + register real *f0 = fraction[0]; + register real *f1 = fraction[1]; + ba = balloc; + for(sample=smpb,i=0;imuls[n+1][*sca++]); + else *f0++ = DOUBLE_TO_REAL(0.0); + + if((n=*ba++)) + *f1++ = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15( ((-1)<muls[n+1][*sca++]); + else *f1++ = DOUBLE_TO_REAL(0.0); + } + for(i=jsbound;imuls[n+1][*sca++]); + *f1++ = REAL_MUL_SCALE_LAYER12(samp, fr->muls[n+1][*sca++]); + } + else *f0++ = *f1++ = DOUBLE_TO_REAL(0.0); + } + for(i=fr->down_sample_sblimit;i<32;i++) + fraction[0][i] = fraction[1][i] = 0.0; + } + else + { + register real *f0 = fraction[0]; + ba = balloc; + for(sample=smpb,i=0;imuls[n+1][*sca++]); + else *f0++ = DOUBLE_TO_REAL(0.0); + } + for(i=fr->down_sample_sblimit;i<32;i++) + fraction[0][i] = DOUBLE_TO_REAL(0.0); + } +} + +int do_layer1(mpg123_handle *fr) +{ + int clip=0; + int i,stereo = fr->stereo; + unsigned int balloc[2*SBLIMIT]; + unsigned int scale_index[2][SBLIMIT]; + real (*fraction)[SBLIMIT] = fr->layer1.fraction; /* fraction[2][SBLIMIT] */ + int single = fr->single; + + fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : 32; + + if(stereo == 1 || single == SINGLE_MIX) /* I don't see mixing handled here */ + single = SINGLE_LEFT; + + I_step_one(balloc,scale_index,fr); + + for(i=0;isynth_mono)(fraction[single], fr); + else + clip += (fr->synth_stereo)(fraction[0], fraction[1], fr); + } + + return clip; +} + + diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/layer2.c b/node_modules/lame/deps/mpg123/src/libmpg123/layer2.c new file mode 100644 index 0000000..056e8f4 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/layer2.c @@ -0,0 +1,371 @@ +/* + layer2.c: the layer 2 decoder, root of mpg123 + + copyright 1994-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + mpg123 started as mp2 decoder a long time ago... + part of this file is required for layer 1, too. +*/ + + +#include "mpg123lib_intern.h" +#ifndef NO_LAYER2 +#include "l2tables.h" +#endif +#include "getbits.h" + +#ifndef NO_LAYER12 /* Stuff needed for layer I and II. */ + +static int grp_3tab[32 * 3] = { 0, }; /* used: 27 */ +static int grp_5tab[128 * 3] = { 0, }; /* used: 125 */ +static int grp_9tab[1024 * 3] = { 0, }; /* used: 729 */ + +#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES) +#include "l12_integer_tables.h" +#else +static const double mulmul[27] = +{ + 0.0 , -2.0/3.0 , 2.0/3.0 , + 2.0/7.0 , 2.0/15.0 , 2.0/31.0, 2.0/63.0 , 2.0/127.0 , 2.0/255.0 , + 2.0/511.0 , 2.0/1023.0 , 2.0/2047.0 , 2.0/4095.0 , 2.0/8191.0 , + 2.0/16383.0 , 2.0/32767.0 , 2.0/65535.0 , + -4.0/5.0 , -2.0/5.0 , 2.0/5.0, 4.0/5.0 , + -8.0/9.0 , -4.0/9.0 , -2.0/9.0 , 2.0/9.0 , 4.0/9.0 , 8.0/9.0 +}; +#endif + +void init_layer12(void) +{ + const int base[3][9] = + { + { 1 , 0, 2 , } , + { 17, 18, 0 , 19, 20 , } , + { 21, 1, 22, 23, 0, 24, 25, 2, 26 } + }; + int i,j,k,l,len; + const int tablen[3] = { 3 , 5 , 9 }; + int *itable; + int *tables[3] = { grp_3tab , grp_5tab , grp_9tab }; + + for(i=0;i<3;i++) + { + itable = tables[i]; + len = tablen[i]; + for(j=0;jmuls[k], k); + *table++ = 0.0; + } +} + +real* init_layer12_table(mpg123_handle *fr, real *table, int m) +{ +#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES) + int i; + for(i=0;i<63;i++) + *table++ = layer12_table[m][i]; +#else + int i,j; + for(j=3,i=0;i<63;i++,j--) + *table++ = DOUBLE_TO_REAL_SCALE_LAYER12(mulmul[m] * pow(2.0,(double) j / 3.0)); +#endif + + return table; +} + +#ifdef OPT_MMXORSSE +real* init_layer12_table_mmx(mpg123_handle *fr, real *table, int m) +{ + int i,j; + if(!fr->p.down_sample) + { + for(j=3,i=0;i<63;i++,j--) + *table++ = DOUBLE_TO_REAL(16384 * mulmul[m] * pow(2.0,(double) j / 3.0)); + } + else + { + for(j=3,i=0;i<63;i++,j--) + *table++ = DOUBLE_TO_REAL(mulmul[m] * pow(2.0,(double) j / 3.0)); + } + return table; +} +#endif + +#endif /* NO_LAYER12 */ + +/* The rest is the actual decoding of layer II data. */ + +#ifndef NO_LAYER2 + +static void II_step_one(unsigned int *bit_alloc,int *scale,mpg123_handle *fr) +{ + int stereo = fr->stereo-1; + int sblimit = fr->II_sblimit; + int jsbound = fr->jsbound; + int sblimit2 = fr->II_sblimit<alloc; + int i; + unsigned int scfsi_buf[64]; + unsigned int *scfsi,*bita; + int sc,step; + + bita = bit_alloc; + if(stereo) + { + for(i=jsbound;i;i--,alloc1+=(1<bits; + *bita++ = (char) getbits(fr, step); + *bita++ = (char) getbits(fr, step); + } + for(i=sblimit-jsbound;i;i--,alloc1+=(1<bits; + bita[0] = (char) getbits(fr, step); + bita[1] = bita[0]; + bita+=2; + } + bita = bit_alloc; + scfsi=scfsi_buf; + + for(i=sblimit2;i;i--) + if(*bita++) *scfsi++ = (char) getbits_fast(fr, 2); + } + else /* mono */ + { + for(i=sblimit;i;i--,alloc1+=(1<bits; + *bita++ = (char) getbits(fr, step); + } + bita = bit_alloc; + scfsi=scfsi_buf; + for(i=sblimit;i;i--) + if(*bita++) *scfsi++ = (char) getbits_fast(fr, 2); + } + + bita = bit_alloc; + scfsi=scfsi_buf; + for(i=sblimit2;i;i--) + if(*bita++) + switch(*scfsi++) + { + case 0: + *scale++ = getbits_fast(fr, 6); + *scale++ = getbits_fast(fr, 6); + *scale++ = getbits_fast(fr, 6); + break; + case 1 : + *scale++ = sc = getbits_fast(fr, 6); + *scale++ = sc; + *scale++ = getbits_fast(fr, 6); + break; + case 2: + *scale++ = sc = getbits_fast(fr, 6); + *scale++ = sc; + *scale++ = sc; + break; + default: /* case 3 */ + *scale++ = getbits_fast(fr, 6); + *scale++ = sc = getbits_fast(fr, 6); + *scale++ = sc; + break; + } +} + + +static void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int *scale,mpg123_handle *fr,int x1) +{ + int i,j,k,ba; + int stereo = fr->stereo; + int sblimit = fr->II_sblimit; + int jsbound = fr->jsbound; + const struct al_table *alloc2,*alloc1 = fr->alloc; + unsigned int *bita=bit_alloc; + int d1,step; + + for(i=0;ibits; + for(j=0;jbits; + if( (d1=alloc2->d) < 0) + { + real cm=fr->muls[k][scale[x1]]; + fraction[j][0][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm); + fraction[j][1][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm); + fraction[j][2][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm); + } + else + { + const int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab }; + unsigned int idx,*tab,m=scale[x1]; + idx = (unsigned int) getbits(fr, k); + tab = (unsigned int *) (table[d1] + idx + idx + idx); + fraction[j][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]); + fraction[j][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]); + fraction[j][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m]); + } + scale+=3; + } + else + fraction[j][0][i] = fraction[j][1][i] = fraction[j][2][i] = DOUBLE_TO_REAL(0.0); + } + } + + for(i=jsbound;ibits; + bita++; /* channel 1 and channel 2 bitalloc are the same */ + if( (ba=*bita++) ) + { + k=(alloc2 = alloc1+ba)->bits; + if( (d1=alloc2->d) < 0) + { + real cm; + cm=fr->muls[k][scale[x1+3]]; + fraction[0][0][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1); + fraction[0][1][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1); + fraction[0][2][i] = DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1); + fraction[1][0][i] = REAL_MUL_SCALE_LAYER12(fraction[0][0][i], cm); + fraction[1][1][i] = REAL_MUL_SCALE_LAYER12(fraction[0][1][i], cm); + fraction[1][2][i] = REAL_MUL_SCALE_LAYER12(fraction[0][2][i], cm); + cm=fr->muls[k][scale[x1]]; + fraction[0][0][i] = REAL_MUL_SCALE_LAYER12(fraction[0][0][i], cm); + fraction[0][1][i] = REAL_MUL_SCALE_LAYER12(fraction[0][1][i], cm); + fraction[0][2][i] = REAL_MUL_SCALE_LAYER12(fraction[0][2][i], cm); + } + else + { + const int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab }; + unsigned int idx,*tab,m1,m2; + m1 = scale[x1]; m2 = scale[x1+3]; + idx = (unsigned int) getbits(fr, k); + tab = (unsigned int *) (table[d1] + idx + idx + idx); + fraction[0][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m2]); + fraction[0][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m2]); + fraction[0][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m1]); fraction[1][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m2]); + } + scale+=6; + } + else + { + fraction[0][0][i] = fraction[0][1][i] = fraction[0][2][i] = + fraction[1][0][i] = fraction[1][1][i] = fraction[1][2][i] = DOUBLE_TO_REAL(0.0); + } +/* + Historic comment... + should we use individual scalefac for channel 2 or + is the current way the right one , where we just copy channel 1 to + channel 2 ?? + The current 'strange' thing is, that we throw away the scalefac + values for the second channel ...!! + -> changed .. now we use the scalefac values of channel one !! +*/ + } + + if(sblimit > (fr->down_sample_sblimit) ) + sblimit = fr->down_sample_sblimit; + + for(i=sblimit;isampling_frequency >= 3) /* Or equivalent: (fr->lsf == 1) */ + table = 4; + else + table = translate[fr->sampling_frequency][2-fr->stereo][fr->bitrate_index]; + + sblim = sblims[table]; + fr->alloc = tables[table]; + fr->II_sblimit = sblim; +} + + +int do_layer2(mpg123_handle *fr) +{ + int clip=0; + int i,j; + int stereo = fr->stereo; + /* pick_table clears unused subbands */ + /* replacement for real fraction[2][4][SBLIMIT], needs alignment. */ + real (*fraction)[4][SBLIMIT] = fr->layer2.fraction; + unsigned int bit_alloc[64]; + int scale[192]; + int single = fr->single; + + II_select_table(fr); + fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : fr->II_sblimit; + + if(fr->jsbound > fr->II_sblimit) + { + fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); + fr->jsbound=fr->II_sblimit; + } + + /* TODO: What happens with mono mixing, actually? */ + if(stereo == 1 || single == SINGLE_MIX) /* also, mix not really handled */ + single = SINGLE_LEFT; + + II_step_one(bit_alloc, scale, fr); + + for(i=0;i>2); + for(j=0;j<3;j++) + { + if(single != SINGLE_STEREO) + clip += (fr->synth_mono)(fraction[single][j], fr); + else + clip += (fr->synth_stereo)(fraction[0][j], fraction[1][j], fr); + } + } + + return clip; +} + +#endif /* NO_LAYER2 */ diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/layer3.c b/node_modules/lame/deps/mpg123/src/libmpg123/layer3.c new file mode 100644 index 0000000..e43a5de --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/layer3.c @@ -0,0 +1,2053 @@ +/* + layer3.c: the layer 3 decoder + + copyright 1995-2009 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Michael Hipp + + Dear visitor: + If you feel you don't understand fully the works of this file, your feeling might be correct. + + Optimize-TODO: put short bands into the band-field without the stride of 3 reals + Length-optimze: unify long and short band code where it is possible + + The int-vs-pointer situation has to be cleaned up. +*/ + +#include "mpg123lib_intern.h" +#include "huffman.h" +#include "getbits.h" +#include "debug.h" + +/* define CUT_SFB21 if you want to cut-off the frequency above 16kHz */ +#if 0 +#define CUT_SFB21 +#endif + +#ifdef REAL_IS_FIXED +#define NEW_DCT9 +#include "l3_integer_tables.h" +#else +/* static one-time calculated tables... or so */ +static real ispow[8207]; +static real aa_ca[8],aa_cs[8]; +static real win[4][36]; +static real win1[4][36]; +real COS9[9]; /* dct36_3dnow wants to use that */ +static real COS6_1,COS6_2; +real tfcos36[9]; /* dct36_3dnow wants to use that */ +static real tfcos12[3]; +#define NEW_DCT9 +#ifdef NEW_DCT9 +static real cos9[3],cos18[3]; +static real tan1_1[16],tan2_1[16],tan1_2[16],tan2_2[16]; +static real pow1_1[2][16],pow2_1[2][16],pow1_2[2][16],pow2_2[2][16]; +#endif +#endif + +/* Decoder state data, living on the stack of do_layer3. */ + +struct gr_info_s +{ + int scfsi; + unsigned part2_3_length; + unsigned big_values; + unsigned scalefac_compress; + unsigned block_type; + unsigned mixed_block_flag; + unsigned table_select[3]; + /* Making those two signed int as workaround for open64/pathscale/sun compilers, and also for consistency, since they're worked on together with other signed variables. */ + int maxband[3]; + int maxbandl; + unsigned maxb; + unsigned region1start; + unsigned region2start; + unsigned preflag; + unsigned scalefac_scale; + unsigned count1table_select; + real *full_gain[3]; + real *pow2gain; +}; + +struct III_sideinfo +{ + unsigned main_data_begin; + unsigned private_bits; + /* Hm, funny... struct inside struct... */ + struct { struct gr_info_s gr[2]; } ch[2]; +}; + +struct bandInfoStruct +{ + unsigned short longIdx[23]; + unsigned char longDiff[22]; + unsigned short shortIdx[14]; + unsigned char shortDiff[13]; +}; + +/* Techy details about our friendly MPEG data. Fairly constant over the years;-) */ +static const struct bandInfoStruct bandInfo[9] = +{ + { /* MPEG 1.0 */ + {0,4,8,12,16,20,24,30,36,44,52,62,74, 90,110,134,162,196,238,288,342,418,576}, + {4,4,4,4,4,4,6,6,8, 8,10,12,16,20,24,28,34,42,50,54, 76,158}, + {0,4*3,8*3,12*3,16*3,22*3,30*3,40*3,52*3,66*3, 84*3,106*3,136*3,192*3}, + {4,4,4,4,6,8,10,12,14,18,22,30,56} + }, + { + {0,4,8,12,16,20,24,30,36,42,50,60,72, 88,106,128,156,190,230,276,330,384,576}, + {4,4,4,4,4,4,6,6,6, 8,10,12,16,18,22,28,34,40,46,54, 54,192}, + {0,4*3,8*3,12*3,16*3,22*3,28*3,38*3,50*3,64*3, 80*3,100*3,126*3,192*3}, + {4,4,4,4,6,6,10,12,14,16,20,26,66} + }, + { + {0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576}, + {4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102, 26}, + {0,4*3,8*3,12*3,16*3,22*3,30*3,42*3,58*3,78*3,104*3,138*3,180*3,192*3}, + {4,4,4,4,6,8,12,16,20,26,34,42,12} + }, + { /* MPEG 2.0 */ + {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 } , + {0,4*3,8*3,12*3,18*3,24*3,32*3,42*3,56*3,74*3,100*3,132*3,174*3,192*3} , + {4,4,4,6,6,8,10,14,18,26,32,42,18 } + }, + { /* Twiddling 3 values here (not just 330->332!) fixed bug 1895025. */ + {0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576}, + {6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,54,62,70,76,36 }, + {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,136*3,180*3,192*3}, + {4,4,4,6,8,10,12,14,18,24,32,44,12 } + }, + { + {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 }, + {0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,134*3,174*3,192*3}, + {4,4,4,6,8,10,12,14,18,24,30,40,18 } + }, + { /* MPEG 2.5 */ + {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54}, + {0,12,24,36,54,78,108,144,186,240,312,402,522,576}, + {4,4,4,6,8,10,12,14,18,24,30,40,18} + }, + { + {0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576}, + {6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54}, + {0,12,24,36,54,78,108,144,186,240,312,402,522,576}, + {4,4,4,6,8,10,12,14,18,24,30,40,18} + }, + { + {0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576}, + {12,12,12,12,12,12,16,20,24,28,32,40,48,56,64,76,90,2,2,2,2,2}, + {0, 24, 48, 72,108,156,216,288,372,480,486,492,498,576}, + {8,8,8,12,16,20,24,28,36,2,2,2,26} + } +}; + +static int mapbuf0[9][152]; +static int mapbuf1[9][156]; +static int mapbuf2[9][44]; +static int *map[9][3]; +static int *mapend[9][3]; + +static unsigned int n_slen2[512]; /* MPEG 2.0 slen for 'normal' mode */ +static unsigned int i_slen2[256]; /* MPEG 2.0 slen for intensity stereo */ + +/* Some helpers used in init_layer3 */ + +#ifdef OPT_MMXORSSE +real init_layer3_gainpow2_mmx(mpg123_handle *fr, int i) +{ + if(!fr->p.down_sample) return DOUBLE_TO_REAL(16384.0 * pow((double)2.0,-0.25 * (double) (i+210) )); + else return DOUBLE_TO_REAL(pow((double)2.0,-0.25 * (double) (i+210))); +} +#endif + +real init_layer3_gainpow2(mpg123_handle *fr, int i) +{ +#if defined(REAL_IS_FIXED) && defined(PRECALC_TABLES) + return gainpow2[i+256]; +#else + return DOUBLE_TO_REAL_SCALE_LAYER3(pow((double)2.0,-0.25 * (double) (i+210)),i+256); +#endif +} + + +/* init tables for layer-3 ... specific with the downsampling... */ +void init_layer3(void) +{ + int i,j,k,l; + +#if !defined(REAL_IS_FIXED) || !defined(PRECALC_TABLES) + for(i=0;i<8207;i++) + ispow[i] = DOUBLE_TO_REAL_POW43(pow((double)i,(double)4.0/3.0)); + + for(i=0;i<8;i++) + { + const double Ci[8] = {-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037}; + double sq = sqrt(1.0+Ci[i]*Ci[i]); + aa_cs[i] = DOUBLE_TO_REAL(1.0/sq); + aa_ca[i] = DOUBLE_TO_REAL(Ci[i]/sq); + } + + for(i=0;i<18;i++) + { + win[0][i] = win[1][i] = + DOUBLE_TO_REAL( 0.5*sin(M_PI/72.0 * (double)(2*(i+0) +1)) / cos(M_PI * (double)(2*(i+0) +19) / 72.0) ); + win[0][i+18] = win[3][i+18] = + DOUBLE_TO_REAL( 0.5*sin(M_PI/72.0 * (double)(2*(i+18)+1)) / cos(M_PI * (double)(2*(i+18)+19) / 72.0) ); + } + for(i=0;i<6;i++) + { + win[1][i+18] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (2*(i+18)+19) / 72.0 )); + win[3][i+12] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (2*(i+12)+19) / 72.0 )); + win[1][i+24] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+13) ) / cos ( M_PI * (double) (2*(i+24)+19) / 72.0 )); + win[1][i+30] = win[3][i] = DOUBLE_TO_REAL(0.0); + win[3][i+6 ] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+1 ) ) / cos ( M_PI * (double) (2*(i+6 )+19) / 72.0 )); + } + + for(i=0;i<9;i++) + COS9[i] = DOUBLE_TO_REAL(cos( M_PI / 18.0 * (double) i)); + + for(i=0;i<9;i++) + tfcos36[i] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (i*2+1) / 36.0 )); + + for(i=0;i<3;i++) + tfcos12[i] = DOUBLE_TO_REAL(0.5 / cos ( M_PI * (double) (i*2+1) / 12.0 )); + + COS6_1 = DOUBLE_TO_REAL(cos( M_PI / 6.0 * (double) 1)); + COS6_2 = DOUBLE_TO_REAL(cos( M_PI / 6.0 * (double) 2)); + +#ifdef NEW_DCT9 + cos9[0] = DOUBLE_TO_REAL(cos(1.0*M_PI/9.0)); + cos9[1] = DOUBLE_TO_REAL(cos(5.0*M_PI/9.0)); + cos9[2] = DOUBLE_TO_REAL(cos(7.0*M_PI/9.0)); + cos18[0] = DOUBLE_TO_REAL(cos(1.0*M_PI/18.0)); + cos18[1] = DOUBLE_TO_REAL(cos(11.0*M_PI/18.0)); + cos18[2] = DOUBLE_TO_REAL(cos(13.0*M_PI/18.0)); +#endif + + for(i=0;i<12;i++) + { + win[2][i] = DOUBLE_TO_REAL(0.5 * sin( M_PI / 24.0 * (double) (2*i+1) ) / cos ( M_PI * (double) (2*i+7) / 24.0 )); + } + + for(i=0;i<16;i++) + { + double t = tan( (double) i * M_PI / 12.0 ); + tan1_1[i] = DOUBLE_TO_REAL_15(t / (1.0+t)); + tan2_1[i] = DOUBLE_TO_REAL_15(1.0 / (1.0 + t)); + tan1_2[i] = DOUBLE_TO_REAL_15(M_SQRT2 * t / (1.0+t)); + tan2_2[i] = DOUBLE_TO_REAL_15(M_SQRT2 / (1.0 + t)); + + for(j=0;j<2;j++) + { + double base = pow(2.0,-0.25*(j+1.0)); + double p1=1.0,p2=1.0; + if(i > 0) + { + if( i & 1 ) p1 = pow(base,(i+1.0)*0.5); + else p2 = pow(base,i*0.5); + } + pow1_1[j][i] = DOUBLE_TO_REAL_15(p1); + pow2_1[j][i] = DOUBLE_TO_REAL_15(p2); + pow1_2[j][i] = DOUBLE_TO_REAL_15(M_SQRT2 * p1); + pow2_2[j][i] = DOUBLE_TO_REAL_15(M_SQRT2 * p2); + } + } +#endif + + for(j=0;j<4;j++) + { + const int len[4] = { 36,36,12,36 }; + for(i=0;ilongDiff; + for(i=0,cb = 0; cb < 8 ; cb++,i+=*bdf++) + { + *mp++ = (*bdf) >> 1; + *mp++ = i; + *mp++ = 3; + *mp++ = cb; + } + bdf = bi->shortDiff+3; + for(cb=3;cb<13;cb++) + { + int l = (*bdf++) >> 1; + for(lwin=0;lwin<3;lwin++) + { + *mp++ = l; + *mp++ = i + lwin; + *mp++ = lwin; + *mp++ = cb; + } + i += 6*l; + } + mapend[j][0] = mp; + + mp = map[j][1] = mapbuf1[j]; + bdf = bi->shortDiff+0; + for(i=0,cb=0;cb<13;cb++) + { + int l = (*bdf++) >> 1; + for(lwin=0;lwin<3;lwin++) + { + *mp++ = l; + *mp++ = i + lwin; + *mp++ = lwin; + *mp++ = cb; + } + i += 6*l; + } + mapend[j][1] = mp; + + mp = map[j][2] = mapbuf2[j]; + bdf = bi->longDiff; + for(cb = 0; cb < 22 ; cb++) + { + *mp++ = (*bdf++) >> 1; + *mp++ = cb; + } + mapend[j][2] = mp; + } + + /* Now for some serious loopings! */ + for(i=0;i<5;i++) + for(j=0;j<6;j++) + for(k=0;k<6;k++) + { + int n = k + j * 6 + i * 36; + i_slen2[n] = i|(j<<3)|(k<<6)|(3<<12); + } + for(i=0;i<4;i++) + for(j=0;j<4;j++) + for(k=0;k<4;k++) + { + int n = k + j * 4 + i * 16; + i_slen2[n+180] = i|(j<<3)|(k<<6)|(4<<12); + } + for(i=0;i<4;i++) + for(j=0;j<3;j++) + { + int n = j + i * 3; + i_slen2[n+244] = i|(j<<3) | (5<<12); + n_slen2[n+500] = i|(j<<3) | (2<<12) | (1<<15); + } + for(i=0;i<5;i++) + for(j=0;j<5;j++) + for(k=0;k<4;k++) + for(l=0;l<4;l++) + { + int n = l + k * 4 + j * 16 + i * 80; + n_slen2[n] = i|(j<<3)|(k<<6)|(l<<9)|(0<<12); + } + for(i=0;i<5;i++) + for(j=0;j<5;j++) + for(k=0;k<4;k++) + { + int n = k + j * 4 + i * 20; + n_slen2[n+400] = i|(j<<3)|(k<<6)|(1<<12); + } +} + + +void init_layer3_stuff(mpg123_handle *fr, real (*gainpow2)(mpg123_handle *fr, int i)) +{ + int i,j; + + for(i=-256;i<118+4;i++) fr->gainpow2[i+256] = gainpow2(fr,i); + + for(j=0;j<9;j++) + { + for(i=0;i<23;i++) + { + fr->longLimit[j][i] = (bandInfo[j].longIdx[i] - 1 + 8) / 18 + 1; + if(fr->longLimit[j][i] > (fr->down_sample_sblimit) ) + fr->longLimit[j][i] = fr->down_sample_sblimit; + } + for(i=0;i<14;i++) + { + fr->shortLimit[j][i] = (bandInfo[j].shortIdx[i] - 1) / 18 + 1; + if(fr->shortLimit[j][i] > (fr->down_sample_sblimit) ) + fr->shortLimit[j][i] = fr->down_sample_sblimit; + } + } +} + +/* + Observe! + Now come the actualy decoding routines. +*/ + +/* read additional side information (for MPEG 1 and MPEG 2) */ +static int III_get_side_info(mpg123_handle *fr, struct III_sideinfo *si,int stereo, int ms_stereo,long sfreq,int single) +{ + int ch, gr; + int powdiff = (single == SINGLE_MIX) ? 4 : 0; + + const int tabs[2][5] = { { 2,9,5,3,4 } , { 1,8,1,2,9 } }; + const int *tab = tabs[fr->lsf]; + + si->main_data_begin = getbits(fr, tab[1]); + + if(si->main_data_begin > fr->bitreservoir) + { + if(!fr->to_ignore && VERBOSE2) fprintf(stderr, "Note: missing %d bytes in bit reservoir for frame %li\n", (int)(si->main_data_begin - fr->bitreservoir), (long)fr->num); + + /* overwrite main_data_begin for the really available bit reservoir */ + backbits(fr, tab[1]); + if(fr->lsf == 0) + { + fr->wordpointer[0] = (unsigned char) (fr->bitreservoir >> 1); + fr->wordpointer[1] = (unsigned char) ((fr->bitreservoir & 1) << 7); + } + else fr->wordpointer[0] = (unsigned char) fr->bitreservoir; + + /* zero "side-info" data for a silence-frame + without touching audio data used as bit reservoir for following frame */ + memset(fr->wordpointer+2, 0, fr->ssize-2); + + /* reread the new bit reservoir offset */ + si->main_data_begin = getbits(fr, tab[1]); + } + + /* Keep track of the available data bytes for the bit reservoir. + Think: Substract the 2 crc bytes in parser already? */ + fr->bitreservoir = fr->bitreservoir + fr->framesize - fr->ssize - (fr->error_protection ? 2 : 0); + /* Limit the reservoir to the max for MPEG 1.0 or 2.x . */ + if(fr->bitreservoir > (unsigned int) (fr->lsf == 0 ? 511 : 255)) + fr->bitreservoir = (fr->lsf == 0 ? 511 : 255); + + /* Now back into less commented territory. It's code. It works. */ + + if (stereo == 1) + si->private_bits = getbits_fast(fr, tab[2]); + else + si->private_bits = getbits_fast(fr, tab[3]); + + if(!fr->lsf) for(ch=0; chch[ch].gr[0].scfsi = -1; + si->ch[ch].gr[1].scfsi = getbits_fast(fr, 4); + } + + for (gr=0; grch[ch].gr[gr]); + + gr_info->part2_3_length = getbits(fr, 12); + gr_info->big_values = getbits(fr, 9); + if(gr_info->big_values > 288) + { + if(NOQUIET) error("big_values too large!"); + gr_info->big_values = 288; + } + gr_info->pow2gain = fr->gainpow2+256 - getbits_fast(fr, 8) + powdiff; + if(ms_stereo) gr_info->pow2gain += 2; + + gr_info->scalefac_compress = getbits(fr, tab[4]); + + if(get1bit(fr)) + { /* window switch flag */ + int i; + gr_info->block_type = getbits_fast(fr, 2); + gr_info->mixed_block_flag = get1bit(fr); + gr_info->table_select[0] = getbits_fast(fr, 5); + gr_info->table_select[1] = getbits_fast(fr, 5); + /* + table_select[2] not needed, because there is no region2, + but to satisfy some verification tools we set it either. + */ + gr_info->table_select[2] = 0; + for(i=0;i<3;i++) + gr_info->full_gain[i] = gr_info->pow2gain + (getbits_fast(fr, 3)<<3); + + if(gr_info->block_type == 0) + { + if(NOQUIET) error("Blocktype == 0 and window-switching == 1 not allowed."); + return 1; + } + + /* region_count/start parameters are implicit in this case. */ + if( (!fr->lsf || (gr_info->block_type == 2)) && !fr->mpeg25) + { + gr_info->region1start = 36>>1; + gr_info->region2start = 576>>1; + } + else + { + if(fr->mpeg25) + { + int r0c,r1c; + if((gr_info->block_type == 2) && (!gr_info->mixed_block_flag) ) r0c = 5; + else r0c = 7; + + /* r0c+1+r1c+1 == 22, always. */ + r1c = 20 - r0c; + gr_info->region1start = bandInfo[sfreq].longIdx[r0c+1] >> 1 ; + gr_info->region2start = bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1; + } + else + { + gr_info->region1start = 54>>1; + gr_info->region2start = 576>>1; + } + } + } + else + { + int i,r0c,r1c; + for (i=0; i<3; i++) + gr_info->table_select[i] = getbits_fast(fr, 5); + + r0c = getbits_fast(fr, 4); /* 0 .. 15 */ + r1c = getbits_fast(fr, 3); /* 0 .. 7 */ + gr_info->region1start = bandInfo[sfreq].longIdx[r0c+1] >> 1 ; + + /* max(r0c+r1c+2) = 15+7+2 = 24 */ + if(r0c+1+r1c+1 > 22) gr_info->region2start = 576>>1; + else gr_info->region2start = bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1; + + gr_info->block_type = 0; + gr_info->mixed_block_flag = 0; + } + if(!fr->lsf) gr_info->preflag = get1bit(fr); + + gr_info->scalefac_scale = get1bit(fr); + gr_info->count1table_select = get1bit(fr); + } + return 0; +} + + +/* read scalefactors */ +static int III_get_scale_factors_1(mpg123_handle *fr, int *scf,struct gr_info_s *gr_info,int ch,int gr) +{ + const unsigned char slen[2][16] = + { + {0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4}, + {0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3} + }; + int numbits; + int num0 = slen[0][gr_info->scalefac_compress]; + int num1 = slen[1][gr_info->scalefac_compress]; + + if(gr_info->block_type == 2) + { + int i=18; + numbits = (num0 + num1) * 18; + + if(gr_info->mixed_block_flag) + { + for (i=8;i;i--) + *scf++ = getbits_fast(fr, num0); + + i = 9; + numbits -= num0; /* num0 * 17 + num1 * 18 */ + } + + for(;i;i--) *scf++ = getbits_fast(fr, num0); + + for(i = 18; i; i--) *scf++ = getbits_fast(fr, num1); + + *scf++ = 0; *scf++ = 0; *scf++ = 0; /* short[13][0..2] = 0 */ + } + else + { + int i; + int scfsi = gr_info->scfsi; + + if(scfsi < 0) + { /* scfsi < 0 => granule == 0 */ + for(i=11;i;i--) *scf++ = getbits_fast(fr, num0); + + for(i=10;i;i--) *scf++ = getbits_fast(fr, num1); + + numbits = (num0 + num1) * 10 + num0; + *scf++ = 0; + } + else + { + numbits = 0; + if(!(scfsi & 0x8)) + { + for (i=0;i<6;i++) *scf++ = getbits_fast(fr, num0); + + numbits += num0 * 6; + } + else scf += 6; + + if(!(scfsi & 0x4)) + { + for (i=0;i<5;i++) *scf++ = getbits_fast(fr, num0); + + numbits += num0 * 5; + } + else scf += 5; + + if(!(scfsi & 0x2)) + { + for(i=0;i<5;i++) *scf++ = getbits_fast(fr, num1); + + numbits += num1 * 5; + } + else scf += 5; + + if(!(scfsi & 0x1)) + { + for (i=0;i<5;i++) *scf++ = getbits_fast(fr, num1); + + numbits += num1 * 5; + } + else scf += 5; + + *scf++ = 0; /* no l[21] in original sources */ + } + } + return numbits; +} + + +static int III_get_scale_factors_2(mpg123_handle *fr, int *scf,struct gr_info_s *gr_info,int i_stereo) +{ + const unsigned char *pnt; + int i,j,n=0,numbits=0; + unsigned int slen; + + const unsigned char stab[3][6][4] = + { + { + { 6, 5, 5,5 } , { 6, 5, 7,3 } , { 11,10,0,0}, + { 7, 7, 7,0 } , { 6, 6, 6,3 } , { 8, 8,5,0} + }, + { + { 9, 9, 9,9 } , { 9, 9,12,6 } , { 18,18,0,0}, + {12,12,12,0 } , {12, 9, 9,6 } , { 15,12,9,0} + }, + { + { 6, 9, 9,9 } , { 6, 9,12,6 } , { 15,18,0,0}, + { 6,15,12,0 } , { 6,12, 9,6 } , { 6,18,9,0} + } + }; + + if(i_stereo) /* i_stereo AND second channel -> do_layer3() checks this */ + slen = i_slen2[gr_info->scalefac_compress>>1]; + else + slen = n_slen2[gr_info->scalefac_compress]; + + gr_info->preflag = (slen>>15) & 0x1; + + n = 0; + if( gr_info->block_type == 2 ) + { + n++; + if(gr_info->mixed_block_flag) n++; + } + + pnt = stab[n][(slen>>12)&0x7]; + + for(i=0;i<4;i++) + { + int num = slen & 0x7; + slen >>= 3; + if(num) + { + for(j=0;j<(int)(pnt[i]);j++) *scf++ = getbits_fast(fr, num); + + numbits += pnt[i] * num; + } + else + for(j=0;j<(int)(pnt[i]);j++) *scf++ = 0; + } + + n = (n << 1) + 1; + for(i=0;iscalefac_scale; + real *xrpnt = (real *) xr; + int l[3],l3; + int part2remain = gr_info->part2_3_length - part2bits; + int *me; +#ifdef REAL_IS_FIXED + int gainpow2_scale_idx = 378; +#endif + + /* mhipp tree has this split up a bit... */ + int num=getbitoffset(fr); + long mask; + /* We must split this, because for num==0 the shift is undefined if you do it in one step. */ + mask = ((unsigned long) getbits(fr, num))<big_values; + int region1 = gr_info->region1start; + int region2 = gr_info->region2start; + l3 = ((576>>1)-bv)>>1; + + /* we may lose the 'odd' bit here !! check this later again */ + if(bv <= region1) + { + l[0] = bv; + l[1] = 0; + l[2] = 0; + } + else + { + l[0] = region1; + if(bv <= region2) + { + l[1] = bv - l[0]; + l[2] = 0; + } + else + { + l[1] = region2 - l[0]; + l[2] = bv - region2; + } + } + } + + if(gr_info->block_type == 2) + { + /* decoding with short or mixed mode BandIndex table */ + int i,max[4]; + int step=0,lwin=3,cb=0; + register real v = 0.0; + register int *m,mc; + + if(gr_info->mixed_block_flag) + { + max[3] = -1; + max[0] = max[1] = max[2] = 2; + m = map[sfreq][0]; + me = mapend[sfreq][0]; + } + else + { + max[0] = max[1] = max[2] = max[3] = -1; + /* max[3] not really needed in this case */ + m = map[sfreq][1]; + me = mapend[sfreq][1]; + } + + mc = 0; + for(i=0;i<2;i++) + { + int lp = l[i]; + const struct newhuff *h = ht+gr_info->table_select[i]; + for(;lp;lp--,mc--) + { + register int x,y; + if( (!mc) ) + { + mc = *m++; + xrpnt = ((real *) xr) + (*m++); + lwin = *m++; + cb = *m++; + if(lwin == 3) + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->pow2gain[(*scf++) << shift]; + step = 1; + } + else + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->full_gain[lwin] + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->full_gain[lwin][(*scf++) << shift]; + step = 3; + } + } + { + const short *val = h->table; + REFRESH_MASK; + while((y=*val++)<0) + { + if (mask < 0) val -= y; + + num--; + mask <<= 1; + } + x = y >> 4; + y &= 0xf; + } + if(x == 15 && h->linbits) + { + max[lwin] = cb; + REFRESH_MASK; + x += ((unsigned long) mask) >> (BITSHIFT+8-h->linbits); + num -= h->linbits+1; + mask <<= h->linbits; + if(mask < 0) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx); + else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx); + + mask <<= 1; + } + else if(x) + { + max[lwin] = cb; + if(mask < 0) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx); + else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx); + + num--; + mask <<= 1; + } + else *xrpnt = DOUBLE_TO_REAL(0.0); + + xrpnt += step; + if(y == 15 && h->linbits) + { + max[lwin] = cb; + REFRESH_MASK; + y += ((unsigned long) mask) >> (BITSHIFT+8-h->linbits); + num -= h->linbits+1; + mask <<= h->linbits; + if(mask < 0) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx); + else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx); + + mask <<= 1; + } + else if(y) + { + max[lwin] = cb; + if(mask < 0) *xrpnt = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx); + else *xrpnt = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx); + + num--; + mask <<= 1; + } + else *xrpnt = DOUBLE_TO_REAL(0.0); + + xrpnt += step; + } + } + + for(;l3 && (part2remain+num > 0);l3--) + { + const struct newhuff* h; + const short* val; + register short a; + /* + This is only a humble hack to prevent a special segfault. + More insight into the real workings is still needed. + Especially why there are (valid?) files that make xrpnt exceed the array with 4 bytes without segfaulting, more seems to be really bad, though. + */ + #ifdef DEBUG + if(!(xrpnt < &xr[SBLIMIT][0])) + { + if(VERBOSE) debug2("attempted soft xrpnt overflow (%p !< %p) ?", (void*) xrpnt, (void*) &xr[SBLIMIT][0]); + } + #endif + if(!(xrpnt < &xr[SBLIMIT][0]+5)) + { + if(NOQUIET) error2("attempted xrpnt overflow (%p !< %p)", (void*) xrpnt, (void*) &xr[SBLIMIT][0]); + return 2; + } + h = htc+gr_info->count1table_select; + val = h->table; + + REFRESH_MASK; + while((a=*val++)<0) + { + if(mask < 0) val -= a; + + num--; + mask <<= 1; + } + if(part2remain+num <= 0) + { + num -= part2remain+num; + break; + } + + for(i=0;i<4;i++) + { + if(!(i & 1)) + { + if(!mc) + { + mc = *m++; + xrpnt = ((real *) xr) + (*m++); + lwin = *m++; + cb = *m++; + if(lwin == 3) + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->pow2gain[(*scf++) << shift]; + step = 1; + } + else + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->full_gain[lwin] + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->full_gain[lwin][(*scf++) << shift]; + step = 3; + } + } + mc--; + } + if( (a & (0x8>>i)) ) + { + max[lwin] = cb; + if(part2remain+num <= 0) + break; + + if(mask < 0) *xrpnt = -REAL_SCALE_LAYER3(v, gainpow2_scale_idx); + else *xrpnt = REAL_SCALE_LAYER3(v, gainpow2_scale_idx); + + num--; + mask <<= 1; + } + else *xrpnt = DOUBLE_TO_REAL(0.0); + + xrpnt += step; + } + } + + if(lwin < 3) + { /* short band? */ + while(1) + { + for(;mc > 0;mc--) + { + *xrpnt = DOUBLE_TO_REAL(0.0); xrpnt += 3; /* short band -> step=3 */ + *xrpnt = DOUBLE_TO_REAL(0.0); xrpnt += 3; + } + if(m >= me) + break; + + mc = *m++; + xrpnt = ((real *) xr) + *m++; + if(*m++ == 0) + break; /* optimize: field will be set to zero at the end of the function */ + + m++; /* cb */ + } + } + + gr_info->maxband[0] = max[0]+1; + gr_info->maxband[1] = max[1]+1; + gr_info->maxband[2] = max[2]+1; + gr_info->maxbandl = max[3]+1; + + { + int rmax = max[0] > max[1] ? max[0] : max[1]; + rmax = (rmax > max[2] ? rmax : max[2]) + 1; + gr_info->maxb = rmax ? fr->shortLimit[sfreq][rmax] : fr->longLimit[sfreq][max[3]+1]; + } + + } + else + { + /* decoding with 'long' BandIndex table (block_type != 2) */ + const unsigned char *pretab = pretab_choice[gr_info->preflag]; + int i,max = -1; + int cb = 0; + int *m = map[sfreq][2]; + register real v = 0.0; + int mc = 0; + + /* long hash table values */ + for(i=0;i<3;i++) + { + int lp = l[i]; + const struct newhuff *h = ht+gr_info->table_select[i]; + + for(;lp;lp--,mc--) + { + int x,y; + if(!mc) + { + mc = *m++; + cb = *m++; +#ifdef CUT_SFB21 + if(cb == 21) + v = 0.0; + else +#endif + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->pow2gain[(*(scf++) + (*pretab++)) << shift]; + } + } + { + const short *val = h->table; + REFRESH_MASK; + while((y=*val++)<0) + { + if (mask < 0) val -= y; + + num--; + mask <<= 1; + } + x = y >> 4; + y &= 0xf; + } + + if(x == 15 && h->linbits) + { + max = cb; + REFRESH_MASK; + x += ((unsigned long) mask) >> (BITSHIFT+8-h->linbits); + num -= h->linbits+1; + mask <<= h->linbits; + if(mask < 0) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx); + else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx); + + mask <<= 1; + } + else if(x) + { + max = cb; + if(mask < 0) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[x], v, gainpow2_scale_idx); + else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[x], v, gainpow2_scale_idx); + num--; + + mask <<= 1; + } + else *xrpnt++ = DOUBLE_TO_REAL(0.0); + + if(y == 15 && h->linbits) + { + max = cb; + REFRESH_MASK; + y += ((unsigned long) mask) >> (BITSHIFT+8-h->linbits); + num -= h->linbits+1; + mask <<= h->linbits; + if(mask < 0) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx); + else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx); + + mask <<= 1; + } + else if(y) + { + max = cb; + if(mask < 0) *xrpnt++ = REAL_MUL_SCALE_LAYER3(-ispow[y], v, gainpow2_scale_idx); + else *xrpnt++ = REAL_MUL_SCALE_LAYER3( ispow[y], v, gainpow2_scale_idx); + + num--; + mask <<= 1; + } + else *xrpnt++ = DOUBLE_TO_REAL(0.0); + } + } + + /* short (count1table) values */ + for(;l3 && (part2remain+num > 0);l3--) + { + const struct newhuff *h = htc+gr_info->count1table_select; + const short *val = h->table; + register short a; + + REFRESH_MASK; + while((a=*val++)<0) + { + if (mask < 0) val -= a; + + num--; + mask <<= 1; + } + if(part2remain+num <= 0) + { + num -= part2remain+num; + break; + } + + for(i=0;i<4;i++) + { + if(!(i & 1)) + { + if(!mc) + { + mc = *m++; + cb = *m++; +#ifdef CUT_SFB21 + if(cb == 21) + v = 0.0; + else +#endif + { +#ifdef REAL_IS_FIXED + gainpow2_scale_idx = (int)(gr_info->pow2gain + (*scf << shift) - fr->gainpow2); +#endif + v = gr_info->pow2gain[((*scf++) + (*pretab++)) << shift]; + } + } + mc--; + } + if( (a & (0x8>>i)) ) + { + max = cb; + if(part2remain+num <= 0) + break; + + if(mask < 0) *xrpnt++ = -REAL_SCALE_LAYER3(v, gainpow2_scale_idx); + else *xrpnt++ = REAL_SCALE_LAYER3(v, gainpow2_scale_idx); + + num--; + mask <<= 1; + } + else *xrpnt++ = DOUBLE_TO_REAL(0.0); + } + } + + gr_info->maxbandl = max+1; + gr_info->maxb = fr->longLimit[sfreq][gr_info->maxbandl]; + } + + part2remain += num; + backbits(fr, num); + num = 0; + + while(xrpnt < &xr[SBLIMIT][0]) + *xrpnt++ = DOUBLE_TO_REAL(0.0); + + while( part2remain > 16 ) + { + skipbits(fr, 16); /* Dismiss stuffing Bits */ + part2remain -= 16; + } + if(part2remain > 0) skipbits(fr, part2remain); + else if(part2remain < 0) + { + debug1("Can't rewind stream by %d bits!",-part2remain); + return 1; /* -> error */ + } + return 0; +} + + +/* calculate real channel values for Joint-I-Stereo-mode */ +static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT],int *scalefac, struct gr_info_s *gr_info,int sfreq,int ms_stereo,int lsf) +{ + real (*xr)[SBLIMIT*SSLIMIT] = (real (*)[SBLIMIT*SSLIMIT] ) xr_buf; + const struct bandInfoStruct *bi = &bandInfo[sfreq]; + + const real *tab1,*tab2; + +#if 1 + int tab; +/* TODO: optimize as static */ + const real *tabs[3][2][2] = + { + { { tan1_1,tan2_1 } , { tan1_2,tan2_2 } }, + { { pow1_1[0],pow2_1[0] } , { pow1_2[0],pow2_2[0] } }, + { { pow1_1[1],pow2_1[1] } , { pow1_2[1],pow2_2[1] } } + }; + + tab = lsf + (gr_info->scalefac_compress & lsf); + tab1 = tabs[tab][ms_stereo][0]; + tab2 = tabs[tab][ms_stereo][1]; +#else + if(lsf) + { + int p = gr_info->scalefac_compress & 0x1; + if(ms_stereo) + { + tab1 = pow1_2[p]; + tab2 = pow2_2[p]; + } + else + { + tab1 = pow1_1[p]; + tab2 = pow2_1[p]; + } + } + else + { + if(ms_stereo) + { + tab1 = tan1_2; + tab2 = tan2_2; + } + else + { + tab1 = tan1_1; + tab2 = tan2_1; + } + } +#endif + + if(gr_info->block_type == 2) + { + int lwin,do_l = 0; + if( gr_info->mixed_block_flag ) do_l = 1; + + for(lwin=0;lwin<3;lwin++) + { /* process each window */ + /* get first band with zero values */ + int is_p,sb,idx,sfb = gr_info->maxband[lwin]; /* sfb is minimal 3 for mixed mode */ + if(sfb > 3) do_l = 0; + + for(;sfb<12;sfb++) + { + is_p = scalefac[sfb*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */ + if(is_p != 7) + { + real t1,t2; + sb = bi->shortDiff[sfb]; + idx = bi->shortIdx[sfb] + lwin; + t1 = tab1[is_p]; t2 = tab2[is_p]; + for (; sb > 0; sb--,idx+=3) + { + real v = xr[0][idx]; + xr[0][idx] = REAL_MUL_15(v, t1); + xr[1][idx] = REAL_MUL_15(v, t2); + } + } + } + +#if 1 +/* in the original: copy 10 to 11 , here: copy 11 to 12 +maybe still wrong??? (copy 12 to 13?) */ + is_p = scalefac[11*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */ + sb = bi->shortDiff[12]; + idx = bi->shortIdx[12] + lwin; +#else + is_p = scalefac[10*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */ + sb = bi->shortDiff[11]; + idx = bi->shortIdx[11] + lwin; +#endif + if(is_p != 7) + { + real t1,t2; + t1 = tab1[is_p]; t2 = tab2[is_p]; + for( ; sb > 0; sb--,idx+=3 ) + { + real v = xr[0][idx]; + xr[0][idx] = REAL_MUL_15(v, t1); + xr[1][idx] = REAL_MUL_15(v, t2); + } + } + } /* end for(lwin; .. ; . ) */ + + /* also check l-part, if ALL bands in the three windows are 'empty' and mode = mixed_mode */ + if(do_l) + { + int sfb = gr_info->maxbandl; + int idx; + if(sfb > 21) return; /* similarity fix related to CVE-2006-1655 */ + + idx = bi->longIdx[sfb]; + for( ; sfb<8; sfb++ ) + { + int sb = bi->longDiff[sfb]; + int is_p = scalefac[sfb]; /* scale: 0-15 */ + if(is_p != 7) + { + real t1,t2; + t1 = tab1[is_p]; t2 = tab2[is_p]; + for( ; sb > 0; sb--,idx++) + { + real v = xr[0][idx]; + xr[0][idx] = REAL_MUL_15(v, t1); + xr[1][idx] = REAL_MUL_15(v, t2); + } + } + else idx += sb; + } + } + } + else + { /* ((gr_info->block_type != 2)) */ + int sfb = gr_info->maxbandl; + int is_p,idx; + if(sfb > 21) return; /* tightened fix for CVE-2006-1655 */ + + idx = bi->longIdx[sfb]; + for ( ; sfb<21; sfb++) + { + int sb = bi->longDiff[sfb]; + is_p = scalefac[sfb]; /* scale: 0-15 */ + if(is_p != 7) + { + real t1,t2; + t1 = tab1[is_p]; t2 = tab2[is_p]; + for( ; sb > 0; sb--,idx++) + { + real v = xr[0][idx]; + xr[0][idx] = REAL_MUL_15(v, t1); + xr[1][idx] = REAL_MUL_15(v, t2); + } + } + else idx += sb; + } + + is_p = scalefac[20]; + if(is_p != 7) + { /* copy l-band 20 to l-band 21 */ + int sb; + real t1 = tab1[is_p],t2 = tab2[is_p]; + + for( sb = bi->longDiff[21]; sb > 0; sb--,idx++ ) + { + real v = xr[0][idx]; + xr[0][idx] = REAL_MUL_15(v, t1); + xr[1][idx] = REAL_MUL_15(v, t2); + } + } + } +} + + +static void III_antialias(real xr[SBLIMIT][SSLIMIT],struct gr_info_s *gr_info) +{ + int sblim; + + if(gr_info->block_type == 2) + { + if(!gr_info->mixed_block_flag) return; + + sblim = 1; + } + else sblim = gr_info->maxb-1; + + /* 31 alias-reduction operations between each pair of sub-bands */ + /* with 8 butterflies between each pair */ + + { + int sb; + real *xr1=(real *) xr[1]; + + for(sb=sblim; sb; sb--,xr1+=10) + { + int ss; + real *cs=aa_cs,*ca=aa_ca; + real *xr2 = xr1; + + for(ss=7;ss>=0;ss--) + { /* upper and lower butterfly inputs */ + register real bu = *--xr2,bd = *xr1; + *xr2 = REAL_MUL(bu, *cs) - REAL_MUL(bd, *ca); + *xr1++ = REAL_MUL(bd, *cs++) + REAL_MUL(bu, *ca++); + } + } + } +} + +/* + This is an optimized DCT from Jeff Tsay's maplay 1.2+ package. + Saved one multiplication by doing the 'twiddle factor' stuff + together with the window mul. (MH) + + This uses Byeong Gi Lee's Fast Cosine Transform algorithm, but the + 9 point IDCT needs to be reduced further. Unfortunately, I don't + know how to do that, because 9 is not an even number. - Jeff. + + Original Message: + + 9 Point Inverse Discrete Cosine Transform + + This piece of code is Copyright 1997 Mikko Tommila and is freely usable + by anybody. The algorithm itself is of course in the public domain. + + Again derived heuristically from the 9-point WFTA. + + The algorithm is optimized (?) for speed, not for small rounding errors or + good readability. + + 36 additions, 11 multiplications + + Again this is very likely sub-optimal. + + The code is optimized to use a minimum number of temporary variables, + so it should compile quite well even on 8-register Intel x86 processors. + This makes the code quite obfuscated and very difficult to understand. + + References: + [1] S. Winograd: "On Computing the Discrete Fourier Transform", + Mathematics of Computation, Volume 32, Number 141, January 1978, + Pages 175-199 +*/ + +/* Calculation of the inverse MDCT + used to be static without 3dnow - does that really matter? */ +void dct36(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf) +{ +#ifdef NEW_DCT9 + real tmp[18]; +#endif + + { + register real *in = inbuf; + + in[17]+=in[16]; in[16]+=in[15]; in[15]+=in[14]; + in[14]+=in[13]; in[13]+=in[12]; in[12]+=in[11]; + in[11]+=in[10]; in[10]+=in[9]; in[9] +=in[8]; + in[8] +=in[7]; in[7] +=in[6]; in[6] +=in[5]; + in[5] +=in[4]; in[4] +=in[3]; in[3] +=in[2]; + in[2] +=in[1]; in[1] +=in[0]; + + in[17]+=in[15]; in[15]+=in[13]; in[13]+=in[11]; in[11]+=in[9]; + in[9] +=in[7]; in[7] +=in[5]; in[5] +=in[3]; in[3] +=in[1]; + + +#ifdef NEW_DCT9 +#if 1 + { + real t3; + { + real t0, t1, t2; + + t0 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4])); + t1 = REAL_MUL(COS6_2, in[12]); + + t3 = in[0]; + t2 = t3 - t1 - t1; + tmp[1] = tmp[7] = t2 - t0; + tmp[4] = t2 + t0 + t0; + t3 += t1; + + t2 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2])); + tmp[1] -= t2; + tmp[7] += t2; + } + { + real t0, t1, t2; + + t0 = REAL_MUL(cos9[0], (in[4] + in[8] )); + t1 = REAL_MUL(cos9[1], (in[8] - in[16])); + t2 = REAL_MUL(cos9[2], (in[4] + in[16])); + + tmp[2] = tmp[6] = t3 - t0 - t2; + tmp[0] = tmp[8] = t3 + t0 + t1; + tmp[3] = tmp[5] = t3 - t1 + t2; + } + } + { + real t1, t2, t3; + + t1 = REAL_MUL(cos18[0], (in[2] + in[10])); + t2 = REAL_MUL(cos18[1], (in[10] - in[14])); + t3 = REAL_MUL(COS6_1, in[6]); + + { + real t0 = t1 + t2 + t3; + tmp[0] += t0; + tmp[8] -= t0; + } + + t2 -= t3; + t1 -= t3; + + t3 = REAL_MUL(cos18[2], (in[2] + in[14])); + + t1 += t3; + tmp[3] += t1; + tmp[5] -= t1; + + t2 -= t3; + tmp[2] += t2; + tmp[6] -= t2; + } + +#else + { + real t0, t1, t2, t3, t4, t5, t6, t7; + + t1 = REAL_MUL(COS6_2, in[12]); + t2 = REAL_MUL(COS6_2, (in[8] + in[16] - in[4])); + + t3 = in[0] + t1; + t4 = in[0] - t1 - t1; + t5 = t4 - t2; + tmp[4] = t4 + t2 + t2; + + t0 = REAL_MUL(cos9[0], (in[4] + in[8])); + t1 = REAL_MUL(cos9[1], (in[8] - in[16])); + + t2 = REAL_MUL(cos9[2], (in[4] + in[16])); + + t6 = t3 - t0 - t2; + t0 += t3 + t1; + t3 += t2 - t1; + + t2 = REAL_MUL(cos18[0], (in[2] + in[10])); + t4 = REAL_MUL(cos18[1], (in[10] - in[14])); + t7 = REAL_MUL(COS6_1, in[6]); + + t1 = t2 + t4 + t7; + tmp[0] = t0 + t1; + tmp[8] = t0 - t1; + t1 = REAL_MUL(cos18[2], (in[2] + in[14])); + t2 += t1 - t7; + + tmp[3] = t3 + t2; + t0 = REAL_MUL(COS6_1, (in[10] + in[14] - in[2])); + tmp[5] = t3 - t2; + + t4 -= t1 + t7; + + tmp[1] = t5 - t0; + tmp[7] = t5 + t0; + tmp[2] = t6 + t4; + tmp[6] = t6 - t4; + } +#endif + + { + real t0, t1, t2, t3, t4, t5, t6, t7; + + t1 = REAL_MUL(COS6_2, in[13]); + t2 = REAL_MUL(COS6_2, (in[9] + in[17] - in[5])); + + t3 = in[1] + t1; + t4 = in[1] - t1 - t1; + t5 = t4 - t2; + + t0 = REAL_MUL(cos9[0], (in[5] + in[9])); + t1 = REAL_MUL(cos9[1], (in[9] - in[17])); + + tmp[13] = REAL_MUL((t4 + t2 + t2), tfcos36[17-13]); + t2 = REAL_MUL(cos9[2], (in[5] + in[17])); + + t6 = t3 - t0 - t2; + t0 += t3 + t1; + t3 += t2 - t1; + + t2 = REAL_MUL(cos18[0], (in[3] + in[11])); + t4 = REAL_MUL(cos18[1], (in[11] - in[15])); + t7 = REAL_MUL(COS6_1, in[7]); + + t1 = t2 + t4 + t7; + tmp[17] = REAL_MUL((t0 + t1), tfcos36[17-17]); + tmp[9] = REAL_MUL((t0 - t1), tfcos36[17-9]); + t1 = REAL_MUL(cos18[2], (in[3] + in[15])); + t2 += t1 - t7; + + tmp[14] = REAL_MUL((t3 + t2), tfcos36[17-14]); + t0 = REAL_MUL(COS6_1, (in[11] + in[15] - in[3])); + tmp[12] = REAL_MUL((t3 - t2), tfcos36[17-12]); + + t4 -= t1 + t7; + + tmp[16] = REAL_MUL((t5 - t0), tfcos36[17-16]); + tmp[10] = REAL_MUL((t5 + t0), tfcos36[17-10]); + tmp[15] = REAL_MUL((t6 + t4), tfcos36[17-15]); + tmp[11] = REAL_MUL((t6 - t4), tfcos36[17-11]); + } + +#define MACRO(v) { \ + real tmpval; \ + tmpval = tmp[(v)] + tmp[17-(v)]; \ + out2[9+(v)] = REAL_MUL(tmpval, w[27+(v)]); \ + out2[8-(v)] = REAL_MUL(tmpval, w[26-(v)]); \ + tmpval = tmp[(v)] - tmp[17-(v)]; \ + ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(tmpval, w[8-(v)]); \ + ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(tmpval, w[9+(v)]); } + + { + register real *out2 = o2; + register real *w = wintab; + register real *out1 = o1; + register real *ts = tsbuf; + + MACRO(0); + MACRO(1); + MACRO(2); + MACRO(3); + MACRO(4); + MACRO(5); + MACRO(6); + MACRO(7); + MACRO(8); + } + +#else + + { + +#define MACRO0(v) { \ + real tmp; \ + out2[9+(v)] = REAL_MUL((tmp = sum0 + sum1), w[27+(v)]); \ + out2[8-(v)] = REAL_MUL(tmp, w[26-(v)]); } \ + sum0 -= sum1; \ + ts[SBLIMIT*(8-(v))] = out1[8-(v)] + REAL_MUL(sum0, w[8-(v)]); \ + ts[SBLIMIT*(9+(v))] = out1[9+(v)] + REAL_MUL(sum0, w[9+(v)]); +#define MACRO1(v) { \ + real sum0,sum1; \ + sum0 = tmp1a + tmp2a; \ + sum1 = REAL_MUL((tmp1b + tmp2b), tfcos36[(v)]); \ + MACRO0(v); } +#define MACRO2(v) { \ + real sum0,sum1; \ + sum0 = tmp2a - tmp1a; \ + sum1 = REAL_MUL((tmp2b - tmp1b), tfcos36[(v)]); \ + MACRO0(v); } + + register const real *c = COS9; + register real *out2 = o2; + register real *w = wintab; + register real *out1 = o1; + register real *ts = tsbuf; + + real ta33,ta66,tb33,tb66; + + ta33 = REAL_MUL(in[2*3+0], c[3]); + ta66 = REAL_MUL(in[2*6+0], c[6]); + tb33 = REAL_MUL(in[2*3+1], c[3]); + tb66 = REAL_MUL(in[2*6+1], c[6]); + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = REAL_MUL(in[2*1+0], c[1]) + ta33 + REAL_MUL(in[2*5+0], c[5]) + REAL_MUL(in[2*7+0], c[7]); + tmp1b = REAL_MUL(in[2*1+1], c[1]) + tb33 + REAL_MUL(in[2*5+1], c[5]) + REAL_MUL(in[2*7+1], c[7]); + tmp2a = REAL_MUL(in[2*2+0], c[2]) + REAL_MUL(in[2*4+0], c[4]) + ta66 + REAL_MUL(in[2*8+0], c[8]); + tmp2b = REAL_MUL(in[2*2+1], c[2]) + REAL_MUL(in[2*4+1], c[4]) + tb66 + REAL_MUL(in[2*8+1], c[8]); + + MACRO1(0); + MACRO2(8); + } + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = REAL_MUL(( in[2*1+0] - in[2*5+0] - in[2*7+0] ), c[3]); + tmp1b = REAL_MUL(( in[2*1+1] - in[2*5+1] - in[2*7+1] ), c[3]); + tmp2a = REAL_MUL(( in[2*2+0] - in[2*4+0] - in[2*8+0] ), c[6]) - in[2*6+0] + in[2*0+0]; + tmp2b = REAL_MUL(( in[2*2+1] - in[2*4+1] - in[2*8+1] ), c[6]) - in[2*6+1] + in[2*0+1]; + + MACRO1(1); + MACRO2(7); + } + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = REAL_MUL(in[2*1+0], c[5]) - ta33 - REAL_MUL(in[2*5+0], c[7]) + REAL_MUL(in[2*7+0], c[1]); + tmp1b = REAL_MUL(in[2*1+1], c[5]) - tb33 - REAL_MUL(in[2*5+1], c[7]) + REAL_MUL(in[2*7+1], c[1]); + tmp2a = - REAL_MUL(in[2*2+0], c[8]) - REAL_MUL(in[2*4+0], c[2]) + ta66 + REAL_MUL(in[2*8+0], c[4]); + tmp2b = - REAL_MUL(in[2*2+1], c[8]) - REAL_MUL(in[2*4+1], c[2]) + tb66 + REAL_MUL(in[2*8+1], c[4]); + + MACRO1(2); + MACRO2(6); + } + + { + real tmp1a,tmp2a,tmp1b,tmp2b; + tmp1a = REAL_MUL(in[2*1+0], c[7]) - ta33 + REAL_MUL(in[2*5+0], c[1]) - REAL_MUL(in[2*7+0], c[5]); + tmp1b = REAL_MUL(in[2*1+1], c[7]) - tb33 + REAL_MUL(in[2*5+1], c[1]) - REAL_MUL(in[2*7+1], c[5]); + tmp2a = - REAL_MUL(in[2*2+0], c[4]) + REAL_MUL(in[2*4+0], c[8]) + ta66 - REAL_MUL(in[2*8+0], c[2]); + tmp2b = - REAL_MUL(in[2*2+1], c[4]) + REAL_MUL(in[2*4+1], c[8]) + tb66 - REAL_MUL(in[2*8+1], c[2]); + + MACRO1(3); + MACRO2(5); + } + + { + real sum0,sum1; + sum0 = in[2*0+0] - in[2*2+0] + in[2*4+0] - in[2*6+0] + in[2*8+0]; + sum1 = REAL_MUL((in[2*0+1] - in[2*2+1] + in[2*4+1] - in[2*6+1] + in[2*8+1] ), tfcos36[4]); + MACRO0(4); + } + } +#endif + + } +} + + +/* new DCT12 */ +static void dct12(real *in,real *rawout1,real *rawout2,register real *wi,register real *ts) +{ +#define DCT12_PART1 \ + in5 = in[5*3]; \ + in5 += (in4 = in[4*3]); \ + in4 += (in3 = in[3*3]); \ + in3 += (in2 = in[2*3]); \ + in2 += (in1 = in[1*3]); \ + in1 += (in0 = in[0*3]); \ + \ + in5 += in3; in3 += in1; \ + \ + in2 = REAL_MUL(in2, COS6_1); \ + in3 = REAL_MUL(in3, COS6_1); + +#define DCT12_PART2 \ + in0 += REAL_MUL(in4, COS6_2); \ + \ + in4 = in0 + in2; \ + in0 -= in2; \ + \ + in1 += REAL_MUL(in5, COS6_2); \ + \ + in5 = REAL_MUL((in1 + in3), tfcos12[0]); \ + in1 = REAL_MUL((in1 - in3), tfcos12[2]); \ + \ + in3 = in4 + in5; \ + in4 -= in5; \ + \ + in2 = in0 + in1; \ + in0 -= in1; + + { + real in0,in1,in2,in3,in4,in5; + register real *out1 = rawout1; + ts[SBLIMIT*0] = out1[0]; ts[SBLIMIT*1] = out1[1]; ts[SBLIMIT*2] = out1[2]; + ts[SBLIMIT*3] = out1[3]; ts[SBLIMIT*4] = out1[4]; ts[SBLIMIT*5] = out1[5]; + + DCT12_PART1 + + { + real tmp0,tmp1 = (in0 - in4); + { + real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]); + tmp0 = tmp1 + tmp2; + tmp1 -= tmp2; + } + ts[(17-1)*SBLIMIT] = out1[17-1] + REAL_MUL(tmp0, wi[11-1]); + ts[(12+1)*SBLIMIT] = out1[12+1] + REAL_MUL(tmp0, wi[6+1]); + ts[(6 +1)*SBLIMIT] = out1[6 +1] + REAL_MUL(tmp1, wi[1]); + ts[(11-1)*SBLIMIT] = out1[11-1] + REAL_MUL(tmp1, wi[5-1]); + } + + DCT12_PART2 + + ts[(17-0)*SBLIMIT] = out1[17-0] + REAL_MUL(in2, wi[11-0]); + ts[(12+0)*SBLIMIT] = out1[12+0] + REAL_MUL(in2, wi[6+0]); + ts[(12+2)*SBLIMIT] = out1[12+2] + REAL_MUL(in3, wi[6+2]); + ts[(17-2)*SBLIMIT] = out1[17-2] + REAL_MUL(in3, wi[11-2]); + + ts[(6 +0)*SBLIMIT] = out1[6+0] + REAL_MUL(in0, wi[0]); + ts[(11-0)*SBLIMIT] = out1[11-0] + REAL_MUL(in0, wi[5-0]); + ts[(6 +2)*SBLIMIT] = out1[6+2] + REAL_MUL(in4, wi[2]); + ts[(11-2)*SBLIMIT] = out1[11-2] + REAL_MUL(in4, wi[5-2]); + } + + in++; + + { + real in0,in1,in2,in3,in4,in5; + register real *out2 = rawout2; + + DCT12_PART1 + + { + real tmp0,tmp1 = (in0 - in4); + { + real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]); + tmp0 = tmp1 + tmp2; + tmp1 -= tmp2; + } + out2[5-1] = REAL_MUL(tmp0, wi[11-1]); + out2[0+1] = REAL_MUL(tmp0, wi[6+1]); + ts[(12+1)*SBLIMIT] += REAL_MUL(tmp1, wi[1]); + ts[(17-1)*SBLIMIT] += REAL_MUL(tmp1, wi[5-1]); + } + + DCT12_PART2 + + out2[5-0] = REAL_MUL(in2, wi[11-0]); + out2[0+0] = REAL_MUL(in2, wi[6+0]); + out2[0+2] = REAL_MUL(in3, wi[6+2]); + out2[5-2] = REAL_MUL(in3, wi[11-2]); + + ts[(12+0)*SBLIMIT] += REAL_MUL(in0, wi[0]); + ts[(17-0)*SBLIMIT] += REAL_MUL(in0, wi[5-0]); + ts[(12+2)*SBLIMIT] += REAL_MUL(in4, wi[2]); + ts[(17-2)*SBLIMIT] += REAL_MUL(in4, wi[5-2]); + } + + in++; + + { + real in0,in1,in2,in3,in4,in5; + register real *out2 = rawout2; + out2[12]=out2[13]=out2[14]=out2[15]=out2[16]=out2[17]=0.0; + + DCT12_PART1 + + { + real tmp0,tmp1 = (in0 - in4); + { + real tmp2 = REAL_MUL((in1 - in5), tfcos12[1]); + tmp0 = tmp1 + tmp2; + tmp1 -= tmp2; + } + out2[11-1] = REAL_MUL(tmp0, wi[11-1]); + out2[6 +1] = REAL_MUL(tmp0, wi[6+1]); + out2[0+1] += REAL_MUL(tmp1, wi[1]); + out2[5-1] += REAL_MUL(tmp1, wi[5-1]); + } + + DCT12_PART2 + + out2[11-0] = REAL_MUL(in2, wi[11-0]); + out2[6 +0] = REAL_MUL(in2, wi[6+0]); + out2[6 +2] = REAL_MUL(in3, wi[6+2]); + out2[11-2] = REAL_MUL(in3, wi[11-2]); + + out2[0+0] += REAL_MUL(in0, wi[0]); + out2[5-0] += REAL_MUL(in0, wi[5-0]); + out2[0+2] += REAL_MUL(in4, wi[2]); + out2[5-2] += REAL_MUL(in4, wi[5-2]); + } +} + + +static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT], real tsOut[SSLIMIT][SBLIMIT], int ch,struct gr_info_s *gr_info, mpg123_handle *fr) +{ + real (*block)[2][SBLIMIT*SSLIMIT] = fr->hybrid_block; + int *blc = fr->hybrid_blc; + + real *tspnt = (real *) tsOut; + real *rawout1,*rawout2; + int bt = 0; + size_t sb = 0; + + { + int b = blc[ch]; + rawout1=block[b][ch]; + b=-b+1; + rawout2=block[b][ch]; + blc[ch] = b; + } + + if(gr_info->mixed_block_flag) + { + sb = 2; + opt_dct36(fr)(fsIn[0],rawout1,rawout2,win[0],tspnt); + opt_dct36(fr)(fsIn[1],rawout1+18,rawout2+18,win1[0],tspnt+1); + rawout1 += 36; rawout2 += 36; tspnt += 2; + } + + bt = gr_info->block_type; + if(bt == 2) + { + for(; sbmaxb; sb+=2,tspnt+=2,rawout1+=36,rawout2+=36) + { + dct12(fsIn[sb] ,rawout1 ,rawout2 ,win[2] ,tspnt); + dct12(fsIn[sb+1],rawout1+18,rawout2+18,win1[2],tspnt+1); + } + } + else + { + for(; sbmaxb; sb+=2,tspnt+=2,rawout1+=36,rawout2+=36) + { + opt_dct36(fr)(fsIn[sb],rawout1,rawout2,win[bt],tspnt); + opt_dct36(fr)(fsIn[sb+1],rawout1+18,rawout2+18,win1[bt],tspnt+1); + } + } + + for(;sbstereo; + int single = fr->single; + int ms_stereo,i_stereo; + int sfreq = fr->sampling_frequency; + int stereo1,granules; + + if(stereo == 1) + { /* stream is mono */ + stereo1 = 1; + single = SINGLE_LEFT; + } + else if(single != SINGLE_STEREO) /* stream is stereo, but force to mono */ + stereo1 = 1; + else + stereo1 = 2; + + if(fr->mode == MPG_MD_JOINT_STEREO) + { + ms_stereo = (fr->mode_ext & 0x2)>>1; + i_stereo = fr->mode_ext & 0x1; + } + else ms_stereo = i_stereo = 0; + + granules = fr->lsf ? 1 : 2; + + /* quick hack to keep the music playing */ + /* after having seen this nasty test file... */ + if(III_get_side_info(fr, &sideinfo,stereo,ms_stereo,sfreq,single)) + { + if(NOQUIET) error("bad frame - unable to get valid sideinfo"); + return clip; + } + + set_pointer(fr,sideinfo.main_data_begin); + + for(gr=0;grlayer3.hybrid_in; + /* hybridOut[2][SSLIMIT][SBLIMIT] */ + real (*hybridOut)[SSLIMIT][SBLIMIT] = fr->layer3.hybrid_out; + + { + struct gr_info_s *gr_info = &(sideinfo.ch[0].gr[gr]); + long part2bits; + if(fr->lsf) + part2bits = III_get_scale_factors_2(fr, scalefacs[0],gr_info,0); + else + part2bits = III_get_scale_factors_1(fr, scalefacs[0],gr_info,0,gr); + + if(III_dequantize_sample(fr, hybridIn[0], scalefacs[0],gr_info,sfreq,part2bits)) + { + if(VERBOSE2) error("dequantization failed!"); + return clip; + } + } + + if(stereo == 2) + { + struct gr_info_s *gr_info = &(sideinfo.ch[1].gr[gr]); + long part2bits; + if(fr->lsf) + part2bits = III_get_scale_factors_2(fr, scalefacs[1],gr_info,i_stereo); + else + part2bits = III_get_scale_factors_1(fr, scalefacs[1],gr_info,1,gr); + + if(III_dequantize_sample(fr, hybridIn[1],scalefacs[1],gr_info,sfreq,part2bits)) + { + if(VERBOSE2) error("dequantization failed!"); + return clip; + } + + if(ms_stereo) + { + int i; + unsigned int maxb = sideinfo.ch[0].gr[gr].maxb; + if(sideinfo.ch[1].gr[gr].maxb > maxb) maxb = sideinfo.ch[1].gr[gr].maxb; + + for(i=0;ilsf); + + if(ms_stereo || i_stereo || (single == SINGLE_MIX) ) + { + if(gr_info->maxb > sideinfo.ch[0].gr[gr].maxb) + sideinfo.ch[0].gr[gr].maxb = gr_info->maxb; + else + gr_info->maxb = sideinfo.ch[0].gr[gr].maxb; + } + + switch(single) + { + case SINGLE_MIX: + { + register int i; + register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1]; + for(i=0;imaxb;i++,in0++) + *in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */ + } + break; + case SINGLE_RIGHT: + { + register int i; + register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1]; + for(i=0;imaxb;i++) + *in0++ = *in1++; + } + break; + } + } + + for(ch=0;chaf.encoding != MPG123_ENC_SIGNED_16 || fr->down_sample != 0) + { +#endif + for(ss=0;sssynth_mono)(hybridOut[0][ss], fr); + else + clip += (fr->synth_stereo)(hybridOut[0][ss], hybridOut[1][ss], fr); + + } +#ifdef OPT_I486 + } else + { + /* Only stereo, 16 bits benefit from the 486 optimization. */ + ss=0; + while(ss < SSLIMIT) + { + int n; + n=(fr->buffer.size - fr->buffer.fill) / (2*2*32); + if(n > (SSLIMIT-ss)) n=SSLIMIT-ss; + + /* Clip counting makes no sense with this function. */ + absynth_1to1_i486(hybridOut[0][ss], 0, fr, n); + absynth_1to1_i486(hybridOut[1][ss], 1, fr, n); + ss+=n; + fr->buffer.fill+=(2*2*32)*n; + } + } +#endif + } + + return clip; +} diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/lfs_alias.c b/node_modules/lame/deps/mpg123/src/libmpg123/lfs_alias.c new file mode 100644 index 0000000..9b018e3 --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/lfs_alias.c @@ -0,0 +1,252 @@ +/* + lfs_alias: Aliases to the small/native API functions with the size of long int as suffix. + + copyright 2010 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + initially written by Thomas Orgis + + Use case: Client code on Linux/x86-64 that defines _FILE_OFFSET_BITS to 64, which is the only choice on that platform anyway. It should be no-op, but prompts the platform-agnostic header of mpg123 to define API calls with the corresponding suffix. + This file provides the names for this case. It's cruft, but glibc does it, too -- so people rely on it. + Oh, and it also caters for the lunatics that define _FILE_OFFSET_BITS=32 on 32 bit platforms. + + There is also the strange case that the mpg123 build itself is configured for unnecessary _FILE_OFFSET_BITS == LFS_ALIAS_BITS =^ sizeof(long). In that case, the "native" function will have the suffix and the alias shall be provided without the suffix. + + So, two basic cases: + 1. mpg123_bla_32 alias for mpg123_bla + 2. mpg123_bla alias for mpg123_bla_32 + Confusing, I know. It sucks. +*/ + +#include "config.h" + +/* Hack for Solaris: Some system headers included from compat.h might force _FILE_OFFSET_BITS. Need to follow that here. */ +#include "compat.h" + +#ifndef LFS_ALIAS_BITS +#error "I need the count of alias bits here." +#endif + +#define MACROCAT_REALLY(a, b) a ## b +#define MACROCAT(a, b) MACROCAT_REALLY(a, b) + +/* This is wicked switchery: Decide which way the aliases are facing. */ + +#if _FILE_OFFSET_BITS+0 == LFS_ALIAS_BITS + +/* The native functions are actually _with_ suffix, so let the mpg123 header use large file hackery to define the correct interfaces. */ +#include "mpg123.h" +/* Don't forget to undef the function symbols before usage... */ + +/* The native functions have suffix, the aliases not. */ +#define NATIVE_SUFFIX MACROCAT(_, _FILE_OFFSET_BITS) +#define NATIVE_NAME(func) MACROCAT(func, NATIVE_SUFFIX) +#define ALIAS_NAME(func) func + +#else + +/* Native functions are without suffix... */ +#define MPG123_NO_LARGENAME +#include "mpg123.h" + +/* The alias functions have suffix, the native ones not. */ +#define ALIAS_SUFFIX MACROCAT(_, LFS_ALIAS_BITS) +#define ALIAS_NAME(func) MACROCAT(func, ALIAS_SUFFIX) +#define NATIVE_NAME(func) func + +#endif + +/* Now get the rest of the infrastructure on speed, namely attribute_align_arg, to stay safe. */ +#include "mpg123lib_intern.h" + +/* + Extract the list of functions we need wrappers for, pregenerating the wrappers for simple cases (inline script for nedit): +perl -ne ' +if(/^\s*EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/) +{ + my $type = $1; + my $name = $2; + my $args = $3; + next unless ($type =~ /off_t/ or $args =~ /off_t/ or ($name =~ /open/ and $name ne mpg123_open_feed)); + $type =~ s/off_t/long/g; + my @nargs = (); + $args =~ s/off_t/long/g; + foreach my $a (split(/,/, $args)) + { + $a =~ s/^.*\s\**([a-z_]+)$/$1/; + push(@nargs, $a); + } + my $nargs = join(", ", @nargs); + $nargs = "Human: figure me out." if($nargs =~ /\(/); + print < +#include +#include +#include "compat.h" +#include "debug.h" + +/* + Now, start off easy... translate simple API calls. + I need to deal with these here: +perl -ne ' +if(/^\s*EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/) +{ + $type = $1; + $name = $2; + $args = $3; + next unless ($type =~ /off_t/ or $args =~ /off_t/); + print "$name\n" unless grep {$_ eq $name} + ("mpg123_open", "mpg123_open_fd", "mpg123_open_handle", "mpg123_replace_reader", "mpg123_replace_reader_handle"); +}' < mpg123.h.in + +mpg123_decode_frame +mpg123_framebyframe_decode +mpg123_framepos +mpg123_tell +mpg123_tellframe +mpg123_tell_stream +mpg123_seek +mpg123_feedseek +mpg123_seek_frame +mpg123_timeframe +mpg123_index +mpg123_set_index +mpg123_position +mpg123_length +mpg123_set_filesize +mpg123_decode_raw ... that's experimental. + +Let's work on them in that order. +*/ + +/* I see that I will need custom data storage. Main use is for the replaced I/O later, but the seek table for small file offsets needs extra storage, too. */ + +/* The wrapper handle for descriptor and handle I/O. */ + +/* The handle is used for nothing (0), or one of these two modes of operation: */ +#define IO_FD 1 /* Wrapping over callbacks operation on integer file descriptor. */ +#define IO_HANDLE 2 /* Wrapping over custom handle callbacks. */ + +struct wrap_data +{ + /* Storage for small offset index table. */ + long *indextable; + /* I/O handle stuff */ + int iotype; /* IO_FD or IO_HANDLE */ + /* Data for IO_FD. */ + int fd; + int my_fd; /* A descriptor that the wrapper code opened itself. */ + /* The actual callbacks from the outside. */ + ssize_t (*r_read) (int, void *, size_t); + long (*r_lseek)(int, long, int); + /* Data for IO_HANDLE. */ + void* handle; + ssize_t (*r_h_read)(void *, void *, size_t); + long (*r_h_lseek)(void*, long, int); + void (*h_cleanup)(void*); +}; + + +/* Cleanup I/O part of the handle handle... but not deleting the wrapper handle itself. + That is stored in the frame and only deleted on mpg123_delete(). */ +static void wrap_io_cleanup(void *handle) +{ + struct wrap_data *ioh = handle; + if(ioh->iotype == IO_HANDLE) + { + if(ioh->h_cleanup != NULL && ioh->handle != NULL) + ioh->h_cleanup(ioh->handle); + + ioh->handle = NULL; + } + if(ioh->my_fd >= 0) + { + close(ioh->my_fd); + ioh->my_fd = -1; + } +} + +/* Really finish off the handle... freeing all memory. */ +static void wrap_destroy(void *handle) +{ + struct wrap_data *wh = handle; + wrap_io_cleanup(handle); + if(wh->indextable != NULL) + free(wh->indextable); + + free(wh); +} + +/* More helper code... extract the special wrapper handle, possible allocate and initialize it. */ +static struct wrap_data* wrap_get(mpg123_handle *mh) +{ + struct wrap_data* whd; + if(mh == NULL) return NULL; + + /* Access the private storage inside the mpg123 handle. + The real callback functions and handles are stored there. */ + if(mh->wrapperdata == NULL) + { + /* Create a new one. */ + mh->wrapperdata = malloc(sizeof(struct wrap_data)); + if(mh->wrapperdata == NULL) + { + mh->err = MPG123_OUT_OF_MEM; + return NULL; + } + /* When we have wrapper data present, the callback for its proper cleanup is needed. */ + mh->wrapperclean = wrap_destroy; + + whd = mh->wrapperdata; + whd->indextable = NULL; + whd->iotype = 0; + whd->fd = -1; + whd->my_fd = -1; + whd->r_read = NULL; + whd->r_lseek = NULL; + whd->handle = NULL; + whd->r_h_read = NULL; + whd->r_h_lseek = NULL; + whd->h_cleanup = NULL; + } + else whd = mh->wrapperdata; + + return whd; +} + +/* After settling the data... start with some simple wrappers. */ + +#undef mpg123_decode_frame +/* int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes) */ +int attribute_align_arg mpg123_decode_frame(mpg123_handle *mh, long *num, unsigned char **audio, size_t *bytes) +{ + off_t largenum; + int err; + + err = MPG123_LARGENAME(mpg123_decode_frame)(mh, &largenum, audio, bytes); + if(err == MPG123_OK && num != NULL) + { + *num = largenum; + if(*num != largenum) + { + mh->err = MPG123_LFS_OVERFLOW; + err = MPG123_ERR; + } + } + return err; +} + +#undef mpg123_framebyframe_decode +/* int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes); */ +int attribute_align_arg mpg123_framebyframe_decode(mpg123_handle *mh, long *num, unsigned char **audio, size_t *bytes) +{ + off_t largenum; + int err; + + err = MPG123_LARGENAME(mpg123_framebyframe_decode)(mh, &largenum, audio, bytes); + if(err == MPG123_OK && num != NULL) + { + *num = largenum; + if(*num != largenum) + { + mh->err = MPG123_LFS_OVERFLOW; + err = MPG123_ERR; + } + } + return err; +} + +#undef mpg123_framepos +/* off_t mpg123_framepos(mpg123_handle *mh); */ +long attribute_align_arg mpg123_framepos(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_framepos)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_tell +/* off_t mpg123_tell(mpg123_handle *mh); */ +long attribute_align_arg mpg123_tell(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_tell)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_tellframe +/* off_t mpg123_tellframe(mpg123_handle *mh); */ +long attribute_align_arg mpg123_tellframe(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_tellframe)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_tell_stream +/* off_t mpg123_tell_stream(mpg123_handle *mh); */ +long attribute_align_arg mpg123_tell_stream(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_tell_stream)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_seek +/* off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence); */ +long attribute_align_arg mpg123_seek(mpg123_handle *mh, long sampleoff, int whence) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_seek)(mh, sampleoff, whence); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_feedseek +/* off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset); */ +long attribute_align_arg mpg123_feedseek(mpg123_handle *mh, long sampleoff, int whence, long *input_offset) +{ + long val; + off_t largeioff; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_feedseek)(mh, sampleoff, whence, &largeioff); + /* Error/message codes are small... */ + if(largeval < 0) return (long)largeval; + + val = largeval; + *input_offset = largeioff; + if(val != largeval || *input_offset != largeioff) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_seek_frame +/* off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence); */ +long attribute_align_arg mpg123_seek_frame(mpg123_handle *mh, long frameoff, int whence) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_seek_frame)(mh, frameoff, whence); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +#undef mpg123_timeframe +/* off_t mpg123_timeframe(mpg123_handle *mh, double sec); */ +long attribute_align_arg mpg123_timeframe(mpg123_handle *mh, double sec) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_timeframe)(mh, sec); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +/* Now something less simple: Index retrieval and manipulation. + The index is an _array_ of off_t, which means that I need to construct a copy with translated long values. */ +#undef mpg123_index +/* int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill) */ +int attribute_align_arg mpg123_index(mpg123_handle *mh, long **offsets, long *step, size_t *fill) +{ + int err; + size_t i; + long smallstep; + size_t thefill; + off_t largestep; + off_t *largeoffsets; + struct wrap_data *whd; + + whd = wrap_get(mh); + if(whd == NULL) return MPG123_ERR; + + err = MPG123_LARGENAME(mpg123_index)(mh, &largeoffsets, &largestep, &thefill); + if(err != MPG123_OK) return err; + + /* For a _very_ large file, even the step could overflow. */ + smallstep = largestep; + if(smallstep != largestep) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + if(step != NULL) *step = smallstep; + + /* When there are no values stored, there is no table content to take care of. + Table pointer does not matter. Mission completed. */ + if(thefill == 0) return MPG123_OK; + + if(fill != NULL) *fill = thefill; + + /* Construct a copy of the index to hand over to the small-minded client. */ + *offsets = safe_realloc(whd->indextable, (*fill)*sizeof(long)); + if(*offsets == NULL) + { + mh->err = MPG123_OUT_OF_MEM; + return MPG123_ERR; + } + whd->indextable = *offsets; + /* Elaborate conversion of each index value, with overflow check. */ + for(i=0; i<*fill; ++i) + { + whd->indextable[i] = largeoffsets[i]; + if(whd->indextable[i] != largeoffsets[i]) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + } + /* If we came that far... there should be a valid copy of the table now. */ + return MPG123_OK; +} + +/* The writing does basically the same than the above, just the opposite. + Oh, and the overflow checks are not needed -- off_t is bigger than long. */ +#undef mpg123_set_index +/* int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill); */ +int attribute_align_arg mpg123_set_index(mpg123_handle *mh, long *offsets, long step, size_t fill) +{ + int err; + size_t i; + struct wrap_data *whd; + off_t *indextmp; + + whd = wrap_get(mh); + if(whd == NULL) return MPG123_ERR; + + /* Expensive temporary storage... for staying outside at the API layer. */ + indextmp = malloc(fill*sizeof(off_t)); + if(indextmp == NULL) + { + mh->err = MPG123_OUT_OF_MEM; + return MPG123_ERR; + } + + if(fill > 0 && offsets == NULL) + { + mh->err = MPG123_BAD_INDEX_PAR; + err = MPG123_ERR; + } + else + { + /* Fill the large-file copy of the provided index, then feed it to mpg123. */ + for(i=0; ierr = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + + if(current_frame != NULL) *current_frame = small_curframe; + + if(frames_left != NULL) *frames_left = small_frameleft; + + + return MPG123_OK; +} + +#undef mpg123_length +/* off_t mpg123_length(mpg123_handle *mh); */ +long attribute_align_arg mpg123_length(mpg123_handle *mh) +{ + long val; + off_t largeval; + + largeval = MPG123_LARGENAME(mpg123_length)(mh); + val = largeval; + if(val != largeval) + { + mh->err = MPG123_LFS_OVERFLOW; + return MPG123_ERR; + } + return val; +} + +/* The simplest wrapper of all... */ +#undef mpg123_set_filesize +/* int mpg123_set_filesize(mpg123_handle *mh, off_t size); */ +int attribute_align_arg mpg123_set_filesize(mpg123_handle *mh, long size) +{ + return MPG123_LARGENAME(mpg123_set_filesize)(mh, size); +} + + +/* ========================================= + THE BOUNDARY OF SANITY + Behold, stranger! + ========================================= */ + + +/* + The messy part: Replacement of I/O core (actally, this is only due to lseek()). + Both descriptor and handle replaced I/O are mapped to replaced handle I/O, the handle wrapping over the actual callbacks and the actual handle/descriptor. + You got multiple levels of handles and callbacks to think about. Have fun reading and comprehending. +*/ + +/* Could go into compat.h ... Windows needs that flag. */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +/* Read callback needs nothing special. */ +ssize_t wrap_read(void* handle, void *buf, size_t count) +{ + struct wrap_data *ioh = handle; + switch(ioh->iotype) + { + case IO_FD: return ioh->r_read(ioh->fd, buf, count); + case IO_HANDLE: return ioh->r_h_read(ioh->handle, buf, count); + } + error("Serious breakage - bad IO type in LFS wrapper!"); + return -1; +} + +/* Seek callback needs protection from too big offsets. */ +off_t wrap_lseek(void *handle, off_t offset, int whence) +{ + struct wrap_data *ioh = handle; + long smalloff = offset; + if(smalloff == offset) + { + switch(ioh->iotype) + { + case IO_FD: return ioh->r_lseek(ioh->fd, smalloff, whence); + case IO_HANDLE: return ioh->r_h_lseek(ioh->handle, smalloff, whence); + } + error("Serious breakage - bad IO type in LFS wrapper!"); + return -1; + } + else + { + errno = EOVERFLOW; + return -1; + } +} + + +/* + Now, let's replace the API dealing with replacement I/O. + Start with undefining the renames... +*/ + +#undef mpg123_replace_reader +#undef mpg123_replace_reader_handle +#undef mpg123_open +#undef mpg123_open_fd +#undef mpg123_open_handle + + +/* Normal reader replacement needs fallback implementations. */ +static ssize_t fallback_read(int fd, void *buf, size_t count) +{ + return read(fd, buf, count); +} + +static long fallback_lseek(int fd, long offset, int whence) +{ + /* Since the offset is long int already, the returned value really should fit into a long... but whatever. */ + long newpos_long; + off_t newpos; + newpos = lseek(fd, offset, whence); + newpos_long = newpos; + if(newpos_long == newpos) + return newpos_long; + else + { + errno = EOVERFLOW; + return -1; + } +} + +/* Reader replacement prepares the hidden handle storage for next mpg123_open_fd() or plain mpg123_open(). */ +int attribute_align_arg mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), long (*r_lseek)(int, long, int) ) +{ + struct wrap_data* ioh; + + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + ioh = wrap_get(mh); + if(ioh == NULL) return MPG123_ERR; + + /* If both callbacks are NULL, switch totally to internal I/O, else just use fallback for at most half of them. */ + if(r_read == NULL && r_lseek == NULL) + { + /* Only the type is actually important to disable the code. */ + ioh->iotype = 0; + ioh->fd = -1; + ioh->r_read = NULL; + ioh->r_lseek = NULL; + } + else + { + ioh->iotype = IO_FD; + ioh->fd = -1; /* On next mpg123_open_fd(), this gets a value. */ + ioh->r_read = r_read != NULL ? r_read : fallback_read; + ioh->r_lseek = r_lseek != NULL ? r_lseek : fallback_lseek; + } + + /* The real reader replacement will happen while opening. */ + return MPG123_OK; +} + +int attribute_align_arg mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void*, void *, size_t), long (*r_lseek)(void*, long, int), void (*cleanup)(void*)) +{ + struct wrap_data* ioh; + + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + ioh = wrap_get(mh); + if(ioh == NULL) return MPG123_ERR; + + ioh->iotype = IO_HANDLE; + ioh->handle = NULL; + ioh->r_h_read = r_read; + ioh->r_h_lseek = r_lseek; + ioh->h_cleanup = cleanup; + + /* The real reader replacement will happen while opening. */ + return MPG123_OK; +} + +/* + The open routines always need to watch out for a prepared wrapper handle to use replaced normal I/O. + Two cases to consider: + 1. Plain normal open using internal I/O. + 2. Client called mpg123_replace_reader() before. + The second case needs hackery to activate the client I/O callbacks. For that, we create a custom I/O handle and use the guts of mpg123_open_fd() on it. +*/ +int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +{ + struct wrap_data* ioh; + + if(mh == NULL) return MPG123_ERR; + + ioh = mh->wrapperdata; + /* Mimic the use of mpg123_replace_reader() functions by lower levels... + IO_HANDLE is not valid here, though. Only IO_FD. */ + if(ioh != NULL && ioh->iotype == IO_FD) + { + int err; + err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup); + if(err != MPG123_OK) return MPG123_ERR; + + /* The above call implied mpg123_close() already */ + /* + I really need to open the file here... to be able to use the replacer handle I/O ... + my_fd is used to indicate closing of the descriptor on cleanup. + */ + ioh->my_fd = compat_open(path, O_RDONLY|O_BINARY); + if(ioh->my_fd < 0) + { + if(!(mh->p.flags & MPG123_QUIET)) error2("Cannot open file %s: %s", path, strerror(errno)); + + mh->err = MPG123_BAD_FILE; + return MPG123_ERR; + } + /* Store a copy of the descriptor where it is actually used. */ + ioh->fd = ioh->my_fd; + /* Initiate I/O operating on my handle now. */ + err = open_stream_handle(mh, ioh); + if(err != MPG123_OK) + { + wrap_io_cleanup(ioh); + return MPG123_ERR; + } + /* All fine... */ + return MPG123_OK; + } + else return MPG123_LARGENAME(mpg123_open)(mh, path); +} + +/* + This is in fact very similar to the above: + The open routines always need to watch out for a prepared wrapper handle to use replaced normal I/O. + Two cases to consider: + 1. Plain normal open_fd using internal I/O. + 2. Client called mpg123_replace_reader() before. + The second case needs hackery to activate the client I/O callbacks. For that, we create a custom I/O handle and use the guts of mpg123_open_fd() on it. +*/ + +int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd) +{ + struct wrap_data* ioh; + + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + ioh = mh->wrapperdata; + if(ioh != NULL && ioh->iotype == IO_FD) + { + int err; + err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup); + if(err != MPG123_OK) return MPG123_ERR; + + /* The above call implied mpg123_close() already */ + + /* Store the real file descriptor inside the handle. */ + ioh->fd = fd; + /* Initiate I/O operating on my handle now. */ + err = open_stream_handle(mh, ioh); + if(err != MPG123_OK) + { + wrap_io_cleanup(ioh); + return MPG123_ERR; + } + /* All fine... */ + return MPG123_OK; + } + else return MPG123_LARGENAME(mpg123_open_fd)(mh, fd); +} + +int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *handle) +{ + struct wrap_data* ioh; + + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + ioh = mh->wrapperdata; + if(ioh != NULL && ioh->iotype == IO_HANDLE && ioh->r_h_read != NULL) + { + /* Wrap the custom handle into my handle. */ + int err; + err = MPG123_LARGENAME(mpg123_replace_reader_handle)(mh, wrap_read, wrap_lseek, wrap_io_cleanup); + if(err != MPG123_OK) return MPG123_ERR; + + ioh->handle = handle; + /* No extra error handling, keep behaviour of the original open_handle. */ + return open_stream_handle(mh, ioh); + } + else + { + /* This is an error ... you need to prepare the I/O before using it. */ + mh->err = MPG123_BAD_CUSTOM_IO; + return MPG123_ERR; + } +} + diff --git a/node_modules/lame/deps/mpg123/src/libmpg123/libmpg123.c b/node_modules/lame/deps/mpg123/src/libmpg123/libmpg123.c new file mode 100644 index 0000000..59a8a8e --- /dev/null +++ b/node_modules/lame/deps/mpg123/src/libmpg123/libmpg123.c @@ -0,0 +1,1607 @@ +/* + libmpg123: MPEG Audio Decoder library + + copyright 1995-2012 by the mpg123 project - free software under the terms of the LGPL 2.1 + see COPYING and AUTHORS files in distribution or http://mpg123.org + +*/ + +#include "mpg123lib_intern.h" +#include "icy2utf8.h" +#include "debug.h" + +#include "gapless.h" + +#define SEEKFRAME(mh) ((mh)->ignoreframe < 0 ? 0 : (mh)->ignoreframe) + +static int initialized = 0; + +int attribute_align_arg mpg123_init(void) +{ + if((sizeof(short) != 2) || (sizeof(long) < 4)) return MPG123_BAD_TYPES; + + if(initialized) return MPG123_OK; /* no need to initialize twice */ + +#ifndef NO_LAYER12 + init_layer12(); /* inits also shared tables with layer1 */ +#endif +#ifndef NO_LAYER3 + init_layer3(); +#endif + prepare_decode_tables(); + check_decoders(); + initialized = 1; + return MPG123_OK; +} + +void attribute_align_arg mpg123_exit(void) +{ + /* nothing yet, but something later perhaps */ +} + +/* create a new handle with specified decoder, decoder can be "", "auto" or NULL for auto-detection */ +mpg123_handle attribute_align_arg *mpg123_new(const char* decoder, int *error) +{ + return mpg123_parnew(NULL, decoder, error); +} + +/* ...the full routine with optional initial parameters to override defaults. */ +mpg123_handle attribute_align_arg *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error) +{ + mpg123_handle *fr = NULL; + int err = MPG123_OK; + + if(initialized) fr = (mpg123_handle*) malloc(sizeof(mpg123_handle)); + else err = MPG123_NOT_INITIALIZED; + if(fr != NULL) + { + frame_init_par(fr, mp); + debug("cpu opt setting"); + if(frame_cpu_opt(fr, decoder) != 1) + { + err = MPG123_BAD_DECODER; + frame_exit(fr); + free(fr); + fr = NULL; + } + } + if(fr != NULL) + { + fr->decoder_change = 1; + } + else if(err == MPG123_OK) err = MPG123_OUT_OF_MEM; + + if(error != NULL) *error = err; + return fr; +} + +int attribute_align_arg mpg123_decoder(mpg123_handle *mh, const char* decoder) +{ + enum optdec dt = dectype(decoder); + + if(mh == NULL) return MPG123_ERR; + + if(dt == nodec) + { + mh->err = MPG123_BAD_DECODER; + return MPG123_ERR; + } + if(dt == mh->cpu_opts.type) return MPG123_OK; + + /* Now really change. */ + /* frame_exit(mh); + frame_init(mh); */ + debug("cpu opt setting"); + if(frame_cpu_opt(mh, decoder) != 1) + { + mh->err = MPG123_BAD_DECODER; + frame_exit(mh); + return MPG123_ERR; + } + /* New buffers for decoder are created in frame_buffers() */ + if((frame_outbuffer(mh) != 0)) + { + mh->err = MPG123_NO_BUFFERS; + frame_exit(mh); + return MPG123_ERR; + } + /* Do _not_ call decode_update here! That is only allowed after a first MPEG frame has been met. */ + mh->decoder_change = 1; + return MPG123_OK; +} + +int attribute_align_arg mpg123_param(mpg123_handle *mh, enum mpg123_parms key, long val, double fval) +{ + int r; + + if(mh == NULL) return MPG123_ERR; + r = mpg123_par(&mh->p, key, val, fval); + if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; } + else + { /* Special treatment for some settings. */ +#ifdef FRAME_INDEX + if(key == MPG123_INDEX_SIZE) + { /* Apply frame index size and grow property on the fly. */ + r = frame_index_setup(mh); + if(r != MPG123_OK) mh->err = MPG123_INDEX_FAIL; + } +#endif +#ifndef NO_FEEDER + /* Feeder pool size is applied right away, reader will react to that. */ + if(key == MPG123_FEEDPOOL || key == MPG123_FEEDBUFFER) + bc_poolsize(&mh->rdat.buffer, mh->p.feedpool, mh->p.feedbuffer); +#endif + } + return r; +} + +int attribute_align_arg mpg123_par(mpg123_pars *mp, enum mpg123_parms key, long val, double fval) +{ + int ret = MPG123_OK; + + if(mp == NULL) return MPG123_BAD_PARS; + switch(key) + { + case MPG123_VERBOSE: + mp->verbose = val; + break; + case MPG123_FLAGS: +#ifndef GAPLESS + if(val & MPG123_GAPLESS) ret = MPG123_NO_GAPLESS; +#endif + if(ret == MPG123_OK) mp->flags = val; + debug1("set flags to 0x%lx", (unsigned long) mp->flags); + break; + case MPG123_ADD_FLAGS: +#ifndef GAPLESS + /* Enabling of gapless mode doesn't work when it's not there, but disabling (below) is no problem. */ + if(val & MPG123_GAPLESS) ret = MPG123_NO_GAPLESS; + else +#endif + mp->flags |= val; + debug1("set flags to 0x%lx", (unsigned long) mp->flags); + break; + case MPG123_REMOVE_FLAGS: + mp->flags &= ~val; + debug1("set flags to 0x%lx", (unsigned long) mp->flags); + break; + case MPG123_FORCE_RATE: /* should this trigger something? */ +#ifdef NO_NTOM + if(val > 0) + ret = MPG123_BAD_RATE; +#else + if(val > 96000) ret = MPG123_BAD_RATE; + else mp->force_rate = val < 0 ? 0 : val; /* >0 means enable, 0 disable */ +#endif + break; + case MPG123_DOWN_SAMPLE: +#ifdef NO_DOWNSAMPLE + if(val != 0) ret = MPG123_BAD_RATE; +#else + if(val < 0 || val > 2) ret = MPG123_BAD_RATE; + else mp->down_sample = (int)val; +#endif + break; + case MPG123_RVA: + if(val < 0 || val > MPG123_RVA_MAX) ret = MPG123_BAD_RVA; + else mp->rva = (int)val; + break; + case MPG123_DOWNSPEED: + mp->halfspeed = val < 0 ? 0 : val; + break; + case MPG123_UPSPEED: + mp->doublespeed = val < 0 ? 0 : val; + break; + case MPG123_ICY_INTERVAL: +#ifndef NO_ICY + mp->icy_interval = val > 0 ? val : 0; +#else + if(val > 0) ret = MPG123_BAD_PARAM; +#endif + break; + case MPG123_OUTSCALE: + /* Choose the value that is non-zero, if any. + Downscaling integers to 1.0 . */ + mp->outscale = val == 0 ? fval : (double)val/SHORT_SCALE; + break; + case MPG123_TIMEOUT: +#ifdef TIMEOUT_READ + mp->timeout = val >= 0 ? val : 0; +#else + if(val > 0) ret = MPG123_NO_TIMEOUT; +#endif + break; + case MPG123_RESYNC_LIMIT: + mp->resync_limit = val; + break; + case MPG123_INDEX_SIZE: +#ifdef FRAME_INDEX + mp->index_size = val; +#else + ret = MPG123_NO_INDEX; +#endif + break; + case MPG123_PREFRAMES: + if(val >= 0) mp->preframes = val; + else ret = MPG123_BAD_VALUE; + break; + case MPG123_FEEDPOOL: +#ifndef NO_FEEDER + if(val >= 0) mp->feedpool = val; + else ret = MPG123_BAD_VALUE; +#else + ret = MPG123_MISSING_FEATURE; +#endif + break; + case MPG123_FEEDBUFFER: +#ifndef NO_FEEDER + if(val > 0) mp->feedbuffer = val; + else ret = MPG123_BAD_VALUE; +#else + ret = MPG123_MISSING_FEATURE; +#endif + break; + default: + ret = MPG123_BAD_PARAM; + } + return ret; +} + +int attribute_align_arg mpg123_getparam(mpg123_handle *mh, enum mpg123_parms key, long *val, double *fval) +{ + int r; + + if(mh == NULL) return MPG123_ERR; + r = mpg123_getpar(&mh->p, key, val, fval); + if(r != MPG123_OK){ mh->err = r; r = MPG123_ERR; } + return r; +} + +int attribute_align_arg mpg123_getpar(mpg123_pars *mp, enum mpg123_parms key, long *val, double *fval) +{ + int ret = 0; + + if(mp == NULL) return MPG123_BAD_PARS; + switch(key) + { + case MPG123_VERBOSE: + if(val) *val = mp->verbose; + break; + case MPG123_FLAGS: + case MPG123_ADD_FLAGS: + if(val) *val = mp->flags; + break; + case MPG123_FORCE_RATE: + if(val) +#ifdef NO_NTOM + *val = 0; +#else + *val = mp->force_rate; +#endif + break; + case MPG123_DOWN_SAMPLE: + if(val) *val = mp->down_sample; + break; + case MPG123_RVA: + if(val) *val = mp->rva; + break; + case MPG123_DOWNSPEED: + if(val) *val = mp->halfspeed; + break; + case MPG123_UPSPEED: + if(val) *val = mp->doublespeed; + break; + case MPG123_ICY_INTERVAL: +#ifndef NO_ICY + if(val) *val = (long)mp->icy_interval; +#else + if(val) *val = 0; +#endif + break; + case MPG123_OUTSCALE: + if(fval) *fval = mp->outscale; + if(val) *val = (long)(mp->outscale*SHORT_SCALE); + break; + case MPG123_RESYNC_LIMIT: + if(val) *val = mp->resync_limit; + break; + case MPG123_INDEX_SIZE: + if(val) +#ifdef FRAME_INDEX + *val = mp->index_size; +#else + *val = 0; /* graceful fallback: no index is index of zero size */ +#endif + break; + case MPG123_PREFRAMES: + *val = mp->preframes; + break; + case MPG123_FEEDPOOL: +#ifndef NO_FEEDER + *val = mp->feedpool; +#else + ret = MPG123_MISSING_FEATURE; +#endif + break; + case MPG123_FEEDBUFFER: +#ifndef NO_FEEDER + *val = mp->feedbuffer; +#else + ret = MPG123_MISSING_FEATURE; +#endif + break; + default: + ret = MPG123_BAD_PARAM; + } + return ret; +} + +int attribute_align_arg mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval) +{ + int ret = MPG123_OK; + long theval = 0; + double thefval = 0.; + + if(mh == NULL) return MPG123_ERR; + + switch(key) + { + case MPG123_ACCURATE: + theval = mh->state_flags & FRAME_ACCURATE; + break; + case MPG123_FRANKENSTEIN: + theval = mh->state_flags & FRAME_FRANKENSTEIN; + break; + case MPG123_BUFFERFILL: +#ifndef NO_FEEDER + { + size_t sval = bc_fill(&mh->rdat.buffer); + theval = (long)sval; + if((size_t)theval != sval) + { + mh->err = MPG123_INT_OVERFLOW; + ret = MPG123_ERR; + } + } +#else + mh->err = MPG123_MISSING_FEATURE; + ret = MPG123_ERR; +#endif + break; + default: + mh->err = MPG123_BAD_KEY; + ret = MPG123_ERR; + } + + if(val != NULL) *val = theval; + if(fval != NULL) *fval = thefval; + + return ret; +} + +int attribute_align_arg mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val) +{ + if(mh == NULL) return MPG123_ERR; + if(band < 0 || band > 31){ mh->err = MPG123_BAD_BAND; return MPG123_ERR; } + switch(channel) + { + case MPG123_LEFT|MPG123_RIGHT: + mh->equalizer[0][band] = mh->equalizer[1][band] = DOUBLE_TO_REAL(val); + break; + case MPG123_LEFT: mh->equalizer[0][band] = DOUBLE_TO_REAL(val); break; + case MPG123_RIGHT: mh->equalizer[1][band] = DOUBLE_TO_REAL(val); break; + default: + mh->err=MPG123_BAD_CHANNEL; + return MPG123_ERR; + } + mh->have_eq_settings = TRUE; + return MPG123_OK; +} + +double attribute_align_arg mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band) +{ + double ret = 0.; + + if(mh == NULL) return MPG123_ERR; + + /* Handle this gracefully. When there is no band, it has no volume. */ + if(band > -1 && band < 32) + switch(channel) + { + case MPG123_LEFT|MPG123_RIGHT: + ret = 0.5*(REAL_TO_DOUBLE(mh->equalizer[0][band])+REAL_TO_DOUBLE(mh->equalizer[1][band])); + break; + case MPG123_LEFT: ret = REAL_TO_DOUBLE(mh->equalizer[0][band]); break; + case MPG123_RIGHT: ret = REAL_TO_DOUBLE(mh->equalizer[1][band]); break; + /* Default case is already handled: ret = 0 */ + } + + return ret; +} + + +/* plain file access, no http! */ +int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +{ + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + return open_stream(mh, path, -1); +} + +int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd) +{ + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + return open_stream(mh, NULL, fd); +} + +int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *iohandle) +{ + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + if(mh->rdat.r_read_handle == NULL) + { + mh->err = MPG123_BAD_CUSTOM_IO; + return MPG123_ERR; + } + return open_stream_handle(mh, iohandle); +} + +int attribute_align_arg mpg123_open_feed(mpg123_handle *mh) +{ + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + return open_feed(mh); +} + +int attribute_align_arg mpg123_replace_reader( mpg123_handle *mh, + ssize_t (*r_read) (int, void *, size_t), + off_t (*r_lseek)(int, off_t, int) ) +{ + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + mh->rdat.r_read = r_read; + mh->rdat.r_lseek = r_lseek; + return MPG123_OK; +} + +int attribute_align_arg mpg123_replace_reader_handle( mpg123_handle *mh, + ssize_t (*r_read) (void*, void *, size_t), + off_t (*r_lseek)(void*, off_t, int), + void (*cleanup)(void*) ) +{ + if(mh == NULL) return MPG123_ERR; + + mpg123_close(mh); + mh->rdat.r_read_handle = r_read; + mh->rdat.r_lseek_handle = r_lseek; + mh->rdat.cleanup_handle = cleanup; + return MPG123_OK; +} + +/* Update decoding engine for + a) a new choice of decoder + b) a changed native format of the MPEG stream + ... calls are only valid after parsing some MPEG frame! */ +int decode_update(mpg123_handle *mh) +{ + long native_rate; + int b; + + if(mh->num < 0) + { + if(!(mh->p.flags & MPG123_QUIET)) error("decode_update() has been called before reading the first MPEG frame! Internal programming error."); + + mh->err = MPG123_BAD_DECODER_SETUP; + return MPG123_ERR; + } + + native_rate = frame_freq(mh); + + b = frame_output_format(mh); /* Select the new output format based on given constraints. */ + if(b < 0) return MPG123_ERR; + + if(b == 1) mh->new_format = 1; /* Store for later... */ + + debug3("updating decoder structure with native rate %li and af.rate %li (new format: %i)", native_rate, mh->af.rate, mh->new_format); + if(mh->af.rate == native_rate) mh->down_sample = 0; + else if(mh->af.rate == native_rate>>1) mh->down_sample = 1; + else if(mh->af.rate == native_rate>>2) mh->down_sample = 2; + else mh->down_sample = 3; /* flexible (fixed) rate */ + switch(mh->down_sample) + { + case 0: + case 1: + case 2: + mh->down_sample_sblimit = SBLIMIT>>(mh->down_sample); + /* With downsampling I get less samples per frame */ + mh->outblock = samples_to_storage(mh, (spf(mh)>>mh->down_sample)); + break; +#ifndef NO_NTOM + case 3: + { + if(synth_ntom_set_step(mh) != 0) return -1; + if(frame_freq(mh) > mh->af.rate) + { + mh->down_sample_sblimit = SBLIMIT * mh->af.rate; + mh->down_sample_sblimit /= frame_freq(mh); + } + else mh->down_sample_sblimit = SBLIMIT; + mh->outblock = samples_to_storage(mh, + ( ( NTOM_MUL-1+spf(mh) + * (((size_t)NTOM_MUL*mh->af.rate)/frame_freq(mh)) + )/NTOM_MUL )); + } + break; +#endif + } + + if(!(mh->p.flags & MPG123_FORCE_MONO)) + { + if(mh->af.channels == 1) mh->single = SINGLE_MIX; + else mh->single = SINGLE_STEREO; + } + else mh->single = (mh->p.flags & MPG123_FORCE_MONO)-1; + if(set_synth_functions(mh) != 0) return -1;; + + /* The needed size of output buffer may have changed. */ + if(frame_outbuffer(mh) != MPG123_OK) return -1; + + do_rva(mh); + debug3("done updating decoder structure with native rate %li and af.rate %li and down_sample %i", frame_freq(mh), mh->af.rate, mh->down_sample); + + return 0; +} + +size_t attribute_align_arg mpg123_safe_buffer(void) +{ + /* real is the largest possible output (it's 32bit float, 32bit int or 64bit double). */ + return sizeof(real)*2*1152*NTOM_MAX; +} + +size_t attribute_align_arg mpg123_outblock(mpg123_handle *mh) +{ + /* Try to be helpful and never return zero output block size. */ + if(mh != NULL && mh->outblock > 0) return mh->outblock; + else return mpg123_safe_buffer(); +} + +/* Read in the next frame we actually want for decoding. + This includes skipping/ignoring frames, in additon to skipping junk in the parser. */ +static int get_next_frame(mpg123_handle *mh) +{ + /* We have some decoder ready, if the desired decoder has changed, + it is OK to use the old one for ignoring frames and activating + the new one for real (decode_update()) after getting the frame. */ + int change = mh->decoder_change; + do + { + int b; + /* Decode & discard some frame(s) before beginning. */ + if(mh->to_ignore && mh->num < mh->firstframe && mh->num >= mh->ignoreframe) + { + debug1("ignoring frame %li", (long)mh->num); + /* Decoder structure must be current! decode_update has been called before... */ + (mh->do_layer)(mh); mh->buffer.fill = 0; +#ifndef NO_NTOM + /* The ignored decoding may have failed. Make sure ntom stays consistent. */ + if(mh->down_sample == 3) ntom_set_ntom(mh, mh->num+1); +#endif + mh->to_ignore = mh->to_decode = FALSE; + } + /* Read new frame data; possibly breaking out here for MPG123_NEED_MORE. */ + debug("read frame"); + mh->to_decode = FALSE; + b = read_frame(mh); /* That sets to_decode only if a full frame was read. */ + debug4("read of frame %li returned %i (to_decode=%i) at sample %li", (long)mh->num, b, mh->to_decode, (long)mpg123_tell(mh)); + if(b == MPG123_NEED_MORE) return MPG123_NEED_MORE; /* need another call with data */ + else if(b <= 0) + { + /* More sophisticated error control? */ + if(b==0 || (mh->rdat.filelen >= 0 && mh->rdat.filepos == mh->rdat.filelen)) + { /* We simply reached the end. */ + mh->track_frames = mh->num + 1; + debug("What about updating/checking gapless sample count here?"); + return MPG123_DONE; + } + else return MPG123_ERR; /* Some real error. */ + } + /* Now, there should be new data to decode ... and also possibly new stream properties */ + if(mh->header_change > 1) + { + debug("big header change"); + change = 1; + } + /* Now some accounting: Look at the numbers and decide if we want this frame. */ + ++mh->playnum; + /* Plain skipping without decoding, only when frame is not ignored on next cycle. */ + if(mh->num < mh->firstframe || (mh->p.doublespeed && (mh->playnum % mh->p.doublespeed))) + { + if(!(mh->to_ignore && mh->num < mh->firstframe && mh->num >= mh->ignoreframe)) + { + frame_skip(mh); + /* Should one fix NtoM here or not? + It is not work the trouble for doublespeed, but what with leading frames? */ + } + } + /* Or, we are finally done and have a new frame. */ + else break; + } while(1); + + /* If we reach this point, we got a new frame ready to be decoded. + All other situations resulted in returns from the loop. */ + if(change) + { + if(decode_update(mh) < 0) /* dito... */ + return MPG123_ERR; + +debug1("new format: %i", mh->new_format); + + mh->decoder_change = 0; + if(mh->fresh) + { +#ifdef GAPLESS + int b=0; + /* Prepare offsets for gapless decoding. */ + debug1("preparing gapless stuff with native rate %li", frame_freq(mh)); + frame_gapless_realinit(mh); + frame_set_frameseek(mh, mh->num); +#endif + mh->fresh = 0; +#ifdef GAPLESS + /* Could this possibly happen? With a real big gapless offset... */ + if(mh->num < mh->firstframe) b = get_next_frame(mh); + if(b < 0) return b; /* Could be error, need for more, new format... */ +#endif + } + } + return MPG123_OK; +} + +/* Assumption: A buffer full of zero samples can be constructed by repetition of this byte. + Oh, and it handles some format conversion. + Only to be used by decode_the_frame() ... */ +static int zero_byte(mpg123_handle *fr) +{ +#ifndef NO_8BIT + return fr->af.encoding & MPG123_ENC_8 ? fr->conv16to8[0] : 0; +#else + return 0; /* All normal signed formats have the zero here (even in byte form -- that may be an assumption for your funny machine...). */ +#endif +} + +/* + Not part of the api. This just decodes the frame and fills missing bits with zeroes. + There can be frames that are broken and thus make do_layer() fail. +*/ +static void decode_the_frame(mpg123_handle *fr) +{ + size_t needed_bytes = samples_to_storage(fr, frame_expect_outsamples(fr)); + fr->clip += (fr->do_layer)(fr); + /*fprintf(stderr, "frame %"OFF_P": got %"SIZE_P" / %"SIZE_P"\n", fr->num,(size_p)fr->buffer.fill, (size_p)needed_bytes);*/ + /* There could be less data than promised. + Also, then debugging, we look out for coding errors that could result in _more_ data than expected. */ +#ifdef DEBUG + if(fr->buffer.fill != needed_bytes) + { +#endif + if(fr->buffer.fill < needed_bytes) + { + if(VERBOSE2) + fprintf(stderr, "Note: broken frame %li, filling up with %"SIZE_P" zeroes, from %"SIZE_P"\n", (long)fr->num, (size_p)(needed_bytes-fr->buffer.fill), (size_p)fr->buffer.fill); + + /* + One could do a loop with individual samples instead... but zero is zero + Actually, that is wrong: zero is mostly a series of null bytes, + but we have funny 8bit formats that have a different opinion on zero... + Unsigned 16 or 32 bit formats are handled later. + */ + memset( fr->buffer.data + fr->buffer.fill, zero_byte(fr), needed_bytes - fr->buffer.fill ); + + fr->buffer.fill = needed_bytes; +#ifndef NO_NTOM + /* ntom_val will be wrong when the decoding wasn't carried out completely */ + ntom_set_ntom(fr, fr->num+1); +#endif + } +#ifdef DEBUG + else + { + if(NOQUIET) + error2("I got _more_ bytes than expected (%"SIZE_P" / %"SIZE_P"), that should not be possible!", (size_p)fr->buffer.fill, (size_p)needed_bytes); + } + } +#endif + postprocess_buffer(fr); +} + +/* + Decode the current frame into the frame structure's buffer, accessible at the location stored in