Compare commits
224 Commits
Author | SHA1 | Date | |
---|---|---|---|
f4f560b164 | |||
14b7f9237b | |||
f3518b3d0f | |||
7964524e0a | |||
8ab8335baa | |||
cd43bf9dfa | |||
ccebf831e7 | |||
9f2f9bd8b0 | |||
adf8c14536 | |||
606e82d718 | |||
1621f1753a | |||
196ab66e14 | |||
38ab32dad9 | |||
86046e52f0 | |||
9e7c860414 | |||
7dc8b86ee2 | |||
6ecbfe3de6 | |||
f9940fc436 | |||
58e75ee276 | |||
e7771f539d | |||
c2f62cd8e0 | |||
f4b6812675 | |||
03e4b37c04 | |||
7b3a9e0f63 | |||
067f546580 | |||
2f7697b7ec | |||
1d214f89ed | |||
0b47207949 | |||
94dd573a81 | |||
6fa4896155 | |||
28c99f9d8b | |||
88fbb5f73b | |||
402c185dd4 | |||
ae2015a604 | |||
023731fc3f | |||
99998aac8a | |||
360d0bc110 | |||
817838e522 | |||
deb3cfb4b6 | |||
af61519632 | |||
b1714cf554 | |||
f0984b19f2 | |||
eb3c9cd6f3 | |||
e677b0ac3c | |||
dd909bfe53 | |||
b13b111614 | |||
5511530926 | |||
5e1ef01bc0 | |||
a060eadab7 | |||
70db31bb8f | |||
1292775a75 | |||
0fbc84d364 | |||
0dd0b835ec | |||
d96e0a7497 | |||
625504b8eb | |||
a185ded47e | |||
5a0c77d06a | |||
e54bd316d5 | |||
f908b45cc7 | |||
d02751ee08 | |||
13ab9786f7 | |||
ba13a08e78 | |||
8c92a5ff7b | |||
37f728835b | |||
a6f1eaa09e | |||
dff8eca16e | |||
a3cca9aae6 | |||
edabd7735c | |||
461e7b7d5a | |||
06ea8d4781 | |||
62ef0bcb42 | |||
a0043ec49f | |||
305f5232e7 | |||
d467c4dd8a | |||
5b2ace80d4 | |||
1484a87cad | |||
b23bc0b16b | |||
a6c8dd846c | |||
5fff3b8161 | |||
b4236d0ec0 | |||
5e8cd12760 | |||
699438602c | |||
52aa6eed0d | |||
6cdf207dcd | |||
607e9ef71b | |||
367c489fc3 | |||
b3c9ad2fcb | |||
ee9cb63327 | |||
889773c38d | |||
b83704a218 | |||
dfe5d51d04 | |||
280dee0438 | |||
aa10ab69f6 | |||
6ef14d985d | |||
61a3226e14 | |||
f9c370212b | |||
021f3ad5bc | |||
8bdc27bf5c | |||
00eb5222f8 | |||
d06f490cc2 | |||
b087a09d37 | |||
4cedc54d2d | |||
8fe7adc50e | |||
bf5236e68b | |||
da1d686705 | |||
2ce5bc73d5 | |||
c6ae9313cc | |||
8f3883563f | |||
950273da41 | |||
391da742fd | |||
4414676076 | |||
0da45b7b40 | |||
7e02cb90f6 | |||
01ba90fdba | |||
b394140f9e | |||
4a1d136721 | |||
ab3009f771 | |||
bf340f3de4 | |||
68f5827dee | |||
b695a4ba3b | |||
d84ab2734e | |||
4f0cc793c7 | |||
b7a4ac22b2 | |||
5db9acae1d | |||
c299c1432c | |||
d8551ab732 | |||
25bc1279c2 | |||
f6d9d23456 | |||
b20d95d616 | |||
071c2f1c20 | |||
566d00f0df | |||
0550aa4e98 | |||
baf69355a5 | |||
17c0266998 | |||
14a2207064 | |||
7c721fc6eb | |||
ab03692a4c | |||
626fa4f27b | |||
15676e0f4f | |||
8709ce8ad5 | |||
bb924d79d6 | |||
8e075e33d9 | |||
b0b002104a | |||
43d1f34fa3 | |||
6db1a097aa | |||
6dae2f0749 | |||
dc87c26b99 | |||
234d597083 | |||
b74c347c7c | |||
996996e609 | |||
cd9050f61f | |||
b70b309977 | |||
ee510f3f3f | |||
8a70b8ea3e | |||
27ee73bb89 | |||
3aeb47e447 | |||
b9ceb30ecf | |||
5b6ee20b2d | |||
d062ec0dfe | |||
d5a0daa0d3 | |||
8c4ec71e26 | |||
1e5aa0ba93 | |||
0326a1f8cc | |||
8311404a09 | |||
c81111c2cf | |||
e499be12ae | |||
e785f7f10a | |||
c3da10bef6 | |||
c8c8cb305e | |||
efdd046ef8 | |||
496eefd2ee | |||
9da79b3a21 | |||
1b2b0970fb | |||
0bb45a7fa8 | |||
15a25a41aa | |||
76b6ff78cd | |||
5285b3f222 | |||
0c993c251b | |||
b3a1f17452 | |||
11929e8c68 | |||
fc9a081250 | |||
2583221117 | |||
a69e551968 | |||
8bd0027e71 | |||
84eaa3e2fd | |||
a57916b3db | |||
87e769786a | |||
05a7e941cf | |||
ed307e6b3b | |||
e8aa957209 | |||
a39f820ff1 | |||
1c621a602f | |||
7169f4a6cb | |||
e202c1a40e | |||
0f4b4da0aa | |||
1f96413bd3 | |||
9695621c91 | |||
2d67f5ead6 | |||
29d2a45abc | |||
13c8b05f9a | |||
2c1a5359c6 | |||
d8530f228e | |||
575f6c2f0a | |||
62cdc592c0 | |||
11373faf23 | |||
0473eec0a2 | |||
7fc23dc085 | |||
c741cc06b2 | |||
39dbfdec82 | |||
0e5d6056e4 | |||
d711993b3b | |||
615bf7fe43 | |||
424b9b5a2f | |||
d1e494b730 | |||
623e4b8fff | |||
b5dd1f2f86 | |||
ec83f9c747 | |||
31af27529e | |||
6302565942 | |||
cda724b2da | |||
c2e2ba2a40 | |||
b5d3f5faa7 | |||
71f3910055 | |||
70ed8c3b32 |
GNUmakefileMakefileREADME.md.gitignoreCITATION.cffChangeLogMakefile.amMakefile.inappveyor.ymlazure-pipelines.ymlconfigureconfigure.acAUTHORSCMakeLists.txtChangeLogconfigure.ac
apps
api.json
api
blog.jsonblog
gg.jsongg
issues.jsonissues
journal.jsonjournal
app.jscommonmark.min.jsindex.htmllit-all.min.jslit-all.min.js.maptf-id-picker.jstf-journal-app.jstf-journal-entry.js
sneaker
ssb.jsonssb
app.jsfilesaver.min.js.maplit-all.min.jslit-all.min.js.maptf-app.jstf-id-picker.jstf-message.jstf-profile.jstf-tab-news-feed.js
welcome.jsonwelcome
app.jsbrands.min.cssfa-brands-400.ttffa-brands-400.woff2fa-regular-400.ttffa-regular-400.woff2fa-solid-900.ttffa-solid-900.woff2fontawesome.min.cssindex.htmlregular.min.csssolid.min.cssssb.pngtildefriends.pngw3.css
wiki.jsonwiki
core
deps
codemirror
annotatescrollbar.min.jscodemirror.min.jscss.min.jsdialog.min.jshtmlmixed.min.jsjavascript.min.jsjshint.jsjshint.min.jssearch.min.jssearchcursor.min.jsupdate.shxml.min.js
libbacktrace
libsodium
.github
workflows
build-aux
build.zigbuilds
ci
appveyor
contrib
dist-build
Makefile.amMakefile.inandroid-aar.shandroid-arm.shandroid-mips32.shandroid-mips64.shapple-xcframework.shemscripten-symbols.defemscripten.shgenerate-emscripten-symbols.shios.shmacos.shmsys2-win32.shmsys2-win64.shosx.shwatchos.sh
libsodium.vcxprojlibsodium.vcxproj.filtersm4
ax_add_fortify_source.m4ax_check_catchable_segv.m4ax_check_define.m4ax_check_gnu_make.m4ax_pthread.m4
msvc-scripts
packaging
regen-msvc
src
Makefile.in
libsodium
Makefile.amMakefile.in
crypto_aead
aegis128l
aead_aegis128l.caegis128l_aesni.caegis128l_aesni.haegis128l_armcrypto.caegis128l_armcrypto.haegis128l_common.haegis128l_soft.caegis128l_soft.himplementations.h
aegis256
aead_aegis256.caegis256_aesni.caegis256_aesni.haegis256_armcrypto.caegis256_armcrypto.haegis256_common.haegis256_soft.caegis256_soft.himplementations.h
aes256gcm
chacha20poly1305
xchacha20poly1305
crypto_core
crypto_generichash
crypto_hash
crypto_kdf
crypto_onetimeauth
poly1305
crypto_pwhash
crypto_scalarmult
curve25519
crypto_sign
crypto_stream
salsa20
crypto_verify
include
Makefile.amMakefile.insodium.h
sodium
randombytes
sodium
test
Makefile.in
default
Makefile.amMakefile.inaead_aegis128l.caead_aegis128l.expaead_aegis256.caead_aegis256.expaead_aes256gcm.ccore_ed25519.ccore_ed25519.expkdf.ckdf_hkdf.ckdf_hkdf.expsecretstream.csecretstream_xchacha20poly1305.csecretstream_xchacha20poly1305.expsodium_core.csodium_utils2.csodium_utils3.cwasi-test-wrapper.shwintest.bat
libuv
.github
workflows
docs
include
src
test
benchmark-async-pummel.cbenchmark-async.cbenchmark-getaddrinfo.cbenchmark-loop-count.cbenchmark-million-async.cbenchmark-million-timers.cbenchmark-multi-accept.cbenchmark-ping-pongs.cbenchmark-ping-udp.cbenchmark-pound.cbenchmark-pump.cbenchmark-queue-work.cbenchmark-spawn.cbenchmark-tcp-write-batch.cbenchmark-thread.cbenchmark-udp-pummel.cblackhole-server.cecho-server.crun-tests.crunner-win.ctask.htest-active.ctest-async-null-cb.ctest-async.ctest-barrier.ctest-callback-stack.ctest-close-fd.ctest-close-order.ctest-condvar.ctest-connect-unspecified.ctest-connection-fail.ctest-cwd-and-chdir.ctest-default-loop-close.ctest-delayed-accept.ctest-dlerror.ctest-eintr-handling.ctest-embed.ctest-emfile.ctest-env-vars.ctest-error.ctest-fork.ctest-fs-copyfile.ctest-fs-event.ctest-fs-fd-hash.ctest-fs-open-flags.ctest-fs-poll.ctest-fs-readdir.ctest-fs.ctest-get-currentexe.ctest-get-loadavg.ctest-get-memory.ctest-get-passwd.ctest-getaddrinfo.ctest-gethostname.ctest-getnameinfo.ctest-getsockname.ctest-getters-setters.ctest-gettimeofday.ctest-handle-fileno.ctest-homedir.ctest-hrtime.ctest-idle.ctest-idna.ctest-ip-name.ctest-ip4-addr.ctest-ip6-addr.ctest-ipc-heavy-traffic-deadlock-bug.ctest-ipc-send-recv.ctest-ipc.ctest-list.htest-loop-alive.ctest-loop-close.ctest-loop-configure.ctest-loop-handles.ctest-loop-stop.ctest-loop-time.ctest-metrics.ctest-multiple-listen.ctest-mutexes.ctest-not-readable-nor-writable-on-read-error.ctest-not-writable-after-shutdown.ctest-osx-select.ctest-ping-pong.ctest-pipe-bind-error.ctest-pipe-close-stdout-read-stdin.ctest-pipe-connect-error.ctest-pipe-connect-multiple.ctest-pipe-connect-prepare.ctest-pipe-getsockname.ctest-pipe-pending-instances.ctest-pipe-sendmsg.ctest-pipe-server-close.ctest-pipe-set-fchmod.ctest-pipe-set-non-blocking.ctest-platform-output.ctest-poll-close-doesnt-corrupt-stack.ctest-poll-close.ctest-poll-closesocket.ctest-poll-multiple-handles.ctest-poll-oob.ctest-poll.ctest-process-priority.ctest-process-title-threadsafe.ctest-process-title.ctest-queue-foreach-delete.ctest-random.ctest-readable-on-eof.ctest-ref.ctest-run-nowait.ctest-run-once.ctest-semaphore.ctest-shutdown-close.ctest-shutdown-eof.ctest-shutdown-simultaneous.ctest-shutdown-twice.ctest-signal-multiple-loops.ctest-signal-pending-on-close.ctest-signal.ctest-socket-buffer-size.ctest-spawn.ctest-stdio-over-pipes.ctest-strscpy.ctest-strtok.ctest-tcp-alloc-cb-fail.ctest-tcp-bind-error.ctest-tcp-bind6-error.ctest-tcp-close-accept.ctest-tcp-close-after-read-timeout.ctest-tcp-close-reset.ctest-tcp-close-while-connecting.ctest-tcp-close.ctest-tcp-connect-error-after-write.ctest-tcp-connect-error.ctest-tcp-connect-timeout.ctest-tcp-connect6-error.ctest-tcp-create-socket-early.ctest-tcp-flags.ctest-tcp-oob.ctest-tcp-open.ctest-tcp-read-stop-start.ctest-tcp-read-stop.ctest-tcp-rst.ctest-tcp-shutdown-after-write.ctest-tcp-try-write-error.ctest-tcp-try-write.ctest-tcp-unexpected-read.ctest-tcp-write-after-connect.ctest-tcp-write-fail.ctest-tcp-write-in-a-row.ctest-tcp-write-queue-order.ctest-tcp-write-to-half-open-connection.ctest-tcp-writealot.ctest-thread-affinity.ctest-thread-equal.ctest-thread.ctest-threadpool-cancel.ctest-threadpool.ctest-timer-again.ctest-timer-from-check.ctest-timer.ctest-tmpdir.ctest-tty-duplicate-key.ctest-tty-escape-sequence-processing.ctest-tty.ctest-udp-alloc-cb-fail.ctest-udp-bind.ctest-udp-connect.ctest-udp-connect6.ctest-udp-create-socket-early.ctest-udp-dgram-too-big.ctest-udp-ipv6.ctest-udp-mmsg.ctest-udp-multicast-interface.ctest-udp-multicast-interface6.ctest-udp-multicast-join.ctest-udp-multicast-join6.ctest-udp-multicast-ttl.ctest-udp-open.ctest-udp-options.ctest-udp-recv-in-a-row.ctest-udp-send-and-recv.ctest-udp-send-hang-loop.ctest-udp-send-immediate.ctest-udp-send-unreachable.ctest-udp-sendmmsg-error.ctest-udp-try-send.ctest-uname.ctest-walk-handles.ctest-watcher-cross-stop.c
lit
openssl
android
arm64-v8a
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm3.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hbio_addr.hbio_tfo.hcommon.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdeterministic_nonce.hdso.hdsoerr.he_os.hendian.herr.hevent_queue.hffc.hhpke_util.hktls.hlist.hnamemap.hnelem.hnumbers.ho_dir.ho_str.hpacket.hpacket_quic.hparam_build_set.hparam_names.hparam_names.h.inparams.hpassphrase.hpriority_queue.hproperty.hpropertyerr.hprovider.hquic_ackm.hquic_cc.hquic_cfq.hquic_channel.hquic_demux.hquic_error.hquic_fc.hquic_fifd.hquic_reactor.hquic_record_rx.hquic_record_tx.hquic_record_util.hquic_rx_depack.hquic_sf_list.hquic_ssl.hquic_statm.hquic_stream.hquic_stream_map.hquic_thread_assist.hquic_tls.hquic_tserver.hquic_txp.hquic_txpim.hquic_types.hquic_vlint.hquic_wire.hquic_wire_pkt.hrecordmethod.hrefcount.hring_buf.hsafe_math.hsha3.hsizes.hsm3.hsockets.hssl.hssl3_cbc.hsslconf.hstatem.hsymhacks.hthread.hthread_arch.hthread_once.htime.htlsgroups.htsan_assist.huint_set.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_names.h.incore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.he_ostime.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhpke.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslconf.h.inopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hquic.hrand.hrand_drbg.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.hthread.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
lib
armeabi-v7a
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hbio_addr.hbio_tfo.hcommon.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdeterministic_nonce.hdso.hdsoerr.he_os.hendian.herr.hevent_queue.hffc.hhpke_util.hktls.hlist.hnamemap.hnelem.hnumbers.ho_dir.hpacket.hpacket_quic.hparam_build_set.hparam_names.hparam_names.h.inparams.hpassphrase.hpriority_queue.hproperty.hpropertyerr.hprovider.hquic_ackm.hquic_cc.hquic_cfq.hquic_channel.hquic_demux.hquic_error.hquic_fc.hquic_fifd.hquic_reactor.hquic_record_rx.hquic_record_tx.hquic_record_util.hquic_rx_depack.hquic_sf_list.hquic_ssl.hquic_statm.hquic_stream.hquic_stream_map.hquic_thread_assist.hquic_tls.hquic_tserver.hquic_txp.hquic_txpim.hquic_types.hquic_vlint.hquic_wire.hquic_wire_pkt.hrecordmethod.hrefcount.hring_buf.hsafe_math.hsha3.hsizes.hsm3.hsockets.hssl.hssl3_cbc.hsslconf.hstatem.hsymhacks.hthread.hthread_arch.hthread_once.htime.htlsgroups.htsan_assist.huint_set.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_names.h.incore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.he_ostime.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhpke.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hquic.hrand.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.hthread.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
x86
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hbio_addr.hbio_tfo.hcommon.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdeterministic_nonce.hdso.hdsoerr.he_os.hendian.herr.hevent_queue.hffc.hhpke_util.hktls.hlist.hnamemap.hnelem.hnumbers.ho_dir.hpacket.hpacket_quic.hparam_build_set.hparam_names.hparam_names.h.inparams.hpassphrase.hpriority_queue.hproperty.hpropertyerr.hprovider.hquic_ackm.hquic_cc.hquic_cfq.hquic_channel.hquic_demux.hquic_error.hquic_fc.hquic_fifd.hquic_reactor.hquic_record_rx.hquic_record_tx.hquic_record_util.hquic_rx_depack.hquic_sf_list.hquic_ssl.hquic_statm.hquic_stream.hquic_stream_map.hquic_thread_assist.hquic_tls.hquic_tserver.hquic_txp.hquic_txpim.hquic_types.hquic_vlint.hquic_wire.hquic_wire_pkt.hrecordmethod.hrefcount.hring_buf.hsafe_math.hsha3.hsizes.hsm3.hsockets.hssl.hssl3_cbc.hsslconf.hstatem.hsymhacks.hthread.hthread_arch.hthread_once.htime.htlsgroups.htsan_assist.huint_set.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_names.h.incore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.he_ostime.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhpke.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hquic.hrand.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.hthread.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
x86_64
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm3.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hbio_addr.hbio_tfo.hcommon.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdeterministic_nonce.hdso.hdsoerr.he_os.hendian.herr.hevent_queue.hffc.hhpke_util.hktls.hlist.hnamemap.hnelem.hnumbers.ho_dir.ho_str.hpacket.hpacket_quic.hparam_build_set.hparam_names.hparam_names.h.inparams.hpassphrase.hpriority_queue.hproperty.hpropertyerr.hprovider.hquic_ackm.hquic_cc.hquic_cfq.hquic_channel.hquic_demux.hquic_error.hquic_fc.hquic_fifd.hquic_reactor.hquic_record_rx.hquic_record_tx.hquic_record_util.hquic_rx_depack.hquic_sf_list.hquic_ssl.hquic_statm.hquic_stream.hquic_stream_map.hquic_thread_assist.hquic_tls.hquic_tserver.hquic_txp.hquic_txpim.hquic_types.hquic_vlint.hquic_wire.hquic_wire_pkt.hrecordmethod.hrefcount.hring_buf.hsafe_math.hsha3.hsizes.hsm3.hsockets.hssl.hssl3_cbc.hsslconf.hstatem.hsymhacks.hthread.hthread_arch.hthread_once.htime.htlsgroups.htsan_assist.huint_set.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_names.h.incore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.he_ostime.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhpke.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslconf.h.inopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hquic.hrand.hrand_drbg.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.hthread.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
lib
ios
ios64-xcrun
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hbio_addr.hbio_tfo.hcommon.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdeterministic_nonce.hdso.hdsoerr.he_os.hendian.herr.hevent_queue.hffc.hhpke_util.hktls.hlist.hnamemap.hnelem.hnumbers.ho_dir.hpacket.hpacket_quic.hparam_build_set.hparam_names.hparam_names.h.inparams.hpassphrase.hpriority_queue.hproperty.hpropertyerr.hprovider.hquic_ackm.hquic_cc.hquic_cfq.hquic_channel.hquic_demux.hquic_error.hquic_fc.hquic_fifd.hquic_reactor.hquic_record_rx.hquic_record_tx.hquic_record_util.hquic_rx_depack.hquic_sf_list.hquic_ssl.hquic_statm.hquic_stream.hquic_stream_map.hquic_thread_assist.hquic_tls.hquic_tserver.hquic_txp.hquic_txpim.hquic_types.hquic_vlint.hquic_wire.hquic_wire_pkt.hrecordmethod.hrefcount.hring_buf.hsafe_math.hsha3.hsizes.hsm3.hsockets.hssl.hssl3_cbc.hsslconf.hstatem.hsymhacks.hthread.hthread_arch.hthread_once.htime.htlsgroups.htsan_assist.huint_set.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_names.h.incore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.he_ostime.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhpke.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hquic.hrand.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.hthread.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
lib
iossimulator-xcrun
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hbio_addr.hbio_tfo.hcommon.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdeterministic_nonce.hdso.hdsoerr.he_os.hendian.herr.hevent_queue.hffc.hhpke_util.hktls.hlist.hnamemap.hnelem.hnumbers.ho_dir.hpacket.hpacket_quic.hparam_build_set.hparam_names.hparam_names.h.inparams.hpassphrase.hpriority_queue.hproperty.hpropertyerr.hprovider.hquic_ackm.hquic_cc.hquic_cfq.hquic_channel.hquic_demux.hquic_error.hquic_fc.hquic_fifd.hquic_reactor.hquic_record_rx.hquic_record_tx.hquic_record_util.hquic_rx_depack.hquic_sf_list.hquic_ssl.hquic_statm.hquic_stream.hquic_stream_map.hquic_thread_assist.hquic_tls.hquic_tserver.hquic_txp.hquic_txpim.hquic_types.hquic_vlint.hquic_wire.hquic_wire_pkt.hrecordmethod.hrefcount.hring_buf.hsafe_math.hsha3.hsizes.hsm3.hsockets.hssl.hssl3_cbc.hsslconf.hstatem.hsymhacks.hthread.hthread_arch.hthread_once.htime.htlsgroups.htsan_assist.huint_set.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_names.h.incore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.he_ostime.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhpke.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hquic.hrand.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.hthread.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
mingw64
bin
include
openssl
aes.hasn1.hasn1_mac.hasn1err.hasn1t.hasync.hasyncerr.hbio.hbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcms.hcmserr.hcomp.hcomperr.hconf.hconf_api.hconferr.hcrypto.hcryptoerr.hct.hcterr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.hebcdic.hec.hecdh.hecdsa.hecerr.hengine.hengineerr.herr.hevp.hevperr.hhmac.hidea.hkdf.hkdferr.hlhash.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsperr.hopensslconf.hopensslv.hossl_typ.hpem.hpem2.hpemerr.hpkcs12.hpkcs12err.hpkcs7.hpkcs7err.hrand.hrand_drbg.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hseed.hsha.hsrp.hsrtp.hssl.hssl2.hssl3.hsslerr.hstack.hstore.hstoreerr.hsymhacks.htls1.hts.htserr.htxt_db.hui.huierr.hwhrlpool.hx509.hx509_vfy.hx509err.hx509v3.hx509v3err.h
lib
pkgconfig
share
doc
openssl
html
man1
CA.pl.htmlasn1parse.htmlca.htmlciphers.htmlcms.htmlcrl.htmlcrl2pkcs7.htmldgst.htmldhparam.htmldsa.htmldsaparam.htmlec.htmlecparam.htmlenc.htmlengine.htmlerrstr.htmlgendsa.htmlgenpkey.htmlgenrsa.htmllist.htmlnseq.htmlocsp.htmlopenssl.htmlpasswd.htmlpkcs12.htmlpkcs7.htmlpkcs8.htmlpkey.htmlpkeyparam.htmlpkeyutl.htmlprime.htmlrand.htmlrehash.htmlreq.htmlrsa.htmlrsautl.htmls_client.htmls_server.htmls_time.htmlsess_id.htmlsmime.htmlspeed.htmlspkac.htmlsrp.htmlstoreutl.htmlts.htmltsget.htmlverify.htmlversion.htmlx509.html
man3
ADMISSIONS.htmlASN1_INTEGER_get_int64.htmlASN1_ITEM_lookup.htmlASN1_OBJECT_new.htmlASN1_STRING_TABLE_add.htmlASN1_STRING_length.htmlASN1_STRING_new.htmlASN1_STRING_print_ex.htmlASN1_TIME_set.htmlASN1_TYPE_get.htmlASN1_generate_nconf.htmlASYNC_WAIT_CTX_new.htmlASYNC_start_job.htmlBF_encrypt.htmlBIO_ADDR.htmlBIO_ADDRINFO.htmlBIO_connect.htmlBIO_ctrl.htmlBIO_f_base64.htmlBIO_f_buffer.htmlBIO_f_cipher.htmlBIO_f_md.htmlBIO_f_null.htmlBIO_f_ssl.htmlBIO_find_type.htmlBIO_get_data.htmlBIO_get_ex_new_index.htmlBIO_meth_new.htmlBIO_new.htmlBIO_new_CMS.htmlBIO_parse_hostserv.htmlBIO_printf.htmlBIO_push.htmlBIO_read.htmlBIO_s_accept.htmlBIO_s_bio.htmlBIO_s_connect.htmlBIO_s_fd.htmlBIO_s_file.htmlBIO_s_mem.htmlBIO_s_null.htmlBIO_s_socket.htmlBIO_set_callback.htmlBIO_should_retry.htmlBN_BLINDING_new.htmlBN_CTX_new.htmlBN_CTX_start.htmlBN_add.htmlBN_add_word.htmlBN_bn2bin.htmlBN_cmp.htmlBN_copy.htmlBN_generate_prime.htmlBN_mod_inverse.htmlBN_mod_mul_montgomery.htmlBN_mod_mul_reciprocal.htmlBN_new.htmlBN_num_bytes.htmlBN_rand.htmlBN_security_bits.htmlBN_set_bit.htmlBN_swap.htmlBN_zero.htmlBUF_MEM_new.htmlCMS_add0_cert.htmlCMS_add1_recipient_cert.htmlCMS_add1_signer.htmlCMS_compress.htmlCMS_decrypt.htmlCMS_encrypt.htmlCMS_final.htmlCMS_get0_RecipientInfos.htmlCMS_get0_SignerInfos.htmlCMS_get0_type.htmlCMS_get1_ReceiptRequest.htmlCMS_sign.htmlCMS_sign_receipt.htmlCMS_uncompress.htmlCMS_verify.htmlCMS_verify_receipt.htmlCONF_modules_free.htmlCONF_modules_load_file.htmlCRYPTO_THREAD_run_once.htmlCRYPTO_get_ex_new_index.htmlCRYPTO_memcmp.htmlCTLOG_STORE_get0_log_by_id.htmlCTLOG_STORE_new.htmlCTLOG_new.htmlCT_POLICY_EVAL_CTX_new.htmlDEFINE_STACK_OF.htmlDES_random_key.htmlDH_generate_key.htmlDH_generate_parameters.htmlDH_get0_pqg.htmlDH_get_1024_160.htmlDH_meth_new.htmlDH_new.htmlDH_new_by_nid.htmlDH_set_method.htmlDH_size.htmlDSA_SIG_new.htmlDSA_do_sign.htmlDSA_dup_DH.htmlDSA_generate_key.htmlDSA_generate_parameters.htmlDSA_get0_pqg.htmlDSA_meth_new.htmlDSA_new.htmlDSA_set_method.htmlDSA_sign.htmlDSA_size.htmlDTLS_get_data_mtu.htmlDTLS_set_timer_cb.htmlDTLSv1_listen.htmlECDSA_SIG_new.htmlECPKParameters_print.htmlEC_GFp_simple_method.htmlEC_GROUP_copy.htmlEC_GROUP_new.htmlEC_KEY_get_enc_flags.htmlEC_KEY_new.htmlEC_POINT_add.htmlEC_POINT_new.htmlENGINE_add.htmlERR_GET_LIB.htmlERR_clear_error.htmlERR_error_string.htmlERR_get_error.htmlERR_load_crypto_strings.htmlERR_load_strings.htmlERR_print_errors.htmlERR_put_error.htmlERR_remove_state.htmlERR_set_mark.htmlEVP_BytesToKey.htmlEVP_CIPHER_CTX_get_cipher_data.htmlEVP_CIPHER_meth_new.htmlEVP_DigestInit.htmlEVP_DigestSignInit.htmlEVP_DigestVerifyInit.htmlEVP_EncodeInit.htmlEVP_EncryptInit.htmlEVP_MD_meth_new.htmlEVP_OpenInit.htmlEVP_PKEY_ASN1_METHOD.htmlEVP_PKEY_CTX_ctrl.htmlEVP_PKEY_CTX_new.htmlEVP_PKEY_CTX_set1_pbe_pass.htmlEVP_PKEY_CTX_set_hkdf_md.htmlEVP_PKEY_CTX_set_rsa_pss_keygen_md.htmlEVP_PKEY_CTX_set_scrypt_N.htmlEVP_PKEY_CTX_set_tls1_prf_md.htmlEVP_PKEY_asn1_get_count.htmlEVP_PKEY_cmp.htmlEVP_PKEY_decrypt.htmlEVP_PKEY_derive.htmlEVP_PKEY_encrypt.htmlEVP_PKEY_get_default_digest_nid.htmlEVP_PKEY_keygen.htmlEVP_PKEY_meth_get_count.htmlEVP_PKEY_meth_new.htmlEVP_PKEY_new.htmlEVP_PKEY_print_private.htmlEVP_PKEY_set1_RSA.htmlEVP_PKEY_sign.htmlEVP_PKEY_size.htmlEVP_PKEY_verify.htmlEVP_PKEY_verify_recover.htmlEVP_SealInit.htmlEVP_SignInit.htmlEVP_VerifyInit.htmlEVP_aes.htmlEVP_aria.htmlEVP_bf_cbc.htmlEVP_blake2b512.htmlEVP_camellia.htmlEVP_cast5_cbc.htmlEVP_chacha20.htmlEVP_des.htmlEVP_desx_cbc.htmlEVP_idea_cbc.htmlEVP_md2.htmlEVP_md4.htmlEVP_md5.htmlEVP_mdc2.htmlEVP_rc2_cbc.htmlEVP_rc4.htmlEVP_rc5_32_12_16_cbc.htmlEVP_ripemd160.htmlEVP_seed_cbc.htmlEVP_sha1.htmlEVP_sha224.htmlEVP_sha3_224.htmlEVP_sm3.htmlEVP_sm4_cbc.htmlEVP_whirlpool.htmlHMAC.htmlMD5.htmlMDC2_Init.htmlOBJ_nid2obj.htmlOCSP_REQUEST_new.htmlOCSP_cert_to_id.htmlOCSP_request_add1_nonce.htmlOCSP_resp_find_status.htmlOCSP_response_status.htmlOCSP_sendreq_new.htmlOPENSSL_Applink.htmlOPENSSL_LH_COMPFUNC.htmlOPENSSL_LH_stats.htmlOPENSSL_VERSION_NUMBER.htmlOPENSSL_config.htmlOPENSSL_fork_prepare.htmlOPENSSL_ia32cap.htmlOPENSSL_init_crypto.htmlOPENSSL_init_ssl.htmlOPENSSL_instrument_bus.htmlOPENSSL_load_builtin_modules.htmlOPENSSL_malloc.htmlOPENSSL_secure_malloc.htmlOSSL_STORE_INFO.htmlOSSL_STORE_LOADER.htmlOSSL_STORE_SEARCH.htmlOSSL_STORE_expect.htmlOSSL_STORE_open.htmlOpenSSL_add_all_algorithms.htmlPEM_bytes_read_bio.htmlPEM_read.htmlPEM_read_CMS.htmlPEM_read_bio_PrivateKey.htmlPEM_read_bio_ex.htmlPEM_write_bio_CMS_stream.htmlPEM_write_bio_PKCS7_stream.htmlPKCS12_create.htmlPKCS12_newpass.htmlPKCS12_parse.htmlPKCS5_PBKDF2_HMAC.htmlPKCS7_decrypt.htmlPKCS7_encrypt.htmlPKCS7_sign.htmlPKCS7_sign_add_signer.htmlPKCS7_verify.htmlRAND_DRBG_generate.htmlRAND_DRBG_get0_master.htmlRAND_DRBG_new.htmlRAND_DRBG_reseed.htmlRAND_DRBG_set_callbacks.htmlRAND_DRBG_set_ex_data.htmlRAND_add.htmlRAND_bytes.htmlRAND_cleanup.htmlRAND_egd.htmlRAND_load_file.htmlRAND_set_rand_method.htmlRC4_set_key.htmlRIPEMD160_Init.htmlRSA_blinding_on.htmlRSA_check_key.htmlRSA_generate_key.htmlRSA_get0_key.htmlRSA_meth_new.htmlRSA_new.htmlRSA_padding_add_PKCS1_type_1.htmlRSA_print.htmlRSA_private_encrypt.htmlRSA_public_encrypt.htmlRSA_set_method.htmlRSA_sign.htmlRSA_sign_ASN1_OCTET_STRING.htmlRSA_size.htmlSCT_new.htmlSCT_print.htmlSCT_validate.htmlSHA256_Init.htmlSMIME_read_CMS.htmlSMIME_read_PKCS7.htmlSMIME_write_CMS.htmlSMIME_write_PKCS7.htmlSSL_CIPHER_get_name.htmlSSL_COMP_add_compression_method.htmlSSL_CONF_CTX_new.htmlSSL_CONF_CTX_set1_prefix.htmlSSL_CONF_CTX_set_flags.htmlSSL_CONF_CTX_set_ssl_ctx.htmlSSL_CONF_cmd.htmlSSL_CONF_cmd_argv.htmlSSL_CTX_add1_chain_cert.htmlSSL_CTX_add_extra_chain_cert.htmlSSL_CTX_add_session.htmlSSL_CTX_config.htmlSSL_CTX_ctrl.htmlSSL_CTX_dane_enable.htmlSSL_CTX_flush_sessions.htmlSSL_CTX_free.htmlSSL_CTX_get0_param.htmlSSL_CTX_get_verify_mode.htmlSSL_CTX_has_client_custom_ext.htmlSSL_CTX_load_verify_locations.htmlSSL_CTX_new.htmlSSL_CTX_sess_number.htmlSSL_CTX_sess_set_cache_size.htmlSSL_CTX_sess_set_get_cb.htmlSSL_CTX_sessions.htmlSSL_CTX_set0_CA_list.htmlSSL_CTX_set1_curves.htmlSSL_CTX_set1_sigalgs.htmlSSL_CTX_set1_verify_cert_store.htmlSSL_CTX_set_alpn_select_cb.htmlSSL_CTX_set_cert_cb.htmlSSL_CTX_set_cert_store.htmlSSL_CTX_set_cert_verify_callback.htmlSSL_CTX_set_cipher_list.htmlSSL_CTX_set_client_cert_cb.htmlSSL_CTX_set_client_hello_cb.htmlSSL_CTX_set_ct_validation_callback.htmlSSL_CTX_set_ctlog_list_file.htmlSSL_CTX_set_default_passwd_cb.htmlSSL_CTX_set_ex_data.htmlSSL_CTX_set_generate_session_id.htmlSSL_CTX_set_info_callback.htmlSSL_CTX_set_keylog_callback.htmlSSL_CTX_set_max_cert_list.htmlSSL_CTX_set_min_proto_version.htmlSSL_CTX_set_mode.htmlSSL_CTX_set_msg_callback.htmlSSL_CTX_set_num_tickets.htmlSSL_CTX_set_options.htmlSSL_CTX_set_psk_client_callback.htmlSSL_CTX_set_quiet_shutdown.htmlSSL_CTX_set_read_ahead.htmlSSL_CTX_set_record_padding_callback.htmlSSL_CTX_set_security_level.htmlSSL_CTX_set_session_cache_mode.htmlSSL_CTX_set_session_id_context.htmlSSL_CTX_set_session_ticket_cb.htmlSSL_CTX_set_split_send_fragment.htmlSSL_CTX_set_ssl_version.htmlSSL_CTX_set_stateless_cookie_generate_cb.htmlSSL_CTX_set_timeout.htmlSSL_CTX_set_tlsext_servername_callback.htmlSSL_CTX_set_tlsext_status_cb.htmlSSL_CTX_set_tlsext_ticket_key_cb.htmlSSL_CTX_set_tlsext_use_srtp.htmlSSL_CTX_set_tmp_dh_callback.htmlSSL_CTX_set_verify.htmlSSL_CTX_use_certificate.htmlSSL_CTX_use_psk_identity_hint.htmlSSL_CTX_use_serverinfo.htmlSSL_SESSION_free.htmlSSL_SESSION_get0_cipher.htmlSSL_SESSION_get0_hostname.htmlSSL_SESSION_get0_id_context.htmlSSL_SESSION_get0_peer.htmlSSL_SESSION_get_compress_id.htmlSSL_SESSION_get_ex_data.htmlSSL_SESSION_get_protocol_version.htmlSSL_SESSION_get_time.htmlSSL_SESSION_has_ticket.htmlSSL_SESSION_is_resumable.htmlSSL_SESSION_print.htmlSSL_SESSION_set1_id.htmlSSL_accept.htmlSSL_alert_type_string.htmlSSL_alloc_buffers.htmlSSL_check_chain.htmlSSL_clear.htmlSSL_connect.htmlSSL_do_handshake.htmlSSL_export_keying_material.htmlSSL_extension_supported.htmlSSL_free.htmlSSL_get0_peer_scts.htmlSSL_get_SSL_CTX.htmlSSL_get_all_async_fds.htmlSSL_get_ciphers.htmlSSL_get_client_random.htmlSSL_get_current_cipher.htmlSSL_get_default_timeout.htmlSSL_get_error.htmlSSL_get_extms_support.htmlSSL_get_fd.htmlSSL_get_peer_cert_chain.htmlSSL_get_peer_certificate.htmlSSL_get_peer_signature_nid.htmlSSL_get_peer_tmp_key.htmlSSL_get_psk_identity.htmlSSL_get_rbio.htmlSSL_get_session.htmlSSL_get_shared_sigalgs.htmlSSL_get_verify_result.htmlSSL_get_version.htmlSSL_in_init.htmlSSL_key_update.htmlSSL_library_init.htmlSSL_load_client_CA_file.htmlSSL_new.htmlSSL_pending.htmlSSL_read.htmlSSL_read_early_data.htmlSSL_rstate_string.htmlSSL_session_reused.htmlSSL_set1_host.htmlSSL_set_bio.htmlSSL_set_connect_state.htmlSSL_set_fd.htmlSSL_set_session.htmlSSL_set_shutdown.htmlSSL_set_verify_result.htmlSSL_shutdown.htmlSSL_state_string.htmlSSL_want.htmlSSL_write.htmlUI_STRING.htmlUI_UTIL_read_pw.htmlUI_create_method.htmlUI_new.htmlX509V3_get_d2i.htmlX509_ALGOR_dup.htmlX509_CRL_get0_by_serial.htmlX509_EXTENSION_set_object.htmlX509_LOOKUP.htmlX509_LOOKUP_hash_dir.htmlX509_LOOKUP_meth_new.htmlX509_NAME_ENTRY_get_object.htmlX509_NAME_add_entry_by_txt.htmlX509_NAME_get0_der.htmlX509_NAME_get_index_by_NID.htmlX509_NAME_print_ex.htmlX509_PUBKEY_new.htmlX509_SIG_get0.htmlX509_STORE_CTX_get_error.htmlX509_STORE_CTX_new.htmlX509_STORE_CTX_set_verify_cb.htmlX509_STORE_add_cert.htmlX509_STORE_get0_param.htmlX509_STORE_new.htmlX509_STORE_set_verify_cb_func.htmlX509_VERIFY_PARAM_set_flags.htmlX509_check_ca.htmlX509_check_host.htmlX509_check_issued.htmlX509_check_private_key.htmlX509_check_purpose.htmlX509_cmp.htmlX509_cmp_time.htmlX509_digest.htmlX509_dup.htmlX509_get0_notBefore.htmlX509_get0_signature.htmlX509_get0_uids.htmlX509_get_extension_flags.htmlX509_get_pubkey.htmlX509_get_serialNumber.htmlX509_get_subject_name.htmlX509_get_version.htmlX509_new.htmlX509_sign.htmlX509_verify_cert.htmlX509v3_get_ext_by_NID.htmld2i_DHparams.htmld2i_PKCS8PrivateKey_bio.htmld2i_PrivateKey.htmld2i_SSL_SESSION.htmld2i_X509.htmli2d_CMS_bio_stream.htmli2d_PKCS7_bio_stream.htmli2d_re_X509_tbs.htmlo2i_SCT_LIST.html
man5
man7
man
man1
CA.pl.1asn1parse.1ca.1ciphers.1cms.1crl.1crl2pkcs7.1dgst.1dhparam.1dsa.1dsaparam.1ec.1ecparam.1enc.1engine.1errstr.1gendsa.1genpkey.1genrsa.1list.1nseq.1ocsp.1openssl.1passwd.1pkcs12.1pkcs7.1pkcs8.1pkey.1pkeyparam.1pkeyutl.1prime.1rand.1rehash.1req.1rsa.1rsautl.1s_client.1s_server.1s_time.1sess_id.1smime.1speed.1spkac.1srp.1storeutl.1ts.1tsget.1verify.1version.1x509.1
man3
ADMISSIONS.3ASN1_INTEGER_get_int64.3ASN1_ITEM_lookup.3ASN1_OBJECT_new.3ASN1_STRING_TABLE_add.3ASN1_STRING_length.3ASN1_STRING_new.3ASN1_STRING_print_ex.3ASN1_TIME_set.3ASN1_TYPE_get.3ASN1_generate_nconf.3ASYNC_WAIT_CTX_new.3ASYNC_start_job.3BF_encrypt.3BIO_ADDR.3BIO_ADDRINFO.3BIO_connect.3BIO_ctrl.3BIO_f_base64.3BIO_f_buffer.3BIO_f_cipher.3BIO_f_md.3BIO_f_null.3BIO_f_ssl.3BIO_find_type.3BIO_get_data.3BIO_get_ex_new_index.3BIO_meth_new.3BIO_new.3BIO_new_CMS.3BIO_parse_hostserv.3BIO_printf.3BIO_push.3BIO_read.3BIO_s_accept.3BIO_s_bio.3BIO_s_connect.3BIO_s_fd.3BIO_s_file.3BIO_s_mem.3BIO_s_null.3BIO_s_socket.3BIO_set_callback.3BIO_should_retry.3BN_BLINDING_new.3BN_CTX_new.3BN_CTX_start.3BN_add.3BN_add_word.3BN_bn2bin.3BN_cmp.3BN_copy.3BN_generate_prime.3BN_mod_inverse.3BN_mod_mul_montgomery.3BN_mod_mul_reciprocal.3BN_new.3BN_num_bytes.3BN_rand.3BN_security_bits.3BN_set_bit.3BN_swap.3BN_zero.3BUF_MEM_new.3CMS_add0_cert.3CMS_add1_recipient_cert.3CMS_add1_signer.3CMS_compress.3CMS_decrypt.3CMS_encrypt.3CMS_final.3CMS_get0_RecipientInfos.3CMS_get0_SignerInfos.3CMS_get0_type.3CMS_get1_ReceiptRequest.3CMS_sign.3CMS_sign_receipt.3CMS_uncompress.3CMS_verify.3CMS_verify_receipt.3CONF_modules_free.3CONF_modules_load_file.3CRYPTO_THREAD_run_once.3CRYPTO_get_ex_new_index.3CRYPTO_memcmp.3CTLOG_STORE_get0_log_by_id.3CTLOG_STORE_new.3CTLOG_new.3CT_POLICY_EVAL_CTX_new.3DEFINE_STACK_OF.3DES_random_key.3DH_generate_key.3DH_generate_parameters.3DH_get0_pqg.3DH_get_1024_160.3DH_meth_new.3DH_new.3DH_new_by_nid.3DH_set_method.3DH_size.3DSA_SIG_new.3DSA_do_sign.3DSA_dup_DH.3DSA_generate_key.3DSA_generate_parameters.3DSA_get0_pqg.3DSA_meth_new.3DSA_new.3DSA_set_method.3DSA_sign.3DSA_size.3DTLS_get_data_mtu.3DTLS_set_timer_cb.3DTLSv1_listen.3ECDSA_SIG_new.3ECPKParameters_print.3EC_GFp_simple_method.3EC_GROUP_copy.3EC_GROUP_new.3EC_KEY_get_enc_flags.3EC_KEY_new.3EC_POINT_add.3EC_POINT_new.3ENGINE_add.3ERR_GET_LIB.3ERR_clear_error.3ERR_error_string.3ERR_get_error.3ERR_load_crypto_strings.3ERR_load_strings.3ERR_print_errors.3ERR_put_error.3ERR_remove_state.3ERR_set_mark.3EVP_BytesToKey.3EVP_CIPHER_CTX_get_cipher_data.3EVP_CIPHER_meth_new.3EVP_DigestInit.3EVP_DigestSignInit.3EVP_DigestVerifyInit.3EVP_EncodeInit.3EVP_EncryptInit.3EVP_MD_meth_new.3EVP_OpenInit.3EVP_PKEY_ASN1_METHOD.3EVP_PKEY_CTX_ctrl.3EVP_PKEY_CTX_new.3EVP_PKEY_CTX_set1_pbe_pass.3EVP_PKEY_CTX_set_hkdf_md.3EVP_PKEY_CTX_set_rsa_pss_keygen_md.3EVP_PKEY_CTX_set_scrypt_N.3EVP_PKEY_CTX_set_tls1_prf_md.3EVP_PKEY_asn1_get_count.3EVP_PKEY_cmp.3EVP_PKEY_decrypt.3EVP_PKEY_derive.3EVP_PKEY_encrypt.3EVP_PKEY_get_default_digest_nid.3EVP_PKEY_keygen.3EVP_PKEY_meth_get_count.3EVP_PKEY_meth_new.3EVP_PKEY_new.3EVP_PKEY_print_private.3EVP_PKEY_set1_RSA.3EVP_PKEY_sign.3EVP_PKEY_size.3EVP_PKEY_verify.3EVP_PKEY_verify_recover.3EVP_SealInit.3EVP_SignInit.3EVP_VerifyInit.3EVP_aes.3EVP_aria.3EVP_bf_cbc.3EVP_blake2b512.3EVP_camellia.3EVP_cast5_cbc.3EVP_chacha20.3EVP_des.3EVP_desx_cbc.3EVP_idea_cbc.3EVP_md2.3EVP_md4.3EVP_md5.3EVP_mdc2.3EVP_rc2_cbc.3EVP_rc4.3EVP_rc5_32_12_16_cbc.3EVP_ripemd160.3EVP_seed_cbc.3EVP_sha1.3EVP_sha224.3EVP_sha3_224.3EVP_sm3.3EVP_sm4_cbc.3EVP_whirlpool.3HMAC.3MD5.3MDC2_Init.3OBJ_nid2obj.3OCSP_REQUEST_new.3OCSP_cert_to_id.3OCSP_request_add1_nonce.3OCSP_resp_find_status.3OCSP_response_status.3OCSP_sendreq_new.3OPENSSL_Applink.3OPENSSL_LH_COMPFUNC.3OPENSSL_LH_stats.3OPENSSL_VERSION_NUMBER.3OPENSSL_config.3OPENSSL_fork_prepare.3OPENSSL_ia32cap.3OPENSSL_init_crypto.3OPENSSL_init_ssl.3OPENSSL_instrument_bus.3OPENSSL_load_builtin_modules.3OPENSSL_malloc.3OPENSSL_secure_malloc.3OSSL_STORE_INFO.3OSSL_STORE_LOADER.3OSSL_STORE_SEARCH.3OSSL_STORE_expect.3OSSL_STORE_open.3OpenSSL_add_all_algorithms.3PEM_bytes_read_bio.3PEM_read.3PEM_read_CMS.3PEM_read_bio_PrivateKey.3PEM_read_bio_ex.3PEM_write_bio_CMS_stream.3PEM_write_bio_PKCS7_stream.3PKCS12_create.3PKCS12_newpass.3PKCS12_parse.3PKCS5_PBKDF2_HMAC.3PKCS7_decrypt.3PKCS7_encrypt.3PKCS7_sign.3PKCS7_sign_add_signer.3PKCS7_verify.3RAND_DRBG_generate.3RAND_DRBG_get0_master.3RAND_DRBG_new.3RAND_DRBG_reseed.3RAND_DRBG_set_callbacks.3RAND_DRBG_set_ex_data.3RAND_add.3RAND_bytes.3RAND_cleanup.3RAND_egd.3RAND_load_file.3RAND_set_rand_method.3RC4_set_key.3RIPEMD160_Init.3RSA_blinding_on.3RSA_check_key.3RSA_generate_key.3RSA_get0_key.3RSA_meth_new.3RSA_new.3RSA_padding_add_PKCS1_type_1.3RSA_print.3RSA_private_encrypt.3RSA_public_encrypt.3RSA_set_method.3RSA_sign.3RSA_sign_ASN1_OCTET_STRING.3RSA_size.3SCT_new.3SCT_print.3SCT_validate.3SHA256_Init.3SMIME_read_CMS.3SMIME_read_PKCS7.3SMIME_write_CMS.3SMIME_write_PKCS7.3SSL_CIPHER_get_name.3SSL_COMP_add_compression_method.3SSL_CONF_CTX_new.3SSL_CONF_CTX_set1_prefix.3SSL_CONF_CTX_set_flags.3SSL_CONF_CTX_set_ssl_ctx.3SSL_CONF_cmd.3SSL_CONF_cmd_argv.3SSL_CTX_add1_chain_cert.3SSL_CTX_add_extra_chain_cert.3SSL_CTX_add_session.3SSL_CTX_config.3SSL_CTX_ctrl.3SSL_CTX_dane_enable.3SSL_CTX_flush_sessions.3SSL_CTX_free.3SSL_CTX_get0_param.3SSL_CTX_get_verify_mode.3SSL_CTX_has_client_custom_ext.3SSL_CTX_load_verify_locations.3SSL_CTX_new.3SSL_CTX_sess_number.3SSL_CTX_sess_set_cache_size.3SSL_CTX_sess_set_get_cb.3SSL_CTX_sessions.3SSL_CTX_set0_CA_list.3SSL_CTX_set1_curves.3SSL_CTX_set1_sigalgs.3SSL_CTX_set1_verify_cert_store.3SSL_CTX_set_alpn_select_cb.3SSL_CTX_set_cert_cb.3SSL_CTX_set_cert_store.3SSL_CTX_set_cert_verify_callback.3SSL_CTX_set_cipher_list.3SSL_CTX_set_client_cert_cb.3SSL_CTX_set_client_hello_cb.3SSL_CTX_set_ct_validation_callback.3SSL_CTX_set_ctlog_list_file.3SSL_CTX_set_default_passwd_cb.3SSL_CTX_set_ex_data.3SSL_CTX_set_generate_session_id.3SSL_CTX_set_info_callback.3SSL_CTX_set_keylog_callback.3SSL_CTX_set_max_cert_list.3SSL_CTX_set_min_proto_version.3SSL_CTX_set_mode.3SSL_CTX_set_msg_callback.3SSL_CTX_set_num_tickets.3SSL_CTX_set_options.3SSL_CTX_set_psk_client_callback.3SSL_CTX_set_quiet_shutdown.3SSL_CTX_set_read_ahead.3SSL_CTX_set_record_padding_callback.3SSL_CTX_set_security_level.3SSL_CTX_set_session_cache_mode.3SSL_CTX_set_session_id_context.3SSL_CTX_set_session_ticket_cb.3SSL_CTX_set_split_send_fragment.3SSL_CTX_set_ssl_version.3SSL_CTX_set_stateless_cookie_generate_cb.3SSL_CTX_set_timeout.3SSL_CTX_set_tlsext_servername_callback.3SSL_CTX_set_tlsext_status_cb.3SSL_CTX_set_tlsext_ticket_key_cb.3SSL_CTX_set_tlsext_use_srtp.3SSL_CTX_set_tmp_dh_callback.3SSL_CTX_set_verify.3SSL_CTX_use_certificate.3SSL_CTX_use_psk_identity_hint.3SSL_CTX_use_serverinfo.3SSL_SESSION_free.3SSL_SESSION_get0_cipher.3SSL_SESSION_get0_hostname.3SSL_SESSION_get0_id_context.3SSL_SESSION_get0_peer.3SSL_SESSION_get_compress_id.3SSL_SESSION_get_ex_data.3SSL_SESSION_get_protocol_version.3SSL_SESSION_get_time.3SSL_SESSION_has_ticket.3SSL_SESSION_is_resumable.3SSL_SESSION_print.3SSL_SESSION_set1_id.3SSL_accept.3SSL_alert_type_string.3SSL_alloc_buffers.3SSL_check_chain.3SSL_clear.3SSL_connect.3SSL_do_handshake.3SSL_export_keying_material.3SSL_extension_supported.3SSL_free.3SSL_get0_peer_scts.3SSL_get_SSL_CTX.3SSL_get_all_async_fds.3SSL_get_ciphers.3SSL_get_client_random.3SSL_get_current_cipher.3SSL_get_default_timeout.3SSL_get_error.3SSL_get_extms_support.3SSL_get_fd.3SSL_get_peer_cert_chain.3SSL_get_peer_certificate.3SSL_get_peer_signature_nid.3SSL_get_peer_tmp_key.3SSL_get_psk_identity.3SSL_get_rbio.3SSL_get_session.3SSL_get_shared_sigalgs.3SSL_get_verify_result.3SSL_get_version.3SSL_in_init.3SSL_key_update.3SSL_library_init.3SSL_load_client_CA_file.3SSL_new.3SSL_pending.3SSL_read.3SSL_read_early_data.3SSL_rstate_string.3SSL_session_reused.3SSL_set1_host.3SSL_set_bio.3SSL_set_connect_state.3SSL_set_fd.3SSL_set_session.3SSL_set_shutdown.3SSL_set_verify_result.3SSL_shutdown.3SSL_state_string.3SSL_want.3SSL_write.3UI_STRING.3UI_UTIL_read_pw.3UI_create_method.3UI_new.3X509V3_get_d2i.3X509_ALGOR_dup.3X509_CRL_get0_by_serial.3X509_EXTENSION_set_object.3X509_LOOKUP.3X509_LOOKUP_hash_dir.3X509_LOOKUP_meth_new.3X509_NAME_ENTRY_get_object.3X509_NAME_add_entry_by_txt.3X509_NAME_get0_der.3X509_NAME_get_index_by_NID.3X509_NAME_print_ex.3X509_PUBKEY_new.3X509_SIG_get0.3X509_STORE_CTX_get_error.3X509_STORE_CTX_new.3X509_STORE_CTX_set_verify_cb.3X509_STORE_add_cert.3X509_STORE_get0_param.3X509_STORE_new.3X509_STORE_set_verify_cb_func.3X509_VERIFY_PARAM_set_flags.3X509_check_ca.3X509_check_host.3X509_check_issued.3X509_check_private_key.3X509_check_purpose.3X509_cmp.3X509_cmp_time.3X509_digest.3X509_dup.3X509_get0_notBefore.3X509_get0_signature.3X509_get0_uids.3X509_get_extension_flags.3X509_get_pubkey.3X509_get_serialNumber.3X509_get_subject_name.3X509_get_version.3X509_new.3X509_sign.3X509_verify_cert.3X509v3_get_ext_by_NID.3d2i_DHparams.3d2i_PKCS8PrivateKey_bio.3d2i_PrivateKey.3d2i_SSL_SESSION.3d2i_X509.3i2d_CMS_bio_stream.3i2d_PKCS7_bio_stream.3i2d_re_X509_tbs.3o2i_SCT_LIST.3
man5
man7
usr
local
include
crypto
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes_platform.haria.hasn1.hasn1_dsa.hasn1err.hasync.hasyncerr.hbioerr.hbn.hbn_conf.hbn_conf.h.inbn_dh.hbn_srp.hbnerr.hbuffererr.hchacha.hcmll_platform.hcmperr.hcmserr.hcomperr.hconferr.hcontext.hcrmferr.hcryptlib.hcryptoerr.hcterr.hctype.hdecoder.hdecodererr.hdes_platform.hdh.hdherr.hdsa.hdsaerr.hdso_conf.hdso_conf.h.inec.hecerr.hecx.hencoder.hencodererr.hengine.hengineerr.herr.hess.hesserr.hevp.hevperr.hhttperr.hlhash.hmd32_common.hmodes.hobjects.hobjectserr.hocsperr.hpem.hpemerr.hpkcs12err.hpkcs7.hpkcs7err.hpoly1305.hppc_arch.hpunycode.hrand.hrand_pool.hranderr.hriscv_arch.defriscv_arch.hrsa.hrsaerr.hsecurity_bits.hsha.hsiphash.hsiv.hsm2.hsm2err.hsm4.hsm4_platform.hsparc_arch.hsparse_array.hstore.hstoreerr.htserr.htypes.huierr.hx509.hx509err.hx509v3err.h
internal
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Hasn1.hbio.hbio_addr.hbio_tfo.hcommon.hcomp.hconf.hconstant_time.hcore.hcryptlib.hdane.hdeprecated.hder.hdeterministic_nonce.hdso.hdsoerr.he_os.hendian.herr.hevent_queue.hffc.hhpke_util.hktls.hlist.hnamemap.hnelem.hnumbers.ho_dir.hpacket.hpacket_quic.hparam_build_set.hparam_names.hparam_names.h.inparams.hpassphrase.hpriority_queue.hproperty.hpropertyerr.hprovider.hquic_ackm.hquic_cc.hquic_cfq.hquic_channel.hquic_demux.hquic_error.hquic_fc.hquic_fifd.hquic_reactor.hquic_record_rx.hquic_record_tx.hquic_record_util.hquic_rx_depack.hquic_sf_list.hquic_ssl.hquic_statm.hquic_stream.hquic_stream_map.hquic_thread_assist.hquic_tls.hquic_tserver.hquic_txp.hquic_txpim.hquic_types.hquic_vlint.hquic_wire.hquic_wire_pkt.hrecordmethod.hrefcount.hring_buf.hsafe_math.hsha3.hsizes.hsm3.hsockets.hssl.hssl3_cbc.hsslconf.hstatem.hsymhacks.hthread.hthread_arch.hthread_once.htime.htlsgroups.htsan_assist.huint_set.hunicode.h
openssl
__DECC_INCLUDE_EPILOGUE.H__DECC_INCLUDE_PROLOGUE.Haes.hasn1.hasn1.h.inasn1_mac.hasn1err.hasn1t.hasn1t.h.inasync.hasyncerr.hbio.hbio.h.inbioerr.hblowfish.hbn.hbnerr.hbuffer.hbuffererr.hcamellia.hcast.hcmac.hcmp.hcmp.h.incmp_util.hcmperr.hcms.hcms.h.incmserr.hcomp.hcomperr.hconf.hconf.h.inconf_api.hconferr.hconfiguration.hconfiguration.h.inconftypes.hcore.hcore_dispatch.hcore_names.hcore_names.h.incore_object.hcrmf.hcrmf.h.incrmferr.hcrypto.hcrypto.h.incryptoerr.hcryptoerr_legacy.hct.hct.h.incterr.hdecoder.hdecodererr.hdes.hdh.hdherr.hdsa.hdsaerr.hdtls1.he_os2.he_ostime.hebcdic.hec.hecdh.hecdsa.hecerr.hencoder.hencodererr.hengine.hengineerr.herr.herr.h.iness.hess.h.inesserr.hevp.hevperr.hfips_names.hfipskey.hfipskey.h.inhmac.hhpke.hhttp.hhttperr.hidea.hkdf.hkdferr.hlhash.hlhash.h.inmacros.hmd2.hmd4.hmd5.hmdc2.hmodes.hobj_mac.hobjects.hobjectserr.hocsp.hocsp.h.inocsperr.hopensslconf.hopensslv.hopensslv.h.inossl_typ.hparam_build.hparams.hpem.hpem2.hpemerr.hpkcs12.hpkcs12.h.inpkcs12err.hpkcs7.hpkcs7.h.inpkcs7err.hprov_ssl.hproverr.hprovider.hquic.hrand.hranderr.hrc2.hrc4.hrc5.hripemd.hrsa.hrsaerr.hsafestack.hsafestack.h.inseed.hself_test.hsha.hsrp.hsrp.h.insrtp.hssl.hssl.h.inssl2.hssl3.hsslerr.hsslerr_legacy.hstack.hstore.hstoreerr.hsymhacks.hthread.htls1.htrace.hts.htserr.htxt_db.htypes.hui.hui.h.inuierr.hwhrlpool.hx509.hx509.h.inx509_vfy.hx509_vfy.h.inx509err.hx509v3.hx509v3.h.inx509v3err.h
quickjs
ChangelogMakefileTODOVERSION
doc
libbf.clibregexp.clibunicode-table.hqjs.cqjsc.cquickjs-atom.hquickjs-opcode.hquickjs.cquickjs.htest262.conftest262_errors.txtunicode_download.shunicode_gen_def.hsqlite
src
android
bcrypt.js.cdatabase.js.chttp.chttp.hhttpd.js.chttpd.js.hios.mios
Entitlements.plistInfo.plistResourceRules.plistembedded.mobileprovisiontildefriends.pngtildefriends.svg
log.hmain.cmem.cpacketstream.csocket.js.cssb.cssb.connections.cssb.db.cssb.db.hssb.export.cssb.hssb.import.cssb.js.cssb.rpc.cssb.rpc.hssb.tests.ctask.ctask.htaskstub.js.ctests.ctrace.cutil.js.cutil.js.hversion.htools
842
GNUmakefile
Normal file
842
GNUmakefile
Normal file
@ -0,0 +1,842 @@
|
||||
.ONESHELL:
|
||||
.DELETE_ON_ERROR:
|
||||
MAKEFLAGS += --warn-undefined-variables
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
|
||||
VERSION_CODE := 14
|
||||
VERSION_NUMBER := 0.0.14
|
||||
VERSION_NAME := Served on apple cider dressed winter greens.
|
||||
|
||||
PROJECT = tildefriends
|
||||
BUILD_DIR ?= out
|
||||
UNAME_S := $(shell uname -s)
|
||||
UNAME_M := $(shell uname -m)
|
||||
|
||||
ANDROID_SDK ?= ~/Android/Sdk
|
||||
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
BUILD_TYPES := macosdebug macosrelease iosdebug iosrelease iossimdebug iossimrelease
|
||||
else ifeq ($(UNAME_S),Linux)
|
||||
BUILD_TYPES := debug release
|
||||
HAVE_ANDROID = $(if $(shell which $(ANDROID_SDK)/platform-tools/adb),1,0)
|
||||
HAVE_LINUX_IOS = $(if $(shell which deps/ios_toolchain/target/bin deps/ios_toolchain/target/bin/arm-apple-darwin11-clang),1,0)
|
||||
HAVE_WIN = $(if $(shell which x86_64-w64-mingw32-gcc-win32),1,0)
|
||||
else ifeq ($(UNAME_S),Haiku)
|
||||
BUILD_TYPES := debug release
|
||||
CFLAGS += -Dstatic_assert=_Static_assert
|
||||
LDFLAGS += \
|
||||
-lbsd \
|
||||
-lnetwork
|
||||
else ifeq ($(UNAME_S),OpenBSD)
|
||||
BUILD_TYPES := debug release
|
||||
CFLAGS += \
|
||||
-Wno-unknown-warning-option
|
||||
LDFLAGS += \
|
||||
-lexecinfo \
|
||||
-lc++abi
|
||||
HAVE_ANDROID := 0
|
||||
HAVE_LINUX_IOS := 0
|
||||
HAVE_WIN := 0
|
||||
else
|
||||
$(error Unexpected host platform $(UNAME_S).)
|
||||
endif
|
||||
|
||||
CFLAGS += \
|
||||
-std=gnu11 \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Wno-unused-parameter \
|
||||
-MMD \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
-fno-exceptions \
|
||||
-g
|
||||
|
||||
ANDROID_BUILD_TOOLS := $(ANDROID_SDK)/build-tools/34.0.0
|
||||
ANDROID_PLATFORM := $(ANDROID_SDK)/platforms/android-33
|
||||
ANDROID_NDK ?= $(ANDROID_SDK)/ndk/26.0.10792818
|
||||
ANDROID_MIN_SDK_VERSION := 24
|
||||
ANDROID_TARGET_SDK_VERSION := 34
|
||||
|
||||
ANDROID_ARMV7A_TARGETS := \
|
||||
out/androiddebug-armv7a/tildefriends \
|
||||
out/androidrelease-armv7a/tildefriends
|
||||
ANDROID_ARM64_TARGETS := \
|
||||
out/androiddebug/tildefriends \
|
||||
out/androidrelease/tildefriends
|
||||
ANDROID_X86_TARGETS := \
|
||||
out/androiddebug-x86/tildefriends \
|
||||
out/androidrelease-x86/tildefriends
|
||||
ANDROID_X86_64_TARGETS := \
|
||||
out/androiddebug-x86_64/tildefriends \
|
||||
out/androidrelease-x86_64/tildefriends
|
||||
ANDROID_TARGETS := \
|
||||
$(ANDROID_X86_TARGETS) \
|
||||
$(ANDROID_X86_64_TARGETS) \
|
||||
$(ANDROID_ARMV7A_TARGETS) \
|
||||
$(ANDROID_ARM64_TARGETS)
|
||||
ifeq ($(HAVE_ANDROID),1)
|
||||
BUILD_TYPES += \
|
||||
androiddebug \
|
||||
androidrelease \
|
||||
androiddebug-armv7a \
|
||||
androidrelease-armv7a \
|
||||
androiddebug-x86 \
|
||||
androidrelease-x86 \
|
||||
androiddebug-x86_64 \
|
||||
androidrelease-x86_64
|
||||
all: out/TildeFriends-arm-debug.apk out/TildeFriends-arm-release.apk out/TildeFriends-x86-debug.apk out/TildeFriends-x86-release.apk
|
||||
endif
|
||||
|
||||
WINDOWS_TARGETS := \
|
||||
out/windebug/tildefriends.exe \
|
||||
out/winrelease/tildefriends.exe
|
||||
ifeq ($(HAVE_WIN),1)
|
||||
BUILD_TYPES += windebug winrelease
|
||||
endif
|
||||
|
||||
LINUX_TARGETS := \
|
||||
out/debug/tildefriends \
|
||||
out/release/tildefriends
|
||||
MACOS_TARGETS := \
|
||||
out/macosdebug/tildefriends \
|
||||
out/macosrelease/tildefriends
|
||||
IOS_TARGETS := \
|
||||
out/iosdebug/tildefriends \
|
||||
out/iosrelease/tildefriends
|
||||
IOSSIM_TARGETS := \
|
||||
out/iossimdebug/tildefriends \
|
||||
out/iossimrelease/tildefriends
|
||||
IOS_APPS = \
|
||||
out/tildefriends-iosdebug.app/tildefriends \
|
||||
out/tildefriends-iosrelease.app/tildefriends
|
||||
ifeq ($(HAVE_LINUX_IOS),1)
|
||||
BUILD_TYPES += iosdebug iosrelease
|
||||
all: $(IOS_APPS)
|
||||
endif
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
all: $(IOS_APPS) \
|
||||
out/tildefriends-iossimdebug.app/tildefriends \
|
||||
out/tildefriends-iossimrelease.app/tildefriends
|
||||
endif
|
||||
|
||||
DEBUG_TARGETS := \
|
||||
out/debug/tildefriends \
|
||||
out/windebug/tildefriends.exe \
|
||||
out/iosdebug/tildefriends \
|
||||
out/iossimdebug/tildefriends \
|
||||
out/macosdebug/tildefriends \
|
||||
out/androiddebug/tildefriends \
|
||||
out/androiddebug-armv7a/tildefriends \
|
||||
out/androiddebug-x86_64/tildefriends \
|
||||
out/androiddebug-x86/tildefriends
|
||||
RELEASE_TARGETS := \
|
||||
out/release/tildefriends \
|
||||
out/winrelease/tildefriends.exe \
|
||||
out/iosrelease/tildefriends \
|
||||
out/iossimrelease/tildefriends \
|
||||
out/macosrelease/tildefriends \
|
||||
out/androidrelease/tildefriends \
|
||||
out/androidrelease-armv7a/tildefriends \
|
||||
out/androidrelease-x86_64/tildefriends \
|
||||
out/androidrelease-x86/tildefriends
|
||||
ALL_TARGETS = $(DEBUG_TARGETS) $(RELEASE_TARGETS)
|
||||
ANDROID_RELEASE_TARGETS := $(filter-out $(DEBUG_TARGETS),$(ANDROID_TARGETS))
|
||||
NONANDROID_RELEASE_TARGETS := $(filter-out $(ANDROID_ARM64_TARGETS),$(RELEASE_TARGETS))
|
||||
NONANDROID_TARGETS := $(filter-out $(ANDROID_TARGETS),$(ALL_TARGETS))
|
||||
NONMACOS_TARGETS := $(filter-out $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS),$(ALL_TARGETS))
|
||||
|
||||
$(NONANDROID_TARGETS): CFLAGS += -fno-omit-frame-pointer
|
||||
$(filter-out $(ANDROID_TARGETS) $(WINDOWS_TARGETS),$(ALL_TARGETS)): LDFLAGS += -rdynamic
|
||||
$(ANDROID_TARGETS): CFLAGS += \
|
||||
--sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/sysroot \
|
||||
-fPIC \
|
||||
-fdebug-compilation-dir . \
|
||||
-fomit-frame-pointer \
|
||||
-fno-asynchronous-unwind-tables \
|
||||
-funwind-tables
|
||||
$(ANDROID_TARGETS): LDFLAGS += --sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC
|
||||
$(DEBUG_TARGETS): CFLAGS += -DDEBUG -Og
|
||||
$(RELEASE_TARGETS): CFLAGS += -DNDEBUG
|
||||
$(NONANDROID_RELEASE_TARGETS): CFLAGS += -O3
|
||||
$(ANDROID_RELEASE_TARGETS): CFLAGS += -Os
|
||||
$(WINDOWS_TARGETS): CC = x86_64-w64-mingw32-gcc-win32
|
||||
$(WINDOWS_TARGETS): AS = $(CC)
|
||||
$(WINDOWS_TARGETS): CFLAGS += \
|
||||
-D_WIN32_WINNT=0x0A00 \
|
||||
-DWINVER=0x0A00 \
|
||||
-DNTDDI_VERSION=NTDDI_WIN10 \
|
||||
-Ideps/openssl/mingw64/usr/local/include
|
||||
$(WINDOWS_TARGETS): LDFLAGS += \
|
||||
-static \
|
||||
-lm \
|
||||
-Ldeps/openssl/mingw64/usr/local/lib
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
$(MACOS_TARGETS): CC = xcrun clang
|
||||
$(IOS_TARGETS): IOS_SYSROOT := $(shell xcrun --sdk iphoneos --show-sdk-path)
|
||||
$(IOS_TARGETS): CC = xcrun --sdk iphoneos clang -isysroot $(IOS_SYSROOT) -arch arm64
|
||||
$(IOSSIM_TARGETS): IOSSIM_SYSROOT := $(shell xcrun --sdk iphonesimulator --show-sdk-path)
|
||||
$(IOSSIM_TARGETS): CC = xcrun --sdk iphonesimulator clang -isysroot $(IOSSIM_SYSROOT) -arch x86_64
|
||||
else ifeq ($(UNAME_S),Linux)
|
||||
$(IOS_TARGETS): IOS_SYSROOT := deps/iPhoneOS17.0.sdk
|
||||
$(IOS_TARGETS): CC = PATH=$$PATH:deps/ios_toolchain/target/bin deps/ios_toolchain/target/bin/arm-apple-darwin11-clang
|
||||
endif
|
||||
$(ANDROID_X86_64_TARGETS): ANDROID_NDK_TARGET_TRIPLE := x86_64-linux-android
|
||||
$(ANDROID_X86_TARGETS): ANDROID_NDK_TARGET_TRIPLE := i686-linux-android
|
||||
$(ANDROID_ARMV7A_TARGETS): ANDROID_NDK_TARGET_TRIPLE := armv7a-linux-androideabi
|
||||
$(ANDROID_ARM64_TARGETS): ANDROID_NDK_TARGET_TRIPLE := aarch64-linux-android
|
||||
$(ANDROID_TARGETS): CC = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/$(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_MIN_SDK_VERSION)-clang
|
||||
$(ANDROID_TARGETS): AS = $(CC)
|
||||
$(ANDROID_TARGETS): CFLAGS += \
|
||||
-target $(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_MIN_SDK_VERSION) \
|
||||
-Wno-unknown-warning-option
|
||||
$(ANDROID_ARMV7A_TARGETS): CFLAGS += -Ideps/openssl/android/armeabi-v7a/usr/local/include
|
||||
$(ANDROID_ARMV7A_TARGETS): LDFLAGS += -Ldeps/openssl/android/armeabi-v7a/usr/local/lib
|
||||
$(ANDROID_ARM64_TARGETS): CFLAGS += -Ideps/openssl/android/arm64-v8a/usr/local/include
|
||||
$(ANDROID_ARM64_TARGETS): LDFLAGS += -Ldeps/openssl/android/arm64-v8a/usr/local/lib
|
||||
$(ANDROID_X86_TARGETS): CFLAGS += -Ideps/openssl/android/x86/usr/local/include
|
||||
$(ANDROID_X86_TARGETS): CFLAGS += -Wno-atomic-alignment
|
||||
$(ANDROID_X86_TARGETS): LDFLAGS += -Ldeps/openssl/android/x86/usr/local/lib
|
||||
$(ANDROID_X86_64_TARGETS): CFLAGS += -Ideps/openssl/android/x86_64/usr/local/include
|
||||
$(ANDROID_X86_64_TARGETS): LDFLAGS += -Ldeps/openssl/android/x86_64/usr/local/lib
|
||||
$(NONMACOS_TARGETS): CFLAGS += -Wno-cast-function-type
|
||||
$(NONMACOS_TARGETS): LDFLAGS += -Wl,--gc-sections
|
||||
$(IOS_TARGETS): CFLAGS += -mios-version-min=9.0 -Ideps/openssl/ios/ios64-xcrun/usr/local/include
|
||||
$(IOS_TARGETS): LDFLAGS += -Ldeps/openssl/ios/ios64-xcrun/usr/local/lib
|
||||
$(IOSSIM_TARGETS): CFLAGS += -Ideps/openssl/ios/iossimulator-xcrun/usr/local/include
|
||||
$(IOSSIM_TARGETS): LDFLAGS += -Ldeps/openssl/ios/iossimulator-xcrun/usr/local/lib
|
||||
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
ifneq ($(UNAME_S),Haiku)
|
||||
debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
|
||||
debug: LDFLAGS += -fsanitize=address -fsanitize=undefined
|
||||
endif
|
||||
endif
|
||||
|
||||
get_objs = \
|
||||
$(foreach build_type,$(BUILD_TYPES),$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)))))) \
|
||||
$(foreach build_type,debug release,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))) \
|
||||
$(foreach build_type,windebug winrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_win))))) \
|
||||
$(foreach build_type,androiddebug androidrelease androiddebug-x86 androidrelease-x86 androiddebug-x86_64 androidrelease-x86_64 androiddebug-armv7a androiddebug-armv7a,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_android))))) \
|
||||
$(foreach build_type,androiddebug androidrelease androiddebug-x86 androidrelease-x86 androiddebug-x86_64 androidrelease-x86_64 androiddebug-armv7a androidrelease-armv7a,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))) \
|
||||
$(foreach build_type,macosdebug macosrelease iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_macos))))) \
|
||||
$(foreach build_type,iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_ios))))) \
|
||||
$(foreach build_type,androiddebug-x86 androidrelease-x86,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_x86)))))
|
||||
|
||||
APP_SOURCES := $(wildcard src/*.c)
|
||||
APP_SOURCES_ios := $(wildcard src/*.m)
|
||||
APP_OBJS := $(call get_objs,APP_SOURCES)
|
||||
$(APP_OBJS): CFLAGS += \
|
||||
-Ideps/base64c/include \
|
||||
-Ideps/crypt_blowfish \
|
||||
-Ideps/libbacktrace \
|
||||
-Ideps/libsodium \
|
||||
-Ideps/libsodium/src/libsodium/include \
|
||||
-Ideps/libuv/include \
|
||||
-Ideps/zlib \
|
||||
-Ideps/zlib/contrib/minizip \
|
||||
-Ideps/picohttpparser \
|
||||
-Ideps/quickjs \
|
||||
-Ideps/sqlite \
|
||||
-Ideps/valgrind \
|
||||
-Ideps/xopt \
|
||||
-Wdouble-promotion \
|
||||
-Werror
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
$(filter-out $(BUILD_DIR)/android% $(BUILD_DIR)/macos% $(BUILD_DIR)/ios%,$(APP_OBJS)): CFLAGS += \
|
||||
-fanalyzer
|
||||
endif
|
||||
|
||||
BLOWFISH_SOURCES := \
|
||||
deps/crypt_blowfish/crypt_blowfish.c \
|
||||
deps/crypt_blowfish/crypt_gensalt.c \
|
||||
deps/crypt_blowfish/wrapper.c
|
||||
BLOWFISH_SOURCES_win := \
|
||||
deps/crypt_blowfish/x86.S
|
||||
BLOWFISH_SOURCES_x86 := \
|
||||
deps/crypt_blowfish/x86.S
|
||||
BLOWFISH_OBJS := $(call get_objs,BLOWFISH_SOURCES)
|
||||
|
||||
UV_SOURCES := \
|
||||
deps/libuv/src/fs-poll.c \
|
||||
deps/libuv/src/idna.c \
|
||||
deps/libuv/src/inet.c \
|
||||
deps/libuv/src/random.c \
|
||||
deps/libuv/src/strscpy.c \
|
||||
deps/libuv/src/strtok.c \
|
||||
deps/libuv/src/threadpool.c \
|
||||
deps/libuv/src/timer.c \
|
||||
deps/libuv/src/uv-common.c \
|
||||
deps/libuv/src/uv-data-getter-setters.c \
|
||||
deps/libuv/src/version.c
|
||||
UV_SOURCES_unix := \
|
||||
deps/libuv/src/unix/async.c \
|
||||
deps/libuv/src/unix/core.c \
|
||||
deps/libuv/src/unix/dl.c \
|
||||
deps/libuv/src/unix/fs.c \
|
||||
deps/libuv/src/unix/getaddrinfo.c \
|
||||
deps/libuv/src/unix/getnameinfo.c \
|
||||
deps/libuv/src/unix/loop-watcher.c \
|
||||
deps/libuv/src/unix/loop.c \
|
||||
deps/libuv/src/unix/pipe.c \
|
||||
deps/libuv/src/unix/poll.c \
|
||||
deps/libuv/src/unix/process.c \
|
||||
deps/libuv/src/unix/random-devurandom.c \
|
||||
deps/libuv/src/unix/random-getrandom.c \
|
||||
deps/libuv/src/unix/signal.c \
|
||||
deps/libuv/src/unix/stream.c \
|
||||
deps/libuv/src/unix/tcp.c \
|
||||
deps/libuv/src/unix/thread.c \
|
||||
deps/libuv/src/unix/tty.c \
|
||||
deps/libuv/src/unix/udp.c
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
UV_SOURCES_unix += \
|
||||
deps/libuv/src/unix/linux.c \
|
||||
deps/libuv/src/unix/procfs-exepath.c \
|
||||
deps/libuv/src/unix/proctitle.c \
|
||||
deps/libuv/src/unix/random-sysctl-linux.c
|
||||
else ifeq ($(UNAME_S),Haiku)
|
||||
UV_SOURCES_unix += \
|
||||
deps/libuv/src/unix/bsd-ifaddrs.c \
|
||||
deps/libuv/src/unix/haiku.c \
|
||||
deps/libuv/src/unix/no-fsevents.c \
|
||||
deps/libuv/src/unix/no-proctitle.c \
|
||||
deps/libuv/src/unix/posix-hrtime.c \
|
||||
deps/libuv/src/unix/posix-poll.c
|
||||
else ifeq ($(UNAME_S),OpenBSD)
|
||||
UV_SOURCES_unix += \
|
||||
deps/libuv/src/unix/bsd-ifaddrs.c \
|
||||
deps/libuv/src/unix/kqueue.c \
|
||||
deps/libuv/src/unix/no-proctitle.c \
|
||||
deps/libuv/src/unix/openbsd.c \
|
||||
deps/libuv/src/unix/posix-hrtime.c \
|
||||
deps/libuv/src/unix/random-getentropy.c
|
||||
endif
|
||||
UV_SOURCES_android := \
|
||||
deps/libuv/src/unix/random-getentropy.c
|
||||
UV_SOURCES_win := \
|
||||
deps/libuv/src/win/async.c \
|
||||
deps/libuv/src/win/core.c \
|
||||
deps/libuv/src/win/detect-wakeup.c \
|
||||
deps/libuv/src/win/dl.c \
|
||||
deps/libuv/src/win/error.c \
|
||||
deps/libuv/src/win/fs-event.c \
|
||||
deps/libuv/src/win/fs.c \
|
||||
deps/libuv/src/win/getaddrinfo.c \
|
||||
deps/libuv/src/win/getnameinfo.c \
|
||||
deps/libuv/src/win/handle.c \
|
||||
deps/libuv/src/win/loop-watcher.c \
|
||||
deps/libuv/src/win/pipe.c \
|
||||
deps/libuv/src/win/poll.c \
|
||||
deps/libuv/src/win/process-stdio.c \
|
||||
deps/libuv/src/win/process.c \
|
||||
deps/libuv/src/win/signal.c \
|
||||
deps/libuv/src/win/snprintf.c \
|
||||
deps/libuv/src/win/stream.c \
|
||||
deps/libuv/src/win/tcp.c \
|
||||
deps/libuv/src/win/thread.c \
|
||||
deps/libuv/src/win/tty.c \
|
||||
deps/libuv/src/win/udp.c \
|
||||
deps/libuv/src/win/util.c \
|
||||
deps/libuv/src/win/winapi.c \
|
||||
deps/libuv/src/win/winsock.c
|
||||
UV_SOURCES_macos := \
|
||||
deps/libuv/src/unix/async.c \
|
||||
deps/libuv/src/unix/bsd-ifaddrs.c \
|
||||
deps/libuv/src/unix/core.c \
|
||||
deps/libuv/src/unix/darwin.c \
|
||||
deps/libuv/src/unix/darwin-proctitle.c \
|
||||
deps/libuv/src/unix/dl.c \
|
||||
deps/libuv/src/unix/fs.c \
|
||||
deps/libuv/src/unix/fsevents.c \
|
||||
deps/libuv/src/unix/getaddrinfo.c \
|
||||
deps/libuv/src/unix/getnameinfo.c \
|
||||
deps/libuv/src/unix/kqueue.c \
|
||||
deps/libuv/src/unix/loop-watcher.c \
|
||||
deps/libuv/src/unix/loop.c \
|
||||
deps/libuv/src/unix/pipe.c \
|
||||
deps/libuv/src/unix/poll.c \
|
||||
deps/libuv/src/unix/process.c \
|
||||
deps/libuv/src/unix/proctitle.c \
|
||||
deps/libuv/src/unix/random-devurandom.c \
|
||||
deps/libuv/src/unix/random-getentropy.c \
|
||||
deps/libuv/src/unix/signal.c \
|
||||
deps/libuv/src/unix/stream.c \
|
||||
deps/libuv/src/unix/tcp.c \
|
||||
deps/libuv/src/unix/thread.c \
|
||||
deps/libuv/src/unix/tty.c \
|
||||
deps/libuv/src/unix/udp.c
|
||||
UV_OBJS := $(call get_objs,UV_SOURCES)
|
||||
$(UV_OBJS): CFLAGS += \
|
||||
-Ideps/libuv/include \
|
||||
-Ideps/libuv/src \
|
||||
-Wno-dangling-pointer \
|
||||
-Wno-incompatible-pointer-types \
|
||||
-Wno-maybe-uninitialized \
|
||||
-Wno-sign-compare \
|
||||
-Wno-unused-but-set-parameter \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-unused-result \
|
||||
-Wno-unused-variable
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
$(UV_OBJS): CFLAGS += \
|
||||
-D_GNU_SOURCE
|
||||
else ifeq ($(UNAME_S),Haiku)
|
||||
$(UV_OBJS): CFLAGS += \
|
||||
-D_BSD_SOURCE \
|
||||
-Wno-format-truncation
|
||||
endif
|
||||
|
||||
SODIUM_SOURCES := \
|
||||
deps/libsodium/src/libsodium/crypto_aead/aegis128l/aead_aegis128l.c \
|
||||
deps/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.c \
|
||||
deps/libsodium/src/libsodium/crypto_aead/aegis256/aead_aegis256.c \
|
||||
deps/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_soft.c \
|
||||
deps/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512.c \
|
||||
deps/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256.c \
|
||||
deps/libsodium/src/libsodium/crypto_box/crypto_box.c \
|
||||
deps/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c \
|
||||
deps/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c \
|
||||
deps/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c \
|
||||
deps/libsodium/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_core/softaes/softaes.c \
|
||||
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c \
|
||||
deps/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c \
|
||||
deps/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256.c \
|
||||
deps/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c \
|
||||
deps/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c \
|
||||
deps/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \
|
||||
deps/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c \
|
||||
deps/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.c \
|
||||
deps/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c \
|
||||
deps/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c \
|
||||
deps/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c \
|
||||
deps/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c \
|
||||
deps/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c \
|
||||
deps/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c \
|
||||
deps/libsodium/src/libsodium/crypto_sign/crypto_sign.c \
|
||||
deps/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c \
|
||||
deps/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c \
|
||||
deps/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c \
|
||||
deps/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c \
|
||||
deps/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c \
|
||||
deps/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c \
|
||||
deps/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c \
|
||||
deps/libsodium/src/libsodium/crypto_verify/verify.c \
|
||||
deps/libsodium/src/libsodium/randombytes/randombytes.c \
|
||||
deps/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c \
|
||||
deps/libsodium/src/libsodium/sodium/core.c \
|
||||
deps/libsodium/src/libsodium/sodium/codecs.c \
|
||||
deps/libsodium/src/libsodium/sodium/runtime.c \
|
||||
deps/libsodium/src/libsodium/sodium/utils.c \
|
||||
deps/libsodium/src/libsodium/sodium/version.c
|
||||
SODIUM_OBJS := $(call get_objs,SODIUM_SOURCES)
|
||||
$(SODIUM_OBJS): CFLAGS += \
|
||||
-DCONFIGURED=1 \
|
||||
-DMINIMAL=1 \
|
||||
-DHAVE_ALLOCA \
|
||||
-DHAVE_CPUID_V \
|
||||
-DHAVE_GCC_MEMORY_FENCES \
|
||||
-Wno-unused-function \
|
||||
-Wno-unused-variable \
|
||||
-Wno-type-limits \
|
||||
-Wno-unknown-pragmas \
|
||||
-Wno-attributes \
|
||||
-Ideps/libsodium/builds/msvc \
|
||||
-Ideps/libsodium/src/libsodium/include/sodium
|
||||
ifneq ($(UNAME_S),OpenBSD)
|
||||
$(filter-out $(BUILD_DIR)/win%,$(SODIUM_OBJS)): CFLAGS += \
|
||||
-DHAVE_ALLOCA_H
|
||||
endif
|
||||
|
||||
SQLITE_SOURCES := deps/sqlite/sqlite3.c
|
||||
SQLITE_OBJS := $(call get_objs,SQLITE_SOURCES)
|
||||
$(SQLITE_OBJS): CFLAGS += \
|
||||
-DSQLITE_DBCONFIG_DEFAULT_DEFENSIVE \
|
||||
-DSQLITE_DEFAULT_MEMSTATUS=0 \
|
||||
-DSQLITE_DQS=0 \
|
||||
-DSQLITE_ENABLE_MEMSYS5 \
|
||||
-DSQLITE_ENABLE_FTS5 \
|
||||
-DSQLITE_ENABLE_JSON1 \
|
||||
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
|
||||
-DSQLITE_MAX_ATTACHED=1 \
|
||||
-DSQLITE_MAX_COLUMN=100 \
|
||||
-DSQLITE_MAX_COMPOUND_SELECT=300 \
|
||||
-DSQLITE_MAX_EXPR_DEPTH=40 \
|
||||
-DSQLITE_MAX_FUNCTION_ARG=8 \
|
||||
-DSQLITE_MAX_LENGTH=5242880 \
|
||||
-DSQLITE_MAX_LIKE_PATTERN_LENGTH=50 \
|
||||
-DSQLITE_MAX_SQL_LENGTH=100000 \
|
||||
-DSQLITE_MAX_TRIGGER_DEPTH=10 \
|
||||
-DSQLITE_MAX_VARIABLE_NUMBER=100 \
|
||||
-DSQLITE_MAX_VDBE_OP=25000 \
|
||||
-DSQLITE_OMIT_DEPRECATED \
|
||||
-DSQLITE_OMIT_DESERIALIZE \
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION \
|
||||
-DSQLITE_OMIT_TCL_VARIABLE \
|
||||
-DSQLITE_PRAGMA_DEFAULT_WAL_SYNCHRONOUS=1 \
|
||||
-DSQLITE_SECURE_DELETE \
|
||||
-DSQLITE_THREADSAFE=2 \
|
||||
-DSQLITE_UNTESTABLE \
|
||||
-DSQLITE_USE_ALLOCA \
|
||||
-DHAVE_ISNAN \
|
||||
-DHAVE_GETHOSTUUID=0 \
|
||||
-Wno-implicit-fallthrough \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-unused-function \
|
||||
-Wno-unused-variable
|
||||
|
||||
XOPT_SOURCES := deps/xopt/xopt.c
|
||||
XOPT_OBJS := $(call get_objs,XOPT_SOURCES)
|
||||
$(filter $(BUILD_DIR)/win%,$(XOPT_OBJS)): CFLAGS += \
|
||||
-DHAVE_SNPRINTF \
|
||||
-DHAVE_VSNPRINTF \
|
||||
-DHAVE_VASNPRINTF \
|
||||
-DHAVE_VASPRINTF \
|
||||
-Dvsnprintf=rpl_vsnprintf
|
||||
$(XOPT_OBJS): CFLAGS += \
|
||||
-Wno-implicit-const-int-float-conversion
|
||||
|
||||
QUICKJS_SOURCES := \
|
||||
deps/quickjs/cutils.c \
|
||||
deps/quickjs/libbf.c \
|
||||
deps/quickjs/libregexp.c \
|
||||
deps/quickjs/libunicode.c \
|
||||
deps/quickjs/quickjs.c
|
||||
QUICKJS_OBJS := $(call get_objs,QUICKJS_SOURCES)
|
||||
$(QUICKJS_OBJS): CFLAGS += \
|
||||
-DCONFIG_VERSION=\"$(shell cat deps/quickjs/VERSION)\" \
|
||||
-DCONFIG_BIGNUM \
|
||||
-D_GNU_SOURCE \
|
||||
-Wno-enum-conversion \
|
||||
-Wno-implicit-const-int-float-conversion \
|
||||
-Wno-implicit-fallthrough \
|
||||
-Wno-sign-compare \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-unused-variable
|
||||
$(NONANDROID_TARGETS): CFLAGS += -DDUMP_LEAKS
|
||||
|
||||
LIBBACKTRACE_SOURCES := \
|
||||
deps/libbacktrace/atomic.c \
|
||||
deps/libbacktrace/backtrace.c \
|
||||
deps/libbacktrace/dwarf.c \
|
||||
deps/libbacktrace/fileline.c \
|
||||
deps/libbacktrace/print.c \
|
||||
deps/libbacktrace/simple.c \
|
||||
deps/libbacktrace/sort.c \
|
||||
deps/libbacktrace/state.c
|
||||
LIBBACKTRACE_SOURCES_unix := \
|
||||
deps/libbacktrace/elf.c \
|
||||
deps/libbacktrace/mmap.c \
|
||||
deps/libbacktrace/mmapio.c \
|
||||
deps/libbacktrace/posix.c
|
||||
LIBBACKTRACE_SOURCES_win := \
|
||||
deps/libbacktrace/alloc.c \
|
||||
deps/libbacktrace/pecoff.c \
|
||||
deps/libbacktrace/posix.c \
|
||||
deps/libbacktrace/read.c
|
||||
LIBBACKTRACE_SOURCES_macos := \
|
||||
deps/libbacktrace/dwarf.c \
|
||||
deps/libbacktrace/macho.c \
|
||||
deps/libbacktrace/mmap.c \
|
||||
deps/libbacktrace/mmapio.c \
|
||||
deps/libbacktrace/posix.c
|
||||
LIBBACKTRACE_OBJS := $(call get_objs,LIBBACKTRACE_SOURCES)
|
||||
$(LIBBACKTRACE_OBJS): CFLAGS += \
|
||||
-Ideps/libbacktrace_config \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-maybe-initialized \
|
||||
-Wno-unused-function \
|
||||
-DBACKTRACE_ELF_SIZE=64
|
||||
|
||||
PICOHTTPPARSER_SOURCES := \
|
||||
deps/picohttpparser/picohttpparser.c
|
||||
PICOHTTPPARSER_OBJS := $(call get_objs,PICOHTTPPARSER_SOURCES)
|
||||
|
||||
MINIUNZIP_SOURCES := \
|
||||
deps/zlib/contrib/minizip/unzip.c \
|
||||
deps/zlib/contrib/minizip/ioapi.c \
|
||||
deps/zlib/adler32.c \
|
||||
deps/zlib/crc32.c \
|
||||
deps/zlib/inffast.c \
|
||||
deps/zlib/inflate.c \
|
||||
deps/zlib/inftrees.c \
|
||||
deps/zlib/zutil.c
|
||||
MINIUNZIP_OBJS := $(call get_objs,MINIUNZIP_SOURCES)
|
||||
$(MINIUNZIP_OBJS): CFLAGS += \
|
||||
-Ideps/zlib \
|
||||
-Wno-maybe-uninitialized
|
||||
|
||||
LDFLAGS += \
|
||||
-pthread \
|
||||
-lm
|
||||
debug release $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
|
||||
-lssl \
|
||||
-lcrypto
|
||||
ifneq ($(UNAME_S),Haiku)
|
||||
ifneq ($(UNAME_S),OpenBSD)
|
||||
debug release $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
|
||||
-ldl
|
||||
endif
|
||||
endif
|
||||
$(WINDOWS_TARGETS): LDFLAGS += \
|
||||
-lssl \
|
||||
-lcrypto \
|
||||
-lcrypt32 \
|
||||
-ldbghelp \
|
||||
-liphlpapi \
|
||||
-lkernel32 \
|
||||
-lole32 \
|
||||
-luserenv \
|
||||
-luuid \
|
||||
-lws2_32 \
|
||||
-lwsock32
|
||||
$(ANDROID_TARGETS): LDFLAGS += \
|
||||
-target $(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_MIN_SDK_VERSION) \
|
||||
-ldl \
|
||||
-llog \
|
||||
-lssl \
|
||||
-lcrypto
|
||||
$(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): CFLAGS += \
|
||||
-Wno-unknown-warning-option
|
||||
$(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
|
||||
-framework Foundation \
|
||||
-framework CoreFoundation \
|
||||
-framework UIKit \
|
||||
-framework WebKit
|
||||
|
||||
unix: debug release
|
||||
win: windebug winrelease
|
||||
all: $(BUILD_TYPES)
|
||||
.PHONY: all win unix
|
||||
|
||||
ALL_APP_OBJS := \
|
||||
$(APP_OBJS) \
|
||||
$(BLOWFISH_OBJS) \
|
||||
$(LIBBACKTRACE_OBJS) \
|
||||
$(MINIUNZIP_OBJS) \
|
||||
$(PICOHTTPPARSER_OBJS) \
|
||||
$(QUICKJS_OBJS) \
|
||||
$(SODIUM_OBJS) \
|
||||
$(SQLITE_OBJS) \
|
||||
$(UV_OBJS) \
|
||||
$(XOPT_OBJS)
|
||||
|
||||
DEPS = $(ALL_APP_OBJS:.o=.d)
|
||||
-include $(DEPS)
|
||||
|
||||
define build_rules
|
||||
$(1): $(BUILD_DIR)/$(1)/$(PROJECT)$(if $(filter win%,$(1)),.exe)
|
||||
.PHONY: $(1)
|
||||
|
||||
$(BUILD_DIR)/$(1)/$(PROJECT)$(if $(filter win%,$(1)),.exe): $(filter $(BUILD_DIR)/$(1)/%,$(ALL_APP_OBJS))
|
||||
@echo [link] $$@
|
||||
@$$(CC) -o $$@ $$^ $$(LDFLAGS)
|
||||
|
||||
$(BUILD_DIR)/$(1)/%.o: %.c
|
||||
@mkdir -p $$(dir $$@)
|
||||
@echo [c] $$@
|
||||
@$$(CC) $$(CFLAGS) -c $$< -o $$@
|
||||
|
||||
$(BUILD_DIR)/$(1)/%.o: %.m
|
||||
@mkdir -p $$(dir $$@)
|
||||
@echo [m] $$@
|
||||
@$$(CC) $$(CFLAGS) -c $$< -o $$@
|
||||
|
||||
$(BUILD_DIR)/$(1)/%.o: %.S
|
||||
@mkdir -p $$(dir $$@)
|
||||
@echo [as] $$@
|
||||
@$$(AS) -c $$< -o $$@
|
||||
endef
|
||||
|
||||
$(foreach build_type,$(BUILD_TYPES),$(eval $(call build_rules,$(build_type))))
|
||||
|
||||
src/version.h : $(firstword $(MAKEFILE_LIST))
|
||||
@echo [version] $@
|
||||
@echo "#define VERSION_NUMBER \"$(VERSION_NUMBER)\"" > $@
|
||||
@echo "#define VERSION_NAME \"$(VERSION_NAME)\"" >> $@
|
||||
|
||||
src/android/AndroidManifest.xml : $(firstword $(MAKEFILE_LIST))
|
||||
@echo [android_version] $@
|
||||
@sed -i \
|
||||
-e 's/versionCode=".*"/versionCode="$(VERSION_CODE)"/' \
|
||||
-e 's/versionName=".*"/versionName="$(VERSION_NUMBER)"/' \
|
||||
-e 's/android:minSdkVersion="[[:digit:]]*"/android:minSdkVersion="$(ANDROID_MIN_SDK_VERSION)"/' \
|
||||
-e 's/android:targetSdkVersion="[[:digit:]]*"/android:targetSdkVersion="$(ANDROID_TARGET_SDK_VERSION)"/' \
|
||||
$@
|
||||
|
||||
# Android support.
|
||||
out/res/layout_activity_main.xml.flat: src/android/res/layout/activity_main.xml
|
||||
@mkdir -p $(dir $@)
|
||||
@echo [aapt2] $@
|
||||
@$(ANDROID_BUILD_TOOLS)/aapt2 compile -o out/res/ src/android/res/layout/activity_main.xml
|
||||
|
||||
out/res/drawable_icon.xml.flat: src/android/res/drawable/icon.xml
|
||||
@mkdir -p $(dir $@)
|
||||
@echo [aapt2] $@
|
||||
@$(ANDROID_BUILD_TOOLS)/aapt2 compile -o out/res/ src/android/res/drawable/icon.xml
|
||||
|
||||
out/apk/res.apk out/gen/com/unprompted/tildefriends/R.java: out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat src/android/AndroidManifest.xml
|
||||
@mkdir -p $(dir $@)
|
||||
@$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat --manifest src/android/AndroidManifest.xml -o out/apk/res.apk --java out/gen/
|
||||
|
||||
JAVA_FILES := out/gen/com/unprompted/tildefriends/R.java $(wildcard src/android/com/unprompted/tildefriends/*.java)
|
||||
CLASS_FILES := $(foreach src,$(JAVA_FILES),out/classes/com/unprompted/tildefriends/$(notdir $(src:.java=.class)))
|
||||
|
||||
$(CLASS_FILES) &: $(JAVA_FILES)
|
||||
@echo [javac] $(CLASS_FILES)
|
||||
@javac --release 8 -Xlint:deprecation -classpath $(ANDROID_PLATFORM)/android.jar -d out/classes $(JAVA_FILES)
|
||||
|
||||
out/apk/classes.dex: $(CLASS_FILES)
|
||||
@mkdir -p $(dir $@)
|
||||
@echo [d8] $@
|
||||
@$(ANDROID_BUILD_TOOLS)/d8 --$(BUILD_TYPE) --lib $(ANDROID_PLATFORM)/android.jar --output $(dir $@) out/classes/com/unprompted/tildefriends/*.class
|
||||
|
||||
PACKAGE_DIRS := \
|
||||
apps/ \
|
||||
core/ \
|
||||
deps/codemirror/ \
|
||||
deps/lit/
|
||||
|
||||
RAW_FILES := $(filter-out apps/blog% apps/gg% apps/issues% apps/welcome% apps/journal% %.map, $(shell find $(PACKAGE_DIRS) -type f))
|
||||
|
||||
out/apk/TildeFriends-arm-debug.unsigned.apk: BUILD_TYPE := debug
|
||||
out/apk/TildeFriends-arm-release.unsigned.apk: BUILD_TYPE := release
|
||||
out/apk/TildeFriends-x86-debug.unsigned.apk: BUILD_TYPE := debug
|
||||
out/apk/TildeFriends-x86-release.unsigned.apk: BUILD_TYPE := release
|
||||
|
||||
out/apk/TildeFriends-arm-debug.unsigned.apk: out/apk/classes.dex out/androiddebug/tildefriends out/androiddebug-armv7a/tildefriends $(RAW_FILES) out/apk/res.apk
|
||||
out/apk/TildeFriends-arm-release.unsigned.apk: out/apk/classes.dex out/androidrelease/tildefriends out/androidrelease-armv7a/tildefriends $(RAW_FILES) out/apk/res.apk
|
||||
out/apk/TildeFriends-x86-debug.unsigned.apk: out/apk/classes.dex out/androiddebug-x86_64/tildefriends out/androiddebug-x86/tildefriends $(RAW_FILES) out/apk/res.apk
|
||||
out/apk/TildeFriends-x86-release.unsigned.apk: out/apk/classes.dex out/androidrelease-x86_64/tildefriends out/androidrelease-x86/tildefriends $(RAW_FILES) out/apk/res.apk
|
||||
|
||||
out/apk/TildeFriends-arm-%.unsigned.apk:
|
||||
@mkdir -p $(dir $@) out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/ out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/
|
||||
@echo [aapt] $@
|
||||
@cp out/android$(BUILD_TYPE)/tildefriends out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/tildefriends.so
|
||||
@cp out/android$(BUILD_TYPE)-armv7a/tildefriends out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/tildefriends.so
|
||||
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/tildefriends.so
|
||||
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/tildefriends.so
|
||||
@cp out/apk/res.apk $@
|
||||
@cp out/apk/classes.dex out/apk-arm-$(BUILD_TYPE)/
|
||||
@cd out/apk-arm-$(BUILD_TYPE) && zip -u ../../$@ -q -9 -r . && cd ../../
|
||||
@zip -u $@ -q -9 $(RAW_FILES)
|
||||
|
||||
out/apk/TildeFriends-x86-%.unsigned.apk:
|
||||
@mkdir -p $(dir $@) out/apk-x86-$(BUILD_TYPE)/lib/x86_64/ out/apk-x86-$(BUILD_TYPE)/lib/x86/
|
||||
@echo [aapt] $@
|
||||
@cp out/android$(BUILD_TYPE)-x86_64/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86_64/tildefriends.so
|
||||
@cp out/android$(BUILD_TYPE)-x86/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86/tildefriends.so
|
||||
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86_64/tildefriends.so
|
||||
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86/tildefriends.so
|
||||
@cp out/apk/res.apk $@
|
||||
@cp out/apk/classes.dex out/apk-x86-$(BUILD_TYPE)/
|
||||
@cd out/apk-x86-$(BUILD_TYPE) && zip -u ../../$@ -q -9 -r . && cd ../../
|
||||
@zip -u $@ -q -9 $(RAW_FILES)
|
||||
|
||||
out/%.apk: out/apk/%.unsigned.apk
|
||||
@echo [apksigner] $(notdir $@)
|
||||
@$(ANDROID_BUILD_TOOLS)/apksigner sign --ks .keys/android.jks --ks-key-alias androidKey --ks-pass pass:android --key-pass pass:android --out $@ $<
|
||||
|
||||
release-apk: out/TildeFriends-arm-release.apk out/TildeFriends-x86-release.apk
|
||||
.PHONY: release-apk
|
||||
|
||||
releaseapkgo: out/TildeFriends-arm-release.apk
|
||||
@adb install -r $<
|
||||
@adb shell am start com.unprompted.tildefriends/.MainActivity
|
||||
.PHONY: releaseapkgo
|
||||
|
||||
# iOS Support
|
||||
out/%.app/Info.plist: src/ios/Info.plist
|
||||
@mkdir -p $(dir $@)
|
||||
@cp -v $< $@
|
||||
out/%.app/tildefriends.png: src/ios/tildefriends.png
|
||||
@mkdir -p $(dir $@)
|
||||
@cp -v $< $@
|
||||
|
||||
out/%/data.zip: $(RAW_FILES)
|
||||
@zip -u $@ -q -9 $(RAW_FILES)
|
||||
|
||||
out/tildefriends-%.app/tildefriends: out/%/tildefriends out/tildefriends-%.app/Info.plist out/tildefriends-%.app/tildefriends.png out/tildefriends-%.app/data.zip
|
||||
@mkdir -p $(dir $@)
|
||||
@cp -v $< $@
|
||||
ifeq ($(HAVE_LINUX_IOS),1)
|
||||
@zsign -q -k .keys/apple.p12 -f -m src/ios/embedded.mobileprovision $(realpath $(dir $@))
|
||||
endif
|
||||
.SECONDARY:
|
||||
out/tildefriends-%.ipa: out/tildefriends-ios%.app/tildefriends
|
||||
@echo [ipa] $@
|
||||
@rm -rf $@.tmp $@
|
||||
@mkdir -p $@.tmp/Payload/tildefriends.app/
|
||||
@cp -R $(dir $<)/* $@.tmp/Payload/tildefriends.app/
|
||||
@cd $@.tmp/ && zip -u ../../$@ -q -9 -r ./
|
||||
@rm -rf $@.tmp/
|
||||
|
||||
iossimdebug-app: out/tildefriends-iossimdebug.app/tildefriends
|
||||
iossimrelease-app: out/tildefriends-iossimrelease.app/tildefriends
|
||||
iosdebug-app: out/tildefriends-iosdebug.app/tildefriends
|
||||
iosrelease-app: out/tildefriends-iosrelease.app/tildefriends
|
||||
|
||||
iosdebug-ipa: out/tildefriends-debug.ipa
|
||||
iosrelease-ipa: out/tildefriends-release.ipa
|
||||
.PHONY: iossimdebug-app iossimrelease-app iosdebug-app iosrelease-app
|
||||
|
||||
ios%go: out/tildefriends-ios%.app/tildefriends
|
||||
ideviceinstaller -i $(realpath $(dir $<))
|
||||
|
||||
iossimdebuggo: out/tildefriends-iossimdebug.app/tildefriends
|
||||
xcrun simctl install booted out/tildefriends-iossimdebug.app/
|
||||
xcrun simctl launch booted com.unprompted.tildefriends
|
||||
.PHONY: iossimdebuggo
|
||||
|
||||
apklog:
|
||||
@adb logcat *:S tildefriends
|
||||
.PHONY: apklog
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
.PHONY: clean
|
||||
|
||||
dist: release-apk iosrelease-ipa
|
||||
@echo "[export] $$(svn info --show-item url)"
|
||||
@rm -rf tildefriends-$(VERSION_NUMBER)
|
||||
@svn export -q . tildefriends-$(VERSION_NUMBER)
|
||||
@echo "tildefriends-$(VERSION_NUMBER): $(VERSION_NAME)" > tildefriends-$(VERSION_NUMBER)/VERSION
|
||||
@echo "[tar] tildefriends-$(VERSION_NUMBER).tar.xz"
|
||||
@tar \
|
||||
--exclude=apps/gg* \
|
||||
--exclude=apps/welcome* \
|
||||
--exclude=deps/libbacktrace/Isaac.Newton-Opticks.txt \
|
||||
--exclude=deps/libsodium/builds/msvc/vs* \
|
||||
--exclude=deps/libsodium/builds/msvc/build \
|
||||
--exclude=deps/libsodium/builds/msvc/properties \
|
||||
--exclude=deps/libsodium/configure \
|
||||
--exclude=deps/libsodium/test \
|
||||
--exclude=deps/libuv/docs \
|
||||
--exclude=deps/libuv/test \
|
||||
--exclude=deps/openssl \
|
||||
--exclude=deps/speedscope/*.map \
|
||||
--exclude=deps/sqlite/shell.c \
|
||||
--exclude=deps/zlib/contrib/vstudio \
|
||||
--exclude=deps/zlib/doc \
|
||||
-caf tildefriends-$(VERSION_NUMBER).tar.xz tildefriends-$(VERSION_NUMBER)
|
||||
@rm -rf tildefriends-$(VERSION_NUMBER)
|
||||
@echo "[cp] TildeFriends-x86-$(VERSION_NUMBER).apk"
|
||||
@cp out/TildeFriends-x86-release.apk TildeFriends-x86-$(VERSION_NUMBER).apk
|
||||
@echo "[cp] TildeFriends-arm-$(VERSION_NUMBER).apk"
|
||||
@cp out/TildeFriends-arm-release.apk TildeFriends-arm-$(VERSION_NUMBER).apk
|
||||
@echo "[cp] TildeFriends-$(VERSION_NUMBER).ipa"
|
||||
@cp out/tildefriends-release.ipa TildeFriends-$(VERSION_NUMBER).ipa
|
||||
.PHONY: dist
|
||||
|
||||
dist-test: dist
|
||||
@tar -xf tildefriends-$(VERSION_NUMBER).tar.xz
|
||||
@$(MAKE) -C tildefriends-$(VERSION_NUMBER)/ debug release
|
||||
@docker build tildefriends-$(VERSION_NUMBER)/
|
||||
@rm -rf tildefriends-$(VERSION_NUMBER)
|
||||
.PHONY: dist-test
|
561
Makefile
561
Makefile
@ -1,561 +0,0 @@
|
||||
.ONESHELL:
|
||||
.DELETE_ON_ERROR:
|
||||
MAKEFLAGS += --warn-undefined-variables
|
||||
MAKEFLAGS += --no-builtin-rules
|
||||
|
||||
VERSION_CODE := 11
|
||||
VERSION_NUMBER := 0.0.11
|
||||
VERSION_NAME := Be nothing, and you will have everything to give to others.
|
||||
|
||||
PROJECT = tildefriends
|
||||
BUILD_DIR ?= out
|
||||
BUILD_TYPES := debug release windebug winrelease androiddebug androidrelease androiddebug-x86_64 androidrelease-x86_64
|
||||
UNAME_M := $(shell uname -m)
|
||||
|
||||
CFLAGS += \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-cast-function-type \
|
||||
-MMD \
|
||||
-ffunction-sections \
|
||||
-fdata-sections \
|
||||
-fno-exceptions \
|
||||
-g
|
||||
LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
ANDROID_SDK ?= ~/Android/Sdk
|
||||
ANDROID_BUILD_TOOLS := $(ANDROID_SDK)/build-tools/33.0.1
|
||||
ANDROID_PLATFORM := $(ANDROID_SDK)/platforms/android-33
|
||||
ANDROID_NDK ?= $(ANDROID_SDK)/ndk/23.1.7779620
|
||||
ANDROID_MIN_SDK_VERSION := 28
|
||||
|
||||
ANDROID_ARM64_TARGETS := \
|
||||
out/androiddebug/tildefriends \
|
||||
out/androidrelease/tildefriends
|
||||
ANDROID_X86_64_TARGETS := \
|
||||
out/androiddebug-x86_64/tildefriends \
|
||||
out/androidrelease-x86_64/tildefriends
|
||||
ANDROID_TARGETS := \
|
||||
$(ANDROID_X86_64_TARGETS) \
|
||||
$(ANDROID_ARM64_TARGETS)
|
||||
|
||||
DEBUG_TARGETS := \
|
||||
out/debug/tildefriends \
|
||||
out/windebug/tildefriends \
|
||||
out/androiddebug/tildefriends \
|
||||
out/androiddebug-x86_64/tildefriends
|
||||
RELEASE_TARGETS := \
|
||||
out/release/tildefriends \
|
||||
out/winrelease/tildefriends \
|
||||
out/androidrelease/tildefriends \
|
||||
out/androidrelease-x86_64/tildefriends
|
||||
ANDROID_RELEASE_TARGETS := $(filter-out $(DEBUG_TARGETS),$(ANDROID_TARGETS))
|
||||
NONANDROID_RELEASE_TARGETS := $(filter-out $(ANDROID_ARM64_TARGETS),$(RELEASE_TARGETS))
|
||||
NONANDROID_TARGETS := $(filter-out $(ANDROID_TARGETS),$(DEBUG_TARGETS) $(RELEASE_TARGETS))
|
||||
|
||||
$(NONANDROID_TARGETS): CFLAGS += -fno-omit-frame-pointer
|
||||
$(NONANDROID_TARGETS): LDFLAGS += -rdynamic
|
||||
$(ANDROID_TARGETS): CFLAGS += \
|
||||
--sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/sysroot \
|
||||
-fPIC \
|
||||
-fdebug-compilation-dir . \
|
||||
-fomit-frame-pointer \
|
||||
-fno-asynchronous-unwind-tables \
|
||||
-funwind-tables
|
||||
$(ANDROID_TARGETS): LDFLAGS += --sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC
|
||||
$(DEBUG_TARGETS): CFLAGS += -DDEBUG -Og
|
||||
$(RELEASE_TARGETS): CFLAGS += -DNDEBUG
|
||||
$(NONANDROID_RELEASE_TARGETS): CFLAGS += -O3
|
||||
$(ANDROID_RELEASE_TARGETS): CFLAGS += -Os
|
||||
windebug winrelease: CC = x86_64-w64-mingw32-gcc-win32
|
||||
windebug winrelease: AS = $(CC)
|
||||
windebug winrelease: CFLAGS += \
|
||||
-D_WIN32_WINNT=0x0A00 \
|
||||
-DWINVER=0x0A00 \
|
||||
-DNTDDI_VERSION=NTDDI_WIN10 \
|
||||
-Ideps/openssl/mingw64/include
|
||||
windebug winrelease: LDFLAGS += \
|
||||
-static \
|
||||
-lm \
|
||||
-Ldeps/openssl/mingw64/lib
|
||||
$(ANDROID_X86_64_TARGETS): ANDROID_NDK_TARGET_TRIPLE := x86_64-linux-android
|
||||
$(ANDROID_ARM64_TARGETS): ANDROID_NDK_TARGET_TRIPLE := aarch64-linux-android
|
||||
$(ANDROID_TARGETS): CC = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/$(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_MIN_SDK_VERSION)-clang
|
||||
$(ANDROID_TARGETS): AS = $(CC)
|
||||
$(ANDROID_TARGETS): CFLAGS += \
|
||||
-target $(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_MIN_SDK_VERSION) \
|
||||
-Wno-unknown-warning-option
|
||||
$(ANDROID_ARM64_TARGETS): CFLAGS += -Ideps/openssl/android/arm64-v8a/usr/local/include
|
||||
$(ANDROID_ARM64_TARGETS): LDFLAGS += -Ldeps/openssl/android/arm64-v8a/usr/local/lib
|
||||
$(ANDROID_X86_64_TARGETS): CFLAGS += -Ideps/openssl/android/x86_64/usr/local/include
|
||||
$(ANDROID_X86_64_TARGETS): LDFLAGS += -Ldeps/openssl/android/x86_64/usr/local/lib
|
||||
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
|
||||
debug: LDFLAGS += -fsanitize=address -fsanitize=undefined
|
||||
endif
|
||||
|
||||
get_objs = \
|
||||
$(foreach build_type,$(BUILD_TYPES),$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)))))) \
|
||||
$(foreach build_type,debug release,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))) \
|
||||
$(foreach build_type,windebug winrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_win))))) \
|
||||
$(foreach build_type,androiddebug androidrelease androiddebug-x86_64 androidrelease-x86_64,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_android))))) \
|
||||
$(foreach build_type,androiddebug androidrelease androiddebug-x86_64 androidrelease-x86_64,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix)))))
|
||||
|
||||
APP_SOURCES := $(wildcard src/*.c)
|
||||
APP_OBJS := $(call get_objs,APP_SOURCES)
|
||||
$(APP_OBJS): CFLAGS += \
|
||||
-Ideps/base64c/include \
|
||||
-Ideps/crypt_blowfish \
|
||||
-Ideps/libbacktrace \
|
||||
-Ideps/libsodium \
|
||||
-Ideps/libsodium/src/libsodium/include \
|
||||
-Ideps/libuv/include \
|
||||
-Ideps/zlib \
|
||||
-Ideps/zlib/contrib/minizip \
|
||||
-Ideps/picohttpparser \
|
||||
-Ideps/quickjs \
|
||||
-Ideps/sqlite \
|
||||
-Ideps/valgrind \
|
||||
-Ideps/xopt \
|
||||
-Wdouble-promotion \
|
||||
-Werror
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
$(filter-out $(BUILD_DIR)/android%,$(APP_OBJS)): CFLAGS += \
|
||||
-fanalyzer
|
||||
endif
|
||||
|
||||
BLOWFISH_SOURCES := \
|
||||
deps/crypt_blowfish/crypt_blowfish.c \
|
||||
deps/crypt_blowfish/crypt_gensalt.c \
|
||||
deps/crypt_blowfish/wrapper.c
|
||||
BLOWFISH_SOURCES_win = \
|
||||
deps/crypt_blowfish/x86.S
|
||||
BLOWFISH_OBJS := $(call get_objs,BLOWFISH_SOURCES)
|
||||
|
||||
UV_SOURCES := \
|
||||
deps/libuv/src/fs-poll.c \
|
||||
deps/libuv/src/idna.c \
|
||||
deps/libuv/src/inet.c \
|
||||
deps/libuv/src/random.c \
|
||||
deps/libuv/src/strscpy.c \
|
||||
deps/libuv/src/strtok.c \
|
||||
deps/libuv/src/threadpool.c \
|
||||
deps/libuv/src/timer.c \
|
||||
deps/libuv/src/uv-common.c \
|
||||
deps/libuv/src/uv-data-getter-setters.c \
|
||||
deps/libuv/src/version.c
|
||||
UV_SOURCES_unix := \
|
||||
deps/libuv/src/unix/async.c \
|
||||
deps/libuv/src/unix/core.c \
|
||||
deps/libuv/src/unix/dl.c \
|
||||
deps/libuv/src/unix/fs.c \
|
||||
deps/libuv/src/unix/getaddrinfo.c \
|
||||
deps/libuv/src/unix/getnameinfo.c \
|
||||
deps/libuv/src/unix/linux.c \
|
||||
deps/libuv/src/unix/loop-watcher.c \
|
||||
deps/libuv/src/unix/loop.c \
|
||||
deps/libuv/src/unix/pipe.c \
|
||||
deps/libuv/src/unix/poll.c \
|
||||
deps/libuv/src/unix/process.c \
|
||||
deps/libuv/src/unix/procfs-exepath.c \
|
||||
deps/libuv/src/unix/proctitle.c \
|
||||
deps/libuv/src/unix/random-devurandom.c \
|
||||
deps/libuv/src/unix/random-getrandom.c \
|
||||
deps/libuv/src/unix/random-sysctl-linux.c \
|
||||
deps/libuv/src/unix/signal.c \
|
||||
deps/libuv/src/unix/stream.c \
|
||||
deps/libuv/src/unix/tcp.c \
|
||||
deps/libuv/src/unix/thread.c \
|
||||
deps/libuv/src/unix/tty.c \
|
||||
deps/libuv/src/unix/udp.c
|
||||
UV_SOURCES_android := \
|
||||
deps/libuv/src/unix/random-getentropy.c
|
||||
UV_SOURCES_win := \
|
||||
deps/libuv/src/win/async.c \
|
||||
deps/libuv/src/win/core.c \
|
||||
deps/libuv/src/win/detect-wakeup.c \
|
||||
deps/libuv/src/win/dl.c \
|
||||
deps/libuv/src/win/error.c \
|
||||
deps/libuv/src/win/fs-event.c \
|
||||
deps/libuv/src/win/fs.c \
|
||||
deps/libuv/src/win/getaddrinfo.c \
|
||||
deps/libuv/src/win/getnameinfo.c \
|
||||
deps/libuv/src/win/handle.c \
|
||||
deps/libuv/src/win/loop-watcher.c \
|
||||
deps/libuv/src/win/pipe.c \
|
||||
deps/libuv/src/win/poll.c \
|
||||
deps/libuv/src/win/process-stdio.c \
|
||||
deps/libuv/src/win/process.c \
|
||||
deps/libuv/src/win/signal.c \
|
||||
deps/libuv/src/win/snprintf.c \
|
||||
deps/libuv/src/win/stream.c \
|
||||
deps/libuv/src/win/tcp.c \
|
||||
deps/libuv/src/win/thread.c \
|
||||
deps/libuv/src/win/tty.c \
|
||||
deps/libuv/src/win/udp.c \
|
||||
deps/libuv/src/win/util.c \
|
||||
deps/libuv/src/win/winapi.c \
|
||||
deps/libuv/src/win/winsock.c
|
||||
UV_OBJS := $(call get_objs,UV_SOURCES)
|
||||
$(UV_OBJS): CFLAGS += \
|
||||
-Ideps/libuv/include \
|
||||
-Ideps/libuv/src \
|
||||
-Wno-dangling-pointer \
|
||||
-Wno-incompatible-pointer-types \
|
||||
-Wno-maybe-uninitialized \
|
||||
-Wno-sign-compare \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-unused-result \
|
||||
-Wno-unused-variable \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
SODIUM_SOURCES := \
|
||||
deps/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512.c \
|
||||
deps/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256.c \
|
||||
deps/libsodium/src/libsodium/crypto_box/crypto_box.c \
|
||||
deps/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c \
|
||||
deps/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c \
|
||||
deps/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c \
|
||||
deps/libsodium/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c \
|
||||
deps/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c \
|
||||
deps/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256.c \
|
||||
deps/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c \
|
||||
deps/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c \
|
||||
deps/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \
|
||||
deps/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c \
|
||||
deps/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.c \
|
||||
deps/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c \
|
||||
deps/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c \
|
||||
deps/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c \
|
||||
deps/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c \
|
||||
deps/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c \
|
||||
deps/libsodium/src/libsodium/crypto_sign/crypto_sign.c \
|
||||
deps/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c \
|
||||
deps/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c \
|
||||
deps/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c \
|
||||
deps/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c \
|
||||
deps/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c \
|
||||
deps/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c \
|
||||
deps/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c \
|
||||
deps/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c \
|
||||
deps/libsodium/src/libsodium/crypto_verify/sodium/verify.c \
|
||||
deps/libsodium/src/libsodium/randombytes/randombytes.c \
|
||||
deps/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c \
|
||||
deps/libsodium/src/libsodium/sodium/core.c \
|
||||
deps/libsodium/src/libsodium/sodium/codecs.c \
|
||||
deps/libsodium/src/libsodium/sodium/runtime.c \
|
||||
deps/libsodium/src/libsodium/sodium/utils.c \
|
||||
deps/libsodium/src/libsodium/sodium/version.c
|
||||
SODIUM_OBJS := $(call get_objs,SODIUM_SOURCES)
|
||||
$(SODIUM_OBJS): CFLAGS += \
|
||||
-DCONFIGURED=1 \
|
||||
-DMINIMAL=1 \
|
||||
-Wno-unused-function \
|
||||
-Wno-unused-variable \
|
||||
-Wno-type-limits \
|
||||
-Wno-unknown-pragmas \
|
||||
-Ideps/libsodium/builds/msvc \
|
||||
-Ideps/libsodium/src/libsodium/include/sodium
|
||||
|
||||
SQLITE_SOURCES := deps/sqlite/sqlite3.c
|
||||
SQLITE_OBJS := $(call get_objs,SQLITE_SOURCES)
|
||||
$(SQLITE_OBJS): CFLAGS += \
|
||||
-DSQLITE_DBCONFIG_DEFAULT_DEFENSIVE \
|
||||
-DSQLITE_DEFAULT_MEMSTATUS=0 \
|
||||
-DSQLITE_DQS=0 \
|
||||
-DSQLITE_ENABLE_MEMSYS5 \
|
||||
-DSQLITE_ENABLE_FTS5 \
|
||||
-DSQLITE_ENABLE_JSON1 \
|
||||
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
|
||||
-DSQLITE_MAX_ATTACHED=1 \
|
||||
-DSQLITE_MAX_COLUMN=100 \
|
||||
-DSQLITE_MAX_COMPOUND_SELECT=300 \
|
||||
-DSQLITE_MAX_EXPR_DEPTH=40 \
|
||||
-DSQLITE_MAX_FUNCTION_ARG=8 \
|
||||
-DSQLITE_MAX_LENGTH=5242880 \
|
||||
-DSQLITE_MAX_LIKE_PATTERN_LENGTH=50 \
|
||||
-DSQLITE_MAX_SQL_LENGTH=100000 \
|
||||
-DSQLITE_MAX_TRIGGER_DEPTH=10 \
|
||||
-DSQLITE_MAX_VARIABLE_NUMBER=100 \
|
||||
-DSQLITE_MAX_VDBE_OP=25000 \
|
||||
-DSQLITE_OMIT_DEPRECATED \
|
||||
-DSQLITE_OMIT_DESERIALIZE \
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION \
|
||||
-DSQLITE_OMIT_TCL_VARIABLE \
|
||||
-DSQLITE_PRAGMA_DEFAULT_WAL_SYNCHRONOUS=1 \
|
||||
-DSQLITE_SECURE_DELETE \
|
||||
-DSQLITE_THREADSAFE=0 \
|
||||
-DSQLITE_UNTESTABLE \
|
||||
-DSQLITE_USE_ALLOCA \
|
||||
-DHAVE_ISNAN \
|
||||
-Wno-implicit-fallthrough \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-unused-function \
|
||||
-Wno-unused-variable
|
||||
|
||||
XOPT_SOURCES := deps/xopt/xopt.c
|
||||
XOPT_OBJS := $(call get_objs,XOPT_SOURCES)
|
||||
$(filter $(BUILD_DIR)/win%,$(XOPT_OBJS)): CFLAGS += \
|
||||
-DHAVE_SNPRINTF \
|
||||
-DHAVE_VSNPRINTF \
|
||||
-DHAVE_VASNPRINTF \
|
||||
-DHAVE_VASPRINTF \
|
||||
-Dvsnprintf=rpl_vsnprintf
|
||||
$(XOPT_OBJS): CFLAGS += \
|
||||
-Wno-implicit-const-int-float-conversion
|
||||
|
||||
QUICKJS_SOURCES := \
|
||||
deps/quickjs/cutils.c \
|
||||
deps/quickjs/libbf.c \
|
||||
deps/quickjs/libregexp.c \
|
||||
deps/quickjs/libunicode.c \
|
||||
deps/quickjs/quickjs.c
|
||||
QUICKJS_OBJS := $(call get_objs,QUICKJS_SOURCES)
|
||||
$(QUICKJS_OBJS): CFLAGS += \
|
||||
-DCONFIG_VERSION=\"$(shell cat deps/quickjs/VERSION)\" \
|
||||
-DCONFIG_BIGNUM \
|
||||
-D_GNU_SOURCE \
|
||||
-Wno-enum-conversion \
|
||||
-Wno-implicit-const-int-float-conversion \
|
||||
-Wno-implicit-fallthrough \
|
||||
-Wno-sign-compare \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-unused-variable
|
||||
$(NONANDROID_TARGETS): CFLAGS += -DDUMP_LEAKS
|
||||
|
||||
LIBBACKTRACE_SOURCES := \
|
||||
deps/libbacktrace/atomic.c \
|
||||
deps/libbacktrace/backtrace.c \
|
||||
deps/libbacktrace/dwarf.c \
|
||||
deps/libbacktrace/fileline.c \
|
||||
deps/libbacktrace/print.c \
|
||||
deps/libbacktrace/simple.c \
|
||||
deps/libbacktrace/sort.c \
|
||||
deps/libbacktrace/state.c
|
||||
LIBBACKTRACE_SOURCES_unix := \
|
||||
deps/libbacktrace/elf.c \
|
||||
deps/libbacktrace/mmap.c \
|
||||
deps/libbacktrace/mmapio.c \
|
||||
deps/libbacktrace/posix.c
|
||||
LIBBACKTRACE_SOURCES_win := \
|
||||
deps/libbacktrace/alloc.c \
|
||||
deps/libbacktrace/pecoff.c \
|
||||
deps/libbacktrace/posix.c \
|
||||
deps/libbacktrace/read.c
|
||||
LIBBACKTRACE_OBJS := $(call get_objs,LIBBACKTRACE_SOURCES)
|
||||
$(LIBBACKTRACE_OBJS): CFLAGS += \
|
||||
-Ideps/libbacktrace_config \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-maybe-initialized \
|
||||
-Wno-unused-function \
|
||||
-DBACKTRACE_ELF_SIZE=64
|
||||
|
||||
PICOHTTPPARSER_SOURCES := \
|
||||
deps/picohttpparser/picohttpparser.c
|
||||
PICOHTTPPARSER_OBJS := $(call get_objs,PICOHTTPPARSER_SOURCES)
|
||||
|
||||
MINIUNZIP_SOURCES := \
|
||||
deps/zlib/contrib/minizip/unzip.c \
|
||||
deps/zlib/contrib/minizip/ioapi.c \
|
||||
deps/zlib/adler32.c \
|
||||
deps/zlib/crc32.c \
|
||||
deps/zlib/inffast.c \
|
||||
deps/zlib/inflate.c \
|
||||
deps/zlib/inftrees.c \
|
||||
deps/zlib/zutil.c
|
||||
MINIUNZIP_OBJS := $(call get_objs,MINIUNZIP_SOURCES)
|
||||
$(MINIUNZIP_OBJS): CFLAGS += \
|
||||
-Ideps/zlib \
|
||||
-Wno-maybe-uninitialized
|
||||
|
||||
LDFLAGS += \
|
||||
-pthread \
|
||||
-lm
|
||||
debug release: LDFLAGS += \
|
||||
-ldl \
|
||||
-lssl \
|
||||
-lcrypto
|
||||
windebug winrelease: LDFLAGS += \
|
||||
-lssl \
|
||||
-lcrypto \
|
||||
-lcrypt32 \
|
||||
-ldbghelp \
|
||||
-liphlpapi \
|
||||
-lkernel32 \
|
||||
-lole32 \
|
||||
-luserenv \
|
||||
-luuid \
|
||||
-lws2_32 \
|
||||
-lwsock32
|
||||
$(ANDROID_TARGETS): LDFLAGS += \
|
||||
-target $(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_MIN_SDK_VERSION) \
|
||||
-ldl \
|
||||
-llog \
|
||||
-lssl \
|
||||
-lcrypto
|
||||
|
||||
unix: debug release
|
||||
win: windebug winrelease
|
||||
all: $(BUILD_TYPES) out/TildeFriends-debug.apk out/TildeFriends-release.apk
|
||||
.PHONY: all win unix
|
||||
|
||||
ALL_APP_OBJS := \
|
||||
$(APP_OBJS) \
|
||||
$(BLOWFISH_OBJS) \
|
||||
$(LIBBACKTRACE_OBJS) \
|
||||
$(MINIUNZIP_OBJS) \
|
||||
$(PICOHTTPPARSER_OBJS) \
|
||||
$(QUICKJS_OBJS) \
|
||||
$(SODIUM_OBJS) \
|
||||
$(SQLITE_OBJS) \
|
||||
$(UV_OBJS) \
|
||||
$(XOPT_OBJS)
|
||||
|
||||
DEPS = $(ALL_APP_OBJS:.o=.d)
|
||||
-include $(DEPS)
|
||||
|
||||
define build_rules
|
||||
$(1): $(BUILD_DIR)/$(1)/$(PROJECT)$(if $(filter win%,$(1)),.exe)
|
||||
.PHONY: $(1)
|
||||
|
||||
$(BUILD_DIR)/$(1)/$(PROJECT)$(if $(filter win%,$(1)),.exe): $(filter $(BUILD_DIR)/$(1)/%,$(ALL_APP_OBJS))
|
||||
@echo [link] $$@
|
||||
@$$(CC) -o $$@ -Wl,-Map,$$@.map $$^ $$(LDFLAGS)
|
||||
|
||||
$(BUILD_DIR)/$(1)/%.o: %.c
|
||||
@mkdir -p $$(dir $$@)
|
||||
@echo [c] $$@
|
||||
@$$(CC) $$(CFLAGS) -c $$< -o $$@
|
||||
|
||||
$(BUILD_DIR)/$(1)/%.o: %.S
|
||||
@mkdir -p $$(dir $$@)
|
||||
@echo [as] $$@
|
||||
@$$(AS) -c $$< -o $$@
|
||||
endef
|
||||
|
||||
$(foreach build_type,$(BUILD_TYPES),$(eval $(call build_rules,$(build_type))))
|
||||
|
||||
src/version.h : $(firstword $(MAKEFILE_LIST))
|
||||
@echo [version] $@
|
||||
@echo "#define VERSION_NUMBER \"$(VERSION_NUMBER)\"\n#define VERSION_NAME \"$(VERSION_NAME)\"\n" > $@
|
||||
|
||||
src/android/AndroidManifest.xml : $(firstword $(MAKEFILE_LIST))
|
||||
@echo [android_version] $@
|
||||
@sed -i \
|
||||
-e 's/versionCode=".*"/versionCode="$(VERSION_CODE)"/' \
|
||||
-e 's/versionName=".*"/versionName="$(VERSION_NUMBER)"/' \
|
||||
-e 's/android:minSdkVersion=".*"/android:minSdkVersion="$(ANDROID_MIN_SDK_VERSION)"/' \
|
||||
$@
|
||||
|
||||
# Android support.
|
||||
out/res/layout_activity_main.xml.flat: src/android/res/layout/activity_main.xml
|
||||
@mkdir -p $(dir $@)
|
||||
@echo [aapt2] $@
|
||||
@$(ANDROID_BUILD_TOOLS)/aapt2 compile -o out/res/ src/android/res/layout/activity_main.xml
|
||||
|
||||
out/res/drawable_icon.xml.flat: src/android/res/drawable/icon.xml
|
||||
@mkdir -p $(dir $@)
|
||||
@echo [aapt2] $@
|
||||
@$(ANDROID_BUILD_TOOLS)/aapt2 compile -o out/res/ src/android/res/drawable/icon.xml
|
||||
|
||||
out/apk/res.apk out/gen/com/unprompted/tildefriends/R.java: out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat src/android/AndroidManifest.xml
|
||||
@mkdir -p $(dir $@)
|
||||
@$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat --manifest src/android/AndroidManifest.xml -o out/apk/res.apk --java out/gen/
|
||||
|
||||
JAVA_FILES := out/gen/com/unprompted/tildefriends/R.java $(wildcard src/android/com/unprompted/tildefriends/*.java)
|
||||
CLASS_FILES := $(foreach src,$(JAVA_FILES),out/classes/com/unprompted/tildefriends/$(notdir $(src:.java=.class)))
|
||||
|
||||
$(CLASS_FILES) &: $(JAVA_FILES)
|
||||
@echo [javac] $(CLASS_FILES)
|
||||
@javac --release 8 -Xlint:deprecation -classpath $(ANDROID_PLATFORM)/android.jar -d out/classes $(JAVA_FILES)
|
||||
|
||||
out/apk/classes.dex: $(CLASS_FILES)
|
||||
@mkdir -p $(dir $@)
|
||||
@echo [d8] $@
|
||||
@$(ANDROID_BUILD_TOOLS)/d8 --$(BUILD_TYPE) --lib $(ANDROID_PLATFORM)/android.jar --output $(dir $@) out/classes/com/unprompted/tildefriends/*.class
|
||||
|
||||
PACKAGE_DIRS := \
|
||||
apps/ \
|
||||
core/ \
|
||||
deps/codemirror/ \
|
||||
deps/lit/
|
||||
|
||||
RAW_FILES := $(shell find $(PACKAGE_DIRS) -type f)
|
||||
|
||||
out/apk/TildeFriends-debug.unsigned.apk: BUILD_TYPE := debug
|
||||
out/apk/TildeFriends-release.unsigned.apk: BUILD_TYPE := release
|
||||
|
||||
out/apk/TildeFriends-debug.unsigned.apk: out/apk/classes.dex out/androiddebug/tildefriends out/androiddebug-x86_64/tildefriends $(RAW_FILES) out/apk/res.apk
|
||||
out/apk/TildeFriends-release.unsigned.apk: out/apk/classes.dex out/androidrelease/tildefriends out/androidrelease-x86_64/tildefriends $(RAW_FILES) out/apk/res.apk
|
||||
|
||||
out/%.unsigned.apk:
|
||||
@mkdir -p $(dir $@) out/apk$(BUILD_TYPE)/bin/aarch64/ out/apk$(BUILD_TYPE)/bin/x86_64/
|
||||
@echo [aapt] $@
|
||||
@cp out/android$(BUILD_TYPE)/tildefriends out/apk$(BUILD_TYPE)/bin/aarch64/
|
||||
@cp out/android$(BUILD_TYPE)-x86_64/tildefriends out/apk$(BUILD_TYPE)/bin/x86_64/
|
||||
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk$(BUILD_TYPE)/bin/aarch64/tildefriends
|
||||
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk$(BUILD_TYPE)/bin/x86_64/tildefriends
|
||||
@cp out/apk/res.apk $@
|
||||
@cp out/apk/classes.dex out/apk$(BUILD_TYPE)/
|
||||
@cd out/apk$(BUILD_TYPE) && zip -u ../../$@ -q -9 -r . && cd ../../
|
||||
@zip -u $@ -q -9 -x '*.map' -r $(PACKAGE_DIRS) $(RAW_FILES)
|
||||
|
||||
out/%.apk: out/apk/%.unsigned.apk
|
||||
@echo [apksigner] $(notdir $@)
|
||||
@$(ANDROID_BUILD_TOOLS)/apksigner sign --ks keystore.jks --ks-key-alias androidKey --ks-pass pass:android --key-pass pass:android --out $@ $<
|
||||
|
||||
apk: out/TildeFriends-release.apk
|
||||
.PHONY: apk
|
||||
|
||||
apkgo: out/TildeFriends-release.apk
|
||||
@adb install $<
|
||||
@adb shell am start com.unprompted.tildefriends/.MainActivity
|
||||
.PHONY: apkgo
|
||||
|
||||
apklog:
|
||||
@adb logcat *:S tildefriends
|
||||
.PHONY: apklog
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
.PHONY: clean
|
||||
|
||||
dist: apk
|
||||
@echo "[export] $$(svn info --show-item url)"
|
||||
@rm -rf tildefriends-$(VERSION_NUMBER)
|
||||
@svn export -q . tildefriends-$(VERSION_NUMBER)
|
||||
@echo "tildefriends-$(VERSION_NUMBER): $(VERSION_NAME)" > tildefriends-$(VERSION_NUMBER)/VERSION
|
||||
@echo "[tar] tildefriends-$(VERSION_NUMBER).tar.xz"
|
||||
@tar \
|
||||
--exclude=apps/gg* \
|
||||
--exclude=deps/libbacktrace/Isaac.Newton-Opticks.txt \
|
||||
--exclude=deps/libsodium/builds/msvc/vs* \
|
||||
--exclude=deps/libsodium/builds/msvc/build \
|
||||
--exclude=deps/libsodium/builds/msvc/properties \
|
||||
--exclude=deps/libsodium/configure \
|
||||
--exclude=deps/libsodium/test \
|
||||
--exclude=deps/libuv/docs \
|
||||
--exclude=deps/libuv/test \
|
||||
--exclude=deps/openssl \
|
||||
--exclude=deps/speedscope/*.map \
|
||||
--exclude=deps/sqlite/shell.c \
|
||||
--exclude=deps/zlib/contrib/vstudio \
|
||||
--exclude=deps/zlib/doc \
|
||||
-caf tildefriends-$(VERSION_NUMBER).tar.xz tildefriends-$(VERSION_NUMBER)
|
||||
@rm -rf tildefriends-$(VERSION_NUMBER)
|
||||
@echo "[cp] TildeFriends-$(VERSION_NUMBER).apk"
|
||||
@cp out/TildeFriends-release.apk TildeFriends-$(VERSION_NUMBER).apk
|
||||
.PHONY: dist
|
||||
|
||||
dist-test: dist
|
||||
@tar -xf tildefriends-$(VERSION_NUMBER).tar.xz
|
||||
@$(MAKE) -C tildefriends-$(VERSION_NUMBER)/ debug release
|
||||
@rm -rf tildefriends-$(VERSION_NUMBER)
|
||||
.PHONY: dist-test
|
@ -15,8 +15,9 @@ Scuttlebutt, as well as a platform for writing and running web applications.
|
||||
are kept up to date in the tree.
|
||||
2. To build, run `make debug` or `make release`. An executable will be
|
||||
generated in a subdirectory of `out/`.
|
||||
3. `make windebug` or `make winrelease` will generate a windows executable
|
||||
which might work.
|
||||
3. It's possible to build for Android, iOS, and Windows on Linux, if you have
|
||||
the right dependencies in the right places. `make windebug winrelease
|
||||
iosdebug-ipa iosrelease-ipa release-apk`.
|
||||
4. To build in docker, `docker build .`.
|
||||
|
||||
## Running
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "📜"
|
||||
"emoji": "📜",
|
||||
"previous": "&miGORZ8BwjHg2YO0t4bms6SI28XWPYqnqOZ8u9zsbZc=.sha256"
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -37,6 +37,49 @@ Set the contents of the client <iframe/>.
|
||||
* *String* **html** The HTML contents.
|
||||
`;
|
||||
|
||||
docs['core.apps()'] = `
|
||||
Gets a list of apps owned by the current user.
|
||||
### Returns
|
||||
*Array* An array of string names of the apps owned by the current user.
|
||||
`;
|
||||
|
||||
docs['core.url'] = `
|
||||
The url by which the running app is being invoked.
|
||||
`;
|
||||
|
||||
docs['app.localStorageSet()'] = `
|
||||
Set a value in browser local storage.
|
||||
### Parameters
|
||||
*String* **key** The localStorage key to set.
|
||||
*String* **value** The localStorage value to set.
|
||||
`;
|
||||
|
||||
docs['app.localStorageGet()'] = `
|
||||
Gets a value from browser local storage.
|
||||
### Parameters
|
||||
*String* **key** The key with which the value was set.
|
||||
### Returns
|
||||
*String* The value, or undefined.
|
||||
`;
|
||||
|
||||
docs['app.print()'] = `
|
||||
Log information for debugging purposes to the server and to the connected browser console.
|
||||
### Parameters
|
||||
* ... Any args to print.
|
||||
`;
|
||||
|
||||
docs['ssb.createIdentity()'] = `
|
||||
Create a new SSB identity.
|
||||
### Returns
|
||||
*String* The created identity public key.
|
||||
`;
|
||||
|
||||
docs['ssb.getIdentities()'] = `
|
||||
Get all SSB identities owned by the current user.
|
||||
### Returns
|
||||
*Array* An array of public key strings.
|
||||
`;
|
||||
|
||||
docs['ssb.sqlAsync()'] = `
|
||||
Run an SQL query against the sqlite database.
|
||||
### Parameters
|
||||
|
5
apps/blog.json
Normal file
5
apps/blog.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🪵",
|
||||
"previous": "&YHBylHM7DlDDiGfuNj+g95Bf7NFxTZs/IKG14TbWnhs=.sha256"
|
||||
}
|
8
apps/blog/app.js
Normal file
8
apps/blog/app.js
Normal file
@ -0,0 +1,8 @@
|
||||
import * as blog from './blog.js';
|
||||
|
||||
async function main() {
|
||||
let blogs = await blog.get_posts();
|
||||
await app.setDocument(blog.render_html(blogs));
|
||||
}
|
||||
|
||||
main();
|
149
apps/blog/blog.js
Normal file
149
apps/blog/blog.js
Normal file
@ -0,0 +1,149 @@
|
||||
import * as commonmark from './commonmark.min.js';
|
||||
|
||||
function escape(text) {
|
||||
return (text ?? '').replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>');
|
||||
}
|
||||
|
||||
function escapeAttribute(text) {
|
||||
return (text ?? '').replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll("'", ''');
|
||||
}
|
||||
|
||||
function markdown(md) {
|
||||
let reader = new commonmark.Parser({safe: true});
|
||||
let writer = new commonmark.HtmlRenderer();
|
||||
let parsed = reader.parse(md || '');
|
||||
let walker = parsed.walker();
|
||||
let event, node;
|
||||
while ((event = walker.next())) {
|
||||
node = event.node;
|
||||
if (event.entering) {
|
||||
if (node.type == 'image') {
|
||||
if (node.destination.startsWith('&')) {
|
||||
node.destination = '/' + node.destination + '/view';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return writer.render(parsed);
|
||||
}
|
||||
|
||||
export async function render_blog_post_html(blog_post) {
|
||||
let blob = utf8Decode(await ssb.blobGet(blog_post.blog));
|
||||
return `<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div>
|
||||
<div><a href="../ssb/#${escapeAttribute(blog_post.author)}">${escape(blog_post.name)}</a> ${escape(new Date(blog_post.timestamp).toString())}</div>
|
||||
<div>${markdown(blob)}</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
}
|
||||
|
||||
function render_blog_post(blog_post) {
|
||||
return `
|
||||
<div>
|
||||
<h2><a href="../ssb/#${escapeAttribute(blog_post.id)}">${escape(blog_post.title)}</a></h2>
|
||||
<div><a href="../ssb/#${escapeAttribute(blog_post.author)}">${escape(blog_post.name)}</a> ${escape(new Date(blog_post.timestamp).toString())}</div>
|
||||
<div>${markdown(blog_post.summary)}</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
export function render_html(blogs) {
|
||||
return `<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>🪵Tilde Blog</title>
|
||||
<link href="./atom" type="application/atom+xml" rel="alternate" title="🪵Tilde Blog"/>
|
||||
<style>
|
||||
html {
|
||||
background-color: #ccc;
|
||||
}
|
||||
</style>
|
||||
<base target="_blank">
|
||||
</head>
|
||||
<body>
|
||||
<div style="display: flex; flex-direction: row; align-items: center; gap: 1em">
|
||||
<h1>🪵Tilde Blog</h1>
|
||||
<div style="font-size: xx-small; vertical-align: middle"><a href="/~cory/blog/atom">atom feed</a></div>
|
||||
</div>
|
||||
${blogs.map(blog_post => render_blog_post(blog_post)).join('\n')}
|
||||
</body>
|
||||
</html>`;
|
||||
}
|
||||
|
||||
function render_blog_post_atom(blog_post) {
|
||||
return `<entry>
|
||||
<title>${escape(blog_post.title)}</title>
|
||||
<link href="https://tildefriends.net/~cory/ssb/#${blog_post.id}" />
|
||||
<id>${blog_post.id}</id>
|
||||
<published>${escape(new Date(blog_post.timestamp).toString())}</published>
|
||||
<summary>${escape(blog_post.summary)}</summary>
|
||||
<author>
|
||||
<name>${escape(blog_post.name)}</name>
|
||||
<feed>${escape(blog_post.author)}</feed>
|
||||
</author>
|
||||
</entry>`;
|
||||
}
|
||||
|
||||
export function render_atom(blogs) {
|
||||
return `<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title>🪵Tilde Blog</title>
|
||||
<subtitle>A subtitle.</subtitle>
|
||||
<link href="https://tildefriends.net/~cory/blog/atom" rel="self"/>
|
||||
<link href="https://tildefriends.net/~cory/blog/"/>
|
||||
<id>https://www.tildefriends.net/~cory/blog/</id>
|
||||
<updated>${new Date().toString()}</updated>
|
||||
${blogs.map(blog_post => render_blog_post_atom(blog_post)).join('\n')}
|
||||
</feed>`;
|
||||
}
|
||||
|
||||
export async function get_posts() {
|
||||
let blogs = [];
|
||||
await ssb.sqlAsync(`
|
||||
WITH
|
||||
blogs AS (
|
||||
SELECT
|
||||
messages.author,
|
||||
messages.id,
|
||||
json_extract(messages.content, '$.title') AS title,
|
||||
json_extract(messages.content, '$.summary') AS summary,
|
||||
json_extract(messages.content, '$.blog') AS blog,
|
||||
messages.timestamp
|
||||
FROM messages_fts('blog')
|
||||
JOIN messages ON messages.rowid = messages_fts.rowid
|
||||
WHERE json_extract(messages.content, '$.type') = 'blog'),
|
||||
public AS (
|
||||
SELECT author FROM (
|
||||
SELECT
|
||||
messages.author,
|
||||
RANK() OVER (PARTITION BY messages.author ORDER BY messages.sequence DESC) AS author_rank,
|
||||
json_extract(messages.content, '$.publicWebHosting') AS is_public
|
||||
FROM messages_fts('about')
|
||||
JOIN messages ON messages.rowid = messages_fts.rowid
|
||||
WHERE json_extract(messages.content, '$.type') = 'about' AND is_public IS NOT NULL)
|
||||
WHERE author_rank = 1 AND is_public),
|
||||
names AS (
|
||||
SELECT author, name FROM (
|
||||
SELECT
|
||||
messages.author,
|
||||
RANK() OVER (PARTITION BY messages.author ORDER BY messages.sequence DESC) AS author_rank,
|
||||
json_extract(messages.content, '$.name') AS name
|
||||
FROM messages_fts('about')
|
||||
JOIN messages ON messages.rowid = messages_fts.rowid
|
||||
WHERE json_extract(messages.content, '$.type') = 'about' AND
|
||||
json_extract(messages.content, '$.about') = messages.author AND
|
||||
name IS NOT NULL)
|
||||
WHERE author_rank = 1)
|
||||
SELECT blogs.*, names.name FROM blogs
|
||||
JOIN public ON public.author = blogs.author
|
||||
LEFT OUTER JOIN names ON names.author = blogs.author
|
||||
ORDER BY blogs.timestamp DESC LIMIT 20
|
||||
`, [], function(row) {
|
||||
blogs.push(row);
|
||||
});
|
||||
return blogs;
|
||||
}
|
1
apps/blog/commonmark.min.js
vendored
Normal file
1
apps/blog/commonmark.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
22
apps/blog/handler.js
Normal file
22
apps/blog/handler.js
Normal file
@ -0,0 +1,22 @@
|
||||
import * as blog from './blog.js';
|
||||
|
||||
async function main() {
|
||||
let blogs = await blog.get_posts();
|
||||
for (let blog_post of blogs) {
|
||||
let title = (blog_post.title || '').replaceAll(/\W/g, '_').toLowerCase();
|
||||
if (request.path === title) {
|
||||
respond({data: await blog.render_blog_post_html(blog_post), content_type: 'text/html; charset=utf-8'});
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (request.path == 'atom') {
|
||||
respond({data: blog.render_atom(blogs), content_type: 'application/atom+xml'});
|
||||
} else {
|
||||
respond({data: blog.render_html(blogs), content_type: 'text/html; charset=utf-8'});
|
||||
}
|
||||
}
|
||||
|
||||
main().catch(function(error) {
|
||||
respond({data: `<!DOCTYPE html>
|
||||
<pre style="color: #f00">${error.message}\n${error.stack}</pre>`, content_type: 'text/html'});
|
||||
});
|
126
apps/blog/lit-all.min.js
vendored
Normal file
126
apps/blog/lit-all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
apps/blog/lit-all.min.js.map
Normal file
1
apps/blog/lit-all.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1,4 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🗺"
|
||||
"emoji": "🗺",
|
||||
"previous": "&0XSp+xdQwVtQ88bXzvWdH15Ex63hv5zUKTa4zx7HBGM=.sha256"
|
||||
}
|
1
apps/gg/emojis.json
Normal file
1
apps/gg/emojis.json
Normal file
File diff suppressed because one or more lines are too long
50
apps/gg/lit-all.min.js
vendored
50
apps/gg/lit-all.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -19,9 +19,10 @@ const k_store = {
|
||||
'🛶': 10,
|
||||
'🏠': 10,
|
||||
'⛰': 10,
|
||||
'🐠': 10,
|
||||
};
|
||||
|
||||
const k_marker_snap = {x: 5, y: 1};
|
||||
const k_marker_snap = {x: 5, y: 4};
|
||||
|
||||
class GgAppElement extends LitElement {
|
||||
static get properties() {
|
||||
@ -37,6 +38,7 @@ class GgAppElement extends LitElement {
|
||||
url: {type: String},
|
||||
currency: {type: Number},
|
||||
to_build: {type: String},
|
||||
emoji_of_the_day: {type: String},
|
||||
};
|
||||
}
|
||||
|
||||
@ -62,6 +64,11 @@ class GgAppElement extends LitElement {
|
||||
|
||||
async load() {
|
||||
console.log('load');
|
||||
let emojis = await (await fetch('emojis.json')).json();
|
||||
emojis = Object.values(emojis).map(x => Object.values(x)).flat();
|
||||
let today = new Date();
|
||||
let date_index = today.getYear() * 356 + today.getMonth() * 31 + today.getDate();
|
||||
this.emoji_of_the_day = emojis[(date_index * 123457) % emojis.length];
|
||||
this.user = await tfrpc.rpc.getUser();
|
||||
this.url = (await tfrpc.rpc.url()).split('?')[0];
|
||||
try {
|
||||
@ -367,11 +374,11 @@ class GgAppElement extends LitElement {
|
||||
.openOn(this.leaflet);
|
||||
}
|
||||
|
||||
snap_to_grid(latlng, fudge) {
|
||||
let position = this.leaflet.options.crs.latLngToPoint(latlng, this.leaflet.getZoom());
|
||||
snap_to_grid(latlng, fudge, zoom) {
|
||||
let position = this.leaflet.options.crs.latLngToPoint(latlng, zoom ?? this.leaflet.getZoom());
|
||||
position.x = Math.round(position.x / 16) * 16 + (fudge?.x ?? 0);
|
||||
position.y = Math.round(position.y / 16) * 16 + (fudge?.y ?? 0);
|
||||
position = this.leaflet.options.crs.pointToLatLng(position, this.leaflet.getZoom());
|
||||
position = this.leaflet.options.crs.pointToLatLng(position, zoom ?? this.leaflet.getZoom());
|
||||
return position;
|
||||
}
|
||||
|
||||
@ -383,6 +390,12 @@ class GgAppElement extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
on_zoom(event) {
|
||||
if (this.marker) {
|
||||
this.marker.setLatLng(this.snap_to_grid(this.marker.getLatLng(), k_marker_snap));
|
||||
}
|
||||
}
|
||||
|
||||
on_mouse_down(event) {
|
||||
if (this.marker) {
|
||||
this.marker.remove();
|
||||
@ -407,6 +420,7 @@ class GgAppElement extends LitElement {
|
||||
this.leaflet = L.map(map, {attributionControl: false, maxZoom: 16, bounceAtZoomLimits: false});
|
||||
this.leaflet.on({contextmenu: this.on_click.bind(this)});
|
||||
this.leaflet.on({click: this.on_mouse_down.bind(this)});
|
||||
this.leaflet.on({zoom: this.on_zoom.bind(this)});
|
||||
}
|
||||
let self = this;
|
||||
let grid_layer = L.GridLayer.extend({
|
||||
@ -431,24 +445,26 @@ class GgAppElement extends LitElement {
|
||||
self.draw_activity_to_tile(image_data, mini.width, mini.height, ul, lr, activity);
|
||||
}
|
||||
context.textAlign = 'left';
|
||||
context.textBaseline = 'top';
|
||||
context.textBaseline = 'bottom';
|
||||
for (let x = 0; x < mini.width; x++) {
|
||||
for (let y = 0; y < mini.height; y++) {
|
||||
let start = (y * mini.width + x) * 4;
|
||||
let pixel = self.color_to_emoji(image_data.data.slice(start, start + 4));
|
||||
if (pixel) {
|
||||
context.fillText(pixel, x * size.x / mini.width, y * size.y / mini.height);
|
||||
//context.fillRect(x * size.x / mini.width, y * size.y / mini.height, size.x / mini.width, size.y / mini.height);
|
||||
context.fillText(pixel, x * size.x / mini.width, y * size.y / mini.height + mini.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let placed of self.placed_emojis) {
|
||||
let position = self.leaflet.options.crs.latLngToPoint(self.snap_to_grid(placed.position), coords.z);
|
||||
let position = self.leaflet.options.crs.latLngToPoint(self.snap_to_grid(placed.position, undefined, coords.z), coords.z);
|
||||
let tile_x = Math.floor(position.x / size.x);
|
||||
let tile_y = Math.floor(position.y / size.y);
|
||||
position.x = position.x - tile_x * size.x;
|
||||
position.y = position.y - tile_y * size.y;
|
||||
if (tile_x == coords.x && tile_y == coords.y) {
|
||||
context.fillText(placed.emoji, position.x, position.y);
|
||||
//context.fillRect(position.x, position.y, size.x / mini.width, size.y / mini.height);
|
||||
context.fillText(placed.emoji, position.x, position.y + mini.height);
|
||||
}
|
||||
}
|
||||
return tile;
|
||||
@ -704,10 +720,12 @@ class GgAppElement extends LitElement {
|
||||
}
|
||||
|
||||
render_store() {
|
||||
let store = Object.assign({}, k_store);
|
||||
store[this.emoji_of_the_day] = 5;
|
||||
return html`
|
||||
<h2>Store</h2>
|
||||
<div><b>Your balance:</b> ${this.currency}</div>
|
||||
${Object.entries(k_store).map(this.render_store_item.bind(this))}
|
||||
${Object.entries(store).map(this.render_store_item.bind(this))}
|
||||
`;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🦟"
|
||||
"emoji": "🦟",
|
||||
"previous": "&TegdzvFE+im94shygaHkgDYSaSrwY2h0OKUXSRPBQDM=.sha256"
|
||||
}
|
44
apps/issues/lit-all.min.js
vendored
44
apps/issues/lit-all.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -136,7 +136,7 @@ class TfIssuesAppElement extends LitElement {
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.issues = Object.values(issues).sort((x, y) => y.created - x.created);
|
||||
this.issues = Object.values(issues).sort((x, y) => (y.open - x.open) || (y.created - x.created));
|
||||
if (this.selected) {
|
||||
for (let issue of this.issues) {
|
||||
if (issue.id == this.selected.id) {
|
||||
@ -149,7 +149,7 @@ class TfIssuesAppElement extends LitElement {
|
||||
render_issue_table_row(issue) {
|
||||
return html`
|
||||
<tr>
|
||||
<td>${issue.open ? 'open' : 'closed'}</td>
|
||||
<td>${issue.open ? '☐ open' : '☑ closed'}</td>
|
||||
<td style="max-width: 8em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">${issue.author}</td>
|
||||
<td style="max-width: 40em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer" @click=${() => this.selected = issue}>
|
||||
${issue.text.split('\n')?.[0]}
|
||||
|
5
apps/journal.json
Normal file
5
apps/journal.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "📝",
|
||||
"previous": "&2hdIDbBrAg63T2X1MzdGSF7yiqHvlnfF0PnInQLp0DA=.sha256"
|
||||
}
|
173
apps/journal/app.js
Normal file
173
apps/journal/app.js
Normal file
@ -0,0 +1,173 @@
|
||||
import * as tfrpc from '/tfrpc.js';
|
||||
|
||||
let g_hash;
|
||||
let g_collection_notifies = {};
|
||||
|
||||
tfrpc.register(async function getOwnerIdentities() {
|
||||
return ssb.getOwnerIdentities();
|
||||
});
|
||||
|
||||
tfrpc.register(async function getIdentities() {
|
||||
return ssb.getIdentities();
|
||||
});
|
||||
|
||||
tfrpc.register(async function query(sql, args) {
|
||||
let result = [];
|
||||
await ssb.sqlAsync(sql, args, function callback(row) {
|
||||
result.push(row);
|
||||
});
|
||||
return result;
|
||||
});
|
||||
|
||||
tfrpc.register(async function localStorageGet(key) {
|
||||
return app.localStorageGet(key);
|
||||
});
|
||||
|
||||
tfrpc.register(async function localStorageSet(key, value) {
|
||||
return app.localStorageSet(key, value);
|
||||
});
|
||||
|
||||
tfrpc.register(async function following(ids, depth) {
|
||||
return ssb.following(ids, depth);
|
||||
});
|
||||
|
||||
tfrpc.register(async function appendMessage(id, message) {
|
||||
return ssb.appendMessageWithIdentity(id, message);
|
||||
});
|
||||
|
||||
tfrpc.register(async function store_blob(blob) {
|
||||
if (Array.isArray(blob)) {
|
||||
blob = Uint8Array.from(blob);
|
||||
}
|
||||
return await ssb.blobStore(blob);
|
||||
});
|
||||
|
||||
tfrpc.register(async function get_blob(id) {
|
||||
return utf8Decode(await ssb.blobGet(id));
|
||||
});
|
||||
|
||||
let g_new_message_resolve;
|
||||
let g_new_message_promise = new Promise(function(resolve, reject) {
|
||||
g_new_message_resolve = resolve;
|
||||
});
|
||||
|
||||
function new_message() {
|
||||
return g_new_message_promise;
|
||||
}
|
||||
|
||||
ssb.addEventListener('message', function(id) {
|
||||
let resolve = g_new_message_resolve;
|
||||
g_new_message_promise = new Promise(function(resolve, reject) {
|
||||
g_new_message_resolve = resolve;
|
||||
});
|
||||
if (resolve) {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
|
||||
core.register('message', async function message_handler(message) {
|
||||
if (message.event == 'hashChange') {
|
||||
print('hash change', message.hash);
|
||||
g_hash = message.hash;
|
||||
await tfrpc.rpc.hash_changed(message.hash);
|
||||
}
|
||||
});
|
||||
|
||||
tfrpc.register(function set_hash(hash) {
|
||||
if (g_hash != hash) {
|
||||
return app.setHash(hash);
|
||||
}
|
||||
});
|
||||
|
||||
tfrpc.register(function get_hash(id, message) {
|
||||
return g_hash;
|
||||
});
|
||||
|
||||
tfrpc.register(async function try_decrypt(id, content) {
|
||||
return await ssb.privateMessageDecrypt(id, content);
|
||||
});
|
||||
tfrpc.register(async function encrypt(id, recipients, content) {
|
||||
return await ssb.privateMessageEncrypt(id, recipients, content);
|
||||
});
|
||||
|
||||
async function process_message(whoami, collection, message, kind, parent) {
|
||||
let content = JSON.parse(message.content);
|
||||
if (typeof content == 'string') {
|
||||
let x;
|
||||
for (let id of whoami) {
|
||||
x = await ssb.privateMessageDecrypt(id, content);
|
||||
if (x) {
|
||||
content = JSON.parse(x);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!x) {
|
||||
return;
|
||||
}
|
||||
if (content.type !== kind ||
|
||||
(parent && content.parent !== parent)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (content?.key) {
|
||||
if (content?.tombstone) {
|
||||
delete collection[content.key];
|
||||
} else {
|
||||
collection[content.key] = Object.assign(collection[content.key] || {}, content);
|
||||
}
|
||||
} else {
|
||||
collection[message.id] = Object.assign(content, {id: message.id});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
tfrpc.register(async function collection(ids, kind, parent, max_rowid, data) {
|
||||
let whoami = await ssb.getIdentities();
|
||||
data = data ?? {};
|
||||
let rowid = 0;
|
||||
await ssb.sqlAsync('SELECT MAX(rowid) AS rowid FROM messages', [], function(row) {
|
||||
rowid = row.rowid;
|
||||
});
|
||||
while (true) {
|
||||
if (rowid == max_rowid) {
|
||||
await new_message();
|
||||
await ssb.sqlAsync('SELECT MAX(rowid) AS rowid FROM messages', [], function(row) {
|
||||
rowid = row.rowid;
|
||||
});
|
||||
}
|
||||
|
||||
let modified = false;
|
||||
let rows = [];
|
||||
await ssb.sqlAsync(`
|
||||
SELECT messages.id, author, content, timestamp
|
||||
FROM messages
|
||||
JOIN json_each(?1) AS id ON messages.author = id.value
|
||||
WHERE
|
||||
messages.rowid > ?2 AND
|
||||
messages.rowid <= ?3 AND
|
||||
((json_extract(messages.content, '$.type') = ?4 AND
|
||||
(?5 IS NULL OR json_extract(messages.content, '$.parent') = ?5)) OR
|
||||
content LIKE '"%')
|
||||
`,
|
||||
[JSON.stringify(ids), max_rowid ?? -1, rowid, kind, parent],
|
||||
function(row) {
|
||||
rows.push(row);
|
||||
});
|
||||
max_rowid = rowid;
|
||||
for (let row of rows) {
|
||||
if (await process_message(whoami, data, row, kind, parent)) {
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
if (modified) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return [rowid, data];
|
||||
});
|
||||
|
||||
async function main() {
|
||||
await app.setDocument(utf8Decode(await getFile('index.html')));
|
||||
}
|
||||
|
||||
main();
|
1
apps/journal/commonmark.min.js
vendored
Normal file
1
apps/journal/commonmark.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
14
apps/journal/index.html
Normal file
14
apps/journal/index.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<base target="_top">
|
||||
</head>
|
||||
<body style="color: #fff">
|
||||
<tf-journal-app></tf-journal-app>
|
||||
<script src="commonmark.min.js"></script>
|
||||
<script>window.litDisableBundleWarning = true;</script>
|
||||
<script src="tf-journal-app.js" type="module"></script>
|
||||
<script src="tf-journal-entry.js" type="module"></script>
|
||||
<script src="tf-id-picker.js" type="module"></script>
|
||||
</body>
|
||||
</html>
|
120
apps/journal/lit-all.min.js
vendored
Normal file
120
apps/journal/lit-all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
apps/journal/lit-all.min.js.map
Normal file
1
apps/journal/lit-all.min.js.map
Normal file
File diff suppressed because one or more lines are too long
36
apps/journal/tf-id-picker.js
Normal file
36
apps/journal/tf-id-picker.js
Normal file
@ -0,0 +1,36 @@
|
||||
import {LitElement, html} from './lit-all.min.js';
|
||||
import * as tfrpc from '/static/tfrpc.js';
|
||||
|
||||
/*
|
||||
** Provide a list of IDs, and this lets the user pick one.
|
||||
*/
|
||||
class TfIdentityPickerElement extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
ids: {type: Array},
|
||||
selected: {type: String},
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.ids = [];
|
||||
}
|
||||
|
||||
changed(event) {
|
||||
this.selected = event.srcElement.value;
|
||||
this.dispatchEvent(new Event('change', {
|
||||
srcElement: this,
|
||||
}));
|
||||
}
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<select @change=${this.changed} style="max-width: 100%">
|
||||
${(this.ids ?? []).map(id => html`<option ?selected=${id == this.selected} value=${id}>${id}</option>`)}
|
||||
</select>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('tf-id-picker', TfIdentityPickerElement);
|
75
apps/journal/tf-journal-app.js
Normal file
75
apps/journal/tf-journal-app.js
Normal file
@ -0,0 +1,75 @@
|
||||
import {LitElement, html, keyed, live} from './lit-all.min.js';
|
||||
import * as tfrpc from '/static/tfrpc.js';
|
||||
|
||||
class TfJournalAppElement extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
ids: {type: Array},
|
||||
owner_ids: {type: Array},
|
||||
whoami: {type: String},
|
||||
journals: {type: Object},
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.ids = [];
|
||||
this.owner_ids = [];
|
||||
this.journals = {};
|
||||
this.load();
|
||||
}
|
||||
|
||||
async load() {
|
||||
this.ids = await tfrpc.rpc.getIdentities();
|
||||
this.whoami = await tfrpc.rpc.localStorageGet('journal_whoami');
|
||||
await this.read_journals();
|
||||
}
|
||||
|
||||
async read_journals() {
|
||||
let max_rowid;
|
||||
let journals;
|
||||
while (true)
|
||||
{
|
||||
[max_rowid, journals] = await tfrpc.rpc.collection([this.whoami], 'journal-entry', undefined, max_rowid, journals);
|
||||
this.journals = Object.assign({}, journals);
|
||||
console.log('JOURNALS', this.journals);
|
||||
}
|
||||
}
|
||||
|
||||
async on_whoami_changed(event) {
|
||||
let new_id = event.srcElement.selected;
|
||||
await tfrpc.rpc.localStorageSet('journal_whoami', new_id);
|
||||
this.whoami = new_id;
|
||||
}
|
||||
|
||||
async on_journal_publish(event) {
|
||||
let key = event.detail.key;
|
||||
let text = event.detail.text;
|
||||
let message = {
|
||||
type: 'journal-entry',
|
||||
key: key,
|
||||
text: text,
|
||||
};
|
||||
message.recps = [this.whoami];
|
||||
print(message);
|
||||
message = await tfrpc.rpc.encrypt(this.whoami, message.recps, JSON.stringify(message));
|
||||
print(message);
|
||||
await tfrpc.rpc.appendMessage(this.whoami, message);
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log('RENDER APP', this.journals);
|
||||
let self = this;
|
||||
return html`
|
||||
<div>
|
||||
<tf-id-picker .ids=${this.ids} selected=${this.whoami} @change=${this.on_whoami_changed}></tf-id-picker>
|
||||
</div>
|
||||
<tf-journal-entry
|
||||
whoami=${this.whoami}
|
||||
.journals=${this.journals}
|
||||
@publish=${this.on_journal_publish}></tf-journal-entry>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('tf-journal-app', TfJournalAppElement);
|
84
apps/journal/tf-journal-entry.js
Normal file
84
apps/journal/tf-journal-entry.js
Normal file
@ -0,0 +1,84 @@
|
||||
import {LitElement, html, unsafeHTML, range} from './lit-all.min.js';
|
||||
import * as tfrpc from '/static/tfrpc.js';
|
||||
|
||||
class TfJournalEntryElement extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
whoami: {type: String},
|
||||
key: {type: String},
|
||||
journals: {type: Object},
|
||||
text: {type: String},
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.journals = {};
|
||||
this.key = new Date().toISOString().split('T')[0];
|
||||
}
|
||||
|
||||
markdown(md) {
|
||||
var reader = new commonmark.Parser({safe: true});
|
||||
var writer = new commonmark.HtmlRenderer();
|
||||
var parsed = reader.parse(md || '');
|
||||
return writer.render(parsed);
|
||||
}
|
||||
|
||||
on_discard(event) {
|
||||
this.text = undefined;
|
||||
}
|
||||
|
||||
async on_publish() {
|
||||
console.log('publish', this.text);
|
||||
this.dispatchEvent(new CustomEvent('publish', {
|
||||
bubbles: true,
|
||||
detail: {
|
||||
key: this.shadowRoot.getElementById('date_picker').value,
|
||||
text: this.text,
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
back_dates(count) {
|
||||
let now = new Date();
|
||||
let result = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
let next = new Date(now);
|
||||
next.setDate(now.getDate() - i);
|
||||
result.push(next.toISOString().split('T')[0]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
on_edit(event) {
|
||||
this.text = event.srcElement.value;
|
||||
}
|
||||
|
||||
on_date_change(event) {
|
||||
this.key = event.srcElement.value;
|
||||
this.text = this.journals[this.key]?.text;
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log('RENDER ENTRY', this.key, this.journals?.[this.key]);
|
||||
return html`
|
||||
<select id="date_picker" @change=${this.on_date_change}>
|
||||
${this.back_dates(10).map(x => html`
|
||||
<option value=${x}>${x}</option>
|
||||
`)}
|
||||
</select>
|
||||
<div style="display: inline-flex; flex-direction: row">
|
||||
<button ?disabled=${this.text == this.journals?.[this.key]?.text} @click=${this.on_publish}>Publish</button>
|
||||
<button @click=${this.on_discard}>Discard</button>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: row">
|
||||
<textarea
|
||||
style="flex: 1 1; min-height: 10em"
|
||||
@input=${this.on_edit} .value=${this.text ?? this.journals?.[this.key]?.text ?? ''}></textarea>
|
||||
<div style="flex: 1 1">${unsafeHTML(this.markdown(this.text ?? this.journals?.[this.key]?.text))}</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('tf-journal-entry', TfJournalEntryElement);
|
44
apps/sneaker/lit-all.min.js
vendored
44
apps/sneaker/lit-all.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🐌"
|
||||
"emoji": "🐌",
|
||||
"previous": "&dO6ckMIPVv9QvSc+0TOg0S59qe+rirPo2a6p9xSHj9M=.sha256"
|
||||
}
|
@ -18,12 +18,21 @@ tfrpc.register(async function databaseSet(key, value) {
|
||||
tfrpc.register(async function createIdentity() {
|
||||
return ssb.createIdentity();
|
||||
});
|
||||
tfrpc.register(async function getServerIdentity() {
|
||||
return ssb.getServerIdentity();
|
||||
});
|
||||
tfrpc.register(async function setServerFollowingMe(id, following) {
|
||||
return ssb.setServerFollowingMe(id, following);
|
||||
});
|
||||
tfrpc.register(async function getIdentities() {
|
||||
return ssb.getIdentities();
|
||||
});
|
||||
tfrpc.register(async function getAllIdentities() {
|
||||
return ssb.getAllIdentities();
|
||||
});
|
||||
tfrpc.register(async function following(ids, depth) {
|
||||
return ssb.following(ids, depth);
|
||||
});
|
||||
tfrpc.register(async function getBroadcasts() {
|
||||
return ssb.getBroadcasts();
|
||||
});
|
||||
|
1
apps/ssb/filesaver.min.js.map
Normal file
1
apps/ssb/filesaver.min.js.map
Normal file
File diff suppressed because one or more lines are too long
44
apps/ssb/lit-all.min.js
vendored
44
apps/ssb/lit-all.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -75,78 +75,6 @@ class TfElement extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
async contacts_internal(id, last_row_id, following, max_row_id) {
|
||||
let result = Object.assign({}, following[id] || {});
|
||||
result.following = result.following || {};
|
||||
result.blocking = result.blocking || {};
|
||||
let contacts = await tfrpc.rpc.query(
|
||||
`
|
||||
SELECT content FROM messages
|
||||
WHERE author = ? AND
|
||||
rowid > ? AND
|
||||
rowid <= ? AND
|
||||
json_extract(content, '$.type') = 'contact'
|
||||
ORDER BY sequence
|
||||
`,
|
||||
[id, last_row_id, max_row_id]);
|
||||
for (let row of contacts) {
|
||||
let contact = JSON.parse(row.content);
|
||||
if (contact.following === true) {
|
||||
result.following[contact.contact] = true;
|
||||
} else if (contact.following === false) {
|
||||
delete result.following[contact.contact];
|
||||
} else if (contact.blocking === true) {
|
||||
result.blocking[contact.contact] = true;
|
||||
} else if (contact.blocking === false) {
|
||||
delete result.blocking[contact.contact];
|
||||
}
|
||||
}
|
||||
following[id] = result;
|
||||
return result;
|
||||
}
|
||||
|
||||
async contact(id, last_row_id, following, max_row_id) {
|
||||
return await this.contacts_internal(id, last_row_id, following, max_row_id);
|
||||
}
|
||||
|
||||
async following_deep_internal(ids, depth, blocking, last_row_id, following, max_row_id) {
|
||||
let contacts = await Promise.all([...new Set(ids)].map(x => this.contact(x, last_row_id, following, max_row_id)));
|
||||
let result = {};
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
let id = ids[i];
|
||||
let contact = contacts[i];
|
||||
let all_blocking = Object.assign({}, contact.blocking, blocking);
|
||||
let found = Object.keys(contact.following).filter(y => !all_blocking[y]);
|
||||
let deeper = depth > 1 ? await this.following_deep_internal(found, depth - 1, all_blocking, last_row_id, following, max_row_id) : [];
|
||||
result[id] = [id, ...found, ...deeper];
|
||||
}
|
||||
return [...new Set(Object.values(result).flat())];
|
||||
}
|
||||
|
||||
async following_deep(ids, depth, blocking) {
|
||||
const k_cache_version = 5;
|
||||
let cache = await tfrpc.rpc.databaseGet('following');
|
||||
cache = cache ? JSON.parse(cache) : {};
|
||||
if (cache.version !== k_cache_version) {
|
||||
cache = {
|
||||
version: k_cache_version,
|
||||
following: {},
|
||||
last_row_id: 0,
|
||||
};
|
||||
}
|
||||
let max_row_id = (await tfrpc.rpc.query(`
|
||||
SELECT MAX(rowid) AS max_row_id FROM messages
|
||||
`, []))[0].max_row_id;
|
||||
let result = await this.following_deep_internal(ids, depth, blocking, cache.last_row_id, cache.following, max_row_id);
|
||||
cache.last_row_id = max_row_id;
|
||||
let store = JSON.stringify(cache);
|
||||
/* 2023-02-20: Exceeding message size. */
|
||||
//if (store.length < 512 * 1024) {
|
||||
await tfrpc.rpc.databaseSet('following', store);
|
||||
//}
|
||||
return [result, cache.following];
|
||||
}
|
||||
|
||||
async fetch_about(ids, users) {
|
||||
const k_cache_version = 1;
|
||||
let cache = await tfrpc.rpc.databaseGet('about');
|
||||
@ -228,6 +156,7 @@ class TfElement extends LitElement {
|
||||
]);
|
||||
if (messages && messages.length) {
|
||||
this.unread = [...this.unread, ...messages];
|
||||
this.unread = this.unread.slice(this.unread.length - 1024);
|
||||
}
|
||||
}
|
||||
|
||||
@ -255,7 +184,7 @@ class TfElement extends LitElement {
|
||||
|
||||
render_id_picker() {
|
||||
return html`
|
||||
<tf-id-picker id="picker" selected=${this.whoami} .ids=${this.ids} @change=${this._handle_whoami_changed}></tf-id-picker>
|
||||
<tf-id-picker id="picker" selected=${this.whoami} .ids=${this.ids} .users=${this.users} @change=${this._handle_whoami_changed}></tf-id-picker>
|
||||
<button @click=${this.create_identity} id="create_identity">Create Identity</button>
|
||||
`;
|
||||
}
|
||||
@ -283,9 +212,21 @@ class TfElement extends LitElement {
|
||||
async load() {
|
||||
let whoami = this.whoami;
|
||||
let tags = this.load_recent_tags();
|
||||
let [following, users] = await this.following_deep([whoami], 2, {});
|
||||
users = await this.fetch_about(following.sort(), users);
|
||||
this.following = following;
|
||||
let following = await tfrpc.rpc.following([whoami], 2);
|
||||
let users = {};
|
||||
let by_count = [];
|
||||
for (let [id, v] of Object.entries(following)) {
|
||||
users[id] = {
|
||||
following: v.of,
|
||||
blocking: v.ob,
|
||||
followed: v.if,
|
||||
blocked: v.ib,
|
||||
};
|
||||
by_count.push({count: v.of, id: id});
|
||||
}
|
||||
console.log(by_count.sort((x, y) => y.count - x.count).slice(0, 20));
|
||||
users = await this.fetch_about(Object.keys(following).sort(), users);
|
||||
this.following = Object.keys(following);
|
||||
this.users = users;
|
||||
await tags;
|
||||
console.log(`load finished ${whoami} => ${this.whoami}`);
|
||||
|
@ -9,12 +9,14 @@ class TfIdentityPickerElement extends LitElement {
|
||||
return {
|
||||
ids: {type: Array},
|
||||
selected: {type: String},
|
||||
users: {type: Object},
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.ids = [];
|
||||
this.users = {};
|
||||
}
|
||||
|
||||
changed(event) {
|
||||
@ -27,7 +29,7 @@ class TfIdentityPickerElement extends LitElement {
|
||||
render() {
|
||||
return html`
|
||||
<select @change=${this.changed} style="max-width: 100%">
|
||||
${(this.ids ?? []).map(id => html`<option ?selected=${id == this.selected} value=${id}>${id}</option>`)}
|
||||
${(this.ids ?? []).map(id => html`<option ?selected=${id == this.selected} value=${id}>${this.users[id]?.name ? (this.users[id]?.name + ' - ') : undefined}<small>${id}</small></option>`)}
|
||||
</select>
|
||||
`;
|
||||
}
|
||||
|
@ -258,9 +258,16 @@ class TfMessageElement extends LitElement {
|
||||
case 'md':
|
||||
raw_button = html`<input type="button" value="Message" @click=${() => self.format = 'message'}></input>`;
|
||||
break;
|
||||
default:
|
||||
case 'decrypted':
|
||||
raw_button = html`<input type="button" value="Raw" @click=${() => self.format = 'raw'}></input>`;
|
||||
break;
|
||||
default:
|
||||
if (this.message.decrypted) {
|
||||
raw_button = html`<input type="button" value="Decrypted" @click=${() => self.format = 'decrypted'}></input>`;
|
||||
} else {
|
||||
raw_button = html`<input type="button" value="Raw" @click=${() => self.format = 'raw'}></input>`;
|
||||
}
|
||||
break;
|
||||
}
|
||||
function small_frame(inner) {
|
||||
let body;
|
||||
@ -526,7 +533,11 @@ class TfMessageElement extends LitElement {
|
||||
`);
|
||||
} else if (typeof(this.message.content) == 'string') {
|
||||
if (this.message?.decrypted) {
|
||||
return small_frame(html`<span>🔓</span><pre>${JSON.stringify(this.decrypted, null, 2)}</pre>`);
|
||||
if (this.format == 'decrypted') {
|
||||
return small_frame(html`<span>🔓</span><pre>${JSON.stringify(this.message.decrypted, null, 2)}</pre>`);
|
||||
} else {
|
||||
return small_frame(html`<span>🔓</span><div>${this.message.decrypted.type}</div>`);
|
||||
}
|
||||
} else {
|
||||
return small_frame(html`<span>🔒</span>`);
|
||||
}
|
||||
|
@ -11,6 +11,9 @@ class TfProfileElement extends LitElement {
|
||||
id: {type: String},
|
||||
users: {type: Object},
|
||||
size: {type: Number},
|
||||
server_follows_me: {type: Boolean},
|
||||
following: {type: Boolean},
|
||||
blocking: {type: Boolean},
|
||||
};
|
||||
}
|
||||
|
||||
@ -24,6 +27,51 @@ class TfProfileElement extends LitElement {
|
||||
this.id = null;
|
||||
this.users = {};
|
||||
this.size = 0;
|
||||
this.server_follows_me = undefined;
|
||||
}
|
||||
|
||||
async load() {
|
||||
if (this.whoami !== this._follow_whoami) {
|
||||
this._follow_whoami = this.whoami;
|
||||
this.following = undefined;
|
||||
this.blocking = undefined;
|
||||
|
||||
let result = await tfrpc.rpc.query(`
|
||||
SELECT json_extract(content, '$.following') AS following
|
||||
FROM messages WHERE author = ? AND
|
||||
json_extract(content, '$.type') = 'contact' AND
|
||||
json_extract(content, '$.contact') = ? AND
|
||||
following IS NOT NULL
|
||||
ORDER BY sequence DESC LIMIT 1
|
||||
`, [this.whoami, this.id]);
|
||||
this.following = result?.[0]?.following ?? false;
|
||||
result = await tfrpc.rpc.query(`
|
||||
SELECT json_extract(content, '$.blocking') AS blocking
|
||||
FROM messages WHERE author = ? AND
|
||||
json_extract(content, '$.type') = 'contact' AND
|
||||
json_extract(content, '$.contact') = ? AND
|
||||
blocking IS NOT NULL
|
||||
ORDER BY sequence DESC LIMIT 1
|
||||
`, [this.whoami, this.id]);
|
||||
this.blocking = result?.[0]?.blocking ?? false;
|
||||
}
|
||||
}
|
||||
|
||||
async initial_load() {
|
||||
this.server_follows_me = undefined;
|
||||
let server_id = await tfrpc.rpc.getServerIdentity();
|
||||
let followed = await tfrpc.rpc.query(`
|
||||
SELECT json_extract(content, '$.following') AS following
|
||||
FROM messages
|
||||
WHERE author = ? AND
|
||||
json_extract(content, '$.type') = 'contact' AND
|
||||
json_extract(content, '$.contact') = ? ORDER BY sequence DESC LIMIT 1
|
||||
`, [server_id, this.whoami]);
|
||||
let is_followed = false;
|
||||
for (let row of followed) {
|
||||
is_followed = row.following != 0;
|
||||
}
|
||||
this.server_follows_me = is_followed;
|
||||
}
|
||||
|
||||
modify(change) {
|
||||
@ -58,6 +106,7 @@ class TfProfileElement extends LitElement {
|
||||
name: original.name,
|
||||
description: original.description,
|
||||
image: original.image,
|
||||
publicWebHosting: original.publicWebHosting,
|
||||
};
|
||||
console.log(this.editing);
|
||||
}
|
||||
@ -103,7 +152,24 @@ class TfProfileElement extends LitElement {
|
||||
input.click();
|
||||
}
|
||||
|
||||
async server_follow_me(follow) {
|
||||
try {
|
||||
await tfrpc.rpc.setServerFollowingMe(this.whoami, follow);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
try {
|
||||
await this.initial_load();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.id == this.whoami && this.editing && this.server_follows_me === undefined) {
|
||||
this.initial_load();
|
||||
}
|
||||
this.load();
|
||||
let self = this;
|
||||
let profile = this.users[this.id] || {};
|
||||
tfrpc.rpc.query(
|
||||
@ -116,50 +182,57 @@ class TfProfileElement extends LitElement {
|
||||
let block;
|
||||
if (this.id === this.whoami) {
|
||||
if (this.editing) {
|
||||
let server_follow;
|
||||
if (this.server_follows_me === true) {
|
||||
server_follow = html`<input type="button" value="Server, Stop Following Me" @click=${() => this.server_follow_me(false)}></input>`;
|
||||
} else if (this.server_follows_me === false) {
|
||||
server_follow = html`<input type="button" value="Server, Follow Me" @click=${() => this.server_follow_me(true)}></input>`;
|
||||
}
|
||||
edit = html`
|
||||
<input type="button" value="Save Profile" @click=${this.save_edits}></input>
|
||||
<input type="button" value="Discard" @click=${this.discard_edits}></input>
|
||||
${server_follow}
|
||||
`;
|
||||
} else {
|
||||
edit = html`<input type="button" value="Edit Profile" @click=${this.edit}></input>`;
|
||||
}
|
||||
}
|
||||
if (this.id !== this.whoami &&
|
||||
this.users[this.whoami]?.following) {
|
||||
this.following !== undefined) {
|
||||
follow =
|
||||
this.users[this.whoami].following[this.id] ?
|
||||
this.following ?
|
||||
html`<input type="button" value="Unfollow" @click=${this.unfollow}></input>` :
|
||||
html`<input type="button" value="Follow" @click=${this.follow}></input>`;
|
||||
}
|
||||
if (this.id !== this.whoami &&
|
||||
this.users[this.whoami]?.blocking) {
|
||||
this.blocking !== undefined) {
|
||||
block =
|
||||
this.users[this.whoami].blocking[this.id] ?
|
||||
this.blocking ?
|
||||
html`<input type="button" value="Unblock" @click=${this.unblock}></input>` :
|
||||
html`<input type="button" value="Block" @click=${this.block}></input>`;
|
||||
}
|
||||
let edit_profile = this.editing ? html`
|
||||
<div style="flex: 1 0 50%">
|
||||
<div style="flex: 1 0 50%; display: flex; flex-direction: column">
|
||||
<div>
|
||||
<label for="name">Name:</label>
|
||||
<input type="text" id="name" value=${this.editing.name} @input=${event => this.editing = Object.assign({}, this.editing, {name: event.srcElement.value})}></input>
|
||||
</div>
|
||||
<div>
|
||||
<div><label for="description">Description:</label></div>
|
||||
<textarea id="description" @input=${event => this.editing = Object.assign({}, this.editing, {description: event.srcElement.value})}>${this.editing.description}</textarea>
|
||||
</div>
|
||||
<div><label for="description">Description:</label></div>
|
||||
<textarea style="flex: 1 0" id="description" @input=${event => this.editing = Object.assign({}, this.editing, {description: event.srcElement.value})}>${this.editing.description}</textarea>
|
||||
<div>
|
||||
<label for="public_web_hosting">Public Web Hosting:</label>
|
||||
<input type="checkbox" id="public_web_hosting" value=${this.editing.public_web_hosting} @input=${event => this.editing = Object.assign({}, this.editing, {publicWebHosting: event.srcElement.checked})}></input>
|
||||
<input type="checkbox" id="public_web_hosting" ?checked=${this.editing.publicWebHosting} @input=${event => self.editing = Object.assign({}, self.editing, {publicWebHosting: event.srcElement.checked})}></input>
|
||||
</div>
|
||||
<div>
|
||||
<input type="button" value="Attach Image" @click=${this.attach_image}></input>
|
||||
</div>
|
||||
<input type="button" value="Attach Image" @click=${this.attach_image}></input>
|
||||
</div>` : null;
|
||||
let image = typeof(profile.image) == 'string' ? profile.image : profile.image?.link;
|
||||
image = this.editing?.image ?? image;
|
||||
let description = this.editing?.description ?? profile.description;
|
||||
return html`<div style="border: 2px solid black; background-color: rgba(255, 255, 255, 0.2); padding: 16px">
|
||||
<tf-user id=${this.id} .users=${this.users}></tf-user> (${tfutils.human_readable_size(this.size)})
|
||||
<div style="display: flex; flex-direction: row">
|
||||
<div style="display: flex; flex-direction: row; gap: 1em">
|
||||
${edit_profile}
|
||||
<div style="flex: 1 0 50%">
|
||||
<div><img src=${'/' + image + '/view'} style="width: 256px; height: auto"></img></div>
|
||||
@ -167,10 +240,10 @@ class TfProfileElement extends LitElement {
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Following ${Object.keys(profile.following || {}).length} identities.
|
||||
Followed by ${Object.values(self.users).filter(x => (x.following || {})[self.id]).length} identities.
|
||||
Blocking ${Object.keys(profile.blocking || {}).length} identities.
|
||||
Blocked by ${Object.values(self.users).filter(x => (x.blocking || {})[self.id]).length} identities.
|
||||
Following ${profile.following} identities.
|
||||
Followed by ${profile.followed} identities.
|
||||
Blocking ${profile.blocking} identities.
|
||||
Blocked by ${profile.blocked} identities.
|
||||
</div>
|
||||
<div>
|
||||
${edit}
|
||||
|
@ -65,34 +65,39 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
this.hash.substring(1),
|
||||
]);
|
||||
} else {
|
||||
return await tfrpc.rpc.query(
|
||||
`
|
||||
WITH news AS (SELECT messages.*
|
||||
FROM messages
|
||||
JOIN json_each(?) AS following ON messages.author = following.value
|
||||
WHERE messages.timestamp > ? AND messages.timestamp < ?
|
||||
ORDER BY messages.timestamp DESC)
|
||||
SELECT messages.*
|
||||
FROM news
|
||||
JOIN messages_refs ON news.id = messages_refs.ref
|
||||
JOIN messages ON messages_refs.message = messages.id
|
||||
UNION
|
||||
SELECT messages.*
|
||||
FROM news
|
||||
JOIN messages_refs ON news.id = messages_refs.message
|
||||
JOIN messages ON messages_refs.ref = messages.id
|
||||
UNION
|
||||
SELECT news.* FROM news
|
||||
`,
|
||||
[
|
||||
JSON.stringify(this.following),
|
||||
this.start_time,
|
||||
/*
|
||||
** Don't show messages more than a day into the future to prevent
|
||||
** messages with far-future timestamps from staying at the top forever.
|
||||
*/
|
||||
new Date().valueOf() + 24 * 60 * 60 * 1000,
|
||||
]);
|
||||
let promises = [];
|
||||
const k_following_limit = 256;
|
||||
for (let i = 0; i < this.following.length; i += k_following_limit) {
|
||||
promises.push(tfrpc.rpc.query(
|
||||
`
|
||||
WITH news AS (SELECT messages.*
|
||||
FROM messages
|
||||
JOIN json_each(?) AS following ON messages.author = following.value
|
||||
WHERE messages.timestamp > ? AND messages.timestamp < ?
|
||||
ORDER BY messages.timestamp DESC)
|
||||
SELECT messages.*
|
||||
FROM news
|
||||
JOIN messages_refs ON news.id = messages_refs.ref
|
||||
JOIN messages ON messages_refs.message = messages.id
|
||||
UNION
|
||||
SELECT messages.*
|
||||
FROM news
|
||||
JOIN messages_refs ON news.id = messages_refs.message
|
||||
JOIN messages ON messages_refs.ref = messages.id
|
||||
UNION
|
||||
SELECT news.* FROM news
|
||||
`,
|
||||
[
|
||||
JSON.stringify(this.following.slice(i, i + k_following_limit)),
|
||||
this.start_time,
|
||||
/*
|
||||
** Don't show messages more than a day into the future to prevent
|
||||
** messages with far-future timestamps from staying at the top forever.
|
||||
*/
|
||||
new Date().valueOf() + 24 * 60 * 60 * 1000,
|
||||
]));
|
||||
}
|
||||
return [].concat(...(await Promise.all(promises)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,6 +133,7 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
}
|
||||
|
||||
async decrypt(messages) {
|
||||
console.log('decrypt');
|
||||
let result = [];
|
||||
for (let message of messages) {
|
||||
let content;
|
||||
@ -162,7 +168,7 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
if (!this.messages ||
|
||||
this._messages_hash !== this.hash ||
|
||||
this._messages_following !== this.following) {
|
||||
console.log(`loading messages for ${this.whoami}`);
|
||||
console.log(`loading messages for ${this.whoami} (following ${this.following.length})`);
|
||||
let self = this;
|
||||
this.messages = [];
|
||||
this._messages_hash = this.hash;
|
||||
|
5
apps/welcome.json
Normal file
5
apps/welcome.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "👋",
|
||||
"previous": "&xc5LDQt9bWp6wrPxZhvSGiMXjweSK1YbO2DReM7/2ic=.sha256"
|
||||
}
|
5
apps/welcome/app.js
Normal file
5
apps/welcome/app.js
Normal file
@ -0,0 +1,5 @@
|
||||
async function main() {
|
||||
await app.setDocument(utf8Decode(getFile('index.html')));
|
||||
}
|
||||
|
||||
main();
|
6
apps/welcome/brands.min.css
vendored
Normal file
6
apps/welcome/brands.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
apps/welcome/fa-brands-400.ttf
Normal file
BIN
apps/welcome/fa-brands-400.ttf
Normal file
Binary file not shown.
BIN
apps/welcome/fa-brands-400.woff2
Normal file
BIN
apps/welcome/fa-brands-400.woff2
Normal file
Binary file not shown.
BIN
apps/welcome/fa-regular-400.ttf
Normal file
BIN
apps/welcome/fa-regular-400.ttf
Normal file
Binary file not shown.
BIN
apps/welcome/fa-regular-400.woff2
Normal file
BIN
apps/welcome/fa-regular-400.woff2
Normal file
Binary file not shown.
BIN
apps/welcome/fa-solid-900.ttf
Normal file
BIN
apps/welcome/fa-solid-900.ttf
Normal file
Binary file not shown.
BIN
apps/welcome/fa-solid-900.woff2
Normal file
BIN
apps/welcome/fa-solid-900.woff2
Normal file
Binary file not shown.
9
apps/welcome/fontawesome.min.css
vendored
Normal file
9
apps/welcome/fontawesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
173
apps/welcome/index.html
Normal file
173
apps/welcome/index.html
Normal file
@ -0,0 +1,173 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="w3.css">
|
||||
<link rel="stylesheet" href="fontawesome.min.css">
|
||||
<link rel="stylesheet" href="regular.min.css">
|
||||
<link rel="stylesheet" href="solid.min.css">
|
||||
<link rel="stylesheet" href="brands.min.css">
|
||||
|
||||
<style>
|
||||
body,h1,h2,h3,h4,h5 {font-family: "Poppins", sans-serif}
|
||||
body {font-size: 16px;}
|
||||
img {margin-bottom: -8px;}
|
||||
.mySlides {display: none;}
|
||||
</style>
|
||||
<base target="_top">
|
||||
</head>
|
||||
<body class="w3-content w3-black" style="max-width:1500px;">
|
||||
<!-- The App Section -->
|
||||
<div class="w3-padding-64 w3-white">
|
||||
<div class="w3-row-padding">
|
||||
<div class="w3-col l8 m6 w3-padding-32">
|
||||
<h1 class="w3-jumbo">
|
||||
<b>😎 Tilde Friends</b>
|
||||
</h1>
|
||||
<h1 class="w3-xxlarge w3-text-green"><b>Make apps and friends from the comfort of your web browser.</b></h1>
|
||||
<p>Tilde Friends is a platform for building, running, and sharing web applications.</p>
|
||||
<p>Available for lots of devices:
|
||||
<i class="fa-brands fa-linux w3-xlarge"></i>
|
||||
<i class="fa-brands fa-android w3-xlarge"></i>
|
||||
<i class="fa-brands fa-apple w3-xlarge"></i>
|
||||
<i class="fa fa-mobile-screen w3-xlarge"></i>
|
||||
<i class="fa-brands fa-windows w3-xlarge"></i>
|
||||
</p>
|
||||
<a class="w3-button w3-black w3-padding-large" href="https://www.tildefriends.net/~cory/releases/"><i class="fa fa-download"></i> Download</a>
|
||||
<a class="w3-button w3-black w3-padding-large" href="https://www.tildefriends.net/~cory/apps/"><i class="fa fa-link"></i> Try Some Apps</a>
|
||||
</div>
|
||||
<div class="w3-col l4 m6">
|
||||
<img src="tildefriends.png" class="w3-image w3-right w3-hide-small">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SSB Section -->
|
||||
<div class="w3-light-grey">
|
||||
<div class="w3-row-padding w3-padding-64 ">
|
||||
<div class="w3-col l4 m6 s4">
|
||||
<a href="https://scuttlebutt.nz/"><img class="w3-image w3-round-large" src="ssb.png" alt="Secure Scuttlebutt"></a>
|
||||
</div>
|
||||
<div class="w3-col l8 m6" style="height: auto">
|
||||
<h1 class="w3-jumbo"><b>Built for Sharing</b></h1>
|
||||
<p>
|
||||
Tilde Friends participates in the <a href="https://scuttlebutt.nz/">Secure Scuttlebutt</a> distributed social network.
|
||||
</p>
|
||||
<p>
|
||||
Share apps with friends. Discover new apps made by enemies. Post pictures of your coffee. Or just lurk.
|
||||
</p>
|
||||
<p>
|
||||
The social network integration provides tools for connecting with other people world-wide
|
||||
while still allowing apps and everything to operate offline.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Editor Section -->
|
||||
<div class="w3-container w3-padding-64 w3-light-blue">
|
||||
<div class="w3-row-padding">
|
||||
<div class="w3-col l8 m6">
|
||||
<h1 class="w3-jumbo"><b>Edit Anything</b></h1>
|
||||
<i class="fa fa-pen-to-square w3-left w3-jumbo w3-text-gray" style="padding: 32px"></i>
|
||||
<p>
|
||||
See that <code><b>edit</b></code> link near the top left corner of this page? It's there for
|
||||
every Tilde Friends app, so you can modify and see your changes right away.
|
||||
</p>
|
||||
<p>
|
||||
It's kind of like a wiki, but for code!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sandbox Section -->
|
||||
<div class="w3-padding-64 w3-grey">
|
||||
<div class="w3-row-padding">
|
||||
<div class="w3-col">
|
||||
<h1 class="w3-jumbo" style="text-align: right"><b>Sandbox Security</b></h1>
|
||||
<i class="fa fa-road-barrier w3-right w3-jumbo w3-text-yellow" style="padding: 32px"></i>
|
||||
<p>
|
||||
Tilde Friends tries to make sure apps can be trusted using similar techniques to how web
|
||||
browsers and operating systems do it.
|
||||
</p>
|
||||
<p>
|
||||
This is all a work in progress, and it varies by platform, so don't give it all your
|
||||
innermost secrets yet, but do kick its tires and
|
||||
<a href="mailto:cory@tildefriends.net">share</a> any surprises you find.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Technlology Section -->
|
||||
<div class="w3-container w3-padding-64 w3-light-grey w3-center">
|
||||
<h1 class="w3-jumbo"><b>Trusted Technology</b></h1>
|
||||
<p>Tilde Friends is built using boring, trusted tech.</p>
|
||||
<p>Though of course for building Tilde Friends apps, you are free to use whatever fits.</p>
|
||||
|
||||
<div class="w3-row" style="margin-top:64px">
|
||||
<a href="https://en.wikipedia.org/wiki/C_(programming_language)" class="w3-col s3">
|
||||
<i class="fa fa-c w3-text-blue w3-jumbo"></i>
|
||||
<p>C</p>
|
||||
</a>
|
||||
<a href="https://bellard.org/quickjs/" class="w3-col s3">
|
||||
<i class="fa-brands fa-js w3-text-orange w3-jumbo"></i>
|
||||
<p>QuickJS</p>
|
||||
</a>
|
||||
<a href="https://www.sqlite.org/" class="w3-col s3">
|
||||
<i class="fa fa-database w3-text-red w3-jumbo"></i>
|
||||
<p>SQLite</p>
|
||||
</a>
|
||||
<a href="https://libuv.org/" class="w3-col s3">
|
||||
<i class="fa fa-bolt w3-text-yellow w3-jumbo"></i>
|
||||
<p>libuv</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="w3-row" style="margin-top:64px">
|
||||
<a href="https://www.zlib.net/" class="w3-col s3">
|
||||
<i class="fa fa-file-zipper w3-text-cyan w3-jumbo"></i>
|
||||
<p>zlib</p>
|
||||
</a>
|
||||
<a href="https://doc.libsodium.org/" class="w3-col s3">
|
||||
<i class="fa fa-lock w3-text-purple w3-jumbo"></i>
|
||||
<p>libsodium</p>
|
||||
</a>
|
||||
<a href="https://www.openssl.org/" class="w3-col s3">
|
||||
<i class="fa fa-shield-halved w3-text-green w3-jumbo"></i>
|
||||
<p>OpenSSL </p>
|
||||
</a>
|
||||
<a href="https://github.com/ianlancetaylor/libbacktrace" class="w3-col s3">
|
||||
<i class="fa fa-burst w3-text-pink w3-jumbo"></i>
|
||||
<p>libbacktrace</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="w3-row" style="margin-top:64px">
|
||||
<a href="https://codemirror.net/5/" class="w3-col s3">
|
||||
<i class="fa fa-keyboard w3-text-indigo w3-jumbo"></i>
|
||||
<p>CodeMirror</p>
|
||||
</a>
|
||||
<a href="https://speedscope.app/" class="w3-col s3">
|
||||
<i class="fa fa-microscope w3-text-orange w3-jumbo"></i>
|
||||
<p>Speedscope</p>
|
||||
</a>
|
||||
<a href="https://lit.dev/" class="w3-col s3">
|
||||
<i class="fa fa-fire w3-text-cyan w3-jumbo"></i>
|
||||
<p>Lit</p>
|
||||
</a>
|
||||
<a href="https://www.gnu.org/software/make/" class="w3-col s3">
|
||||
<i class="fa fa-hammer w3-text-teal w3-jumbo"></i>
|
||||
<p>GNU Make</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="w3-container w3-padding-32 w3-blue-grey w3-center w3-xlarge">
|
||||
<p class="w3-medium">This page and Tilde Friends itself was made by Cory mostly in coffee shops and a local pizza place.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
6
apps/welcome/regular.min.css
vendored
Normal file
6
apps/welcome/regular.min.css
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/*!
|
||||
* Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
* Copyright 2023 Fonticons, Inc.
|
||||
*/
|
||||
:host,:root{--fa-style-family-classic:"Font Awesome 6 Free";--fa-font-regular:normal 400 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:400;font-display:block;src:url(fa-regular-400.woff2) format("woff2"),url(fa-regular-400.ttf) format("truetype")}.fa-regular,.far{font-weight:400}
|
6
apps/welcome/solid.min.css
vendored
Normal file
6
apps/welcome/solid.min.css
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/*!
|
||||
* Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
* Copyright 2023 Fonticons, Inc.
|
||||
*/
|
||||
:host,:root{--fa-style-family-classic:"Font Awesome 6 Free";--fa-font-solid:normal 900 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:900;font-display:block;src:url(fa-solid-900.woff2) format("woff2"),url(fa-solid-900.ttf) format("truetype")}.fa-solid,.fas{font-weight:900}
|
BIN
apps/welcome/ssb.png
Normal file
BIN
apps/welcome/ssb.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 50 KiB |
BIN
apps/welcome/tildefriends.png
Normal file
BIN
apps/welcome/tildefriends.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 141 KiB |
235
apps/welcome/w3.css
Normal file
235
apps/welcome/w3.css
Normal file
@ -0,0 +1,235 @@
|
||||
/* W3.CSS 4.15 December 2020 by Jan Egil and Borge Refsnes */
|
||||
html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}
|
||||
/* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */
|
||||
html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}
|
||||
article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item}
|
||||
audio,canvas,progress,video{display:inline-block}progress{vertical-align:baseline}
|
||||
audio:not([controls]){display:none;height:0}[hidden],template{display:none}
|
||||
a{background-color:transparent}a:active,a:hover{outline-width:0}
|
||||
abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}
|
||||
b,strong{font-weight:bolder}dfn{font-style:italic}mark{background:#ff0;color:#000}
|
||||
small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
|
||||
sub{bottom:-0.25em}sup{top:-0.5em}figure{margin:1em 40px}img{border-style:none}
|
||||
code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}hr{box-sizing:content-box;height:0;overflow:visible}
|
||||
button,input,select,textarea,optgroup{font:inherit;margin:0}optgroup{font-weight:bold}
|
||||
button,input{overflow:visible}button,select{text-transform:none}
|
||||
button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}
|
||||
button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}
|
||||
button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}
|
||||
fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em}
|
||||
legend{color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}
|
||||
[type=checkbox],[type=radio]{padding:0}
|
||||
[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}
|
||||
[type=search]{-webkit-appearance:textfield;outline-offset:-2px}
|
||||
[type=search]::-webkit-search-decoration{-webkit-appearance:none}
|
||||
::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}
|
||||
/* End extract */
|
||||
html,body{font-family:Verdana,sans-serif;font-size:15px;line-height:1.5}html{overflow-x:hidden}
|
||||
h1{font-size:36px}h2{font-size:30px}h3{font-size:24px}h4{font-size:20px}h5{font-size:18px}h6{font-size:16px}
|
||||
.w3-serif{font-family:serif}.w3-sans-serif{font-family:sans-serif}.w3-cursive{font-family:cursive}.w3-monospace{font-family:monospace}
|
||||
h1,h2,h3,h4,h5,h6{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;margin:10px 0}.w3-wide{letter-spacing:4px}
|
||||
hr{border:0;border-top:1px solid #eee;margin:20px 0}
|
||||
.w3-image{max-width:100%;height:auto}img{vertical-align:middle}a{color:inherit}
|
||||
.w3-table,.w3-table-all{border-collapse:collapse;border-spacing:0;width:100%;display:table}.w3-table-all{border:1px solid #ccc}
|
||||
.w3-bordered tr,.w3-table-all tr{border-bottom:1px solid #ddd}.w3-striped tbody tr:nth-child(even){background-color:#f1f1f1}
|
||||
.w3-table-all tr:nth-child(odd){background-color:#fff}.w3-table-all tr:nth-child(even){background-color:#f1f1f1}
|
||||
.w3-hoverable tbody tr:hover,.w3-ul.w3-hoverable li:hover{background-color:#ccc}.w3-centered tr th,.w3-centered tr td{text-align:center}
|
||||
.w3-table td,.w3-table th,.w3-table-all td,.w3-table-all th{padding:8px 8px;display:table-cell;text-align:left;vertical-align:top}
|
||||
.w3-table th:first-child,.w3-table td:first-child,.w3-table-all th:first-child,.w3-table-all td:first-child{padding-left:16px}
|
||||
.w3-btn,.w3-button{border:none;display:inline-block;padding:8px 16px;vertical-align:middle;overflow:hidden;text-decoration:none;color:inherit;background-color:inherit;text-align:center;cursor:pointer;white-space:nowrap}
|
||||
.w3-btn:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)}
|
||||
.w3-btn,.w3-button{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
||||
.w3-disabled,.w3-btn:disabled,.w3-button:disabled{cursor:not-allowed;opacity:0.3}.w3-disabled *,:disabled *{pointer-events:none}
|
||||
.w3-btn.w3-disabled:hover,.w3-btn:disabled:hover{box-shadow:none}
|
||||
.w3-badge,.w3-tag{background-color:#000;color:#fff;display:inline-block;padding-left:8px;padding-right:8px;text-align:center}.w3-badge{border-radius:50%}
|
||||
.w3-ul{list-style-type:none;padding:0;margin:0}.w3-ul li{padding:8px 16px;border-bottom:1px solid #ddd}.w3-ul li:last-child{border-bottom:none}
|
||||
.w3-tooltip,.w3-display-container{position:relative}.w3-tooltip .w3-text{display:none}.w3-tooltip:hover .w3-text{display:inline-block}
|
||||
.w3-ripple:active{opacity:0.5}.w3-ripple{transition:opacity 0s}
|
||||
.w3-input{padding:8px;display:block;border:none;border-bottom:1px solid #ccc;width:100%}
|
||||
.w3-select{padding:9px 0;width:100%;border:none;border-bottom:1px solid #ccc}
|
||||
.w3-dropdown-click,.w3-dropdown-hover{position:relative;display:inline-block;cursor:pointer}
|
||||
.w3-dropdown-hover:hover .w3-dropdown-content{display:block}
|
||||
.w3-dropdown-hover:first-child,.w3-dropdown-click:hover{background-color:#ccc;color:#000}
|
||||
.w3-dropdown-hover:hover > .w3-button:first-child,.w3-dropdown-click:hover > .w3-button:first-child{background-color:#ccc;color:#000}
|
||||
.w3-dropdown-content{cursor:auto;color:#000;background-color:#fff;display:none;position:absolute;min-width:160px;margin:0;padding:0;z-index:1}
|
||||
.w3-check,.w3-radio{width:24px;height:24px;position:relative;top:6px}
|
||||
.w3-sidebar{height:100%;width:200px;background-color:#fff;position:fixed!important;z-index:1;overflow:auto}
|
||||
.w3-bar-block .w3-dropdown-hover,.w3-bar-block .w3-dropdown-click{width:100%}
|
||||
.w3-bar-block .w3-dropdown-hover .w3-dropdown-content,.w3-bar-block .w3-dropdown-click .w3-dropdown-content{min-width:100%}
|
||||
.w3-bar-block .w3-dropdown-hover .w3-button,.w3-bar-block .w3-dropdown-click .w3-button{width:100%;text-align:left;padding:8px 16px}
|
||||
.w3-main,#main{transition:margin-left .4s}
|
||||
.w3-modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4)}
|
||||
.w3-modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px}
|
||||
.w3-bar{width:100%;overflow:hidden}.w3-center .w3-bar{display:inline-block;width:auto}
|
||||
.w3-bar .w3-bar-item{padding:8px 16px;float:left;width:auto;border:none;display:block;outline:0}
|
||||
.w3-bar .w3-dropdown-hover,.w3-bar .w3-dropdown-click{position:static;float:left}
|
||||
.w3-bar .w3-button{white-space:normal}
|
||||
.w3-bar-block .w3-bar-item{width:100%;display:block;padding:8px 16px;text-align:left;border:none;white-space:normal;float:none;outline:0}
|
||||
.w3-bar-block.w3-center .w3-bar-item{text-align:center}.w3-block{display:block;width:100%}
|
||||
.w3-responsive{display:block;overflow-x:auto}
|
||||
.w3-container:after,.w3-container:before,.w3-panel:after,.w3-panel:before,.w3-row:after,.w3-row:before,.w3-row-padding:after,.w3-row-padding:before,
|
||||
.w3-cell-row:before,.w3-cell-row:after,.w3-clear:after,.w3-clear:before,.w3-bar:before,.w3-bar:after{content:"";display:table;clear:both}
|
||||
.w3-col,.w3-half,.w3-third,.w3-twothird,.w3-threequarter,.w3-quarter{float:left;width:100%}
|
||||
.w3-col.s1{width:8.33333%}.w3-col.s2{width:16.66666%}.w3-col.s3{width:24.99999%}.w3-col.s4{width:33.33333%}
|
||||
.w3-col.s5{width:41.66666%}.w3-col.s6{width:49.99999%}.w3-col.s7{width:58.33333%}.w3-col.s8{width:66.66666%}
|
||||
.w3-col.s9{width:74.99999%}.w3-col.s10{width:83.33333%}.w3-col.s11{width:91.66666%}.w3-col.s12{width:99.99999%}
|
||||
@media (min-width:601px){.w3-col.m1{width:8.33333%}.w3-col.m2{width:16.66666%}.w3-col.m3,.w3-quarter{width:24.99999%}.w3-col.m4,.w3-third{width:33.33333%}
|
||||
.w3-col.m5{width:41.66666%}.w3-col.m6,.w3-half{width:49.99999%}.w3-col.m7{width:58.33333%}.w3-col.m8,.w3-twothird{width:66.66666%}
|
||||
.w3-col.m9,.w3-threequarter{width:74.99999%}.w3-col.m10{width:83.33333%}.w3-col.m11{width:91.66666%}.w3-col.m12{width:99.99999%}}
|
||||
@media (min-width:993px){.w3-col.l1{width:8.33333%}.w3-col.l2{width:16.66666%}.w3-col.l3{width:24.99999%}.w3-col.l4{width:33.33333%}
|
||||
.w3-col.l5{width:41.66666%}.w3-col.l6{width:49.99999%}.w3-col.l7{width:58.33333%}.w3-col.l8{width:66.66666%}
|
||||
.w3-col.l9{width:74.99999%}.w3-col.l10{width:83.33333%}.w3-col.l11{width:91.66666%}.w3-col.l12{width:99.99999%}}
|
||||
.w3-rest{overflow:hidden}.w3-stretch{margin-left:-16px;margin-right:-16px}
|
||||
.w3-content,.w3-auto{margin-left:auto;margin-right:auto}.w3-content{max-width:980px}.w3-auto{max-width:1140px}
|
||||
.w3-cell-row{display:table;width:100%}.w3-cell{display:table-cell}
|
||||
.w3-cell-top{vertical-align:top}.w3-cell-middle{vertical-align:middle}.w3-cell-bottom{vertical-align:bottom}
|
||||
.w3-hide{display:none!important}.w3-show-block,.w3-show{display:block!important}.w3-show-inline-block{display:inline-block!important}
|
||||
@media (max-width:1205px){.w3-auto{max-width:95%}}
|
||||
@media (max-width:600px){.w3-modal-content{margin:0 10px;width:auto!important}.w3-modal{padding-top:30px}
|
||||
.w3-dropdown-hover.w3-mobile .w3-dropdown-content,.w3-dropdown-click.w3-mobile .w3-dropdown-content{position:relative}
|
||||
.w3-hide-small{display:none!important}.w3-mobile{display:block;width:100%!important}.w3-bar-item.w3-mobile,.w3-dropdown-hover.w3-mobile,.w3-dropdown-click.w3-mobile{text-align:center}
|
||||
.w3-dropdown-hover.w3-mobile,.w3-dropdown-hover.w3-mobile .w3-btn,.w3-dropdown-hover.w3-mobile .w3-button,.w3-dropdown-click.w3-mobile,.w3-dropdown-click.w3-mobile .w3-btn,.w3-dropdown-click.w3-mobile .w3-button{width:100%}}
|
||||
@media (max-width:768px){.w3-modal-content{width:500px}.w3-modal{padding-top:50px}}
|
||||
@media (min-width:993px){.w3-modal-content{width:900px}.w3-hide-large{display:none!important}.w3-sidebar.w3-collapse{display:block!important}}
|
||||
@media (max-width:992px) and (min-width:601px){.w3-hide-medium{display:none!important}}
|
||||
@media (max-width:992px){.w3-sidebar.w3-collapse{display:none}.w3-main{margin-left:0!important;margin-right:0!important}.w3-auto{max-width:100%}}
|
||||
.w3-top,.w3-bottom{position:fixed;width:100%;z-index:1}.w3-top{top:0}.w3-bottom{bottom:0}
|
||||
.w3-overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);z-index:2}
|
||||
.w3-display-topleft{position:absolute;left:0;top:0}.w3-display-topright{position:absolute;right:0;top:0}
|
||||
.w3-display-bottomleft{position:absolute;left:0;bottom:0}.w3-display-bottomright{position:absolute;right:0;bottom:0}
|
||||
.w3-display-middle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%)}
|
||||
.w3-display-left{position:absolute;top:50%;left:0%;transform:translate(0%,-50%);-ms-transform:translate(-0%,-50%)}
|
||||
.w3-display-right{position:absolute;top:50%;right:0%;transform:translate(0%,-50%);-ms-transform:translate(0%,-50%)}
|
||||
.w3-display-topmiddle{position:absolute;left:50%;top:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)}
|
||||
.w3-display-bottommiddle{position:absolute;left:50%;bottom:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)}
|
||||
.w3-display-container:hover .w3-display-hover{display:block}.w3-display-container:hover span.w3-display-hover{display:inline-block}.w3-display-hover{display:none}
|
||||
.w3-display-position{position:absolute}
|
||||
.w3-circle{border-radius:50%}
|
||||
.w3-round-small{border-radius:2px}.w3-round,.w3-round-medium{border-radius:4px}.w3-round-large{border-radius:8px}.w3-round-xlarge{border-radius:16px}.w3-round-xxlarge{border-radius:32px}
|
||||
.w3-row-padding,.w3-row-padding>.w3-half,.w3-row-padding>.w3-third,.w3-row-padding>.w3-twothird,.w3-row-padding>.w3-threequarter,.w3-row-padding>.w3-quarter,.w3-row-padding>.w3-col{padding:0 8px}
|
||||
.w3-container,.w3-panel{padding:0.01em 16px}.w3-panel{margin-top:16px;margin-bottom:16px}
|
||||
.w3-code,.w3-codespan{font-family:Consolas,"courier new";font-size:16px}
|
||||
.w3-code{width:auto;background-color:#fff;padding:8px 12px;border-left:4px solid #4CAF50;word-wrap:break-word}
|
||||
.w3-codespan{color:crimson;background-color:#f1f1f1;padding-left:4px;padding-right:4px;font-size:110%}
|
||||
.w3-card,.w3-card-2{box-shadow:0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)}
|
||||
.w3-card-4,.w3-hover-shadow:hover{box-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 rgba(0,0,0,0.19)}
|
||||
.w3-spin{animation:w3-spin 2s infinite linear}@keyframes w3-spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}
|
||||
.w3-animate-fading{animation:fading 10s infinite}@keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}}
|
||||
.w3-animate-opacity{animation:opac 0.8s}@keyframes opac{from{opacity:0} to{opacity:1}}
|
||||
.w3-animate-top{position:relative;animation:animatetop 0.4s}@keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}}
|
||||
.w3-animate-left{position:relative;animation:animateleft 0.4s}@keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}}
|
||||
.w3-animate-right{position:relative;animation:animateright 0.4s}@keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}}
|
||||
.w3-animate-bottom{position:relative;animation:animatebottom 0.4s}@keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}}
|
||||
.w3-animate-zoom {animation:animatezoom 0.6s}@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}}
|
||||
.w3-animate-input{transition:width 0.4s ease-in-out}.w3-animate-input:focus{width:100%!important}
|
||||
.w3-opacity,.w3-hover-opacity:hover{opacity:0.60}.w3-opacity-off,.w3-hover-opacity-off:hover{opacity:1}
|
||||
.w3-opacity-max{opacity:0.25}.w3-opacity-min{opacity:0.75}
|
||||
.w3-greyscale-max,.w3-grayscale-max,.w3-hover-greyscale:hover,.w3-hover-grayscale:hover{filter:grayscale(100%)}
|
||||
.w3-greyscale,.w3-grayscale{filter:grayscale(75%)}.w3-greyscale-min,.w3-grayscale-min{filter:grayscale(50%)}
|
||||
.w3-sepia{filter:sepia(75%)}.w3-sepia-max,.w3-hover-sepia:hover{filter:sepia(100%)}.w3-sepia-min{filter:sepia(50%)}
|
||||
.w3-tiny{font-size:10px!important}.w3-small{font-size:12px!important}.w3-medium{font-size:15px!important}.w3-large{font-size:18px!important}
|
||||
.w3-xlarge{font-size:24px!important}.w3-xxlarge{font-size:36px!important}.w3-xxxlarge{font-size:48px!important}.w3-jumbo{font-size:64px!important}
|
||||
.w3-left-align{text-align:left!important}.w3-right-align{text-align:right!important}.w3-justify{text-align:justify!important}.w3-center{text-align:center!important}
|
||||
.w3-border-0{border:0!important}.w3-border{border:1px solid #ccc!important}
|
||||
.w3-border-top{border-top:1px solid #ccc!important}.w3-border-bottom{border-bottom:1px solid #ccc!important}
|
||||
.w3-border-left{border-left:1px solid #ccc!important}.w3-border-right{border-right:1px solid #ccc!important}
|
||||
.w3-topbar{border-top:6px solid #ccc!important}.w3-bottombar{border-bottom:6px solid #ccc!important}
|
||||
.w3-leftbar{border-left:6px solid #ccc!important}.w3-rightbar{border-right:6px solid #ccc!important}
|
||||
.w3-section,.w3-code{margin-top:16px!important;margin-bottom:16px!important}
|
||||
.w3-margin{margin:16px!important}.w3-margin-top{margin-top:16px!important}.w3-margin-bottom{margin-bottom:16px!important}
|
||||
.w3-margin-left{margin-left:16px!important}.w3-margin-right{margin-right:16px!important}
|
||||
.w3-padding-small{padding:4px 8px!important}.w3-padding{padding:8px 16px!important}.w3-padding-large{padding:12px 24px!important}
|
||||
.w3-padding-16{padding-top:16px!important;padding-bottom:16px!important}.w3-padding-24{padding-top:24px!important;padding-bottom:24px!important}
|
||||
.w3-padding-32{padding-top:32px!important;padding-bottom:32px!important}.w3-padding-48{padding-top:48px!important;padding-bottom:48px!important}
|
||||
.w3-padding-64{padding-top:64px!important;padding-bottom:64px!important}
|
||||
.w3-padding-top-64{padding-top:64px!important}.w3-padding-top-48{padding-top:48px!important}
|
||||
.w3-padding-top-32{padding-top:32px!important}.w3-padding-top-24{padding-top:24px!important}
|
||||
.w3-left{float:left!important}.w3-right{float:right!important}
|
||||
.w3-button:hover{color:#000!important;background-color:#ccc!important}
|
||||
.w3-transparent,.w3-hover-none:hover{background-color:transparent!important}
|
||||
.w3-hover-none:hover{box-shadow:none!important}
|
||||
/* Colors */
|
||||
.w3-amber,.w3-hover-amber:hover{color:#000!important;background-color:#ffc107!important}
|
||||
.w3-aqua,.w3-hover-aqua:hover{color:#000!important;background-color:#00ffff!important}
|
||||
.w3-blue,.w3-hover-blue:hover{color:#fff!important;background-color:#2196F3!important}
|
||||
.w3-light-blue,.w3-hover-light-blue:hover{color:#000!important;background-color:#87CEEB!important}
|
||||
.w3-brown,.w3-hover-brown:hover{color:#fff!important;background-color:#795548!important}
|
||||
.w3-cyan,.w3-hover-cyan:hover{color:#000!important;background-color:#00bcd4!important}
|
||||
.w3-blue-grey,.w3-hover-blue-grey:hover,.w3-blue-gray,.w3-hover-blue-gray:hover{color:#fff!important;background-color:#607d8b!important}
|
||||
.w3-green,.w3-hover-green:hover{color:#fff!important;background-color:#4CAF50!important}
|
||||
.w3-light-green,.w3-hover-light-green:hover{color:#000!important;background-color:#8bc34a!important}
|
||||
.w3-indigo,.w3-hover-indigo:hover{color:#fff!important;background-color:#3f51b5!important}
|
||||
.w3-khaki,.w3-hover-khaki:hover{color:#000!important;background-color:#f0e68c!important}
|
||||
.w3-lime,.w3-hover-lime:hover{color:#000!important;background-color:#cddc39!important}
|
||||
.w3-orange,.w3-hover-orange:hover{color:#000!important;background-color:#ff9800!important}
|
||||
.w3-deep-orange,.w3-hover-deep-orange:hover{color:#fff!important;background-color:#ff5722!important}
|
||||
.w3-pink,.w3-hover-pink:hover{color:#fff!important;background-color:#e91e63!important}
|
||||
.w3-purple,.w3-hover-purple:hover{color:#fff!important;background-color:#9c27b0!important}
|
||||
.w3-deep-purple,.w3-hover-deep-purple:hover{color:#fff!important;background-color:#673ab7!important}
|
||||
.w3-red,.w3-hover-red:hover{color:#fff!important;background-color:#f44336!important}
|
||||
.w3-sand,.w3-hover-sand:hover{color:#000!important;background-color:#fdf5e6!important}
|
||||
.w3-teal,.w3-hover-teal:hover{color:#fff!important;background-color:#009688!important}
|
||||
.w3-yellow,.w3-hover-yellow:hover{color:#000!important;background-color:#ffeb3b!important}
|
||||
.w3-white,.w3-hover-white:hover{color:#000!important;background-color:#fff!important}
|
||||
.w3-black,.w3-hover-black:hover{color:#fff!important;background-color:#000!important}
|
||||
.w3-grey,.w3-hover-grey:hover,.w3-gray,.w3-hover-gray:hover{color:#000!important;background-color:#9e9e9e!important}
|
||||
.w3-light-grey,.w3-hover-light-grey:hover,.w3-light-gray,.w3-hover-light-gray:hover{color:#000!important;background-color:#f1f1f1!important}
|
||||
.w3-dark-grey,.w3-hover-dark-grey:hover,.w3-dark-gray,.w3-hover-dark-gray:hover{color:#fff!important;background-color:#616161!important}
|
||||
.w3-pale-red,.w3-hover-pale-red:hover{color:#000!important;background-color:#ffdddd!important}
|
||||
.w3-pale-green,.w3-hover-pale-green:hover{color:#000!important;background-color:#ddffdd!important}
|
||||
.w3-pale-yellow,.w3-hover-pale-yellow:hover{color:#000!important;background-color:#ffffcc!important}
|
||||
.w3-pale-blue,.w3-hover-pale-blue:hover{color:#000!important;background-color:#ddffff!important}
|
||||
.w3-text-amber,.w3-hover-text-amber:hover{color:#ffc107!important}
|
||||
.w3-text-aqua,.w3-hover-text-aqua:hover{color:#00ffff!important}
|
||||
.w3-text-blue,.w3-hover-text-blue:hover{color:#2196F3!important}
|
||||
.w3-text-light-blue,.w3-hover-text-light-blue:hover{color:#87CEEB!important}
|
||||
.w3-text-brown,.w3-hover-text-brown:hover{color:#795548!important}
|
||||
.w3-text-cyan,.w3-hover-text-cyan:hover{color:#00bcd4!important}
|
||||
.w3-text-blue-grey,.w3-hover-text-blue-grey:hover,.w3-text-blue-gray,.w3-hover-text-blue-gray:hover{color:#607d8b!important}
|
||||
.w3-text-green,.w3-hover-text-green:hover{color:#4CAF50!important}
|
||||
.w3-text-light-green,.w3-hover-text-light-green:hover{color:#8bc34a!important}
|
||||
.w3-text-indigo,.w3-hover-text-indigo:hover{color:#3f51b5!important}
|
||||
.w3-text-khaki,.w3-hover-text-khaki:hover{color:#b4aa50!important}
|
||||
.w3-text-lime,.w3-hover-text-lime:hover{color:#cddc39!important}
|
||||
.w3-text-orange,.w3-hover-text-orange:hover{color:#ff9800!important}
|
||||
.w3-text-deep-orange,.w3-hover-text-deep-orange:hover{color:#ff5722!important}
|
||||
.w3-text-pink,.w3-hover-text-pink:hover{color:#e91e63!important}
|
||||
.w3-text-purple,.w3-hover-text-purple:hover{color:#9c27b0!important}
|
||||
.w3-text-deep-purple,.w3-hover-text-deep-purple:hover{color:#673ab7!important}
|
||||
.w3-text-red,.w3-hover-text-red:hover{color:#f44336!important}
|
||||
.w3-text-sand,.w3-hover-text-sand:hover{color:#fdf5e6!important}
|
||||
.w3-text-teal,.w3-hover-text-teal:hover{color:#009688!important}
|
||||
.w3-text-yellow,.w3-hover-text-yellow:hover{color:#d2be0e!important}
|
||||
.w3-text-white,.w3-hover-text-white:hover{color:#fff!important}
|
||||
.w3-text-black,.w3-hover-text-black:hover{color:#000!important}
|
||||
.w3-text-grey,.w3-hover-text-grey:hover,.w3-text-gray,.w3-hover-text-gray:hover{color:#757575!important}
|
||||
.w3-text-light-grey,.w3-hover-text-light-grey:hover,.w3-text-light-gray,.w3-hover-text-light-gray:hover{color:#f1f1f1!important}
|
||||
.w3-text-dark-grey,.w3-hover-text-dark-grey:hover,.w3-text-dark-gray,.w3-hover-text-dark-gray:hover{color:#3a3a3a!important}
|
||||
.w3-border-amber,.w3-hover-border-amber:hover{border-color:#ffc107!important}
|
||||
.w3-border-aqua,.w3-hover-border-aqua:hover{border-color:#00ffff!important}
|
||||
.w3-border-blue,.w3-hover-border-blue:hover{border-color:#2196F3!important}
|
||||
.w3-border-light-blue,.w3-hover-border-light-blue:hover{border-color:#87CEEB!important}
|
||||
.w3-border-brown,.w3-hover-border-brown:hover{border-color:#795548!important}
|
||||
.w3-border-cyan,.w3-hover-border-cyan:hover{border-color:#00bcd4!important}
|
||||
.w3-border-blue-grey,.w3-hover-border-blue-grey:hover,.w3-border-blue-gray,.w3-hover-border-blue-gray:hover{border-color:#607d8b!important}
|
||||
.w3-border-green,.w3-hover-border-green:hover{border-color:#4CAF50!important}
|
||||
.w3-border-light-green,.w3-hover-border-light-green:hover{border-color:#8bc34a!important}
|
||||
.w3-border-indigo,.w3-hover-border-indigo:hover{border-color:#3f51b5!important}
|
||||
.w3-border-khaki,.w3-hover-border-khaki:hover{border-color:#f0e68c!important}
|
||||
.w3-border-lime,.w3-hover-border-lime:hover{border-color:#cddc39!important}
|
||||
.w3-border-orange,.w3-hover-border-orange:hover{border-color:#ff9800!important}
|
||||
.w3-border-deep-orange,.w3-hover-border-deep-orange:hover{border-color:#ff5722!important}
|
||||
.w3-border-pink,.w3-hover-border-pink:hover{border-color:#e91e63!important}
|
||||
.w3-border-purple,.w3-hover-border-purple:hover{border-color:#9c27b0!important}
|
||||
.w3-border-deep-purple,.w3-hover-border-deep-purple:hover{border-color:#673ab7!important}
|
||||
.w3-border-red,.w3-hover-border-red:hover{border-color:#f44336!important}
|
||||
.w3-border-sand,.w3-hover-border-sand:hover{border-color:#fdf5e6!important}
|
||||
.w3-border-teal,.w3-hover-border-teal:hover{border-color:#009688!important}
|
||||
.w3-border-yellow,.w3-hover-border-yellow:hover{border-color:#ffeb3b!important}
|
||||
.w3-border-white,.w3-hover-border-white:hover{border-color:#fff!important}
|
||||
.w3-border-black,.w3-hover-border-black:hover{border-color:#000!important}
|
||||
.w3-border-grey,.w3-hover-border-grey:hover,.w3-border-gray,.w3-hover-border-gray:hover{border-color:#9e9e9e!important}
|
||||
.w3-border-light-grey,.w3-hover-border-light-grey:hover,.w3-border-light-gray,.w3-hover-border-light-gray:hover{border-color:#f1f1f1!important}
|
||||
.w3-border-dark-grey,.w3-hover-border-dark-grey:hover,.w3-border-dark-gray,.w3-hover-border-dark-gray:hover{border-color:#616161!important}
|
||||
.w3-border-pale-red,.w3-hover-border-pale-red:hover{border-color:#ffe7e7!important}.w3-border-pale-green,.w3-hover-border-pale-green:hover{border-color:#e7ffe7!important}
|
||||
.w3-border-pale-yellow,.w3-hover-border-pale-yellow:hover{border-color:#ffffcc!important}.w3-border-pale-blue,.w3-hover-border-pale-blue:hover{border-color:#e7ffff!important}
|
5
apps/wiki.json
Normal file
5
apps/wiki.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "📝",
|
||||
"previous": "&JHopifgZn2TsiMCQY8HUTlDqHEDDviiu2ifvr8HHNwo=.sha256"
|
||||
}
|
81
apps/wiki/app.js
Normal file
81
apps/wiki/app.js
Normal file
@ -0,0 +1,81 @@
|
||||
import * as tfrpc from '/tfrpc.js';
|
||||
import * as utils from './utils.js';
|
||||
|
||||
let g_hash;
|
||||
let g_collection_notifies = {};
|
||||
|
||||
tfrpc.register(async function getOwnerIdentities() {
|
||||
return ssb.getOwnerIdentities();
|
||||
});
|
||||
|
||||
tfrpc.register(async function getIdentities() {
|
||||
return ssb.getIdentities();
|
||||
});
|
||||
|
||||
tfrpc.register(async function query(sql, args) {
|
||||
let result = [];
|
||||
await ssb.sqlAsync(sql, args, function callback(row) {
|
||||
result.push(row);
|
||||
});
|
||||
return result;
|
||||
});
|
||||
|
||||
tfrpc.register(async function localStorageGet(key) {
|
||||
return app.localStorageGet(key);
|
||||
});
|
||||
|
||||
tfrpc.register(async function localStorageSet(key, value) {
|
||||
return app.localStorageSet(key, value);
|
||||
});
|
||||
|
||||
tfrpc.register(async function following(ids, depth) {
|
||||
return ssb.following(ids, depth);
|
||||
});
|
||||
|
||||
tfrpc.register(async function appendMessage(id, message) {
|
||||
print('APPENDING', message);
|
||||
return ssb.appendMessageWithIdentity(id, message);
|
||||
});
|
||||
|
||||
tfrpc.register(async function store_blob(blob) {
|
||||
if (Array.isArray(blob)) {
|
||||
blob = Uint8Array.from(blob);
|
||||
}
|
||||
return await ssb.blobStore(blob);
|
||||
});
|
||||
|
||||
tfrpc.register(async function get_blob(id) {
|
||||
return utf8Decode(await ssb.blobGet(id));
|
||||
});
|
||||
|
||||
core.register('message', async function message_handler(message) {
|
||||
if (message.event == 'hashChange') {
|
||||
g_hash = message.hash;
|
||||
await tfrpc.rpc.hash_changed(message.hash);
|
||||
}
|
||||
});
|
||||
|
||||
tfrpc.register(function set_hash(hash) {
|
||||
if (g_hash != hash) {
|
||||
return app.setHash(hash);
|
||||
}
|
||||
});
|
||||
|
||||
tfrpc.register(function get_hash(id, message) {
|
||||
return g_hash;
|
||||
});
|
||||
|
||||
tfrpc.register(async function try_decrypt(id, content) {
|
||||
return await ssb.privateMessageDecrypt(id, content);
|
||||
});
|
||||
tfrpc.register(async function encrypt(id, recipients, content) {
|
||||
return await ssb.privateMessageEncrypt(id, recipients, content);
|
||||
});
|
||||
|
||||
tfrpc.register(utils.collection);
|
||||
|
||||
async function main() {
|
||||
await app.setDocument(utf8Decode(await getFile('index.html')));
|
||||
}
|
||||
|
||||
main();
|
1
apps/wiki/commonmark.min.js
vendored
Normal file
1
apps/wiki/commonmark.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
71
apps/wiki/handler.js
Normal file
71
apps/wiki/handler.js
Normal file
@ -0,0 +1,71 @@
|
||||
import * as utils from './utils.js';
|
||||
import * as commonmark from './commonmark.min.js';
|
||||
|
||||
function markdown(md) {
|
||||
let reader = new commonmark.Parser({safe: true});
|
||||
let writer = new commonmark.HtmlRenderer();
|
||||
let parsed = reader.parse(md || '');
|
||||
let walker = parsed.walker();
|
||||
let event;
|
||||
while ((event = walker.next())) {
|
||||
let node = event.node;
|
||||
if (event.entering) {
|
||||
if (node.type === 'link') {
|
||||
if (node.destination.indexOf(':') == -1 &&
|
||||
node.destination.indexOf('/') == -1) {
|
||||
node.destination = `#${this.wiki?.name}/${node.destination}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return writer.render(parsed);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
let slash = request.path.indexOf('/');
|
||||
if (slash != -1) {
|
||||
let wiki_name = request.path.substring(0, slash);
|
||||
let wiki_doc_name = request.path.substring(slash + 1);
|
||||
|
||||
let ids = Object.keys(await ssb.following(await ssb.getOwnerIdentities(), 1));
|
||||
let [max_row_id, wikis] = await utils.collection(ids, 'wiki', null, -1, {});
|
||||
let wiki;
|
||||
for (let w of Object.values(wikis)) {
|
||||
if (w.name === wiki_name && !w.tombstone) {
|
||||
wiki = w;
|
||||
break;
|
||||
}
|
||||
}
|
||||
let wiki_doc;
|
||||
if (wiki) {
|
||||
let [max_row_id, wiki_docs] = await utils.collection(ids, 'wiki-doc', wiki.id, -1, {});
|
||||
for (let w of Object.values(wiki_docs)) {
|
||||
if (w.name === wiki_doc_name && !w.tombstone) {
|
||||
wiki_doc = w;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let md;
|
||||
if (wiki_doc?.blob) {
|
||||
md = utf8Decode(await ssb.blobGet(wiki_doc.blob));
|
||||
}
|
||||
|
||||
await respond({
|
||||
data: `
|
||||
<h1>${wiki_name}: ${wiki_doc_name}</h1>
|
||||
<div>${markdown(md)}</div>
|
||||
`,
|
||||
content_type: 'text/html',
|
||||
status_code: 200,
|
||||
});
|
||||
} else {
|
||||
await respond({
|
||||
data: '<h1>File not found</h1>',
|
||||
content_type: 'text/html',
|
||||
status_code: 404,
|
||||
});
|
||||
}
|
||||
}
|
||||
main();
|
14
apps/wiki/index.html
Normal file
14
apps/wiki/index.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<base target="_top">
|
||||
</head>
|
||||
<body style="color: #fff">
|
||||
<tf-collections-app></tf-collections-app>
|
||||
<script>window.litDisableBundleWarning = true;</script>
|
||||
<script src="tf-collection.js" type="module"></script>
|
||||
<script src="tf-id-picker.js" type="module"></script>
|
||||
<script src="tf-wiki-doc.js" type="module"></script>
|
||||
<script src="tf-wiki-app.js" type="module"></script>
|
||||
</body>
|
||||
</html>
|
120
apps/wiki/lit-all.min.js
vendored
Normal file
120
apps/wiki/lit-all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
apps/wiki/lit-all.min.js.map
Normal file
1
apps/wiki/lit-all.min.js.map
Normal file
File diff suppressed because one or more lines are too long
95
apps/wiki/tf-collection.js
Normal file
95
apps/wiki/tf-collection.js
Normal file
@ -0,0 +1,95 @@
|
||||
import {LitElement, html} from './lit-all.min.js';
|
||||
import * as tfrpc from '/static/tfrpc.js';
|
||||
|
||||
class TfCollectionElement extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
whoami: {type: String},
|
||||
collection: {type: Object},
|
||||
selected_id: {type: String},
|
||||
is_creating: {type: Boolean},
|
||||
is_renaming: {type: Boolean},
|
||||
};
|
||||
}
|
||||
|
||||
on_create(event) {
|
||||
let name = this.shadowRoot.getElementById('create_name').value;
|
||||
this.dispatchEvent(new CustomEvent('create', {
|
||||
bubbles: true,
|
||||
detail: {
|
||||
name: name,
|
||||
},
|
||||
}));
|
||||
this.is_creating = false;
|
||||
}
|
||||
|
||||
on_rename(event) {
|
||||
let id = this.shadowRoot.getElementById('select').value;
|
||||
let name = this.shadowRoot.getElementById('rename_name').value;
|
||||
this.dispatchEvent(new CustomEvent('rename', {
|
||||
bubbles: true,
|
||||
detail: {
|
||||
id: id,
|
||||
value: this.collection[id],
|
||||
name: name,
|
||||
},
|
||||
}));
|
||||
this.is_renaming = false;
|
||||
}
|
||||
|
||||
on_tombstone(event) {
|
||||
let id = this.shadowRoot.getElementById('select').value;
|
||||
if (confirm(`Are you sure you want to delete '${this.collection[id].name}'?`)) {
|
||||
this.dispatchEvent(new CustomEvent('tombstone', {
|
||||
bubbles: true,
|
||||
detail: {
|
||||
id: id,
|
||||
value: this.collection[id],
|
||||
},
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
on_selected(event) {
|
||||
let id = event.srcElement.value;
|
||||
this.selected_id = id != '' ? id : undefined;
|
||||
this.dispatchEvent(new CustomEvent('change', {
|
||||
bubbles: true,
|
||||
detail: {
|
||||
id: id,
|
||||
value: this.collection[id],
|
||||
},
|
||||
}));
|
||||
}
|
||||
|
||||
render() {
|
||||
let self = this;
|
||||
return html`
|
||||
<span style="display: inline-flex; flex-direction: row">
|
||||
<select @change=${this.on_selected} id="select" value=${this.selected_id}>
|
||||
<option value="" ?selected=${this.selected_id === ''} disabled hidden>(select)</option>
|
||||
${Object.values(this.collection ?? {}).sort((x, y) => x.name.localeCompare(y.name)).map(x => html`<option value=${x.id} ?selected=${this.selected_id === x.id}>${x.name}</option>`)}
|
||||
</select>
|
||||
<span ?hidden=${!this.is_renaming || !this.whoami}>
|
||||
<span style="display: inline-flex; flex-direction: row; margin-left: 8px; margin-right: 8px">
|
||||
<label for="rename_name">🏷Rename to:</label>
|
||||
<input type="text" id="rename_name"></input>
|
||||
<button @click=${this.on_rename}>Rename ${this.type}</button>
|
||||
<button @click=${() => self.is_renaming = false}>x</button>
|
||||
</span>
|
||||
</span>
|
||||
<button @click=${() => self.is_renaming = true} ?disabled=${this.is_renaming || !this.selected_id} ?hidden=${!this.whoami}>🏷</button>
|
||||
<button @click=${self.on_tombstone} ?disabled=${!this.selected_id} ?hidden=${!this.whoami}>🪦</button>
|
||||
<span ?hidden=${!this.is_creating || !this.whoami}>
|
||||
<label for="create_name">New ${this.type} name:</label>
|
||||
<input type="text" id="create_name"></input>
|
||||
<button @click=${this.on_create}>Create ${this.type}</button>
|
||||
<button @click=${() => self.is_creating = false}>x</button>
|
||||
</span>
|
||||
<button @click=${() => self.is_creating = true} ?hidden=${this.is_creating || !this.whoami}>+</button>
|
||||
</span>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('tf-collection', TfCollectionElement);
|
36
apps/wiki/tf-id-picker.js
Normal file
36
apps/wiki/tf-id-picker.js
Normal file
@ -0,0 +1,36 @@
|
||||
import {LitElement, html} from './lit-all.min.js';
|
||||
import * as tfrpc from '/static/tfrpc.js';
|
||||
|
||||
/*
|
||||
** Provide a list of IDs, and this lets the user pick one.
|
||||
*/
|
||||
class TfIdentityPickerElement extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
ids: {type: Array},
|
||||
selected: {type: String},
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.ids = [];
|
||||
}
|
||||
|
||||
changed(event) {
|
||||
this.selected = event.srcElement.value;
|
||||
this.dispatchEvent(new Event('change', {
|
||||
srcElement: this,
|
||||
}));
|
||||
}
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<select @change=${this.changed} style="max-width: 100%">
|
||||
${(this.ids ?? []).map(id => html`<option ?selected=${id == this.selected} value=${id}>${id}</option>`)}
|
||||
</select>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('tf-id-picker', TfIdentityPickerElement);
|
311
apps/wiki/tf-wiki-app.js
Normal file
311
apps/wiki/tf-wiki-app.js
Normal file
@ -0,0 +1,311 @@
|
||||
import {LitElement, html, keyed} from './lit-all.min.js';
|
||||
import * as tfrpc from '/static/tfrpc.js';
|
||||
|
||||
class TfCollectionsAppElement extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
ids: {type: Array},
|
||||
owner_ids: {type: Array},
|
||||
whoami: {type: String},
|
||||
following: {type: Array},
|
||||
|
||||
wikis: {type: Object},
|
||||
wiki_docs: {type: Object},
|
||||
|
||||
wiki: {type: Object},
|
||||
wiki_doc: {type: Object},
|
||||
hash: {type: String},
|
||||
|
||||
adding_editor: {type: Boolean},
|
||||
expand_editors: {type: Boolean},
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.ids = [];
|
||||
this.owner_ids = [];
|
||||
this.following = [];
|
||||
this.load();
|
||||
let self = this;
|
||||
tfrpc.register(function hash_changed(hash) {
|
||||
self.notify_hash_changed(hash);
|
||||
});
|
||||
tfrpc.rpc.get_hash().then(hash => self.notify_hash_changed(hash));
|
||||
}
|
||||
|
||||
async load() {
|
||||
this.ids = await tfrpc.rpc.getIdentities();
|
||||
this.owner_ids = await tfrpc.rpc.getOwnerIdentities();
|
||||
this.whoami = await tfrpc.rpc.localStorageGet('collections_whoami');
|
||||
let ids = [...new Set([...this.owner_ids, this.whoami])].sort();
|
||||
this.following = Object.keys(await tfrpc.rpc.following(ids, 1)).sort();
|
||||
|
||||
await this.read_wikis();
|
||||
await this.read_Wiki_docs();
|
||||
}
|
||||
|
||||
async read_wikis() {
|
||||
let max_rowid;
|
||||
let wikis;
|
||||
let start_whoami = this.whoami;
|
||||
while (true)
|
||||
{
|
||||
console.log('read_wikis', this.whoami);
|
||||
[max_rowid, wikis] = await tfrpc.rpc.collection(this.following, 'wiki', undefined, max_rowid, wikis, false);
|
||||
console.log('read ->', wikis);
|
||||
if (this.whoami !== start_whoami) {
|
||||
break;
|
||||
}
|
||||
console.log('wikis =>', wikis);
|
||||
this.wikis = wikis;
|
||||
this.update_wiki();
|
||||
}
|
||||
}
|
||||
|
||||
async read_wiki_docs() {
|
||||
if (!this.wiki?.id) {
|
||||
return;
|
||||
}
|
||||
let start_id = this.wiki.id;
|
||||
let max_rowid;
|
||||
let wiki_docs;
|
||||
while (true)
|
||||
{
|
||||
[max_rowid, wiki_docs] = await tfrpc.rpc.collection(this.wiki?.editors, 'wiki-doc', this.wiki?.id, max_rowid, wiki_docs);
|
||||
if (this.wiki?.id !== start_id) {
|
||||
break;
|
||||
}
|
||||
this.wiki_docs = wiki_docs;
|
||||
this.update_wiki_doc();
|
||||
}
|
||||
}
|
||||
|
||||
hash_wiki() {
|
||||
let hash = this.hash ?? '';
|
||||
hash = hash.charAt(0) == '#' ? hash.substring(1) : hash;
|
||||
let parts = hash.split('/');
|
||||
return parts[0];
|
||||
}
|
||||
|
||||
hash_wiki_doc() {
|
||||
let hash = this.hash ?? '';
|
||||
hash = hash.charAt(0) == '#' ? hash.substring(1) : hash;
|
||||
let slash = hash.indexOf('/');
|
||||
return slash != -1 ? hash.substring(slash + 1) : undefined;
|
||||
}
|
||||
|
||||
update_wiki() {
|
||||
let want_wiki = this.hash_wiki();
|
||||
for (let wiki of Object.values(this.wikis ?? {})) {
|
||||
if (wiki.name === want_wiki) {
|
||||
this.wiki = wiki;
|
||||
this.read_wiki_docs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update_wiki_doc() {
|
||||
let want_wiki_doc = this.hash_wiki_doc();
|
||||
for (let wiki_doc of Object.values(this.wiki_docs ?? {})) {
|
||||
if (wiki_doc.name === want_wiki_doc) {
|
||||
this.wiki_doc = wiki_doc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
notify_hash_changed(hash) {
|
||||
this.hash = hash;
|
||||
this.update_wiki();
|
||||
this.update_wiki_doc();
|
||||
}
|
||||
|
||||
async on_whoami_changed(event) {
|
||||
let new_id = event.srcElement.selected;
|
||||
await tfrpc.rpc.localStorageSet('collections_whoami', new_id);
|
||||
this.whoami = new_id;
|
||||
}
|
||||
|
||||
update_hash() {
|
||||
tfrpc.rpc.set_hash(this.wiki_doc ? `${this.wiki.name}/${this.wiki_doc.name}` : `${this.wiki.name}`);
|
||||
}
|
||||
|
||||
async on_wiki_changed(event) {
|
||||
this.wiki = event.detail.value;
|
||||
this.wiki_doc = undefined;
|
||||
this.wiki_docs = undefined;
|
||||
this.adding_editor = false;
|
||||
this.update_hash();
|
||||
this.read_wiki_docs();
|
||||
}
|
||||
|
||||
async on_wiki_create(event) {
|
||||
await tfrpc.rpc.appendMessage(this.whoami, {
|
||||
type: 'wiki',
|
||||
name: event.detail.name,
|
||||
});
|
||||
}
|
||||
|
||||
async on_wiki_rename(event) {
|
||||
await tfrpc.rpc.appendMessage(this.whoami, {
|
||||
type: 'wiki',
|
||||
key: event.detail.id,
|
||||
name: event.detail.name,
|
||||
});
|
||||
}
|
||||
|
||||
async on_add_editor(event) {
|
||||
let id = this.shadowRoot.getElementById('add_editor').value;
|
||||
let editors = [...this.wiki.editors];
|
||||
if (editors.indexOf(id) == -1) {
|
||||
editors.push(id);
|
||||
editors.sort();
|
||||
}
|
||||
await tfrpc.rpc.appendMessage(this.whoami, {
|
||||
type: 'wiki',
|
||||
key: this.wiki.id,
|
||||
editors: editors,
|
||||
});
|
||||
this.adding_editor = false;
|
||||
}
|
||||
|
||||
async on_remove_editor(id) {
|
||||
if (confirm(`Are you sure you want to remove ${id} as an editor?`)) {
|
||||
let editors = [...this.wiki.editors];
|
||||
if (editors.indexOf(id) != -1) {
|
||||
editors = editors.filter(x => x !== id);
|
||||
}
|
||||
await tfrpc.rpc.appendMessage(this.whoami, {
|
||||
type: 'wiki',
|
||||
key: this.wiki.id,
|
||||
editors: editors,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async on_wiki_tombstone(event) {
|
||||
await tfrpc.rpc.appendMessage(this.whoami, {
|
||||
type: 'wiki',
|
||||
key: event.detail.id,
|
||||
tombstone: {
|
||||
date: new Date().valueOf(),
|
||||
reason: 'tombstoned by user',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async on_wiki_doc_create(event) {
|
||||
await tfrpc.rpc.appendMessage(this.whoami, {
|
||||
type: 'wiki-doc',
|
||||
parent: this.wiki.id,
|
||||
name: event.detail.name,
|
||||
});
|
||||
}
|
||||
|
||||
async on_wiki_doc_rename(event) {
|
||||
await tfrpc.rpc.appendMessage(this.whoami, {
|
||||
type: 'wiki-doc',
|
||||
parent: this.wiki.id,
|
||||
key: event.detail.id,
|
||||
name: event.detail.name,
|
||||
});
|
||||
}
|
||||
|
||||
async on_wiki_doc_tombstone(event) {
|
||||
await tfrpc.rpc.appendMessage(this.whoami, {
|
||||
type: 'wiki-doc',
|
||||
parent: this.wiki.id,
|
||||
key: event.detail.id,
|
||||
tombstone: {
|
||||
date: new Date().valueOf(),
|
||||
reason: 'tombstoned by user',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async on_wiki_doc_changed(event) {
|
||||
this.wiki_doc = event.detail.value;
|
||||
this.update_hash();
|
||||
}
|
||||
|
||||
updated(changed_properties) {
|
||||
if (changed_properties.has('whoami')) {
|
||||
this.wikis = {};
|
||||
this.wiki_docs = {};
|
||||
this.read_wikis();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
let self = this;
|
||||
return html`
|
||||
<style>
|
||||
.toc:hover {
|
||||
background-color: #0cc;
|
||||
}
|
||||
.toc.selected {
|
||||
background-color: #088;
|
||||
}
|
||||
</style>
|
||||
<div>
|
||||
<tf-id-picker .ids=${this.ids} selected=${this.whoami} @change=${this.on_whoami_changed} ?hidden=${!this.ids?.length}></tf-id-picker>
|
||||
</div>
|
||||
<div>
|
||||
${keyed(this.whoami, html`<tf-collection
|
||||
.collection=${this.wikis}
|
||||
whoami=${this.whoami}
|
||||
selected_id=${this.wiki?.id}
|
||||
@create=${this.on_wiki_create}
|
||||
@rename=${this.on_wiki_rename}
|
||||
@tombstone=${this.on_wiki_tombstone}
|
||||
@change=${this.on_wiki_changed}></tf-collection>`)}
|
||||
${keyed(this.wiki_doc?.id, html`<tf-collection
|
||||
.collection=${this.wiki_docs}
|
||||
whoami=${this.whoami}
|
||||
selected_id=${(this.wiki_doc && this.wiki_doc?.parent == this.wiki?.id) ? this.wiki_doc?.id : ''}
|
||||
@create=${this.on_wiki_doc_create}
|
||||
@rename=${this.on_wiki_doc_rename}
|
||||
@tombstone=${this.on_wiki_doc_tombstone}
|
||||
@change=${this.on_wiki_doc_changed}></tf-collection>`)}
|
||||
<button @click=${() => self.expand_editors = !self.expand_editors}>${this.wiki?.editors?.length} editor${this.wiki?.editors?.length > 1 ? 's' : ''}</button>
|
||||
<div ?hidden=${!this.wiki?.editors || !this.expand_editors}>
|
||||
<div>
|
||||
<ul>
|
||||
${this.wiki?.editors.map(id => html`<li><button ?hidden=${id == this.whoami} @click=${() => self.on_remove_editor(id)}>x</button> ${id}</li>`)}
|
||||
<li>
|
||||
<button @click=${() => self.adding_editor = true} ?hidden=${this.wiki?.editors?.indexOf(this.whoami) == -1 || this.adding_editor}>+</button>
|
||||
<div ?hidden=${!this.adding_editor}>
|
||||
<label for="add_editor">Add Editor:</label>
|
||||
<input type="text" id="add_editor"></input>
|
||||
<button @click=${this.on_add_editor}>Add Editor</button>
|
||||
<button @click=${() => self.adding_editor = false}>x</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: row">
|
||||
<div style="flex: 0 0">
|
||||
${Object.values(this.wikis || {}).sort((x, y) => x.name.localeCompare(y.name)).map(wiki => html`
|
||||
<div class="toc ${self.wiki?.id === wiki.id ? 'selected' : ''}" style="white-space: nowrap; cursor: pointer" @click=${() => self.on_wiki_changed({detail: {value: wiki}})}>${wiki.name}</div>
|
||||
<ul>
|
||||
${Object.values(self.wiki_docs || {}).filter(doc => doc.parent === wiki?.id).sort((x, y) => x.name.localeCompare(y.name)).map(doc => html`
|
||||
<li class="toc ${self.wiki_doc?.id === doc.id ? 'selected' : ''}" style="white-space: nowrap; cursor: pointer" @click=${() => self.on_wiki_doc_changed({detail: {value: doc}})}>${doc.name}</li>
|
||||
`)}
|
||||
</ul>
|
||||
`)}
|
||||
</div>
|
||||
${this.wiki_doc && this.wiki_doc.parent === this.wiki?.id ? html`
|
||||
<tf-wiki-doc
|
||||
whoami=${this.whoami}
|
||||
.wiki=${this.wiki}
|
||||
.value=${this.wiki_doc}></tf-wiki-doc>
|
||||
` : undefined}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('tf-collections-app', TfCollectionsAppElement);
|
257
apps/wiki/tf-wiki-doc.js
Normal file
257
apps/wiki/tf-wiki-doc.js
Normal file
@ -0,0 +1,257 @@
|
||||
import {LitElement, html, unsafeHTML} from './lit-all.min.js';
|
||||
import * as tfrpc from '/static/tfrpc.js';
|
||||
import * as commonmark from './commonmark.min.js';
|
||||
|
||||
class TfWikiDocElement extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
whoami: {type: String},
|
||||
wiki: {type: Object},
|
||||
value: {type: Object},
|
||||
blob: {type: String},
|
||||
blob_original: {type: String},
|
||||
blob_for_value: {type: String},
|
||||
is_editing: {type: Boolean},
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
markdown(md) {
|
||||
let reader = new commonmark.Parser({safe: true});
|
||||
let writer = new commonmark.HtmlRenderer();
|
||||
let parsed = reader.parse(md || '');
|
||||
let walker = parsed.walker();
|
||||
let event;
|
||||
while ((event = walker.next())) {
|
||||
let node = event.node;
|
||||
if (event.entering) {
|
||||
if (node.type === 'link') {
|
||||
if (node.destination.indexOf(':') == -1 &&
|
||||
node.destination.indexOf('/') == -1) {
|
||||
node.destination = `#${this.wiki?.name}/${node.destination}`;
|
||||
}
|
||||
} else if (node.type == 'image') {
|
||||
if (node.destination.startsWith('&')) {
|
||||
node.destination = '/' + node.destination + '/view';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return writer.render(parsed);
|
||||
}
|
||||
|
||||
title(md) {
|
||||
let lines = (md || '').split('\n');
|
||||
for (let line of lines) {
|
||||
let m = line.match(/#+ (.*)/);
|
||||
if (m) {
|
||||
return m[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
summary(md) {
|
||||
let lines = (md || '').split('\n');
|
||||
let result = [];
|
||||
let have_content = false;
|
||||
for (let line of lines) {
|
||||
if (have_content && !line.trim().length) {
|
||||
return result.join('\n');
|
||||
}
|
||||
if (!line.startsWith('#') && line.trim().length) {
|
||||
have_content = true;
|
||||
}
|
||||
if (!line.startsWith('#')) {
|
||||
result.push(line);
|
||||
}
|
||||
}
|
||||
return result.join('\n');
|
||||
}
|
||||
|
||||
thumbnail(md) {
|
||||
//let m = md ? md.match(/\!\[image:[^\]]+]\((\&.{44}\.sha256)\)/) : undefined;
|
||||
let m = md ? md.match(/.*\((\&.{44}\.sha256)\).*/) : undefined;
|
||||
console.log('thumb', m);
|
||||
return m ? m[1] : undefined;
|
||||
}
|
||||
|
||||
async load_blob() {
|
||||
let blob = await tfrpc.rpc.get_blob(this.value?.blob);
|
||||
if (blob.endsWith('.box')) {
|
||||
let d = await tfrpc.rpc.try_decrypt(this.whoami, blob);
|
||||
if (d) {
|
||||
blob = d;
|
||||
}
|
||||
}
|
||||
this.blob = blob;
|
||||
this.blob_original = blob;
|
||||
}
|
||||
|
||||
on_edit(event) {
|
||||
this.blob = event.srcElement.value;
|
||||
}
|
||||
|
||||
on_discard(event) {
|
||||
this.blob = this.blob_original;
|
||||
this.is_editing = false;
|
||||
}
|
||||
|
||||
async append_message(draft) {
|
||||
let blob = this.blob;
|
||||
if (draft || this.value?.private) {
|
||||
blob = await tfrpc.rpc.encrypt(this.whoami, this.wiki.editors, blob);
|
||||
}
|
||||
let id = await tfrpc.rpc.store_blob(blob);
|
||||
let message = {
|
||||
type: 'wiki-doc',
|
||||
key: this.value.id,
|
||||
parent: this.value.parent,
|
||||
blob: id,
|
||||
mentions: this.blob.match(/(&.{44}.sha256)/g)?.map(x => ({link: x})),
|
||||
private: this.value?.private,
|
||||
};
|
||||
if (draft) {
|
||||
message.recps = this.value.editors;
|
||||
message = await tfrpc.rpc.encrypt(this.whoami, this.value.editors, JSON.stringify(message));
|
||||
}
|
||||
await tfrpc.rpc.appendMessage(this.whoami, message);
|
||||
this.is_editing = false;
|
||||
}
|
||||
|
||||
async on_save_draft() {
|
||||
return this.append_message(true);
|
||||
}
|
||||
|
||||
async on_publish() {
|
||||
return this.append_message(false);
|
||||
}
|
||||
|
||||
async on_blog_publish() {
|
||||
let blob = this.blob;
|
||||
let id = await tfrpc.rpc.store_blob(blob);
|
||||
let message = {
|
||||
type: 'blog',
|
||||
key: this.value.id,
|
||||
parent: this.value.parent,
|
||||
title: this.title(blob),
|
||||
summary: this.summary(blob),
|
||||
thumbnail: this.thumbnail(blob),
|
||||
blog: id,
|
||||
mentions: this.blob.match(/(&.{44}.sha256)/g)?.map(x => ({link: x})),
|
||||
};
|
||||
await tfrpc.rpc.appendMessage(this.whoami, message);
|
||||
this.is_editing = false;
|
||||
}
|
||||
|
||||
convert_to_format(buffer, type, mime_type) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
let img = new Image();
|
||||
img.onload = function() {
|
||||
let canvas = document.createElement('canvas');
|
||||
let width_scale = Math.min(img.width, 1024) / img.width;
|
||||
let height_scale = Math.min(img.height, 1024) / img.height;
|
||||
let scale = Math.min(width_scale, height_scale);
|
||||
canvas.width = img.width * scale;
|
||||
canvas.height = img.height * scale;
|
||||
let context = canvas.getContext('2d');
|
||||
context.drawImage(img, 0, 0, canvas.width, canvas.height);
|
||||
let data_url = canvas.toDataURL(mime_type);
|
||||
let result = atob(data_url.split(',')[1]).split('').map(x => x.charCodeAt(0));
|
||||
resolve(result);
|
||||
};
|
||||
img.onerror = function(event) {
|
||||
reject(new Error('Failed to load image.'));
|
||||
};
|
||||
let raw = Array.from(new Uint8Array(buffer)).map(b => String.fromCharCode(b)).join('');
|
||||
let original = `data:${type};base64,${btoa(raw)}`;
|
||||
img.src = original;
|
||||
});
|
||||
}
|
||||
|
||||
async add_file(editor, file) {
|
||||
try {
|
||||
let self = this;
|
||||
let buffer = await file.arrayBuffer();
|
||||
let type = file.type;
|
||||
if (type.startsWith('image/')) {
|
||||
let best_buffer;
|
||||
let best_type;
|
||||
for (let format of ['image/png', 'image/jpeg', 'image/webp']) {
|
||||
let test_buffer = await self.convert_to_format(buffer, file.type, format);
|
||||
if (!best_buffer || test_buffer.length < best_buffer.length) {
|
||||
best_buffer = test_buffer;
|
||||
best_type = format;
|
||||
}
|
||||
}
|
||||
buffer = best_buffer;
|
||||
type = best_type;
|
||||
} else {
|
||||
buffer = Array.from(new Uint8Array(buffer));
|
||||
}
|
||||
let id = await tfrpc.rpc.store_blob(buffer);
|
||||
let name = type.split('/')[0] + ':' + file.name;
|
||||
editor.value += `\n`;
|
||||
self.on_edit({srcElement: editor});
|
||||
} catch(e) {
|
||||
alert(e?.message);
|
||||
}
|
||||
}
|
||||
|
||||
paste(event) {
|
||||
let self = this;
|
||||
for (let item of event.clipboardData.items) {
|
||||
if (item.type?.startsWith('image/')) {
|
||||
let file = item.getAsFile();
|
||||
if (!file) {
|
||||
continue;
|
||||
}
|
||||
self.add_file(event.srcElement, file);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
let value = JSON.stringify(this.value);
|
||||
if (this.blob_for_value != value) {
|
||||
this.blob_for_value = value;
|
||||
this.blob = undefined;
|
||||
this.blob_original = undefined;
|
||||
this.load_blob();
|
||||
}
|
||||
let self = this;
|
||||
let thumbnail_ref = this.thumbnail(this.blob);
|
||||
return html`
|
||||
<div style="display: inline-flex; flex-direction: row">
|
||||
<button ?disabled=${!this.whoami || this.is_editing} @click=${() => self.is_editing = true}>Edit</button>
|
||||
<button ?disabled=${this.blob == this.blob_original} @click=${this.on_save_draft}>Save Draft</button>
|
||||
<button ?disabled=${this.blob == this.blob_original && !this.value?.draft} @click=${this.on_publish}>Publish</button>
|
||||
<button ?disabled=${!this.is_editing} @click=${this.on_discard}>Discard</button>
|
||||
<button ?disabled=${!this.is_editing} @click=${() => self.value = Object.assign({}, self.value, {private: !self.value.private})}>${this.value?.private ? 'Make Public' : 'Make Private'}</button>
|
||||
<button ?disabled=${!this.is_editing} @click=${this.on_blog_publish}>Publish Blog</button>
|
||||
</div>
|
||||
<div ?hidden=${!this.value?.private} style="color: #800">🔒 document is private</div>
|
||||
<div style="display: flex; flex-direction: row; ${this.value?.private ? 'border-top: 4px solid #800' : ''}">
|
||||
<textarea
|
||||
?hidden=${!this.is_editing}
|
||||
style="flex: 1 1; min-height: 10em; ${this.value?.private ? 'border: 4px solid #800' : ''}"
|
||||
@input=${this.on_edit}
|
||||
@paste=${this.paste}
|
||||
.value=${this.blob ?? ''}></textarea>
|
||||
<div style="flex: 1 1">
|
||||
<div ?hidden=${!this.is_editing} style="border: 1px solid #fff; border-radius: 1em; padding: 0.5em">
|
||||
<img ?hidden=${!thumbnail_ref} style="max-width: 128px; max-height: 128px; float: right" src="/${thumbnail_ref}/view">
|
||||
<h1 ?hidden=${!this.title(this.blob)}>${unsafeHTML(this.markdown(this.title(this.blob)))}</h1>
|
||||
${unsafeHTML(this.markdown(this.summary(this.blob)))}
|
||||
</div>
|
||||
${unsafeHTML(this.markdown(this.blob))}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('tf-wiki-doc', TfWikiDocElement);
|
105
apps/wiki/utils.js
Normal file
105
apps/wiki/utils.js
Normal file
@ -0,0 +1,105 @@
|
||||
async function process_message(whoami, collection, message, kind, parent) {
|
||||
let content = JSON.parse(message.content);
|
||||
if (typeof content == 'string') {
|
||||
let x;
|
||||
for (let id of (whoami || [])) {
|
||||
x = await ssb.privateMessageDecrypt(id, content);
|
||||
if (x) {
|
||||
try {
|
||||
content = JSON.parse(x);
|
||||
content.draft = true;
|
||||
break;
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!x) {
|
||||
return;
|
||||
}
|
||||
if (content.type !== kind ||
|
||||
(parent && content.parent !== parent)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
content.draft = false;
|
||||
}
|
||||
if (content?.key) {
|
||||
if (content?.tombstone) {
|
||||
delete collection[content.key];
|
||||
} else {
|
||||
collection[content.key] = Object.assign(collection[content.key] || {}, content);
|
||||
}
|
||||
} else {
|
||||
collection[message.id] = Object.assign(content, {id: message.id});
|
||||
if (!collection[message.id].editors) {
|
||||
collection[message.id].editors = [message.author];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
let g_new_message_resolve;
|
||||
let g_new_message_promise = new Promise(function(resolve, reject) {
|
||||
g_new_message_resolve = resolve;
|
||||
});
|
||||
|
||||
function new_message() {
|
||||
return g_new_message_promise;
|
||||
}
|
||||
|
||||
ssb.addEventListener('message', function(id) {
|
||||
let resolve = g_new_message_resolve;
|
||||
g_new_message_promise = new Promise(function(resolve, reject) {
|
||||
g_new_message_resolve = resolve;
|
||||
});
|
||||
if (resolve) {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
|
||||
export async function collection(ids, kind, parent, max_rowid, data, include_private) {
|
||||
let whoami = await ssb.getIdentities();
|
||||
data = data ?? {};
|
||||
let rowid = 0;
|
||||
let first = true;
|
||||
await ssb.sqlAsync('SELECT MAX(rowid) AS rowid FROM messages', [], function(row) {
|
||||
rowid = row.rowid;
|
||||
});
|
||||
while (true) {
|
||||
if (rowid == max_rowid) {
|
||||
await new_message();
|
||||
await ssb.sqlAsync('SELECT MAX(rowid) AS rowid FROM messages', [], function(row) {
|
||||
rowid = row.rowid;
|
||||
});
|
||||
first = false;
|
||||
}
|
||||
|
||||
let modified = false;
|
||||
let rows = [];
|
||||
await ssb.sqlAsync(`
|
||||
SELECT messages.id, author, content, timestamp
|
||||
FROM messages
|
||||
JOIN json_each(?1) AS id ON messages.author = id.value
|
||||
WHERE
|
||||
messages.rowid > ?2 AND
|
||||
messages.rowid <= ?3 AND
|
||||
((json_extract(messages.content, '$.type') = ?4 AND
|
||||
(?5 IS NULL OR json_extract(messages.content, '$.parent') = ?5)) OR
|
||||
(?6 AND content LIKE '"%'))
|
||||
ORDER BY timestamp
|
||||
`, [JSON.stringify(ids), max_rowid ?? -1, rowid, kind, parent, include_private ? true : false], function(row) {
|
||||
rows.push(row);
|
||||
});
|
||||
max_rowid = rowid;
|
||||
for (let row of rows) {
|
||||
if (await process_message(whoami, data, row, kind, parent)) {
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
if (first || modified) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return [rowid, data];
|
||||
}
|
@ -196,7 +196,7 @@ function handler(request, response) {
|
||||
}
|
||||
}
|
||||
|
||||
let cookie = `session=${session}; path=/; Max-Age=${kRefreshInterval}; ${request.client.tls ? 'Secure; ' : ''}SameSite=Strict`;
|
||||
let cookie = `session=${session}; path=/; Max-Age=${kRefreshInterval}; ${request.client.tls ? 'Secure; ' : ''}SameSite=Strict; HttpOnly`;
|
||||
let entry = readSession(session);
|
||||
if (entry && formData.return) {
|
||||
response.writeHead(303, {"Location": formData.return, "Set-Cookie": cookie});
|
||||
@ -220,7 +220,7 @@ function handler(request, response) {
|
||||
});
|
||||
}
|
||||
} else if (request.uri == "/login/logout") {
|
||||
response.writeHead(303, {"Set-Cookie": `session=; path=/; ${request.client.tls ? 'Secure; ' : ''}SameSite=Strict; expires=Thu, 01 Jan 1970 00:00:00 GMT`, "Location": "/login" + (request.query ? "?" + request.query : "")});
|
||||
response.writeHead(303, {"Set-Cookie": `session=; path=/; ${request.client.tls ? 'Secure; ' : ''}SameSite=Strict; expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly`, "Location": "/login" + (request.query ? "?" + request.query : "")});
|
||||
response.end();
|
||||
} else {
|
||||
response.writeHead(200, {"Content-Type": "text/plain; charset=utf-8", "Connection": "close"});
|
||||
|
117
core/client.js
117
core/client.js
@ -110,29 +110,48 @@ class TfNavigationElement extends LitElement {
|
||||
${Object.keys(this.permissions).map(key => html`
|
||||
<div>
|
||||
<span>${key}</span>: ${this.permissions[key] ? '✅ Allowed' : '❌ Denied'}
|
||||
<button @click=${() => this.reset_permission(key)}>Reset</button>
|
||||
<button @click=${() => this.reset_permission(key)} style='min-width: 3em; min-height: 3em">Reset</button>
|
||||
</div>
|
||||
`)}
|
||||
<button @click=${() => this.show_permissions = false}>Close</button>
|
||||
<button @click=${() => this.show_permissions = false} style="min-width: 3em; min-height: 3em">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
set_access_key_title(event) {
|
||||
if (!event.srcElement.title) {
|
||||
event.srcElement.title = `${event.srcElement.dataset.tip} [${(event.srcElement.accessKeyLabel || event.srcElement.accessKey).toUpperCase()}]`;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
let self = this;
|
||||
return html`
|
||||
<style>
|
||||
${k_global_style}
|
||||
.tooltip {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
display: none;
|
||||
border: 1px solid black;
|
||||
padding: 4px;
|
||||
color: black;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.tooltip_parent:hover .tooltip {
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
<div style="margin: 4px; display: flex; flex-direction: row; flex-wrap: nowrap; gap: 3px; align-items: center">
|
||||
<span style="cursor: pointer" @click=${() => this.show_version = !this.show_version}>😎</span>
|
||||
<span ?hidden=${!this.show_version} style="flex: 0 0; white-space: nowrap" title=${this.version?.name + ' ' + Object.entries(this.version || {}).filter(x => ['name', 'number'].indexOf(x[0]) == -1).map(x => `\n* ${x[0]}: ${x[1]}`)}>${this.version?.number}</span>
|
||||
<a accesskey="h" data-tip="Open home app." href="/" style="color: #fff; white-space: nowrap">TF</a>
|
||||
<a accesskey="a" data-tip="Open apps list." href="/~core/apps/">apps</a>
|
||||
<a accesskey="e" data-tip="Toggle the app editor." href="#" @click=${this.toggle_edit}>edit</a>
|
||||
<a accesskey="p" data-tip="View and change permissions." href="#" @click=${() => self.show_permissions = !self.show_permissions}>🎛️</a>
|
||||
<a accesskey="h" @mouseover=${this.set_access_key_title} data-tip="Open home app." href="/" style="color: #fff; white-space: nowrap">TF</a>
|
||||
<a accesskey="a" @mouseover=${this.set_access_key_title} data-tip="Open apps list." href="/~core/apps/">apps</a>
|
||||
<a accesskey="e" @mouseover=${this.set_access_key_title} data-tip="Toggle the app editor." href="#" @click=${this.toggle_edit}>edit</a>
|
||||
<a accesskey="p" @mouseover=${this.set_access_key_title} data-tip="View and change permissions." href="#" @click=${() => self.show_permissions = !self.show_permissions}>🎛️</a>
|
||||
<span style="display: inline-block; vertical-align: top; white-space: pre; color: ${this.status.color ?? kErrorColor}">${this.status.message}</span>
|
||||
<span id="requests"></span>
|
||||
${this.render_permissions()}
|
||||
@ -149,12 +168,14 @@ class TfFilesElement extends LitElement {
|
||||
return {
|
||||
current: {type: String},
|
||||
files: {type: Object},
|
||||
dropping: {type: Number},
|
||||
};
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.files = {};
|
||||
this.dropping = 0;
|
||||
}
|
||||
|
||||
file_click(file) {
|
||||
@ -178,6 +199,34 @@ class TfFilesElement extends LitElement {
|
||||
return html`<div class="${classes.join(' ')}" @click=${x => this.file_click(file)}>${file}</div>`;
|
||||
}
|
||||
|
||||
async drop(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.dropping = 0;
|
||||
for (let file of event.dataTransfer.files) {
|
||||
let buffer = await file.arrayBuffer();
|
||||
let text = new TextDecoder('latin1').decode(buffer);
|
||||
gFiles[file.name] = {
|
||||
doc: new CodeMirror.Doc(text, guessMode(file.name)),
|
||||
buffer: buffer,
|
||||
generation: -1,
|
||||
isNew: true,
|
||||
};
|
||||
gCurrentFile = file.name;
|
||||
}
|
||||
openFile(gCurrentFile);
|
||||
updateFiles();
|
||||
}
|
||||
|
||||
drag_enter(event) {
|
||||
this.dropping++;
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
drag_leave(event) {
|
||||
this.dropping--;
|
||||
}
|
||||
|
||||
render() {
|
||||
let self = this;
|
||||
return html`
|
||||
@ -202,9 +251,15 @@ class TfFilesElement extends LitElement {
|
||||
content: '*';
|
||||
}
|
||||
</style>
|
||||
<div>
|
||||
<div @drop=${this.drop} @dragenter=${this.drag_enter} @dragleave=${this.drag_leave}>
|
||||
${Object.keys(this.files).sort().map(x => self.render_file(x))}
|
||||
</div>
|
||||
<div
|
||||
?hidden=${this.dropping == 0}
|
||||
@drop=${this.drop} @dragenter=${this.drag_enter} @dragleave=${this.drag_leave}
|
||||
style="text-align: center; vertical-align: middle; outline: 16px solid red; margin: -8px; background-color: rgba(255, 0, 0, 0.5); position: absolute; left: 16px; top: 16px; width: calc(100% - 16px); height: calc(100% - 16px); z-index: 1000">
|
||||
Drop File(s)
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
@ -414,7 +469,7 @@ function edit() {
|
||||
{tagName: "script", attributes: {src: "/codemirror/xml.min.js"}},
|
||||
{tagName: "script", attributes: {src: "/codemirror/htmlmixed.min.js"}},
|
||||
{tagName: "script", attributes: {src: "/codemirror/lint.js"}},
|
||||
{tagName: "script", attributes: {src: "/codemirror/jshint.js"}},
|
||||
{tagName: "script", attributes: {src: "/codemirror/jshint.min.js"}},
|
||||
{tagName: "script", attributes: {src: "/codemirror/javascript-lint.min.js"}},
|
||||
], function() {
|
||||
load().catch(function(error) {
|
||||
@ -437,7 +492,8 @@ function guessMode(name) {
|
||||
function loadFile(name, id) {
|
||||
return fetch('/' + id + '/view').then(function(response) {
|
||||
if (!response.ok) {
|
||||
throw new Error('Request failed: ' + response.status + ' ' + response.statusText);
|
||||
alert(`Request failed for ${name}: ${response.status} ${response.statusText}`);
|
||||
return 'missing file!';
|
||||
}
|
||||
return response.text();
|
||||
}).then(function(text) {
|
||||
@ -471,7 +527,8 @@ function load(path) {
|
||||
'mode': {'js': 'javascript'}[(path || url()).split('.').pop()],
|
||||
'lint': {
|
||||
'options': {
|
||||
'esversion': 2021,
|
||||
esversion: 2021,
|
||||
varstmt: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -523,6 +580,9 @@ function save(save_to) {
|
||||
document.getElementById("save").disabled = true;
|
||||
if (gCurrentFile) {
|
||||
gFiles[gCurrentFile].doc = gEditor.getDoc();
|
||||
if (!gFiles[gCurrentFile].isNew && !gFiles[gCurrentFile].doc.isClean(gFiles[gCurrentFile].doc.changeGeneration())) {
|
||||
delete gFiles[gCurrentFile].buffer;
|
||||
}
|
||||
}
|
||||
|
||||
let save_path = save_to;
|
||||
@ -538,17 +598,18 @@ function save(save_to) {
|
||||
let promises = [];
|
||||
for (let name of Object.keys(gFiles)) {
|
||||
let file = gFiles[name];
|
||||
if (file.doc.isClean(file.generation)) {
|
||||
if (!file.isNew && file.doc.isClean(file.generation)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
delete file.id;
|
||||
delete file.isNew;
|
||||
promises.push(fetch('/save', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'text/plain',
|
||||
'Content-Type': 'application/binary',
|
||||
},
|
||||
body: file.doc.getValue(),
|
||||
body: file.buffer ?? file.doc.getValue(),
|
||||
}).then(function(response) {
|
||||
if (!response.ok) {
|
||||
throw new Error('Saving "' + name + '": ' + response.status + ' ' + response.statusText);
|
||||
@ -716,6 +777,8 @@ function api_requestPermission(permission, id) {
|
||||
div = document.createElement('div');
|
||||
for (let option of k_options) {
|
||||
let button = document.createElement('button');
|
||||
button.style.minWidth = '3em';
|
||||
button.style.minHeight = '3em';
|
||||
button.innerText = option.text;
|
||||
button.id = option.id;
|
||||
button.onclick = function() {
|
||||
@ -976,6 +1039,9 @@ function openFile(name) {
|
||||
let oldDoc = gEditor.swapDoc(newDoc);
|
||||
if (gFiles[gCurrentFile]) {
|
||||
gFiles[gCurrentFile].doc = oldDoc;
|
||||
if (!gFiles[gCurrentFile].isNew && gFiles[gCurrentFile].doc.isClean(oldDoc.generation)) {
|
||||
delete gFiles[gCurrentFile].buffer;
|
||||
}
|
||||
}
|
||||
gCurrentFile = name;
|
||||
updateFiles();
|
||||
@ -990,7 +1056,6 @@ function updateFiles() {
|
||||
}]));
|
||||
files.current = gCurrentFile;
|
||||
}
|
||||
|
||||
gEditor.focus();
|
||||
}
|
||||
|
||||
@ -1031,30 +1096,6 @@ window.addEventListener("load", function() {
|
||||
event.preventDefault();
|
||||
trace();
|
||||
});
|
||||
for (let tag of document.getElementsByTagName('a')) {
|
||||
if (tag.accessKey) {
|
||||
tag.classList.add('tooltip_parent');
|
||||
let tooltip = document.createElement('div');
|
||||
tooltip.classList.add('tooltip');
|
||||
if (tag.dataset.tip) {
|
||||
let description = document.createElement('div');
|
||||
description.innerText = tag.dataset.tip;
|
||||
tooltip.appendChild(description);
|
||||
}
|
||||
let parts = tag.accessKeyLabel ? tag.accessKeyLabel.split('+') : [];
|
||||
for (let i = 0; i < parts.length; i++)
|
||||
{
|
||||
let key = parts[i];
|
||||
let kbd = document.createElement('kbd');
|
||||
kbd.innerText = key;
|
||||
tooltip.appendChild(kbd);
|
||||
if (i < parts.length - 1) {
|
||||
tooltip.appendChild(document.createTextNode('+'));
|
||||
}
|
||||
}
|
||||
tag.appendChild(tooltip);
|
||||
}
|
||||
}
|
||||
connectSocket(window.location.pathname);
|
||||
|
||||
if (window.localStorage.getItem('editing') == '1') {
|
||||
|
67
core/core.js
67
core/core.js
@ -47,6 +47,11 @@ const k_global_settings = {
|
||||
default_value: '/~core/apps/',
|
||||
description: 'Default path.',
|
||||
},
|
||||
index_map: {
|
||||
type: 'textarea',
|
||||
default_value: undefined,
|
||||
description: 'Mappings from hostname to redirect path, one per line, as in: "www.tildefriends.net=/~core/index/"',
|
||||
},
|
||||
room: {
|
||||
type: 'boolean',
|
||||
default_value: true,
|
||||
@ -74,12 +79,12 @@ const k_global_settings = {
|
||||
},
|
||||
blob_fetch_age_seconds: {
|
||||
type: 'integer',
|
||||
default_value: (platform() == 'android' ? 0.5 * 365 * 24 * 60 * 60 : undefined),
|
||||
default_value: (platform() == 'android' || platform() == 'iphone' ? 0.5 * 365 * 24 * 60 * 60 : undefined),
|
||||
description: 'Only blobs mentioned more recently than this age will be automatically fetched.',
|
||||
},
|
||||
blob_expire_age_seconds: {
|
||||
type: 'integer',
|
||||
default_value: (platform() == 'android' ? 1.0 * 365 * 24 * 60 * 60 : undefined),
|
||||
default_value: (platform() == 'android' || platform() == 'iphone' ? 1.0 * 365 * 24 * 60 * 60 : undefined),
|
||||
description: 'Blobs older than this will be automatically deleted.',
|
||||
},
|
||||
};
|
||||
@ -391,6 +396,11 @@ async function getProcessBlob(blobId, key, options) {
|
||||
return ssb.createIdentity(process.credentials.session.name);
|
||||
}
|
||||
};
|
||||
imports.ssb.getOwnerIdentities = function() {
|
||||
if (options.packageOwner) {
|
||||
return ssb.getIdentities(options.packageOwner);
|
||||
}
|
||||
};
|
||||
imports.ssb.getIdentities = function() {
|
||||
if (process.credentials &&
|
||||
process.credentials.session &&
|
||||
@ -421,6 +431,13 @@ async function getProcessBlob(blobId, key, options) {
|
||||
return ssb.privateMessageDecrypt(process.credentials.session.name, id, message);
|
||||
}
|
||||
};
|
||||
imports.ssb.setServerFollowingMe = function(id, following) {
|
||||
if (process.credentials &&
|
||||
process.credentials.session &&
|
||||
process.credentials.session.name) {
|
||||
return ssb.setServerFollowingMe(process.credentials.session.name, id, following);
|
||||
}
|
||||
};
|
||||
imports.fetch = function(url, options) {
|
||||
return http.fetch(url, options, gGlobalSettings.fetch_hosts);
|
||||
}
|
||||
@ -683,7 +700,7 @@ async function blobHandler(request, response, blobId, uri) {
|
||||
|
||||
if (!uri) {
|
||||
response.writeHead(303, {"Location": (request.client.tls ? 'https://' : 'http://') + request.headers.host + blobId + '/', "Content-Length": "0"});
|
||||
response.end(data);
|
||||
response.end();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -735,7 +752,6 @@ async function blobHandler(request, response, blobId, uri) {
|
||||
} else if (uri == "/save") {
|
||||
let match;
|
||||
if (match = /^\/\~(\w+)\/(\w+)$/.exec(blobId)) {
|
||||
let newBlobId = await ssb.blobStore(request.body);
|
||||
let user = match[1];
|
||||
let appName = match[2];
|
||||
let credentials = auth.query(request.headers);
|
||||
@ -743,6 +759,25 @@ async function blobHandler(request, response, blobId, uri) {
|
||||
(credentials.session.name == user ||
|
||||
(credentials.permissions.administration && user == 'core'))) {
|
||||
let database = new Database(user);
|
||||
|
||||
let app_object = JSON.parse(utf8Decode(request.body));
|
||||
let previous_id = database.get('path:' + appName);
|
||||
if (previous_id) {
|
||||
try {
|
||||
let previous_object = JSON.parse(utf8Decode(await ssb.blobGet(previous_id)));
|
||||
delete previous_object.previous;
|
||||
delete app_object.previous;
|
||||
if (JSON.stringify(previous_object) == JSON.stringify(app_object)) {
|
||||
response.writeHead(200, {"Content-Type": "text/plain; charset=utf-8"});
|
||||
response.end("/" + previous_id);
|
||||
return;
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
app_object.previous = previous_id;
|
||||
let newBlobId = await ssb.blobStore(JSON.stringify(app_object));
|
||||
|
||||
let apps = new Set();
|
||||
let apps_original = database.get('apps');
|
||||
try {
|
||||
@ -757,14 +792,13 @@ async function blobHandler(request, response, blobId, uri) {
|
||||
database.set('apps', apps);
|
||||
}
|
||||
database.set('path:' + appName, newBlobId);
|
||||
response.writeHead(200, {"Content-Type": "text/plain; charset=utf-8"});
|
||||
response.end("/" + newBlobId);
|
||||
} else {
|
||||
response.writeHead(401, {"Content-Type": "text/plain; charset=utf-8"});
|
||||
response.end("401 Unauthorized");
|
||||
return;
|
||||
}
|
||||
|
||||
response.writeHead(200, {"Content-Type": "text/plain; charset=utf-8"});
|
||||
response.end("/" + newBlobId);
|
||||
} else if (blobId === '') {
|
||||
let newBlobId = await ssb.blobStore(request.body);
|
||||
response.writeHead(200, {"Content-Type": "text/plain; charset=utf-8"});
|
||||
@ -918,10 +952,22 @@ function stringResponse(response, data) {
|
||||
}
|
||||
|
||||
loadSettings().then(function() {
|
||||
httpd.all("/login", auth.handler);
|
||||
httpd.all("", function(request, response) {
|
||||
let httpd_impl = (tildefriends.args.httpdc ? httpdc : httpd);
|
||||
httpd_impl.all("/login", auth.handler);
|
||||
httpd_impl.all("", function(request, response) {
|
||||
let match;
|
||||
if (request.uri === "/" || request.uri === "") {
|
||||
try {
|
||||
for (let line of (gGlobalSettings.index_map || '').split('\n')) {
|
||||
let parts = line.split('=');
|
||||
if (parts.length == 2 && request.headers.host.match(new RegExp(parts[0], 'i'))) {
|
||||
response.writeHead(303, {"Location": (request.client.tls ? 'https://' : 'http://') + request.headers.host + parts[1], "Content-Length": "0"});
|
||||
return response.end();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
response.writeHead(303, {"Location": (request.client.tls ? 'https://' : 'http://') + request.headers.host + gGlobalSettings.index, "Content-Length": "0"});
|
||||
return response.end();
|
||||
} else if (match = /^(\/~[^\/]+\/[^\/]+)(\/?.*)$/.exec(request.uri)) {
|
||||
@ -958,7 +1004,8 @@ loadSettings().then(function() {
|
||||
return response.end(data);
|
||||
}
|
||||
});
|
||||
httpd.registerSocketHandler("/app/socket", app.socket);
|
||||
httpd_impl.registerSocketHandler("/app/socket", app.socket);
|
||||
httpd_impl.start(tildefriends.http_port);
|
||||
}).catch(function(error) {
|
||||
print('Failed to load settings.');
|
||||
printError({print: print}, error);
|
||||
|
350
core/httpd.js
350
core/httpd.js
@ -120,6 +120,7 @@ function Response(request, client) {
|
||||
let requestVersion = request.version.split("/")[1].split(".");
|
||||
let responseVersion = (requestVersion[0] >= 1 && requestVersion[0] >= 1) ? "1.1" : "1.0";
|
||||
let headerString = "HTTP/" + responseVersion + " " + status + " " + reason + "\r\n";
|
||||
headers['Server'] = `Tilde Friends/${version().number}`;
|
||||
for (let i in headers) {
|
||||
headerString += i + ": " + headers[i] + "\r\n";
|
||||
lowerHeaders[i.toLowerCase()] = headers[i];
|
||||
@ -202,131 +203,135 @@ function handleWebSocketRequest(request, response, client) {
|
||||
return;
|
||||
}
|
||||
|
||||
response.send = function(message, opCode) {
|
||||
if (opCode === undefined) {
|
||||
opCode = 0x2;
|
||||
}
|
||||
if (opCode == 0x1 && (typeof message == "string" || message instanceof String)) {
|
||||
message = utf8Encode(message);
|
||||
}
|
||||
let fin = true;
|
||||
let packet = [(fin ? (1 << 7) : 0) | (opCode & 0xf)];
|
||||
let mask = false;
|
||||
if (message.length < 126) {
|
||||
packet.push((mask ? (1 << 7) : 0) | message.length);
|
||||
} else if (message.length < (1 << 16)) {
|
||||
packet.push((mask ? (1 << 7) : 0) | 126);
|
||||
packet.push((message.length >> 8) & 0xff);
|
||||
packet.push(message.length & 0xff);
|
||||
} else {
|
||||
let high = 0; //(message.length / (1 ** 32)) & 0xffffffff;
|
||||
let low = message.length & 0xffffffff;
|
||||
packet.push((mask ? (1 << 7) : 0) | 127);
|
||||
packet.push((high >> 24) & 0xff);
|
||||
packet.push((high >> 16) & 0xff);
|
||||
packet.push((high >> 8) & 0xff);
|
||||
packet.push((high >> 0) & 0xff);
|
||||
packet.push((low >> 24) & 0xff);
|
||||
packet.push((low >> 16) & 0xff);
|
||||
packet.push((low >> 8) & 0xff);
|
||||
packet.push(low & 0xff);
|
||||
}
|
||||
if (client) {
|
||||
response.send = function(message, opCode) {
|
||||
if (opCode === undefined) {
|
||||
opCode = 0x2;
|
||||
}
|
||||
if (opCode == 0x1 && (typeof message == "string" || message instanceof String)) {
|
||||
message = utf8Encode(message);
|
||||
}
|
||||
let fin = true;
|
||||
let packet = [(fin ? (1 << 7) : 0) | (opCode & 0xf)];
|
||||
let mask = false;
|
||||
if (message.length < 126) {
|
||||
packet.push((mask ? (1 << 7) : 0) | message.length);
|
||||
} else if (message.length < (1 << 16)) {
|
||||
packet.push((mask ? (1 << 7) : 0) | 126);
|
||||
packet.push((message.length >> 8) & 0xff);
|
||||
packet.push(message.length & 0xff);
|
||||
} else {
|
||||
let high = 0; //(message.length / (1 ** 32)) & 0xffffffff;
|
||||
let low = message.length & 0xffffffff;
|
||||
packet.push((mask ? (1 << 7) : 0) | 127);
|
||||
packet.push((high >> 24) & 0xff);
|
||||
packet.push((high >> 16) & 0xff);
|
||||
packet.push((high >> 8) & 0xff);
|
||||
packet.push((high >> 0) & 0xff);
|
||||
packet.push((low >> 24) & 0xff);
|
||||
packet.push((low >> 16) & 0xff);
|
||||
packet.push((low >> 8) & 0xff);
|
||||
packet.push(low & 0xff);
|
||||
}
|
||||
|
||||
let array = new Uint8Array(packet.length + message.length);
|
||||
array.set(packet, 0);
|
||||
array.set(message, packet.length);
|
||||
try {
|
||||
return client.write(array);
|
||||
} catch (error) {
|
||||
client.close();
|
||||
throw error;
|
||||
let array = new Uint8Array(packet.length + message.length);
|
||||
array.set(packet, 0);
|
||||
array.set(message, packet.length);
|
||||
try {
|
||||
return client.write(array);
|
||||
} catch (error) {
|
||||
client.close();
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
response.onMessage = null;
|
||||
|
||||
let extra_headers = handler.invoke(request, response);
|
||||
|
||||
client.read(function(data) {
|
||||
if (data) {
|
||||
let newBuffer = new Uint8Array(buffer.length + data.length);
|
||||
newBuffer.set(buffer, 0);
|
||||
newBuffer.set(data, buffer.length);
|
||||
buffer = newBuffer;
|
||||
if (client) {
|
||||
client.read(function(data) {
|
||||
if (data) {
|
||||
let newBuffer = new Uint8Array(buffer.length + data.length);
|
||||
newBuffer.set(buffer, 0);
|
||||
newBuffer.set(data, buffer.length);
|
||||
buffer = newBuffer;
|
||||
|
||||
while (buffer.length >= 2) {
|
||||
let bits0 = buffer[0];
|
||||
let bits1 = buffer[1];
|
||||
if (bits1 & (1 << 7) == 0) {
|
||||
// Unmasked message.
|
||||
client.close();
|
||||
}
|
||||
let opCode = bits0 & 0xf;
|
||||
let fin = bits0 & (1 << 7);
|
||||
let payloadLength = bits1 & 0x7f;
|
||||
let maskStart = 2;
|
||||
|
||||
if (payloadLength == 126) {
|
||||
payloadLength = 0;
|
||||
for (let i = 0; i < 2; i++) {
|
||||
payloadLength <<= 8;
|
||||
payloadLength |= buffer[2 + i];
|
||||
while (buffer.length >= 2) {
|
||||
let bits0 = buffer[0];
|
||||
let bits1 = buffer[1];
|
||||
if (bits1 & (1 << 7) == 0) {
|
||||
// Unmasked message.
|
||||
client.close();
|
||||
}
|
||||
maskStart = 4;
|
||||
} else if (payloadLength == 127) {
|
||||
payloadLength = 0;
|
||||
for (let i = 0; i < 8; i++) {
|
||||
payloadLength <<= 8;
|
||||
payloadLength |= buffer[2 + i];
|
||||
}
|
||||
maskStart = 10;
|
||||
}
|
||||
let havePayload = buffer.length >= payloadLength + 2 + 4;
|
||||
if (havePayload) {
|
||||
let mask =
|
||||
buffer[maskStart + 0] |
|
||||
buffer[maskStart + 1] << 8 |
|
||||
buffer[maskStart + 2] << 16 |
|
||||
buffer[maskStart + 3] << 24;
|
||||
let dataStart = maskStart + 4;
|
||||
let payload = buffer.slice(dataStart, dataStart + payloadLength);
|
||||
let decoded = maskBytes(payload, mask);
|
||||
buffer = buffer.slice(dataStart + payloadLength);
|
||||
let opCode = bits0 & 0xf;
|
||||
let fin = bits0 & (1 << 7);
|
||||
let payloadLength = bits1 & 0x7f;
|
||||
let maskStart = 2;
|
||||
|
||||
if (frame) {
|
||||
let newBuffer = new Uint8Array(frame.length + decoded.length);
|
||||
newBuffer.set(frame, 0);
|
||||
newBuffer.set(decoded, frame.length);
|
||||
frame = newBuffer;
|
||||
} else {
|
||||
frame = decoded;
|
||||
}
|
||||
|
||||
if (opCode) {
|
||||
frameOpCode = opCode;
|
||||
}
|
||||
|
||||
if (fin) {
|
||||
if (response.onMessage) {
|
||||
response.onMessage({
|
||||
data: frameOpCode == 0x1 ? utf8Decode(frame) : frame,
|
||||
opCode: frameOpCode,
|
||||
});
|
||||
if (payloadLength == 126) {
|
||||
payloadLength = 0;
|
||||
for (let i = 0; i < 2; i++) {
|
||||
payloadLength <<= 8;
|
||||
payloadLength |= buffer[2 + i];
|
||||
}
|
||||
frame = undefined;
|
||||
maskStart = 4;
|
||||
} else if (payloadLength == 127) {
|
||||
payloadLength = 0;
|
||||
for (let i = 0; i < 8; i++) {
|
||||
payloadLength <<= 8;
|
||||
payloadLength |= buffer[2 + i];
|
||||
}
|
||||
maskStart = 10;
|
||||
}
|
||||
let havePayload = buffer.length >= payloadLength + 2 + 4;
|
||||
if (havePayload) {
|
||||
let mask =
|
||||
buffer[maskStart + 0] |
|
||||
buffer[maskStart + 1] << 8 |
|
||||
buffer[maskStart + 2] << 16 |
|
||||
buffer[maskStart + 3] << 24;
|
||||
let dataStart = maskStart + 4;
|
||||
let payload = buffer.slice(dataStart, dataStart + payloadLength);
|
||||
let decoded = maskBytes(payload, mask);
|
||||
buffer = buffer.slice(dataStart + payloadLength);
|
||||
|
||||
if (frame) {
|
||||
let newBuffer = new Uint8Array(frame.length + decoded.length);
|
||||
newBuffer.set(frame, 0);
|
||||
newBuffer.set(decoded, frame.length);
|
||||
frame = newBuffer;
|
||||
} else {
|
||||
frame = decoded;
|
||||
}
|
||||
|
||||
if (opCode) {
|
||||
frameOpCode = opCode;
|
||||
}
|
||||
|
||||
if (fin) {
|
||||
if (response.onMessage) {
|
||||
response.onMessage({
|
||||
data: frameOpCode == 0x1 ? utf8Decode(frame) : frame,
|
||||
opCode: frameOpCode,
|
||||
});
|
||||
}
|
||||
frame = undefined;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
response.onClose();
|
||||
client.close();
|
||||
}
|
||||
} else {
|
||||
response.onClose();
|
||||
client.close();
|
||||
}
|
||||
});
|
||||
client.onError(function(error) {
|
||||
logError(client.peerName + " - - [" + new Date() + "] " + error);
|
||||
response.onError(error);
|
||||
});
|
||||
});
|
||||
client.onError(function(error) {
|
||||
logError(client.peerName + " - - [" + new Date() + "] " + error);
|
||||
response.onError(error);
|
||||
});
|
||||
}
|
||||
|
||||
let headers = {
|
||||
"Upgrade": "websocket",
|
||||
@ -341,7 +346,6 @@ function handleWebSocketRequest(request, response, client) {
|
||||
|
||||
function webSocketAcceptResponse(key) {
|
||||
let kMagic = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
|
||||
let kAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
return base64Encode(sha1Digest(key + kMagic));
|
||||
}
|
||||
|
||||
@ -445,7 +449,7 @@ function handleConnection(client) {
|
||||
if (result == -2) {
|
||||
/* More. */
|
||||
} else {
|
||||
badRequest(client, 'Bad request.');
|
||||
badRequest(client, `Bad request(parse=${result}, length=${inputBuffer.length - data.length}).`);
|
||||
return;
|
||||
}
|
||||
} else if (typeof result === 'object') {
|
||||
@ -518,75 +522,77 @@ function handleConnection(client) {
|
||||
}
|
||||
|
||||
let kBacklog = 8;
|
||||
let kHost = '::';
|
||||
let kHost = platform() == 'haiku' ? 'localhost' : '::';
|
||||
|
||||
let socket = new Socket();
|
||||
socket.bind(kHost, tildefriends.http_port).then(function(port) {
|
||||
print("bound to", port);
|
||||
print("checking", tildefriends.args.out_http_port_file);
|
||||
if (tildefriends.args.out_http_port_file) {
|
||||
print("going to write the file");
|
||||
File.writeFile(tildefriends.args.out_http_port_file, port.toString() + '\n').then(function(r) {
|
||||
print("wrote port file", tildefriends.args.out_http_port_file, r);
|
||||
}).catch(function() {
|
||||
print("failed to write port file");
|
||||
});
|
||||
}
|
||||
let listenResult = socket.listen(kBacklog, async function() {
|
||||
try {
|
||||
let client = await socket.accept();
|
||||
client.noDelay = true;
|
||||
handleConnection(client);
|
||||
} catch (error) {
|
||||
logError("[" + new Date() + "] accept error " + error);
|
||||
function start() {
|
||||
let socket = new Socket();
|
||||
socket.bind(kHost, tildefriends.http_port).then(function(port) {
|
||||
print("bound to", port);
|
||||
print("checking", tildefriends.args.out_http_port_file);
|
||||
if (tildefriends.args.out_http_port_file) {
|
||||
print("going to write the file");
|
||||
File.writeFile(tildefriends.args.out_http_port_file, port.toString() + '\n').then(function(r) {
|
||||
print("wrote port file", tildefriends.args.out_http_port_file, r);
|
||||
}).catch(function() {
|
||||
print("failed to write port file");
|
||||
});
|
||||
}
|
||||
});
|
||||
}).catch(function(error) {
|
||||
logError("[" + new Date() + "] bind error " + error);
|
||||
});
|
||||
|
||||
if (tildefriends.https_port) {
|
||||
let tls = {};
|
||||
let secureSocket = new Socket();
|
||||
secureSocket.bind(kHost, tildefriends.https_port).then(function() {
|
||||
return secureSocket.listen(kBacklog, async function() {
|
||||
let listenResult = socket.listen(kBacklog, async function() {
|
||||
try {
|
||||
let client = await secureSocket.accept();
|
||||
let client = await socket.accept();
|
||||
client.noDelay = true;
|
||||
client.tls = true;
|
||||
const kCertificatePath = "data/httpd/certificate.pem";
|
||||
const kPrivateKeyPath = "data/httpd/privatekey.pem";
|
||||
|
||||
let stat = await Promise.all([
|
||||
await File.stat(kCertificatePath),
|
||||
await File.stat(kPrivateKeyPath),
|
||||
]);
|
||||
if (!tls.context ||
|
||||
tls.certStat.mtime != stat[0].mtime ||
|
||||
tls.certStat.size != stat[0].size ||
|
||||
tls.keyStat.mtime != stat[1].mtime ||
|
||||
tls.keyStat.size != stat[1].size) {
|
||||
print("Reloading " + kCertificatePath + " and " + kPrivateKeyPath);
|
||||
let privateKey = utf8Decode(await File.readFile(kPrivateKeyPath));
|
||||
let certificate = utf8Decode(await File.readFile(kCertificatePath));
|
||||
|
||||
tls.context = new TlsContext();
|
||||
tls.context.setPrivateKey(privateKey);
|
||||
tls.context.setCertificate(certificate);
|
||||
tls.certStat = stat[0];
|
||||
tls.keyStat = stat[1];
|
||||
}
|
||||
|
||||
let result = client.startTls(tls.context);
|
||||
handleConnection(client);
|
||||
return result;
|
||||
} catch (error) {
|
||||
logError("[" + new Date() + "] [" + client.peerName + "] " + error);
|
||||
logError("[" + new Date() + "] accept error " + error);
|
||||
}
|
||||
});
|
||||
}).catch(function(error) {
|
||||
logError("[" + new Date() + "] bind error " + error);
|
||||
});
|
||||
|
||||
if (tildefriends.https_port) {
|
||||
let tls = {};
|
||||
let secureSocket = new Socket();
|
||||
secureSocket.bind(kHost, tildefriends.https_port).then(function() {
|
||||
return secureSocket.listen(kBacklog, async function() {
|
||||
try {
|
||||
let client = await secureSocket.accept();
|
||||
client.noDelay = true;
|
||||
client.tls = true;
|
||||
const kCertificatePath = "data/httpd/certificate.pem";
|
||||
const kPrivateKeyPath = "data/httpd/privatekey.pem";
|
||||
|
||||
let stat = await Promise.all([
|
||||
await File.stat(kCertificatePath),
|
||||
await File.stat(kPrivateKeyPath),
|
||||
]);
|
||||
if (!tls.context ||
|
||||
tls.certStat.mtime != stat[0].mtime ||
|
||||
tls.certStat.size != stat[0].size ||
|
||||
tls.keyStat.mtime != stat[1].mtime ||
|
||||
tls.keyStat.size != stat[1].size) {
|
||||
print("Reloading " + kCertificatePath + " and " + kPrivateKeyPath);
|
||||
let privateKey = utf8Decode(await File.readFile(kPrivateKeyPath));
|
||||
let certificate = utf8Decode(await File.readFile(kCertificatePath));
|
||||
|
||||
tls.context = new TlsContext();
|
||||
tls.context.setPrivateKey(privateKey);
|
||||
tls.context.setCertificate(certificate);
|
||||
tls.certStat = stat[0];
|
||||
tls.keyStat = stat[1];
|
||||
}
|
||||
|
||||
let result = client.startTls(tls.context);
|
||||
handleConnection(client);
|
||||
return result;
|
||||
} catch (error) {
|
||||
logError("[" + new Date() + "] " + error);
|
||||
}
|
||||
});
|
||||
}).catch(function(error) {
|
||||
logError("[" + new Date() + "] bind error " + error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export { all, registerSocketHandler };
|
||||
export { all, start, registerSocketHandler };
|
||||
|
@ -125,34 +125,6 @@ a:active {
|
||||
.cyan { color: #2aa198; }
|
||||
.green { color: #859900; }
|
||||
|
||||
.tooltip {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
display: none;
|
||||
border: 1px solid black;
|
||||
padding: 4px;
|
||||
color: black;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.tooltip_parent:hover .tooltip {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
kbd {
|
||||
background-color: #eee;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #b4b4b4;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 2px 0 0 rgba(255, 255, 255, .7) inset;
|
||||
color: #333;
|
||||
display: inline-block;
|
||||
font-size: .85em;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
padding: 2px 4px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.permissions {
|
||||
position: absolute;
|
||||
display: block;
|
||||
|
2
deps/codemirror/annotatescrollbar.min.js
vendored
2
deps/codemirror/annotatescrollbar.min.js
vendored
@ -1 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){function i(t){clearTimeout(n.doRedraw),n.doRedraw=setTimeout(function(){n.redraw()},t)}this.cm=t,this.options=e,this.buttonHeight=e.scrollButtonHeight||t.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=t.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var n=this;t.on("refresh",this.resizeHandler=function(){clearTimeout(n.doUpdate),n.doUpdate=setTimeout(function(){n.computeScale()&&i(20)},100)}),t.on("markerAdded",this.resizeHandler),t.on("markerCleared",this.resizeHandler),!1!==e.listenForChanges&&t.on("changes",this.changeHandler=function(){i(250)})}t.defineExtension("annotateScrollbar",function(t){return new e(this,t="string"==typeof t?{className:t}:t)}),t.defineOption("scrollButtonHeight",0),e.prototype.computeScale=function(){var t=this.cm,t=(t.getWrapperElement().clientHeight-t.display.barHeight-2*this.buttonHeight)/t.getScrollerElement().scrollHeight;if(t!=this.hScale)return this.hScale=t,!0},e.prototype.update=function(t){this.annotations=t,this.redraw()},e.prototype.redraw=function(t){!1!==t&&this.computeScale();var n=this.cm,e=this.hScale,i=document.createDocumentFragment(),o=this.annotations,r=n.getOption("lineWrapping"),a=r&&1.5*n.defaultTextHeight(),s=null,h=null;function l(t,e){var i;return s!=t.line&&(s=t.line,h=n.getLineHandle(t.line),(i=n.getLineHandleVisualStart(h))!=h)&&(s=n.getLineNumber(i),h=i),h.widgets&&h.widgets.length||r&&h.height>a?n.charCoords(t,"local")[e?"top":"bottom"]:n.heightAtLine(h,"local")+(e?0:h.height)}var d=n.lastLine();if(n.display.barWidth)for(var c,p=0;p<o.length;p++){var u=o[p];if(!(u.to.line>d)){for(var m,f,g=c||l(u.from,!0)*e,H=l(u.to,!1)*e;p<o.length-1&&!(o[p+1].to.line>d)&&!(H+.9<(c=l(o[p+1].from,!0)*e));)H=l((u=o[++p]).to,!1)*e;H!=g&&(m=Math.max(H-g,3),(f=i.appendChild(document.createElement("div"))).style.cssText="position: absolute; right: 0px; width: "+Math.max(n.display.barWidth-1,2)+"px; top: "+(g+this.buttonHeight)+"px; height: "+m+"px",f.className=this.options.className,u.id)&&f.setAttribute("annotation-id",u.id)}}this.div.textContent="",this.div.appendChild(i)},e.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}});
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){function i(t){clearTimeout(n.doRedraw),n.doRedraw=setTimeout(function(){n.redraw()},t)}this.cm=t,this.options=e,this.buttonHeight=e.scrollButtonHeight||t.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=t.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var n=this;t.on("refresh",this.resizeHandler=function(){clearTimeout(n.doUpdate),n.doUpdate=setTimeout(function(){n.computeScale()&&i(20)},100)}),t.on("markerAdded",this.resizeHandler),t.on("markerCleared",this.resizeHandler),!1!==e.listenForChanges&&t.on("changes",this.changeHandler=function(){i(250)})}t.defineExtension("annotateScrollbar",function(t){return new e(this,t="string"==typeof t?{className:t}:t)}),t.defineOption("scrollButtonHeight",0),e.prototype.computeScale=function(){var t=this.cm,t=(t.getWrapperElement().clientHeight-t.display.barHeight-2*this.buttonHeight)/t.getScrollerElement().scrollHeight;if(t!=this.hScale)return this.hScale=t,!0},e.prototype.update=function(t){this.annotations=t,this.redraw()},e.prototype.redraw=function(t){!1!==t&&this.computeScale();var n=this.cm,e=this.hScale,i=document.createDocumentFragment(),o=this.annotations,r=n.getOption("lineWrapping"),a=r&&1.5*n.defaultTextHeight(),s=null,h=null;function l(t,e){var i;return s!=t.line&&(s=t.line,h=n.getLineHandle(t.line),(i=n.getLineHandleVisualStart(h))!=h&&(s=n.getLineNumber(i),h=i)),h.widgets&&h.widgets.length||r&&h.height>a?n.charCoords(t,"local")[e?"top":"bottom"]:n.heightAtLine(h,"local")+(e?0:h.height)}var d=n.lastLine();if(n.display.barWidth)for(var c,p=0;p<o.length;p++){var u=o[p];if(!(u.to.line>d)){for(var m,f,g=c||l(u.from,!0)*e,H=l(u.to,!1)*e;p<o.length-1&&!(o[p+1].to.line>d)&&!(H+.9<(c=l(o[p+1].from,!0)*e));)H=l((u=o[++p]).to,!1)*e;H!=g&&(m=Math.max(H-g,3),(f=i.appendChild(document.createElement("div"))).style.cssText="position: absolute; right: 0px; width: "+Math.max(n.display.barWidth-1,2)+"px; top: "+(g+this.buttonHeight)+"px; height: "+m+"px",f.className=this.options.className,u.id&&f.setAttribute("annotation-id",u.id))}}this.div.textContent="",this.div.appendChild(i)},e.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}});
|
2
deps/codemirror/codemirror.min.js
vendored
2
deps/codemirror/codemirror.min.js
vendored
File diff suppressed because one or more lines are too long
2
deps/codemirror/css.min.js
vendored
2
deps/codemirror/css.min.js
vendored
File diff suppressed because one or more lines are too long
2
deps/codemirror/dialog.min.js
vendored
2
deps/codemirror/dialog.min.js
vendored
@ -1 +1 @@
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(s){function f(e,o,n){var e=e.getWrapperElement(),t=e.appendChild(document.createElement("div"));return t.className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof o?t.innerHTML=o:t.appendChild(o),s.addClass(e,"dialog-opened"),t}function p(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}s.defineExtension("openDialog",function(e,o,n){n=n||{},p(this,null);var t=f(this,e,n.bottom),i=!1,r=this;function u(e){"string"==typeof e?l.value=e:i||(i=!0,s.rmClass(t.parentNode,"dialog-opened"),t.parentNode.removeChild(t),r.focus(),n.onClose&&n.onClose(t))}var l=t.getElementsByTagName("input")[0];return l?(l.focus(),n.value&&(l.value=n.value,!1!==n.selectValueOnOpen)&&l.select(),n.onInput&&s.on(l,"input",function(e){n.onInput(e,l.value,u)}),n.onKeyUp&&s.on(l,"keyup",function(e){n.onKeyUp(e,l.value,u)}),s.on(l,"keydown",function(e){n&&n.onKeyDown&&n.onKeyDown(e,l.value,u)||((27==e.keyCode||!1!==n.closeOnEnter&&13==e.keyCode)&&(l.blur(),s.e_stop(e),u()),13==e.keyCode&&o(l.value,e))}),!1!==n.closeOnBlur&&s.on(t,"focusout",function(e){null!==e.relatedTarget&&u()})):(e=t.getElementsByTagName("button")[0])&&(s.on(e,"click",function(){u(),r.focus()}),!1!==n.closeOnBlur&&s.on(e,"blur",u),e.focus()),u}),s.defineExtension("openConfirm",function(e,o,n){p(this,null);var t=f(this,e,n&&n.bottom),i=t.getElementsByTagName("button"),r=!1,u=this,l=1;function a(){r||(r=!0,s.rmClass(t.parentNode,"dialog-opened"),t.parentNode.removeChild(t),u.focus())}i[0].focus();for(var c=0;c<i.length;++c){var d=i[c];!function(o){s.on(d,"click",function(e){s.e_preventDefault(e),a(),o&&o(u)})}(o[c]),s.on(d,"blur",function(){--l,setTimeout(function(){l<=0&&a()},200)}),s.on(d,"focus",function(){++l})}}),s.defineExtension("openNotification",function(e,o){p(this,r);var n,t=f(this,e,o&&o.bottom),i=!1,e=o&&void 0!==o.duration?o.duration:5e3;function r(){i||(i=!0,clearTimeout(n),s.rmClass(t.parentNode,"dialog-opened"),t.parentNode.removeChild(t))}return s.on(t,"click",function(e){s.e_preventDefault(e),r()}),e&&(n=setTimeout(r,e)),r})});
|
||||
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(s){function f(e,o,n){var e=e.getWrapperElement(),t=e.appendChild(document.createElement("div"));return t.className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof o?t.innerHTML=o:t.appendChild(o),s.addClass(e,"dialog-opened"),t}function p(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}s.defineExtension("openDialog",function(e,o,n){n=n||{},p(this,null);var t=f(this,e,n.bottom),i=!1,r=this;function u(e){"string"==typeof e?l.value=e:i||(i=!0,s.rmClass(t.parentNode,"dialog-opened"),t.parentNode.removeChild(t),r.focus(),n.onClose&&n.onClose(t))}var l=t.getElementsByTagName("input")[0];return l?(l.focus(),n.value&&(l.value=n.value,!1!==n.selectValueOnOpen&&l.select()),n.onInput&&s.on(l,"input",function(e){n.onInput(e,l.value,u)}),n.onKeyUp&&s.on(l,"keyup",function(e){n.onKeyUp(e,l.value,u)}),s.on(l,"keydown",function(e){n&&n.onKeyDown&&n.onKeyDown(e,l.value,u)||((27==e.keyCode||!1!==n.closeOnEnter&&13==e.keyCode)&&(l.blur(),s.e_stop(e),u()),13==e.keyCode&&o(l.value,e))}),!1!==n.closeOnBlur&&s.on(t,"focusout",function(e){null!==e.relatedTarget&&u()})):(e=t.getElementsByTagName("button")[0])&&(s.on(e,"click",function(){u(),r.focus()}),!1!==n.closeOnBlur&&s.on(e,"blur",u),e.focus()),u}),s.defineExtension("openConfirm",function(e,o,n){p(this,null);var t=f(this,e,n&&n.bottom),i=t.getElementsByTagName("button"),r=!1,u=this,l=1;function a(){r||(r=!0,s.rmClass(t.parentNode,"dialog-opened"),t.parentNode.removeChild(t),u.focus())}i[0].focus();for(var c=0;c<i.length;++c){var d=i[c];!function(o){s.on(d,"click",function(e){s.e_preventDefault(e),a(),o&&o(u)})}(o[c]),s.on(d,"blur",function(){--l,setTimeout(function(){l<=0&&a()},200)}),s.on(d,"focus",function(){++l})}}),s.defineExtension("openNotification",function(e,o){p(this,r);var n,t=f(this,e,o&&o.bottom),i=!1,e=o&&void 0!==o.duration?o.duration:5e3;function r(){i||(i=!0,clearTimeout(n),s.rmClass(t.parentNode,"dialog-opened"),t.parentNode.removeChild(t))}return s.on(t,"click",function(e){s.e_preventDefault(e),r()}),e&&(n=setTimeout(r,e)),r})});
|
2
deps/codemirror/htmlmixed.min.js
vendored
2
deps/codemirror/htmlmixed.min.js
vendored
@ -1 +1 @@
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],t):t(CodeMirror)}(function(m){"use strict";var l={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var a={};function d(t,e){e=t.match(a[t=e]||(a[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return e?/^\s*(.*?)\s*$/.exec(e[2])[1]:""}function g(t,e){return new RegExp((e?"^":"")+"</\\s*"+t+"\\s*>","i")}function o(t,e){for(var a in t)for(var n=e[a]||(e[a]=[]),l=t[a],o=l.length-1;0<=o;o--)n.unshift(l[o])}m.defineMode("htmlmixed",function(i,t){var c=m.getMode(i,{name:"xml",htmlMode:!0,multilineTagIndentFactor:t.multilineTagIndentFactor,multilineTagIndentPastTag:t.multilineTagIndentPastTag,allowMissingTagName:t.allowMissingTagName}),s={},e=t&&t.tags,a=t&&t.scriptTypes;if(o(l,s),e&&o(e,s),a)for(var n=a.length-1;0<=n;n--)s.script.unshift(["type",a[n].matches,a[n].mode]);function u(t,e){var a,o,r,n=c.token(t,e.htmlState),l=/\btag\b/.test(n);return l&&!/[<>\s\/]/.test(t.current())&&(a=e.htmlState.tagName&&e.htmlState.tagName.toLowerCase())&&s.hasOwnProperty(a)?e.inTag=a+" ":e.inTag&&l&&/>$/.test(t.current())?(a=/^([\S]+) (.*)/.exec(e.inTag),e.inTag=null,l=">"==t.current()&&function(t,e){for(var a=0;a<t.length;a++){var n=t[a];if(!n[0]||n[1].test(d(e,n[0])))return n[2]}}(s[a[1]],a[2]),l=m.getMode(i,l),o=g(a[1],!0),r=g(a[1],!1),e.token=function(t,e){return t.match(o,!1)?(e.token=u,e.localState=e.localMode=null):(a=t,n=r,t=e.localMode.token(t,e.localState),e=a.current(),-1<(l=e.search(n))?a.backUp(e.length-l):e.match(/<\/?$/)&&(a.backUp(e.length),a.match(n,!1)||a.match(e)),t);var a,n,l},e.localMode=l,e.localState=m.startState(l,c.indent(e.htmlState,"",""))):e.inTag&&(e.inTag+=t.current(),t.eol())&&(e.inTag+=" "),n}return{startState:function(){return{token:u,inTag:null,localMode:null,localState:null,htmlState:m.startState(c)}},copyState:function(t){var e;return t.localState&&(e=m.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:e,htmlState:m.copyState(c,t.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(t,e,a){return!t.localMode||/^\s*<\//.test(e)?c.indent(t.htmlState,e,a):t.localMode.indent?t.localMode.indent(t.localState,e,a):m.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||c}}}},"xml","javascript","css"),m.defineMIME("text/html","htmlmixed")});
|
||||
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],t):t(CodeMirror)}(function(m){"use strict";var l={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var a={};function d(t,e){e=t.match(a[t=e]||(a[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return e?/^\s*(.*?)\s*$/.exec(e[2])[1]:""}function g(t,e){return new RegExp((e?"^":"")+"</\\s*"+t+"\\s*>","i")}function o(t,e){for(var a in t)for(var n=e[a]||(e[a]=[]),l=t[a],o=l.length-1;0<=o;o--)n.unshift(l[o])}m.defineMode("htmlmixed",function(i,t){var c=m.getMode(i,{name:"xml",htmlMode:!0,multilineTagIndentFactor:t.multilineTagIndentFactor,multilineTagIndentPastTag:t.multilineTagIndentPastTag,allowMissingTagName:t.allowMissingTagName}),s={},e=t&&t.tags,a=t&&t.scriptTypes;if(o(l,s),e&&o(e,s),a)for(var n=a.length-1;0<=n;n--)s.script.unshift(["type",a[n].matches,a[n].mode]);function u(t,e){var a,o,r,n=c.token(t,e.htmlState),l=/\btag\b/.test(n);return l&&!/[<>\s\/]/.test(t.current())&&(a=e.htmlState.tagName&&e.htmlState.tagName.toLowerCase())&&s.hasOwnProperty(a)?e.inTag=a+" ":e.inTag&&l&&/>$/.test(t.current())?(a=/^([\S]+) (.*)/.exec(e.inTag),e.inTag=null,l=">"==t.current()&&function(t,e){for(var a=0;a<t.length;a++){var n=t[a];if(!n[0]||n[1].test(d(e,n[0])))return n[2]}}(s[a[1]],a[2]),l=m.getMode(i,l),o=g(a[1],!0),r=g(a[1],!1),e.token=function(t,e){return t.match(o,!1)?(e.token=u,e.localState=e.localMode=null):(a=t,n=r,t=e.localMode.token(t,e.localState),e=a.current(),-1<(l=e.search(n))?a.backUp(e.length-l):e.match(/<\/?$/)&&(a.backUp(e.length),a.match(n,!1)||a.match(e)),t);var a,n,l},e.localMode=l,e.localState=m.startState(l,c.indent(e.htmlState,"",""))):e.inTag&&(e.inTag+=t.current(),t.eol()&&(e.inTag+=" ")),n}return{startState:function(){return{token:u,inTag:null,localMode:null,localState:null,htmlState:m.startState(c)}},copyState:function(t){var e;return t.localState&&(e=m.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:e,htmlState:m.copyState(c,t.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(t,e,a){return!t.localMode||/^\s*<\//.test(e)?c.indent(t.htmlState,e,a):t.localMode.indent?t.localMode.indent(t.localState,e,a):m.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||c}}}},"xml","javascript","css"),m.defineMIME("text/html","htmlmixed")});
|
2
deps/codemirror/javascript.min.js
vendored
2
deps/codemirror/javascript.min.js
vendored
File diff suppressed because one or more lines are too long
32076
deps/codemirror/jshint.js
vendored
32076
deps/codemirror/jshint.js
vendored
File diff suppressed because one or more lines are too long
1
deps/codemirror/jshint.min.js
vendored
Normal file
1
deps/codemirror/jshint.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
deps/codemirror/search.min.js
vendored
2
deps/codemirror/search.min.js
vendored
File diff suppressed because one or more lines are too long
2
deps/codemirror/searchcursor.min.js
vendored
2
deps/codemirror/searchcursor.min.js
vendored
File diff suppressed because one or more lines are too long
32
deps/codemirror/update.sh
vendored
32
deps/codemirror/update.sh
vendored
@ -1,20 +1,20 @@
|
||||
LINKS="
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/addon/dialog/dialog.min.css
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/addon/dialog/dialog.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/addon/edit/trailingspace.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/addon/lint/javascript-lint.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/addon/scroll/annotatescrollbar.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/addon/search/matchesonscrollbar.min.css
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/addon/search/matchesonscrollbar.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/addon/search/search.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/addon/search/searchcursor.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/codemirror.min.css
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/codemirror.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/mode/css/css.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/mode/htmlmixed/htmlmixed.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/mode/javascript/javascript.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/mode/xml/xml.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.14/theme/base16-dark.min.css
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/dialog/dialog.min.css
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/dialog/dialog.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/edit/trailingspace.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/lint/javascript-lint.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/scroll/annotatescrollbar.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/search/matchesonscrollbar.min.css
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/search/matchesonscrollbar.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/search/search.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/search/searchcursor.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/css/css.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/htmlmixed/htmlmixed.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/javascript/javascript.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/xml/xml.min.js
|
||||
https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/theme/base16-dark.min.css
|
||||
"
|
||||
|
||||
for link in $LINKS; do
|
||||
|
2
deps/codemirror/xml.min.js
vendored
2
deps/codemirror/xml.min.js
vendored
File diff suppressed because one or more lines are too long
32
deps/libbacktrace/Makefile.am
vendored
32
deps/libbacktrace/Makefile.am
vendored
@ -249,6 +249,7 @@ check_DATA += allocfail.dSYM
|
||||
endif USE_DSYMUTIL
|
||||
|
||||
if HAVE_ELF
|
||||
if HAVE_BUILDID
|
||||
if HAVE_OBJCOPY_DEBUGLINK
|
||||
|
||||
b2test_SOURCES = $(btest_SOURCES)
|
||||
@ -272,6 +273,7 @@ MAKETESTS += b3test_dwz_buildid
|
||||
endif HAVE_DWZ
|
||||
|
||||
endif HAVE_OBJCOPY_DEBUGLINK
|
||||
endif HAVE_BUILDID
|
||||
endif HAVE_ELF
|
||||
|
||||
btest_SOURCES = btest.c testlib.c
|
||||
@ -369,6 +371,25 @@ ztest_alloc_CFLAGS = $(ztest_CFLAGS)
|
||||
|
||||
BUILDTESTS += ztest_alloc
|
||||
|
||||
zstdtest_SOURCES = zstdtest.c testlib.c
|
||||
zstdtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
|
||||
zstdtest_LDADD = libbacktrace.la
|
||||
zstdtest_alloc_LDADD = libbacktrace_alloc.la
|
||||
|
||||
if HAVE_ZSTD
|
||||
zstdtest_LDADD += -lzstd
|
||||
zstdtest_alloc_LDADD += -lzstd
|
||||
endif
|
||||
zstdtest_LDADD += $(CLOCK_GETTIME_LINK)
|
||||
zstdtest_alloc_LDADD += $(CLOCK_GETTIME_LINK)
|
||||
|
||||
BUILDTESTS += zstdtest
|
||||
|
||||
zstdtest_alloc_SOURCES = $(zstdtest_SOURCES)
|
||||
zstdtest_alloc_CFLAGS = $(zstdtest_CFLAGS)
|
||||
|
||||
BUILDTESTS += zstdtest_alloc
|
||||
|
||||
endif HAVE_ELF
|
||||
|
||||
edtest_SOURCES = edtest.c edtest2_build.c testlib.c
|
||||
@ -451,6 +472,17 @@ ctesta_LDADD = libbacktrace.la
|
||||
|
||||
BUILDTESTS += ctestg ctesta
|
||||
|
||||
if HAVE_COMPRESSED_DEBUG_ZSTD
|
||||
|
||||
ctestzstd_SOURCES = btest.c testlib.c
|
||||
ctestzstd_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
ctestzstd_LDFLAGS = -Wl,--compress-debug-sections=zstd
|
||||
ctestzstd_LDADD = libbacktrace.la
|
||||
|
||||
BUILDTESTS += ctestzstd
|
||||
|
||||
endif
|
||||
|
||||
ctestg_alloc_SOURCES = $(ctestg_SOURCES)
|
||||
ctestg_alloc_CFLAGS = $(ctestg_CFLAGS)
|
||||
ctestg_alloc_LDFLAGS = $(ctestg_LDFLAGS)
|
||||
|
234
deps/libbacktrace/Makefile.in
vendored
234
deps/libbacktrace/Makefile.in
vendored
@ -122,8 +122,8 @@ build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
|
||||
$(am__EXEEXT_14)
|
||||
TESTS = $(am__append_4) $(MAKETESTS) $(am__EXEEXT_14)
|
||||
$(am__EXEEXT_16)
|
||||
TESTS = $(am__append_4) $(MAKETESTS) $(am__EXEEXT_16)
|
||||
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_1 = libbacktrace_elf_for_test.la
|
||||
@NATIVE_TRUE@am__append_2 = test_elf_32 test_elf_64 test_macho \
|
||||
@NATIVE_TRUE@ test_xcoff_32 test_xcoff_64 test_pecoff \
|
||||
@ -134,36 +134,39 @@ TESTS = $(am__append_4) $(MAKETESTS) $(am__EXEEXT_14)
|
||||
@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ btest.dSYM btest_alloc.dSYM \
|
||||
@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ stest.dSYM stest_alloc.dSYM \
|
||||
@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ edtest.dSYM edtest_alloc.dSYM
|
||||
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_6 = b2test
|
||||
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_7 = b2test_buildid
|
||||
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_8 = b3test
|
||||
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_9 = b3test_dwz_buildid
|
||||
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_6 = b2test
|
||||
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_7 = b2test_buildid
|
||||
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_8 = b3test
|
||||
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_9 = b3test_dwz_buildid
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__append_10 = btest_lto
|
||||
@NATIVE_TRUE@am__append_11 = btest_alloc stest stest_alloc
|
||||
@HAVE_DWZ_TRUE@@NATIVE_TRUE@am__append_12 = btest_dwz
|
||||
@HAVE_DWZ_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_13 = btest_dwz_gnudebuglink
|
||||
@HAVE_ELF_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_TRUE@am__append_14 = -lz
|
||||
@HAVE_ELF_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_TRUE@am__append_15 = -lz
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__append_16 = ztest ztest_alloc
|
||||
@NATIVE_TRUE@am__append_17 = edtest edtest_alloc
|
||||
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__append_18 = ttest ttest_alloc
|
||||
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_19 = \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__append_16 = ztest ztest_alloc zstdtest \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest_alloc
|
||||
@HAVE_ELF_TRUE@@HAVE_ZSTD_TRUE@@NATIVE_TRUE@am__append_17 = -lzstd
|
||||
@HAVE_ELF_TRUE@@HAVE_ZSTD_TRUE@@NATIVE_TRUE@am__append_18 = -lzstd
|
||||
@NATIVE_TRUE@am__append_19 = edtest edtest_alloc
|
||||
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__append_20 = ttest ttest_alloc
|
||||
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_21 = \
|
||||
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ ttest.dSYM \
|
||||
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ ttest_alloc.dSYM
|
||||
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_20 = btest_gnudebuglink
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__append_21 = ctestg ctesta \
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctestg_alloc \
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta_alloc
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__append_22 = dwarf5 dwarf5_alloc
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_23 = \
|
||||
@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_22 = btest_gnudebuglink
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__append_23 = ctestg ctesta
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@am__append_24 = ctestzstd
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__append_25 = ctestg_alloc ctesta_alloc
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__append_26 = dwarf5 dwarf5_alloc
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_27 = \
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ dwarf5.dSYM \
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ dwarf5_alloc.dSYM
|
||||
@NATIVE_TRUE@am__append_24 = mtest
|
||||
@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_25 = mtest.dSYM
|
||||
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@am__append_26 = mtest_minidebug
|
||||
@HAVE_ELF_TRUE@@HAVE_LIBLZMA_TRUE@am__append_27 = -llzma
|
||||
@HAVE_ELF_TRUE@@HAVE_LIBLZMA_TRUE@am__append_28 = -llzma
|
||||
@HAVE_ELF_TRUE@am__append_29 = xztest xztest_alloc
|
||||
@NATIVE_TRUE@am__append_28 = mtest
|
||||
@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_29 = mtest.dSYM
|
||||
@HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@am__append_30 = mtest_minidebug
|
||||
@HAVE_ELF_TRUE@@HAVE_LIBLZMA_TRUE@am__append_31 = -llzma
|
||||
@HAVE_ELF_TRUE@@HAVE_LIBLZMA_TRUE@am__append_32 = -llzma
|
||||
@HAVE_ELF_TRUE@am__append_33 = xztest xztest_alloc
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/lead-dot.m4 \
|
||||
@ -246,8 +249,8 @@ libbacktrace_noformat_la_OBJECTS = \
|
||||
$(am_libbacktrace_noformat_la_OBJECTS)
|
||||
@NATIVE_TRUE@am_libbacktrace_noformat_la_rpath =
|
||||
@NATIVE_TRUE@am__EXEEXT_1 = allocfail$(EXEEXT)
|
||||
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__EXEEXT_2 = b2test$(EXEEXT)
|
||||
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__EXEEXT_3 = b3test$(EXEEXT)
|
||||
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__EXEEXT_2 = b2test$(EXEEXT)
|
||||
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__EXEEXT_3 = b3test$(EXEEXT)
|
||||
@NATIVE_TRUE@am__EXEEXT_4 = test_elf_32$(EXEEXT) test_elf_64$(EXEEXT) \
|
||||
@NATIVE_TRUE@ test_macho$(EXEEXT) test_xcoff_32$(EXEEXT) \
|
||||
@NATIVE_TRUE@ test_xcoff_64$(EXEEXT) test_pecoff$(EXEEXT) \
|
||||
@ -257,23 +260,26 @@ libbacktrace_noformat_la_OBJECTS = \
|
||||
@NATIVE_TRUE@am__EXEEXT_6 = btest_alloc$(EXEEXT) stest$(EXEEXT) \
|
||||
@NATIVE_TRUE@ stest_alloc$(EXEEXT)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__EXEEXT_7 = ztest$(EXEEXT) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ ztest_alloc$(EXEEXT)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ ztest_alloc$(EXEEXT) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest$(EXEEXT) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest_alloc$(EXEEXT)
|
||||
@NATIVE_TRUE@am__EXEEXT_8 = edtest$(EXEEXT) edtest_alloc$(EXEEXT)
|
||||
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__EXEEXT_9 = ttest$(EXEEXT) \
|
||||
@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ ttest_alloc$(EXEEXT)
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__EXEEXT_10 = \
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctestg$(EXEEXT) \
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta$(EXEEXT) \
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctestg_alloc$(EXEEXT) \
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta$(EXEEXT)
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@am__EXEEXT_11 = ctestzstd$(EXEEXT)
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__EXEEXT_12 = ctestg_alloc$(EXEEXT) \
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta_alloc$(EXEEXT)
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__EXEEXT_11 = dwarf5$(EXEEXT) \
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__EXEEXT_13 = dwarf5$(EXEEXT) \
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@ dwarf5_alloc$(EXEEXT)
|
||||
@NATIVE_TRUE@am__EXEEXT_12 = mtest$(EXEEXT)
|
||||
@HAVE_ELF_TRUE@am__EXEEXT_13 = xztest$(EXEEXT) xztest_alloc$(EXEEXT)
|
||||
am__EXEEXT_14 = $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
|
||||
@NATIVE_TRUE@am__EXEEXT_14 = mtest$(EXEEXT)
|
||||
@HAVE_ELF_TRUE@am__EXEEXT_15 = xztest$(EXEEXT) xztest_alloc$(EXEEXT)
|
||||
am__EXEEXT_16 = $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
|
||||
$(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \
|
||||
$(am__EXEEXT_10) $(am__EXEEXT_11) $(am__EXEEXT_12) \
|
||||
$(am__EXEEXT_13)
|
||||
$(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15)
|
||||
@NATIVE_TRUE@am_allocfail_OBJECTS = allocfail-allocfail.$(OBJEXT) \
|
||||
@NATIVE_TRUE@ allocfail-testlib.$(OBJEXT)
|
||||
allocfail_OBJECTS = $(am_allocfail_OBJECTS)
|
||||
@ -284,17 +290,17 @@ allocfail_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@NATIVE_TRUE@am__objects_2 = b2test-btest.$(OBJEXT) \
|
||||
@NATIVE_TRUE@ b2test-testlib.$(OBJEXT)
|
||||
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am_b2test_OBJECTS = $(am__objects_2)
|
||||
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am_b2test_OBJECTS = $(am__objects_2)
|
||||
b2test_OBJECTS = $(am_b2test_OBJECTS)
|
||||
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_DEPENDENCIES = libbacktrace_elf_for_test.la
|
||||
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_DEPENDENCIES = libbacktrace_elf_for_test.la
|
||||
b2test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(b2test_CFLAGS) $(CFLAGS) \
|
||||
$(b2test_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@NATIVE_TRUE@am__objects_3 = b3test-btest.$(OBJEXT) \
|
||||
@NATIVE_TRUE@ b3test-testlib.$(OBJEXT)
|
||||
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am_b3test_OBJECTS = $(am__objects_3)
|
||||
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am_b3test_OBJECTS = $(am__objects_3)
|
||||
b3test_OBJECTS = $(am_b3test_OBJECTS)
|
||||
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_DEPENDENCIES = libbacktrace_elf_for_test.la
|
||||
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_DEPENDENCIES = libbacktrace_elf_for_test.la
|
||||
b3test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(b3test_CFLAGS) $(CFLAGS) \
|
||||
$(b3test_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@ -355,6 +361,13 @@ ctestg_alloc_OBJECTS = $(am_ctestg_alloc_OBJECTS)
|
||||
ctestg_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ctestg_alloc_CFLAGS) \
|
||||
$(CFLAGS) $(ctestg_alloc_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@am_ctestzstd_OBJECTS = ctestzstd-btest.$(OBJEXT) \
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ ctestzstd-testlib.$(OBJEXT)
|
||||
ctestzstd_OBJECTS = $(am_ctestzstd_OBJECTS)
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_DEPENDENCIES = libbacktrace.la
|
||||
ctestzstd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ctestzstd_CFLAGS) \
|
||||
$(CFLAGS) $(ctestzstd_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am_dwarf5_OBJECTS = \
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@ dwarf5-btest.$(OBJEXT) \
|
||||
@HAVE_DWARF5_TRUE@@NATIVE_TRUE@ dwarf5-testlib.$(OBJEXT)
|
||||
@ -525,6 +538,30 @@ xztest_alloc_OBJECTS = $(am_xztest_alloc_OBJECTS)
|
||||
xztest_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(xztest_alloc_CFLAGS) \
|
||||
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am_zstdtest_OBJECTS = \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest-zstdtest.$(OBJEXT) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest-testlib.$(OBJEXT)
|
||||
zstdtest_OBJECTS = $(am_zstdtest_OBJECTS)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_DEPENDENCIES = libbacktrace.la \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__DEPENDENCIES_1) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__DEPENDENCIES_1)
|
||||
zstdtest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(zstdtest_CFLAGS) \
|
||||
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__objects_13 = \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest_alloc-zstdtest.$(OBJEXT) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ zstdtest_alloc-testlib.$(OBJEXT)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am_zstdtest_alloc_OBJECTS = \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__objects_13)
|
||||
zstdtest_alloc_OBJECTS = $(am_zstdtest_alloc_OBJECTS)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_alloc_DEPENDENCIES = \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ libbacktrace_alloc.la \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__DEPENDENCIES_1) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__DEPENDENCIES_1)
|
||||
zstdtest_alloc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
||||
$(zstdtest_alloc_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \
|
||||
$@
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am_ztest_OBJECTS = ztest-ztest.$(OBJEXT) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ ztest-testlib.$(OBJEXT)
|
||||
ztest_OBJECTS = $(am_ztest_OBJECTS)
|
||||
@ -534,11 +571,11 @@ ztest_OBJECTS = $(am_ztest_OBJECTS)
|
||||
ztest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ztest_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__objects_13 = \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am__objects_14 = \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ ztest_alloc-ztest.$(OBJEXT) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ ztest_alloc-testlib.$(OBJEXT)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@am_ztest_alloc_OBJECTS = \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__objects_13)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__objects_14)
|
||||
ztest_alloc_OBJECTS = $(am_ztest_alloc_OBJECTS)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_alloc_DEPENDENCIES = \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ libbacktrace_alloc.la \
|
||||
@ -588,7 +625,7 @@ SOURCES = $(libbacktrace_la_SOURCES) $(EXTRA_libbacktrace_la_SOURCES) \
|
||||
$(b2test_SOURCES) $(b3test_SOURCES) $(btest_SOURCES) \
|
||||
$(btest_alloc_SOURCES) $(btest_lto_SOURCES) $(ctesta_SOURCES) \
|
||||
$(ctesta_alloc_SOURCES) $(ctestg_SOURCES) \
|
||||
$(ctestg_alloc_SOURCES) $(dwarf5_SOURCES) \
|
||||
$(ctestg_alloc_SOURCES) $(ctestzstd_SOURCES) $(dwarf5_SOURCES) \
|
||||
$(dwarf5_alloc_SOURCES) $(edtest_SOURCES) \
|
||||
$(edtest_alloc_SOURCES) $(mtest_SOURCES) $(stest_SOURCES) \
|
||||
$(stest_alloc_SOURCES) $(test_elf_32_SOURCES) \
|
||||
@ -597,7 +634,8 @@ SOURCES = $(libbacktrace_la_SOURCES) $(EXTRA_libbacktrace_la_SOURCES) \
|
||||
$(test_xcoff_32_SOURCES) $(test_xcoff_64_SOURCES) \
|
||||
$(ttest_SOURCES) $(ttest_alloc_SOURCES) $(unittest_SOURCES) \
|
||||
$(unittest_alloc_SOURCES) $(xztest_SOURCES) \
|
||||
$(xztest_alloc_SOURCES) $(ztest_SOURCES) \
|
||||
$(xztest_alloc_SOURCES) $(zstdtest_SOURCES) \
|
||||
$(zstdtest_alloc_SOURCES) $(ztest_SOURCES) \
|
||||
$(ztest_alloc_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
@ -988,18 +1026,18 @@ libbacktrace_la_DEPENDENCIES = $(libbacktrace_la_LIBADD)
|
||||
# Add a test to this variable if you want it to be built as a Makefile
|
||||
# target and run.
|
||||
MAKETESTS = $(am__append_7) $(am__append_9) $(am__append_12) \
|
||||
$(am__append_13) $(am__append_20) $(am__append_26)
|
||||
$(am__append_13) $(am__append_22) $(am__append_30)
|
||||
|
||||
# Add a test to this variable if you want it to be built as a program,
|
||||
# with SOURCES, etc., and run.
|
||||
BUILDTESTS = $(am__append_2) $(am__append_10) $(am__append_11) \
|
||||
$(am__append_16) $(am__append_17) $(am__append_18) \
|
||||
$(am__append_21) $(am__append_22) $(am__append_24) \
|
||||
$(am__append_29)
|
||||
$(am__append_16) $(am__append_19) $(am__append_20) \
|
||||
$(am__append_23) $(am__append_24) $(am__append_25) \
|
||||
$(am__append_26) $(am__append_28) $(am__append_33)
|
||||
|
||||
# Add a file to this variable if you want it to be built for testing.
|
||||
check_DATA = $(am__append_5) $(am__append_19) $(am__append_23) \
|
||||
$(am__append_25)
|
||||
check_DATA = $(am__append_5) $(am__append_21) $(am__append_27) \
|
||||
$(am__append_29)
|
||||
|
||||
# Flags to use when compiling test programs.
|
||||
libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
|
||||
@ -1054,14 +1092,14 @@ libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
|
||||
@NATIVE_TRUE@allocfail_SOURCES = allocfail.c testlib.c
|
||||
@NATIVE_TRUE@allocfail_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
@NATIVE_TRUE@allocfail_LDADD = libbacktrace_instrumented_alloc.la
|
||||
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_SOURCES = $(btest_SOURCES)
|
||||
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_LDFLAGS = -Wl,--build-id
|
||||
@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_LDADD = libbacktrace_elf_for_test.la
|
||||
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_SOURCES = $(btest_SOURCES)
|
||||
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_LDFLAGS = -Wl,--build-id
|
||||
@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_LDADD = libbacktrace_elf_for_test.la
|
||||
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_SOURCES = $(btest_SOURCES)
|
||||
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_LDFLAGS = -Wl,--build-id
|
||||
@HAVE_BUILDID_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b2test_LDADD = libbacktrace_elf_for_test.la
|
||||
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_SOURCES = $(btest_SOURCES)
|
||||
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_LDFLAGS = -Wl,--build-id
|
||||
@HAVE_BUILDID_TRUE@@HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@b3test_LDADD = libbacktrace_elf_for_test.la
|
||||
@NATIVE_TRUE@btest_SOURCES = btest.c testlib.c
|
||||
@NATIVE_TRUE@btest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -O
|
||||
@NATIVE_TRUE@btest_LDADD = libbacktrace.la
|
||||
@ -1087,6 +1125,17 @@ libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(CLOCK_GETTIME_LINK)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_alloc_SOURCES = $(ztest_SOURCES)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ztest_alloc_CFLAGS = $(ztest_CFLAGS)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_SOURCES = zstdtest.c testlib.c
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_LDADD = libbacktrace.la \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__append_17) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(CLOCK_GETTIME_LINK)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_alloc_LDADD = \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ libbacktrace_alloc.la \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(am__append_18) \
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@ $(CLOCK_GETTIME_LINK)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_alloc_SOURCES = $(zstdtest_SOURCES)
|
||||
@HAVE_ELF_TRUE@@NATIVE_TRUE@zstdtest_alloc_CFLAGS = $(zstdtest_CFLAGS)
|
||||
@NATIVE_TRUE@edtest_SOURCES = edtest.c edtest2_build.c testlib.c
|
||||
@NATIVE_TRUE@edtest_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
@NATIVE_TRUE@edtest_LDADD = libbacktrace.la
|
||||
@ -1107,6 +1156,10 @@ libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDFLAGS = -Wl,--compress-debug-sections=zlib-gabi
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctesta_LDADD = libbacktrace.la
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_SOURCES = btest.c testlib.c
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_CFLAGS = $(libbacktrace_TEST_CFLAGS)
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_LDFLAGS = -Wl,--compress-debug-sections=zstd
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@HAVE_COMPRESSED_DEBUG_ZSTD_TRUE@@NATIVE_TRUE@ctestzstd_LDADD = libbacktrace.la
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_alloc_SOURCES = $(ctestg_SOURCES)
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_alloc_CFLAGS = $(ctestg_CFLAGS)
|
||||
@HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ctestg_alloc_LDFLAGS = $(ctestg_LDFLAGS)
|
||||
@ -1126,12 +1179,12 @@ libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g
|
||||
@NATIVE_TRUE@mtest_LDADD = libbacktrace.la
|
||||
@HAVE_ELF_TRUE@xztest_SOURCES = xztest.c testlib.c
|
||||
@HAVE_ELF_TRUE@xztest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -DSRCDIR=\"$(srcdir)\"
|
||||
@HAVE_ELF_TRUE@xztest_LDADD = libbacktrace.la $(am__append_27) \
|
||||
@HAVE_ELF_TRUE@xztest_LDADD = libbacktrace.la $(am__append_31) \
|
||||
@HAVE_ELF_TRUE@ $(CLOCK_GETTIME_LINK)
|
||||
@HAVE_ELF_TRUE@xztest_alloc_SOURCES = $(xztest_SOURCES)
|
||||
@HAVE_ELF_TRUE@xztest_alloc_CFLAGS = $(xztest_CFLAGS)
|
||||
@HAVE_ELF_TRUE@xztest_alloc_LDADD = libbacktrace_alloc.la \
|
||||
@HAVE_ELF_TRUE@ $(am__append_28) $(CLOCK_GETTIME_LINK)
|
||||
@HAVE_ELF_TRUE@ $(am__append_32) $(CLOCK_GETTIME_LINK)
|
||||
CLEANFILES = \
|
||||
$(MAKETESTS) $(BUILDTESTS) *.debug elf_for_test.c edtest2_build.c \
|
||||
gen_edtest2_build \
|
||||
@ -1305,6 +1358,10 @@ ctestg_alloc$(EXEEXT): $(ctestg_alloc_OBJECTS) $(ctestg_alloc_DEPENDENCIES) $(EX
|
||||
@rm -f ctestg_alloc$(EXEEXT)
|
||||
$(AM_V_CCLD)$(ctestg_alloc_LINK) $(ctestg_alloc_OBJECTS) $(ctestg_alloc_LDADD) $(LIBS)
|
||||
|
||||
ctestzstd$(EXEEXT): $(ctestzstd_OBJECTS) $(ctestzstd_DEPENDENCIES) $(EXTRA_ctestzstd_DEPENDENCIES)
|
||||
@rm -f ctestzstd$(EXEEXT)
|
||||
$(AM_V_CCLD)$(ctestzstd_LINK) $(ctestzstd_OBJECTS) $(ctestzstd_LDADD) $(LIBS)
|
||||
|
||||
dwarf5$(EXEEXT): $(dwarf5_OBJECTS) $(dwarf5_DEPENDENCIES) $(EXTRA_dwarf5_DEPENDENCIES)
|
||||
@rm -f dwarf5$(EXEEXT)
|
||||
$(AM_V_CCLD)$(dwarf5_LINK) $(dwarf5_OBJECTS) $(dwarf5_LDADD) $(LIBS)
|
||||
@ -1385,6 +1442,14 @@ xztest_alloc$(EXEEXT): $(xztest_alloc_OBJECTS) $(xztest_alloc_DEPENDENCIES) $(EX
|
||||
@rm -f xztest_alloc$(EXEEXT)
|
||||
$(AM_V_CCLD)$(xztest_alloc_LINK) $(xztest_alloc_OBJECTS) $(xztest_alloc_LDADD) $(LIBS)
|
||||
|
||||
zstdtest$(EXEEXT): $(zstdtest_OBJECTS) $(zstdtest_DEPENDENCIES) $(EXTRA_zstdtest_DEPENDENCIES)
|
||||
@rm -f zstdtest$(EXEEXT)
|
||||
$(AM_V_CCLD)$(zstdtest_LINK) $(zstdtest_OBJECTS) $(zstdtest_LDADD) $(LIBS)
|
||||
|
||||
zstdtest_alloc$(EXEEXT): $(zstdtest_alloc_OBJECTS) $(zstdtest_alloc_DEPENDENCIES) $(EXTRA_zstdtest_alloc_DEPENDENCIES)
|
||||
@rm -f zstdtest_alloc$(EXEEXT)
|
||||
$(AM_V_CCLD)$(zstdtest_alloc_LINK) $(zstdtest_alloc_OBJECTS) $(zstdtest_alloc_LDADD) $(LIBS)
|
||||
|
||||
ztest$(EXEEXT): $(ztest_OBJECTS) $(ztest_DEPENDENCIES) $(EXTRA_ztest_DEPENDENCIES)
|
||||
@rm -f ztest$(EXEEXT)
|
||||
$(AM_V_CCLD)$(ztest_LINK) $(ztest_OBJECTS) $(ztest_LDADD) $(LIBS)
|
||||
@ -1528,6 +1593,18 @@ ctestg_alloc-testlib.o: testlib.c
|
||||
ctestg_alloc-testlib.obj: testlib.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ctestg_alloc_CFLAGS) $(CFLAGS) -c -o ctestg_alloc-testlib.obj `if test -f 'testlib.c'; then $(CYGPATH_W) 'testlib.c'; else $(CYGPATH_W) '$(srcdir)/testlib.c'; fi`
|
||||
|
||||
ctestzstd-btest.o: btest.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ctestzstd_CFLAGS) $(CFLAGS) -c -o ctestzstd-btest.o `test -f 'btest.c' || echo '$(srcdir)/'`btest.c
|
||||
|
||||
ctestzstd-btest.obj: btest.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ctestzstd_CFLAGS) $(CFLAGS) -c -o ctestzstd-btest.obj `if test -f 'btest.c'; then $(CYGPATH_W) 'btest.c'; else $(CYGPATH_W) '$(srcdir)/btest.c'; fi`
|
||||
|
||||
ctestzstd-testlib.o: testlib.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ctestzstd_CFLAGS) $(CFLAGS) -c -o ctestzstd-testlib.o `test -f 'testlib.c' || echo '$(srcdir)/'`testlib.c
|
||||
|
||||
ctestzstd-testlib.obj: testlib.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ctestzstd_CFLAGS) $(CFLAGS) -c -o ctestzstd-testlib.obj `if test -f 'testlib.c'; then $(CYGPATH_W) 'testlib.c'; else $(CYGPATH_W) '$(srcdir)/testlib.c'; fi`
|
||||
|
||||
dwarf5-btest.o: btest.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dwarf5_CFLAGS) $(CFLAGS) -c -o dwarf5-btest.o `test -f 'btest.c' || echo '$(srcdir)/'`btest.c
|
||||
|
||||
@ -1768,6 +1845,30 @@ xztest_alloc-testlib.o: testlib.c
|
||||
xztest_alloc-testlib.obj: testlib.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xztest_alloc_CFLAGS) $(CFLAGS) -c -o xztest_alloc-testlib.obj `if test -f 'testlib.c'; then $(CYGPATH_W) 'testlib.c'; else $(CYGPATH_W) '$(srcdir)/testlib.c'; fi`
|
||||
|
||||
zstdtest-zstdtest.o: zstdtest.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_CFLAGS) $(CFLAGS) -c -o zstdtest-zstdtest.o `test -f 'zstdtest.c' || echo '$(srcdir)/'`zstdtest.c
|
||||
|
||||
zstdtest-zstdtest.obj: zstdtest.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_CFLAGS) $(CFLAGS) -c -o zstdtest-zstdtest.obj `if test -f 'zstdtest.c'; then $(CYGPATH_W) 'zstdtest.c'; else $(CYGPATH_W) '$(srcdir)/zstdtest.c'; fi`
|
||||
|
||||
zstdtest-testlib.o: testlib.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_CFLAGS) $(CFLAGS) -c -o zstdtest-testlib.o `test -f 'testlib.c' || echo '$(srcdir)/'`testlib.c
|
||||
|
||||
zstdtest-testlib.obj: testlib.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_CFLAGS) $(CFLAGS) -c -o zstdtest-testlib.obj `if test -f 'testlib.c'; then $(CYGPATH_W) 'testlib.c'; else $(CYGPATH_W) '$(srcdir)/testlib.c'; fi`
|
||||
|
||||
zstdtest_alloc-zstdtest.o: zstdtest.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_alloc_CFLAGS) $(CFLAGS) -c -o zstdtest_alloc-zstdtest.o `test -f 'zstdtest.c' || echo '$(srcdir)/'`zstdtest.c
|
||||
|
||||
zstdtest_alloc-zstdtest.obj: zstdtest.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_alloc_CFLAGS) $(CFLAGS) -c -o zstdtest_alloc-zstdtest.obj `if test -f 'zstdtest.c'; then $(CYGPATH_W) 'zstdtest.c'; else $(CYGPATH_W) '$(srcdir)/zstdtest.c'; fi`
|
||||
|
||||
zstdtest_alloc-testlib.o: testlib.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_alloc_CFLAGS) $(CFLAGS) -c -o zstdtest_alloc-testlib.o `test -f 'testlib.c' || echo '$(srcdir)/'`testlib.c
|
||||
|
||||
zstdtest_alloc-testlib.obj: testlib.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zstdtest_alloc_CFLAGS) $(CFLAGS) -c -o zstdtest_alloc-testlib.obj `if test -f 'testlib.c'; then $(CYGPATH_W) 'testlib.c'; else $(CYGPATH_W) '$(srcdir)/testlib.c'; fi`
|
||||
|
||||
ztest-ztest.o: ztest.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ztest_CFLAGS) $(CFLAGS) -c -o ztest-ztest.o `test -f 'ztest.c' || echo '$(srcdir)/'`ztest.c
|
||||
|
||||
@ -2183,6 +2284,20 @@ ztest_alloc.log: ztest_alloc$(EXEEXT)
|
||||
--log-file $$b.log --trs-file $$b.trs \
|
||||
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
"$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
zstdtest.log: zstdtest$(EXEEXT)
|
||||
@p='zstdtest$(EXEEXT)'; \
|
||||
b='zstdtest'; \
|
||||
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
--log-file $$b.log --trs-file $$b.trs \
|
||||
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
"$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
zstdtest_alloc.log: zstdtest_alloc$(EXEEXT)
|
||||
@p='zstdtest_alloc$(EXEEXT)'; \
|
||||
b='zstdtest_alloc'; \
|
||||
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
--log-file $$b.log --trs-file $$b.trs \
|
||||
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
"$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
edtest.log: edtest$(EXEEXT)
|
||||
@p='edtest$(EXEEXT)'; \
|
||||
b='edtest'; \
|
||||
@ -2225,6 +2340,13 @@ ctesta.log: ctesta$(EXEEXT)
|
||||
--log-file $$b.log --trs-file $$b.trs \
|
||||
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
"$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
ctestzstd.log: ctestzstd$(EXEEXT)
|
||||
@p='ctestzstd$(EXEEXT)'; \
|
||||
b='ctestzstd'; \
|
||||
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
--log-file $$b.log --trs-file $$b.trs \
|
||||
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
"$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
ctestg_alloc.log: ctestg_alloc$(EXEEXT)
|
||||
@p='ctestg_alloc$(EXEEXT)'; \
|
||||
b='ctestg_alloc'; \
|
||||
|
7
deps/libbacktrace/config.h.in
vendored
7
deps/libbacktrace/config.h.in
vendored
@ -20,6 +20,10 @@
|
||||
don't. */
|
||||
#undef HAVE_DECL_STRNLEN
|
||||
|
||||
/* Define to 1 if you have the declaration of `_pgmptr', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL__PGMPTR
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
@ -103,6 +107,9 @@
|
||||
/* Define if -lz is available. */
|
||||
#undef HAVE_ZLIB
|
||||
|
||||
/* Define if -lzstd is available. */
|
||||
#undef HAVE_ZSTD
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
162
deps/libbacktrace/configure
vendored
162
deps/libbacktrace/configure
vendored
@ -651,8 +651,14 @@ HAVE_OBJCOPY_DEBUGLINK_FALSE
|
||||
HAVE_OBJCOPY_DEBUGLINK_TRUE
|
||||
READELF
|
||||
OBJCOPY
|
||||
HAVE_COMPRESSED_DEBUG_ZSTD_FALSE
|
||||
HAVE_COMPRESSED_DEBUG_ZSTD_TRUE
|
||||
HAVE_ZSTD_FALSE
|
||||
HAVE_ZSTD_TRUE
|
||||
HAVE_COMPRESSED_DEBUG_FALSE
|
||||
HAVE_COMPRESSED_DEBUG_TRUE
|
||||
HAVE_BUILDID_FALSE
|
||||
HAVE_BUILDID_TRUE
|
||||
HAVE_ZLIB_FALSE
|
||||
HAVE_ZLIB_TRUE
|
||||
HAVE_DWARF5_FALSE
|
||||
@ -11272,7 +11278,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11275 "configure"
|
||||
#line 11281 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -11378,7 +11384,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 11381 "configure"
|
||||
#line 11387 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -12511,6 +12517,19 @@ $as_echo "#define HAVE_GETEXECNAME 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# Check for _pgmptr variable, contains the executable filename on windows
|
||||
ac_fn_c_check_decl "$LINENO" "_pgmptr" "ac_cv_have_decl__pgmptr" "$ac_includes_default"
|
||||
if test "x$ac_cv_have_decl__pgmptr" = xyes; then :
|
||||
ac_have_decl=1
|
||||
else
|
||||
ac_have_decl=0
|
||||
fi
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_DECL__PGMPTR $ac_have_decl
|
||||
_ACEOF
|
||||
|
||||
|
||||
# Check for sysctl definitions.
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for KERN_PROC" >&5
|
||||
@ -12770,6 +12789,44 @@ else
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --build-id is supported" >&5
|
||||
$as_echo_n "checking whether --build-id is supported... " >&6; }
|
||||
if ${libbacktrace_cv_ld_buildid+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
LDFLAGS_hold=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -Wl,--build-id"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
libbacktrace_cv_ld_buildid=yes
|
||||
else
|
||||
libbacktrace_cv_ld_buildid=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LDFLAGS=$LDFLAGS_hold
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libbacktrace_cv_ld_buildid" >&5
|
||||
$as_echo "$libbacktrace_cv_ld_buildid" >&6; }
|
||||
if test "$libbacktrace_cv_ld_buildid" = yes; then
|
||||
HAVE_BUILDID_TRUE=
|
||||
HAVE_BUILDID_FALSE='#'
|
||||
else
|
||||
HAVE_BUILDID_TRUE='#'
|
||||
HAVE_BUILDID_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --compress-debug-sections is supported" >&5
|
||||
$as_echo_n "checking whether --compress-debug-sections is supported... " >&6; }
|
||||
if ${libgo_cv_ld_compress+:} false; then :
|
||||
@ -12808,6 +12865,95 @@ else
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZSTD_compress in -lzstd" >&5
|
||||
$as_echo_n "checking for ZSTD_compress in -lzstd... " >&6; }
|
||||
if ${ac_cv_lib_zstd_ZSTD_compress+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lzstd $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 ZSTD_compress ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return ZSTD_compress ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_zstd_ZSTD_compress=yes
|
||||
else
|
||||
ac_cv_lib_zstd_ZSTD_compress=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_zstd_ZSTD_compress" >&5
|
||||
$as_echo "$ac_cv_lib_zstd_ZSTD_compress" >&6; }
|
||||
if test "x$ac_cv_lib_zstd_ZSTD_compress" = xyes; then :
|
||||
|
||||
$as_echo "#define HAVE_ZSTD 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
if test "$ac_cv_lib_zstd_ZSTD_compress" = yes; then
|
||||
HAVE_ZSTD_TRUE=
|
||||
HAVE_ZSTD_FALSE='#'
|
||||
else
|
||||
HAVE_ZSTD_TRUE='#'
|
||||
HAVE_ZSTD_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --compress-debug-sections=zstd is supported" >&5
|
||||
$as_echo_n "checking whether --compress-debug-sections=zstd is supported... " >&6; }
|
||||
if ${libgo_cv_ld_compress_zstd+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
LDFLAGS_hold=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -Wl,--compress-debug-sections=zstd"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
libgo_cv_ld_compress_zstd=yes
|
||||
else
|
||||
libgo_cv_ld_compress_zstd=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LDFLAGS=$LDFLAGS_hold
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_ld_compress_zstd" >&5
|
||||
$as_echo "$libgo_cv_ld_compress_zstd" >&6; }
|
||||
if test "$libgo_cv_ld_compress_zstd" = yes; then
|
||||
HAVE_COMPRESSED_DEBUG_ZSTD_TRUE=
|
||||
HAVE_COMPRESSED_DEBUG_ZSTD_FALSE='#'
|
||||
else
|
||||
HAVE_COMPRESSED_DEBUG_ZSTD_TRUE='#'
|
||||
HAVE_COMPRESSED_DEBUG_ZSTD_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Extract the first word of "objcopy", so it can be a program name with args.
|
||||
set dummy objcopy; ac_word=$2
|
||||
@ -13350,10 +13496,22 @@ if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then
|
||||
as_fn_error $? "conditional \"HAVE_ZLIB\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${HAVE_BUILDID_TRUE}" && test -z "${HAVE_BUILDID_FALSE}"; then
|
||||
as_fn_error $? "conditional \"HAVE_BUILDID\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${HAVE_COMPRESSED_DEBUG_TRUE}" && test -z "${HAVE_COMPRESSED_DEBUG_FALSE}"; then
|
||||
as_fn_error $? "conditional \"HAVE_COMPRESSED_DEBUG\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${HAVE_ZSTD_TRUE}" && test -z "${HAVE_ZSTD_FALSE}"; then
|
||||
as_fn_error $? "conditional \"HAVE_ZSTD\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${HAVE_COMPRESSED_DEBUG_ZSTD_TRUE}" && test -z "${HAVE_COMPRESSED_DEBUG_ZSTD_FALSE}"; then
|
||||
as_fn_error $? "conditional \"HAVE_COMPRESSED_DEBUG_ZSTD\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${HAVE_OBJCOPY_DEBUGLINK_TRUE}" && test -z "${HAVE_OBJCOPY_DEBUGLINK_FALSE}"; then
|
||||
as_fn_error $? "conditional \"HAVE_OBJCOPY_DEBUGLINK\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
|
31
deps/libbacktrace/configure.ac
vendored
31
deps/libbacktrace/configure.ac
vendored
@ -404,6 +404,9 @@ if test "$have_getexecname" = "yes"; then
|
||||
AC_DEFINE(HAVE_GETEXECNAME, 1, [Define if getexecname is available.])
|
||||
fi
|
||||
|
||||
# Check for _pgmptr variable, contains the executable filename on windows
|
||||
AC_CHECK_DECLS([_pgmptr])
|
||||
|
||||
# Check for sysctl definitions.
|
||||
|
||||
AC_CACHE_CHECK([for KERN_PROC],
|
||||
@ -481,7 +484,18 @@ AC_CHECK_LIB([z], [compress],
|
||||
[AC_DEFINE(HAVE_ZLIB, 1, [Define if -lz is available.])])
|
||||
AM_CONDITIONAL(HAVE_ZLIB, test "$ac_cv_lib_z_compress" = yes)
|
||||
|
||||
dnl Test whether the linker supports the --compress_debug_sections option.
|
||||
dnl Test whether the linker supports the --build-id option.
|
||||
AC_CACHE_CHECK([whether --build-id is supported],
|
||||
[libbacktrace_cv_ld_buildid],
|
||||
[LDFLAGS_hold=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -Wl,--build-id"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
|
||||
[libbacktrace_cv_ld_buildid=yes],
|
||||
[libbacktrace_cv_ld_buildid=no])
|
||||
LDFLAGS=$LDFLAGS_hold])
|
||||
AM_CONDITIONAL(HAVE_BUILDID, test "$libbacktrace_cv_ld_buildid" = yes)
|
||||
|
||||
dnl Test whether the linker supports the --compress-debug-sections option.
|
||||
AC_CACHE_CHECK([whether --compress-debug-sections is supported],
|
||||
[libgo_cv_ld_compress],
|
||||
[LDFLAGS_hold=$LDFLAGS
|
||||
@ -492,6 +506,21 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
|
||||
LDFLAGS=$LDFLAGS_hold])
|
||||
AM_CONDITIONAL(HAVE_COMPRESSED_DEBUG, test "$libgo_cv_ld_compress" = yes)
|
||||
|
||||
AC_CHECK_LIB([zstd], [ZSTD_compress],
|
||||
[AC_DEFINE(HAVE_ZSTD, 1, [Define if -lzstd is available.])])
|
||||
AM_CONDITIONAL(HAVE_ZSTD, test "$ac_cv_lib_zstd_ZSTD_compress" = yes)
|
||||
|
||||
dnl Test whether the linker supports --compress-debug-sections=zstd option.
|
||||
AC_CACHE_CHECK([whether --compress-debug-sections=zstd is supported],
|
||||
[libgo_cv_ld_compress_zstd],
|
||||
[LDFLAGS_hold=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -Wl,--compress-debug-sections=zstd"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
|
||||
[libgo_cv_ld_compress_zstd=yes],
|
||||
[libgo_cv_ld_compress_zstd=no])
|
||||
LDFLAGS=$LDFLAGS_hold])
|
||||
AM_CONDITIONAL(HAVE_COMPRESSED_DEBUG_ZSTD, test "$libgo_cv_ld_compress_zstd" = yes)
|
||||
|
||||
AC_ARG_VAR(OBJCOPY, [location of objcopy])
|
||||
AC_CHECK_PROG(OBJCOPY, objcopy, objcopy,)
|
||||
AC_CHECK_PROG(READELF, readelf, readelf)
|
||||
|
88
deps/libbacktrace/dwarf.c
vendored
88
deps/libbacktrace/dwarf.c
vendored
@ -470,7 +470,7 @@ enum attr_val_encoding
|
||||
/* An address. */
|
||||
ATTR_VAL_ADDRESS,
|
||||
/* An index into the .debug_addr section, whose value is relative to
|
||||
* the DW_AT_addr_base attribute of the compilation unit. */
|
||||
the DW_AT_addr_base attribute of the compilation unit. */
|
||||
ATTR_VAL_ADDRESS_INDEX,
|
||||
/* A unsigned integer. */
|
||||
ATTR_VAL_UINT,
|
||||
@ -608,8 +608,8 @@ struct function
|
||||
struct function_addrs
|
||||
{
|
||||
/* Range is LOW <= PC < HIGH. */
|
||||
uint64_t low;
|
||||
uint64_t high;
|
||||
uintptr_t low;
|
||||
uintptr_t high;
|
||||
/* Function for this address range. */
|
||||
struct function *function;
|
||||
};
|
||||
@ -690,8 +690,8 @@ struct unit
|
||||
struct unit_addrs
|
||||
{
|
||||
/* Range is LOW <= PC < HIGH. */
|
||||
uint64_t low;
|
||||
uint64_t high;
|
||||
uintptr_t low;
|
||||
uintptr_t high;
|
||||
/* Compilation unit for this address range. */
|
||||
struct unit *u;
|
||||
};
|
||||
@ -1428,7 +1428,7 @@ resolve_addr_index (const struct dwarf_sections *dwarf_sections,
|
||||
uint64_t addr_base, int addrsize, int is_bigendian,
|
||||
uint64_t addr_index,
|
||||
backtrace_error_callback error_callback, void *data,
|
||||
uint64_t *address)
|
||||
uintptr_t *address)
|
||||
{
|
||||
uint64_t offset;
|
||||
struct dwarf_buf addr_buf;
|
||||
@ -1449,7 +1449,7 @@ resolve_addr_index (const struct dwarf_sections *dwarf_sections,
|
||||
addr_buf.data = data;
|
||||
addr_buf.reported_underflow = 0;
|
||||
|
||||
*address = read_address (&addr_buf, addrsize);
|
||||
*address = (uintptr_t) read_address (&addr_buf, addrsize);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1528,7 +1528,7 @@ function_addrs_search (const void *vkey, const void *ventry)
|
||||
|
||||
static int
|
||||
add_unit_addr (struct backtrace_state *state, void *rdata,
|
||||
uint64_t lowpc, uint64_t highpc,
|
||||
uintptr_t lowpc, uintptr_t highpc,
|
||||
backtrace_error_callback error_callback, void *data,
|
||||
void *pvec)
|
||||
{
|
||||
@ -1864,10 +1864,10 @@ lookup_abbrev (struct abbrevs *abbrevs, uint64_t code,
|
||||
lowpc/highpc is set or ranges is set. */
|
||||
|
||||
struct pcrange {
|
||||
uint64_t lowpc; /* The low PC value. */
|
||||
uintptr_t lowpc; /* The low PC value. */
|
||||
int have_lowpc; /* Whether a low PC value was found. */
|
||||
int lowpc_is_addr_index; /* Whether lowpc is in .debug_addr. */
|
||||
uint64_t highpc; /* The high PC value. */
|
||||
uintptr_t highpc; /* The high PC value. */
|
||||
int have_highpc; /* Whether a high PC value was found. */
|
||||
int highpc_is_relative; /* Whether highpc is relative to lowpc. */
|
||||
int highpc_is_addr_index; /* Whether highpc is in .debug_addr. */
|
||||
@ -1887,12 +1887,12 @@ update_pcrange (const struct attr* attr, const struct attr_val* val,
|
||||
case DW_AT_low_pc:
|
||||
if (val->encoding == ATTR_VAL_ADDRESS)
|
||||
{
|
||||
pcrange->lowpc = val->u.uint;
|
||||
pcrange->lowpc = (uintptr_t) val->u.uint;
|
||||
pcrange->have_lowpc = 1;
|
||||
}
|
||||
else if (val->encoding == ATTR_VAL_ADDRESS_INDEX)
|
||||
{
|
||||
pcrange->lowpc = val->u.uint;
|
||||
pcrange->lowpc = (uintptr_t) val->u.uint;
|
||||
pcrange->have_lowpc = 1;
|
||||
pcrange->lowpc_is_addr_index = 1;
|
||||
}
|
||||
@ -1901,18 +1901,18 @@ update_pcrange (const struct attr* attr, const struct attr_val* val,
|
||||
case DW_AT_high_pc:
|
||||
if (val->encoding == ATTR_VAL_ADDRESS)
|
||||
{
|
||||
pcrange->highpc = val->u.uint;
|
||||
pcrange->highpc = (uintptr_t) val->u.uint;
|
||||
pcrange->have_highpc = 1;
|
||||
}
|
||||
else if (val->encoding == ATTR_VAL_UINT)
|
||||
{
|
||||
pcrange->highpc = val->u.uint;
|
||||
pcrange->highpc = (uintptr_t) val->u.uint;
|
||||
pcrange->have_highpc = 1;
|
||||
pcrange->highpc_is_relative = 1;
|
||||
}
|
||||
else if (val->encoding == ATTR_VAL_ADDRESS_INDEX)
|
||||
{
|
||||
pcrange->highpc = val->u.uint;
|
||||
pcrange->highpc = (uintptr_t) val->u.uint;
|
||||
pcrange->have_highpc = 1;
|
||||
pcrange->highpc_is_addr_index = 1;
|
||||
}
|
||||
@ -1947,16 +1947,16 @@ add_low_high_range (struct backtrace_state *state,
|
||||
uintptr_t base_address, int is_bigendian,
|
||||
struct unit *u, const struct pcrange *pcrange,
|
||||
int (*add_range) (struct backtrace_state *state,
|
||||
void *rdata, uint64_t lowpc,
|
||||
uint64_t highpc,
|
||||
void *rdata, uintptr_t lowpc,
|
||||
uintptr_t highpc,
|
||||
backtrace_error_callback error_callback,
|
||||
void *data, void *vec),
|
||||
void *rdata,
|
||||
backtrace_error_callback error_callback, void *data,
|
||||
void *vec)
|
||||
{
|
||||
uint64_t lowpc;
|
||||
uint64_t highpc;
|
||||
uintptr_t lowpc;
|
||||
uintptr_t highpc;
|
||||
|
||||
lowpc = pcrange->lowpc;
|
||||
if (pcrange->lowpc_is_addr_index)
|
||||
@ -1994,10 +1994,10 @@ add_ranges_from_ranges (
|
||||
struct backtrace_state *state,
|
||||
const struct dwarf_sections *dwarf_sections,
|
||||
uintptr_t base_address, int is_bigendian,
|
||||
struct unit *u, uint64_t base,
|
||||
struct unit *u, uintptr_t base,
|
||||
const struct pcrange *pcrange,
|
||||
int (*add_range) (struct backtrace_state *state, void *rdata,
|
||||
uint64_t lowpc, uint64_t highpc,
|
||||
uintptr_t lowpc, uintptr_t highpc,
|
||||
backtrace_error_callback error_callback, void *data,
|
||||
void *vec),
|
||||
void *rdata,
|
||||
@ -2036,12 +2036,12 @@ add_ranges_from_ranges (
|
||||
break;
|
||||
|
||||
if (is_highest_address (low, u->addrsize))
|
||||
base = high;
|
||||
base = (uintptr_t) high;
|
||||
else
|
||||
{
|
||||
if (!add_range (state, rdata,
|
||||
low + base + base_address,
|
||||
high + base + base_address,
|
||||
(uintptr_t) low + base + base_address,
|
||||
(uintptr_t) high + base + base_address,
|
||||
error_callback, data, vec))
|
||||
return 0;
|
||||
}
|
||||
@ -2061,10 +2061,10 @@ add_ranges_from_rnglists (
|
||||
struct backtrace_state *state,
|
||||
const struct dwarf_sections *dwarf_sections,
|
||||
uintptr_t base_address, int is_bigendian,
|
||||
struct unit *u, uint64_t base,
|
||||
struct unit *u, uintptr_t base,
|
||||
const struct pcrange *pcrange,
|
||||
int (*add_range) (struct backtrace_state *state, void *rdata,
|
||||
uint64_t lowpc, uint64_t highpc,
|
||||
uintptr_t lowpc, uintptr_t highpc,
|
||||
backtrace_error_callback error_callback, void *data,
|
||||
void *vec),
|
||||
void *rdata,
|
||||
@ -2130,8 +2130,8 @@ add_ranges_from_rnglists (
|
||||
case DW_RLE_startx_endx:
|
||||
{
|
||||
uint64_t index;
|
||||
uint64_t low;
|
||||
uint64_t high;
|
||||
uintptr_t low;
|
||||
uintptr_t high;
|
||||
|
||||
index = read_uleb128 (&rnglists_buf);
|
||||
if (!resolve_addr_index (dwarf_sections, u->addr_base,
|
||||
@ -2153,8 +2153,8 @@ add_ranges_from_rnglists (
|
||||
case DW_RLE_startx_length:
|
||||
{
|
||||
uint64_t index;
|
||||
uint64_t low;
|
||||
uint64_t length;
|
||||
uintptr_t low;
|
||||
uintptr_t length;
|
||||
|
||||
index = read_uleb128 (&rnglists_buf);
|
||||
if (!resolve_addr_index (dwarf_sections, u->addr_base,
|
||||
@ -2184,16 +2184,16 @@ add_ranges_from_rnglists (
|
||||
break;
|
||||
|
||||
case DW_RLE_base_address:
|
||||
base = read_address (&rnglists_buf, u->addrsize);
|
||||
base = (uintptr_t) read_address (&rnglists_buf, u->addrsize);
|
||||
break;
|
||||
|
||||
case DW_RLE_start_end:
|
||||
{
|
||||
uint64_t low;
|
||||
uint64_t high;
|
||||
uintptr_t low;
|
||||
uintptr_t high;
|
||||
|
||||
low = read_address (&rnglists_buf, u->addrsize);
|
||||
high = read_address (&rnglists_buf, u->addrsize);
|
||||
low = (uintptr_t) read_address (&rnglists_buf, u->addrsize);
|
||||
high = (uintptr_t) read_address (&rnglists_buf, u->addrsize);
|
||||
if (!add_range (state, rdata, low + base_address,
|
||||
high + base_address, error_callback, data,
|
||||
vec))
|
||||
@ -2203,11 +2203,11 @@ add_ranges_from_rnglists (
|
||||
|
||||
case DW_RLE_start_length:
|
||||
{
|
||||
uint64_t low;
|
||||
uint64_t length;
|
||||
uintptr_t low;
|
||||
uintptr_t length;
|
||||
|
||||
low = read_address (&rnglists_buf, u->addrsize);
|
||||
length = read_uleb128 (&rnglists_buf);
|
||||
low = (uintptr_t) read_address (&rnglists_buf, u->addrsize);
|
||||
length = (uintptr_t) read_uleb128 (&rnglists_buf);
|
||||
low += base_address;
|
||||
if (!add_range (state, rdata, low, low + length,
|
||||
error_callback, data, vec))
|
||||
@ -2237,9 +2237,9 @@ static int
|
||||
add_ranges (struct backtrace_state *state,
|
||||
const struct dwarf_sections *dwarf_sections,
|
||||
uintptr_t base_address, int is_bigendian,
|
||||
struct unit *u, uint64_t base, const struct pcrange *pcrange,
|
||||
struct unit *u, uintptr_t base, const struct pcrange *pcrange,
|
||||
int (*add_range) (struct backtrace_state *state, void *rdata,
|
||||
uint64_t lowpc, uint64_t highpc,
|
||||
uintptr_t lowpc, uintptr_t highpc,
|
||||
backtrace_error_callback error_callback,
|
||||
void *data, void *vec),
|
||||
void *rdata,
|
||||
@ -3517,7 +3517,7 @@ read_referenced_name (struct dwarf_data *ddata, struct unit *u,
|
||||
|
||||
static int
|
||||
add_function_range (struct backtrace_state *state, void *rdata,
|
||||
uint64_t lowpc, uint64_t highpc,
|
||||
uintptr_t lowpc, uintptr_t highpc,
|
||||
backtrace_error_callback error_callback, void *data,
|
||||
void *pvec)
|
||||
{
|
||||
@ -3557,7 +3557,7 @@ add_function_range (struct backtrace_state *state, void *rdata,
|
||||
|
||||
static int
|
||||
read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata,
|
||||
struct unit *u, uint64_t base, struct dwarf_buf *unit_buf,
|
||||
struct unit *u, uintptr_t base, struct dwarf_buf *unit_buf,
|
||||
const struct line_header *lhdr,
|
||||
backtrace_error_callback error_callback, void *data,
|
||||
struct function_vector *vec_function,
|
||||
@ -3621,7 +3621,7 @@ read_function_entry (struct backtrace_state *state, struct dwarf_data *ddata,
|
||||
&& abbrev->attrs[i].name == DW_AT_low_pc)
|
||||
{
|
||||
if (val.encoding == ATTR_VAL_ADDRESS)
|
||||
base = val.u.uint;
|
||||
base = (uintptr_t) val.u.uint;
|
||||
else if (val.encoding == ATTR_VAL_ADDRESS_INDEX)
|
||||
{
|
||||
if (!resolve_addr_index (&ddata->dwarf_sections,
|
||||
|
2659
deps/libbacktrace/elf.c
vendored
2659
deps/libbacktrace/elf.c
vendored
File diff suppressed because it is too large
Load Diff
27
deps/libbacktrace/fileline.c
vendored
27
deps/libbacktrace/fileline.c
vendored
@ -155,6 +155,16 @@ macho_get_executable_path (struct backtrace_state *state,
|
||||
|
||||
#endif /* !defined (HAVE_MACH_O_DYLD_H) */
|
||||
|
||||
#if HAVE_DECL__PGMPTR
|
||||
|
||||
#define windows_executable_filename() _pgmptr
|
||||
|
||||
#else /* !HAVE_DECL__PGMPTR */
|
||||
|
||||
#define windows_executable_filename() NULL
|
||||
|
||||
#endif /* !HAVE_DECL__PGMPTR */
|
||||
|
||||
/* Initialize the fileline information from the executable. Returns 1
|
||||
on success, 0 on failure. */
|
||||
|
||||
@ -192,7 +202,7 @@ fileline_initialize (struct backtrace_state *state,
|
||||
|
||||
descriptor = -1;
|
||||
called_error_callback = 0;
|
||||
for (pass = 0; pass < 8; ++pass)
|
||||
for (pass = 0; pass < 9; ++pass)
|
||||
{
|
||||
int does_not_exist;
|
||||
|
||||
@ -205,23 +215,28 @@ fileline_initialize (struct backtrace_state *state,
|
||||
filename = getexecname ();
|
||||
break;
|
||||
case 2:
|
||||
filename = "/proc/self/exe";
|
||||
/* Test this before /proc/self/exe, as the latter exists but points
|
||||
to the wine binary (and thus doesn't work). */
|
||||
filename = windows_executable_filename ();
|
||||
break;
|
||||
case 3:
|
||||
filename = "/proc/curproc/file";
|
||||
filename = "/proc/self/exe";
|
||||
break;
|
||||
case 4:
|
||||
filename = "/proc/curproc/file";
|
||||
break;
|
||||
case 5:
|
||||
snprintf (buf, sizeof (buf), "/proc/%ld/object/a.out",
|
||||
(long) getpid ());
|
||||
filename = buf;
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
filename = sysctl_exec_name1 (state, error_callback, data);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
filename = sysctl_exec_name2 (state, error_callback, data);
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
filename = macho_get_executable_path (state, error_callback, data);
|
||||
break;
|
||||
default:
|
||||
|
9
deps/libbacktrace/internal.h
vendored
9
deps/libbacktrace/internal.h
vendored
@ -368,6 +368,15 @@ extern int backtrace_uncompress_zdebug (struct backtrace_state *,
|
||||
unsigned char **uncompressed,
|
||||
size_t *uncompressed_size);
|
||||
|
||||
/* A test-only hook for elf_zstd_decompress. */
|
||||
|
||||
extern int backtrace_uncompress_zstd (struct backtrace_state *,
|
||||
const unsigned char *compressed,
|
||||
size_t compressed_size,
|
||||
backtrace_error_callback, void *data,
|
||||
unsigned char *uncompressed,
|
||||
size_t uncompressed_size);
|
||||
|
||||
/* A test-only hook for elf_uncompress_lzma. */
|
||||
|
||||
extern int backtrace_uncompress_lzma (struct backtrace_state *,
|
||||
|
523
deps/libbacktrace/zstdtest.c
vendored
Normal file
523
deps/libbacktrace/zstdtest.c
vendored
Normal file
@ -0,0 +1,523 @@
|
||||
/* ztest.c -- Test for libbacktrace zstd code.
|
||||
Copyright (C) 2022 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Google.
|
||||
|
||||
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. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_ZSTD
|
||||
#include <zstd.h>
|
||||
#endif
|
||||
|
||||
#include "backtrace.h"
|
||||
#include "backtrace-supported.h"
|
||||
|
||||
#include "internal.h"
|
||||
#include "testlib.h"
|
||||
|
||||
#ifndef HAVE_CLOCK_GETTIME
|
||||
|
||||
typedef int xclockid_t;
|
||||
|
||||
static int
|
||||
xclock_gettime (xclockid_t id ATTRIBUTE_UNUSED,
|
||||
struct timespec *ts ATTRIBUTE_UNUSED)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#define clockid_t xclockid_t
|
||||
#define clock_gettime xclock_gettime
|
||||
#undef CLOCK_REALTIME
|
||||
#define CLOCK_REALTIME 0
|
||||
|
||||
#endif /* !defined(HAVE_CLOCK_GETTIME) */
|
||||
|
||||
#ifdef CLOCK_PROCESS_CPUTIME_ID
|
||||
#define ZSTD_CLOCK_GETTIME_ARG CLOCK_PROCESS_CPUTIME_ID
|
||||
#else
|
||||
#define ZSTD_CLOCK_GETTIME_ARG CLOCK_REALTIME
|
||||
#endif
|
||||
|
||||
/* Some tests for the local zstd inflation code. */
|
||||
|
||||
struct zstd_test
|
||||
{
|
||||
const char *name;
|
||||
const char *uncompressed;
|
||||
size_t uncompressed_len;
|
||||
const char *compressed;
|
||||
size_t compressed_len;
|
||||
};
|
||||
|
||||
/* Error callback. */
|
||||
|
||||
static void
|
||||
error_callback_compress (void *vdata ATTRIBUTE_UNUSED, const char *msg,
|
||||
int errnum)
|
||||
{
|
||||
fprintf (stderr, "%s", msg);
|
||||
if (errnum > 0)
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
fprintf (stderr, "\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
static const struct zstd_test tests[] =
|
||||
{
|
||||
{
|
||||
"empty",
|
||||
"",
|
||||
0,
|
||||
"\x28\xb5\x2f\xfd\x24\x00\x01\x00\x00\x99\xe9\xd8\x51",
|
||||
13,
|
||||
},
|
||||
{
|
||||
"hello",
|
||||
"hello, world\n",
|
||||
0,
|
||||
("\x28\xb5\x2f\xfd\x24\x0d\x69\x00\x00\x68\x65\x6c\x6c\x6f\x2c\x20"
|
||||
"\x77\x6f\x72\x6c\x64\x0a\x4c\x1f\xf9\xf1"),
|
||||
26,
|
||||
},
|
||||
{
|
||||
"goodbye",
|
||||
"goodbye, world",
|
||||
0,
|
||||
("\x28\xb5\x2f\xfd\x24\x0e\x71\x00\x00\x67\x6f\x6f\x64\x62\x79\x65"
|
||||
"\x2c\x20\x77\x6f\x72\x6c\x64\x61\x7b\x4b\x83"),
|
||||
27,
|
||||
},
|
||||
{
|
||||
"ranges",
|
||||
("\xcc\x11\x00\x00\x00\x00\x00\x00\xd5\x13\x00\x00\x00\x00\x00\x00"
|
||||
"\x1c\x14\x00\x00\x00\x00\x00\x00\x72\x14\x00\x00\x00\x00\x00\x00"
|
||||
"\x9d\x14\x00\x00\x00\x00\x00\x00\xd5\x14\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\xfb\x12\x00\x00\x00\x00\x00\x00\x09\x13\x00\x00\x00\x00\x00\x00"
|
||||
"\x0c\x13\x00\x00\x00\x00\x00\x00\xcb\x13\x00\x00\x00\x00\x00\x00"
|
||||
"\x29\x14\x00\x00\x00\x00\x00\x00\x4e\x14\x00\x00\x00\x00\x00\x00"
|
||||
"\x9d\x14\x00\x00\x00\x00\x00\x00\xd5\x14\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\xfb\x12\x00\x00\x00\x00\x00\x00\x09\x13\x00\x00\x00\x00\x00\x00"
|
||||
"\x67\x13\x00\x00\x00\x00\x00\x00\xcb\x13\x00\x00\x00\x00\x00\x00"
|
||||
"\x9d\x14\x00\x00\x00\x00\x00\x00\xd5\x14\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x5f\x0b\x00\x00\x00\x00\x00\x00\x6c\x0b\x00\x00\x00\x00\x00\x00"
|
||||
"\x7d\x0b\x00\x00\x00\x00\x00\x00\x7e\x0c\x00\x00\x00\x00\x00\x00"
|
||||
"\x38\x0f\x00\x00\x00\x00\x00\x00\x5c\x0f\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x83\x0c\x00\x00\x00\x00\x00\x00\xfa\x0c\x00\x00\x00\x00\x00\x00"
|
||||
"\xfd\x0d\x00\x00\x00\x00\x00\x00\xef\x0e\x00\x00\x00\x00\x00\x00"
|
||||
"\x14\x0f\x00\x00\x00\x00\x00\x00\x38\x0f\x00\x00\x00\x00\x00\x00"
|
||||
"\x9f\x0f\x00\x00\x00\x00\x00\x00\xac\x0f\x00\x00\x00\x00\x00\x00"
|
||||
"\xdb\x0f\x00\x00\x00\x00\x00\x00\xff\x0f\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\xfd\x0d\x00\x00\x00\x00\x00\x00\xd8\x0e\x00\x00\x00\x00\x00\x00"
|
||||
"\x9f\x0f\x00\x00\x00\x00\x00\x00\xac\x0f\x00\x00\x00\x00\x00\x00"
|
||||
"\xdb\x0f\x00\x00\x00\x00\x00\x00\xff\x0f\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\xfa\x0c\x00\x00\x00\x00\x00\x00\xea\x0d\x00\x00\x00\x00\x00\x00"
|
||||
"\xef\x0e\x00\x00\x00\x00\x00\x00\x14\x0f\x00\x00\x00\x00\x00\x00"
|
||||
"\x5c\x0f\x00\x00\x00\x00\x00\x00\x9f\x0f\x00\x00\x00\x00\x00\x00"
|
||||
"\xac\x0f\x00\x00\x00\x00\x00\x00\xdb\x0f\x00\x00\x00\x00\x00\x00"
|
||||
"\xff\x0f\x00\x00\x00\x00\x00\x00\x2c\x10\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x60\x11\x00\x00\x00\x00\x00\x00\xd1\x16\x00\x00\x00\x00\x00\x00"
|
||||
"\x40\x0b\x00\x00\x00\x00\x00\x00\x2c\x10\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x7a\x00\x00\x00\x00\x00\x00\x00\xb6\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x9f\x01\x00\x00\x00\x00\x00\x00\xa7\x01\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x7a\x00\x00\x00\x00\x00\x00\x00\xa9\x00\x00\x00\x00\x00\x00\x00"
|
||||
"\x9f\x01\x00\x00\x00\x00\x00\x00\xa7\x01\x00\x00\x00\x00\x00\x00"
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"),
|
||||
672,
|
||||
("\x28\xb5\x2f\xfd\x64\xa0\x01\x2d\x05\x00\xc4\x04\xcc\x11\x00\xd5"
|
||||
"\x13\x00\x1c\x14\x00\x72\x9d\xd5\xfb\x12\x00\x09\x0c\x13\xcb\x13"
|
||||
"\x29\x4e\x67\x5f\x0b\x6c\x0b\x7d\x0b\x7e\x0c\x38\x0f\x5c\x0f\x83"
|
||||
"\x0c\xfa\x0c\xfd\x0d\xef\x0e\x14\x38\x9f\x0f\xac\x0f\xdb\x0f\xff"
|
||||
"\x0f\xd8\x9f\xac\xdb\xff\xea\x5c\x2c\x10\x60\xd1\x16\x40\x0b\x7a"
|
||||
"\x00\xb6\x00\x9f\x01\xa7\x01\xa9\x36\x20\xa0\x83\x14\x34\x63\x4a"
|
||||
"\x21\x70\x8c\x07\x46\x03\x4e\x10\x62\x3c\x06\x4e\xc8\x8c\xb0\x32"
|
||||
"\x2a\x59\xad\xb2\xf1\x02\x82\x7c\x33\xcb\x92\x6f\x32\x4f\x9b\xb0"
|
||||
"\xa2\x30\xf0\xc0\x06\x1e\x98\x99\x2c\x06\x1e\xd8\xc0\x03\x56\xd8"
|
||||
"\xc0\x03\x0f\x6c\xe0\x01\xf1\xf0\xee\x9a\xc6\xc8\x97\x99\xd1\x6c"
|
||||
"\xb4\x21\x45\x3b\x10\xe4\x7b\x99\x4d\x8a\x36\x64\x5c\x77\x08\x02"
|
||||
"\xcb\xe0\xce"),
|
||||
179,
|
||||
}
|
||||
};
|
||||
|
||||
/* Test the hand coded samples. */
|
||||
|
||||
static void
|
||||
test_samples (struct backtrace_state *state)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < sizeof tests / sizeof tests[0]; ++i)
|
||||
{
|
||||
unsigned char *uncompressed;
|
||||
size_t uncompressed_len;
|
||||
|
||||
uncompressed_len = tests[i].uncompressed_len;
|
||||
if (uncompressed_len == 0)
|
||||
uncompressed_len = strlen (tests[i].uncompressed);
|
||||
|
||||
uncompressed = (unsigned char *) malloc (uncompressed_len);
|
||||
if (uncompressed == NULL)
|
||||
{
|
||||
perror ("malloc");
|
||||
fprintf (stderr, "test %s: uncompress failed\n", tests[i].name);
|
||||
++failures;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!backtrace_uncompress_zstd (state,
|
||||
((const unsigned char *)
|
||||
tests[i].compressed),
|
||||
tests[i].compressed_len,
|
||||
error_callback_compress, NULL,
|
||||
uncompressed, uncompressed_len))
|
||||
{
|
||||
fprintf (stderr, "test %s: uncompress failed\n", tests[i].name);
|
||||
++failures;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (memcmp (tests[i].uncompressed, uncompressed, uncompressed_len)
|
||||
!= 0)
|
||||
{
|
||||
size_t j;
|
||||
|
||||
fprintf (stderr, "test %s: uncompressed data mismatch\n",
|
||||
tests[i].name);
|
||||
for (j = 0; j < uncompressed_len; ++j)
|
||||
if (tests[i].uncompressed[j] != uncompressed[j])
|
||||
fprintf (stderr, " %zu: got %#x want %#x\n", j,
|
||||
uncompressed[j], tests[i].uncompressed[j]);
|
||||
++failures;
|
||||
}
|
||||
else
|
||||
printf ("PASS: uncompress %s\n", tests[i].name);
|
||||
}
|
||||
|
||||
free (uncompressed);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZSTD
|
||||
|
||||
/* Given a set of TRIALS timings, discard the lowest and highest
|
||||
values and return the mean average of the rest. */
|
||||
|
||||
static size_t
|
||||
average_time (const size_t *times, size_t trials)
|
||||
{
|
||||
size_t imax;
|
||||
size_t max;
|
||||
size_t imin;
|
||||
size_t min;
|
||||
size_t i;
|
||||
size_t sum;
|
||||
|
||||
imin = 0;
|
||||
imax = 0;
|
||||
min = times[0];
|
||||
max = times[0];
|
||||
for (i = 1; i < trials; ++i)
|
||||
{
|
||||
if (times[i] < min)
|
||||
{
|
||||
imin = i;
|
||||
min = times[i];
|
||||
}
|
||||
if (times[i] > max)
|
||||
{
|
||||
imax = i;
|
||||
max = times[i];
|
||||
}
|
||||
}
|
||||
|
||||
sum = 0;
|
||||
for (i = 0; i < trials; ++i)
|
||||
{
|
||||
if (i != imax && i != imin)
|
||||
sum += times[i];
|
||||
}
|
||||
return sum / (trials - 2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Test a larger text, if available. */
|
||||
|
||||
static void
|
||||
test_large (struct backtrace_state *state ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef HAVE_ZSTD
|
||||
unsigned char *orig_buf;
|
||||
size_t orig_bufsize;
|
||||
size_t i;
|
||||
char *compressed_buf;
|
||||
size_t compressed_bufsize;
|
||||
size_t compressed_size;
|
||||
unsigned char *uncompressed_buf;
|
||||
size_t r;
|
||||
clockid_t cid;
|
||||
struct timespec ts1;
|
||||
struct timespec ts2;
|
||||
size_t ctime;
|
||||
size_t ztime;
|
||||
const size_t trials = 16;
|
||||
size_t ctimes[16];
|
||||
size_t ztimes[16];
|
||||
static const char * const names[] = {
|
||||
"Isaac.Newton-Opticks.txt",
|
||||
"../libgo/go/testdata/Isaac.Newton-Opticks.txt",
|
||||
};
|
||||
|
||||
orig_buf = NULL;
|
||||
orig_bufsize = 0;
|
||||
uncompressed_buf = NULL;
|
||||
compressed_buf = NULL;
|
||||
|
||||
for (i = 0; i < sizeof names / sizeof names[0]; ++i)
|
||||
{
|
||||
size_t len;
|
||||
char *namebuf;
|
||||
FILE *e;
|
||||
struct stat st;
|
||||
char *rbuf;
|
||||
size_t got;
|
||||
|
||||
len = strlen (SRCDIR) + strlen (names[i]) + 2;
|
||||
namebuf = malloc (len);
|
||||
if (namebuf == NULL)
|
||||
{
|
||||
perror ("malloc");
|
||||
goto fail;
|
||||
}
|
||||
snprintf (namebuf, len, "%s/%s", SRCDIR, names[i]);
|
||||
e = fopen (namebuf, "r");
|
||||
free (namebuf);
|
||||
if (e == NULL)
|
||||
continue;
|
||||
if (fstat (fileno (e), &st) < 0)
|
||||
{
|
||||
perror ("fstat");
|
||||
fclose (e);
|
||||
continue;
|
||||
}
|
||||
rbuf = malloc (st.st_size);
|
||||
if (rbuf == NULL)
|
||||
{
|
||||
perror ("malloc");
|
||||
goto fail;
|
||||
}
|
||||
got = fread (rbuf, 1, st.st_size, e);
|
||||
fclose (e);
|
||||
if (got > 0)
|
||||
{
|
||||
orig_buf = (unsigned char *) rbuf;
|
||||
orig_bufsize = got;
|
||||
break;
|
||||
}
|
||||
free (rbuf);
|
||||
}
|
||||
|
||||
if (orig_buf == NULL)
|
||||
{
|
||||
/* We couldn't find an input file. */
|
||||
printf ("UNSUPPORTED: zstd large\n");
|
||||
return;
|
||||
}
|
||||
|
||||
compressed_bufsize = ZSTD_compressBound (orig_bufsize);
|
||||
compressed_buf = malloc (compressed_bufsize);
|
||||
if (compressed_buf == NULL)
|
||||
{
|
||||
perror ("malloc");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
r = ZSTD_compress (compressed_buf, compressed_bufsize,
|
||||
orig_buf, orig_bufsize,
|
||||
ZSTD_CLEVEL_DEFAULT);
|
||||
if (ZSTD_isError (r))
|
||||
{
|
||||
fprintf (stderr, "zstd compress failed: %s\n", ZSTD_getErrorName (r));
|
||||
goto fail;
|
||||
}
|
||||
compressed_size = r;
|
||||
|
||||
uncompressed_buf = malloc (orig_bufsize);
|
||||
if (uncompressed_buf == NULL)
|
||||
{
|
||||
perror ("malloc");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!backtrace_uncompress_zstd (state, (unsigned char *) compressed_buf,
|
||||
compressed_size,
|
||||
error_callback_compress, NULL,
|
||||
uncompressed_buf, orig_bufsize))
|
||||
{
|
||||
fprintf (stderr, "zstd large: backtrace_uncompress_zstd failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (memcmp (uncompressed_buf, orig_buf, orig_bufsize) != 0)
|
||||
{
|
||||
size_t j;
|
||||
|
||||
fprintf (stderr, "zstd large: uncompressed data mismatch\n");
|
||||
for (j = 0; j < orig_bufsize; ++j)
|
||||
if (orig_buf[j] != uncompressed_buf[j])
|
||||
fprintf (stderr, " %zu: got %#x want %#x\n", j,
|
||||
uncompressed_buf[j], orig_buf[j]);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
printf ("PASS: zstd large\n");
|
||||
|
||||
for (i = 0; i < trials; ++i)
|
||||
{
|
||||
cid = ZSTD_CLOCK_GETTIME_ARG;
|
||||
if (clock_gettime (cid, &ts1) < 0)
|
||||
{
|
||||
if (errno == EINVAL)
|
||||
return;
|
||||
perror ("clock_gettime");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!backtrace_uncompress_zstd (state,
|
||||
(unsigned char *) compressed_buf,
|
||||
compressed_size,
|
||||
error_callback_compress, NULL,
|
||||
uncompressed_buf,
|
||||
orig_bufsize))
|
||||
{
|
||||
fprintf (stderr,
|
||||
("zstd large: "
|
||||
"benchmark backtrace_uncompress_zstd failed\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (clock_gettime (cid, &ts2) < 0)
|
||||
{
|
||||
perror ("clock_gettime");
|
||||
return;
|
||||
}
|
||||
|
||||
ctime = (ts2.tv_sec - ts1.tv_sec) * 1000000000;
|
||||
ctime += ts2.tv_nsec - ts1.tv_nsec;
|
||||
ctimes[i] = ctime;
|
||||
|
||||
if (clock_gettime (cid, &ts1) < 0)
|
||||
{
|
||||
perror("clock_gettime");
|
||||
return;
|
||||
}
|
||||
|
||||
r = ZSTD_decompress (uncompressed_buf, orig_bufsize,
|
||||
compressed_buf, compressed_size);
|
||||
|
||||
if (clock_gettime (cid, &ts2) < 0)
|
||||
{
|
||||
perror ("clock_gettime");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ZSTD_isError (r))
|
||||
{
|
||||
fprintf (stderr,
|
||||
"zstd large: benchmark zlib uncompress failed: %s\n",
|
||||
ZSTD_getErrorName (r));
|
||||
return;
|
||||
}
|
||||
|
||||
ztime = (ts2.tv_sec - ts1.tv_sec) * 1000000000;
|
||||
ztime += ts2.tv_nsec - ts1.tv_nsec;
|
||||
ztimes[i] = ztime;
|
||||
}
|
||||
|
||||
/* Toss the highest and lowest times and average the rest. */
|
||||
ctime = average_time (ctimes, trials);
|
||||
ztime = average_time (ztimes, trials);
|
||||
|
||||
printf ("backtrace: %zu ns\n", ctime);
|
||||
printf ("zstd : %zu ns\n", ztime);
|
||||
printf ("ratio : %g\n", (double) ztime / (double) ctime);
|
||||
|
||||
return;
|
||||
|
||||
fail:
|
||||
printf ("FAIL: zstd large\n");
|
||||
++failures;
|
||||
|
||||
if (orig_buf != NULL)
|
||||
free (orig_buf);
|
||||
if (compressed_buf != NULL)
|
||||
free (compressed_buf);
|
||||
if (uncompressed_buf != NULL)
|
||||
free (uncompressed_buf);
|
||||
|
||||
#else /* !HAVE_ZSTD */
|
||||
|
||||
printf ("UNSUPPORTED: zstd large\n");
|
||||
|
||||
#endif /* !HAVE_ZSTD */
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc ATTRIBUTE_UNUSED, char **argv)
|
||||
{
|
||||
struct backtrace_state *state;
|
||||
|
||||
state = backtrace_create_state (argv[0], BACKTRACE_SUPPORTS_THREADS,
|
||||
error_callback_create, NULL);
|
||||
|
||||
test_samples (state);
|
||||
test_large (state);
|
||||
|
||||
exit (failures != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
|
||||
}
|
6
deps/libsodium/.github/workflows/ci.yml
vendored
6
deps/libsodium/.github/workflows/ci.yml
vendored
@ -42,7 +42,7 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
curl -sL -o - https://ziglang.org/download/0.10.1/zig-linux-x86_64-0.10.1.tar.xz | tar xJ -f - -C /opt/
|
||||
curl -sL -o - https://ziglang.org/download/0.11.0/zig-linux-x86_64-0.11.0.tar.xz | tar xJ -f - -C /opt/
|
||||
sudo mv /opt/zig-* /opt/zig
|
||||
|
||||
- name: Autogen
|
||||
@ -59,7 +59,7 @@ jobs:
|
||||
zig build -Dtarget=x86_64-macos
|
||||
zig build -Dtarget=aarch64-macos
|
||||
zig build -Dtarget=wasm32-wasi
|
||||
zig build -Drelease-fast
|
||||
zig build -Doptimize=ReleaseFast
|
||||
rm -fr zig-cache zig-out
|
||||
|
||||
regular:
|
||||
@ -172,7 +172,7 @@ jobs:
|
||||
- name: Install Android NDK
|
||||
run: |
|
||||
mkdir /tmp/android && cd /tmp/android
|
||||
curl -o ndk.zip -L https://dl.google.com/android/repository/android-ndk-r25b-linux.zip
|
||||
curl -o ndk.zip -L https://dl.google.com/android/repository/android-ndk-r25c-linux.zip
|
||||
unzip ndk.zip && rm -f *.zip && mv android-ndk* ndk
|
||||
|
||||
- name: Android compilation
|
||||
|
39
deps/libsodium/.github/workflows/dotnet-core.yml
vendored
39
deps/libsodium/.github/workflows/dotnet-core.yml
vendored
@ -28,13 +28,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Zig
|
||||
uses: goto-bus-stop/setup-zig@869a4299cf8ac7db4ebffaec36ad82a682f88acb
|
||||
uses: goto-bus-stop/setup-zig@6fede2f0550d71291c0accf2834b216e69a2d67a
|
||||
with:
|
||||
version: 0.10.1
|
||||
version: 0.11.0
|
||||
- uses: actions/checkout@v3
|
||||
- name: build
|
||||
run: |
|
||||
zig build -Drelease-fast -Dtarget=x86_64-linux-gnu.2.17
|
||||
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-gnu.2.17 -Dcpu=sandybridge
|
||||
- name: tests
|
||||
run: cd zig-out/bin && ./run.sh
|
||||
- uses: actions/upload-artifact@v3
|
||||
@ -46,12 +46,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Zig
|
||||
uses: goto-bus-stop/setup-zig@869a4299cf8ac7db4ebffaec36ad82a682f88acb
|
||||
uses: goto-bus-stop/setup-zig@6fede2f0550d71291c0accf2834b216e69a2d67a
|
||||
with:
|
||||
version: 0.10.1
|
||||
- name: Fix ARM support
|
||||
run: |
|
||||
curl -L https://raw.githubusercontent.com/ziglang/zig/master/lib/libc/glibc/sysdeps/arm/arm-features.h | sudo tee /opt/hostedtoolcache/zig/zig-linux-x86_64-*/x64/lib/libc/glibc/sysdeps/arm/sysdep.h >/dev/null
|
||||
version: 0.11.0
|
||||
- name: Set up emulation environment
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
@ -64,7 +61,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- name: build
|
||||
run: |
|
||||
zig build -Drelease-fast -Dtarget=arm-linux-gnueabihf.2.23
|
||||
zig build -Doptimize=ReleaseFast -Dtarget=arm-linux-gnueabihf.2.23 -Dcpu=baseline
|
||||
- name: tests
|
||||
run: |
|
||||
cd zig-out/bin && env LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib ./run.sh
|
||||
@ -77,9 +74,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Zig
|
||||
uses: goto-bus-stop/setup-zig@869a4299cf8ac7db4ebffaec36ad82a682f88acb
|
||||
uses: goto-bus-stop/setup-zig@6fede2f0550d71291c0accf2834b216e69a2d67a
|
||||
with:
|
||||
version: 0.10.1
|
||||
version: 0.11.0
|
||||
- name: Set up emulation environment
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
@ -92,7 +89,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- name: build
|
||||
run: |
|
||||
zig build -Drelease-fast -Dtarget=aarch64-linux-gnu.2.23
|
||||
zig build -Doptimize=ReleaseFast -Dtarget=aarch64-linux-gnu.2.23 -Dcpu=baseline
|
||||
- name: tests
|
||||
run: |
|
||||
cd zig-out/bin && env LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib ./run.sh
|
||||
@ -111,13 +108,13 @@ jobs:
|
||||
apk update
|
||||
apk add alpine-sdk ca-certificates xz
|
||||
- name: Install Zig
|
||||
uses: goto-bus-stop/setup-zig@869a4299cf8ac7db4ebffaec36ad82a682f88acb
|
||||
uses: goto-bus-stop/setup-zig@6fede2f0550d71291c0accf2834b216e69a2d67a
|
||||
with:
|
||||
version: 0.10.1
|
||||
version: 0.11.0
|
||||
- uses: actions/checkout@v3
|
||||
- name: build
|
||||
run: |
|
||||
zig build -Drelease-fast -Dtarget=x86_64-linux-musl
|
||||
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-musl -Dcpu=sandybridge
|
||||
- name: tests
|
||||
run: |
|
||||
cd zig-out/bin && ./run.sh
|
||||
@ -130,13 +127,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Zig
|
||||
uses: goto-bus-stop/setup-zig@869a4299cf8ac7db4ebffaec36ad82a682f88acb
|
||||
uses: goto-bus-stop/setup-zig@6fede2f0550d71291c0accf2834b216e69a2d67a
|
||||
with:
|
||||
version: 0.10.1
|
||||
version: 0.11.0
|
||||
- uses: actions/checkout@v3
|
||||
- name: build
|
||||
run: |
|
||||
zig build -Drelease-fast -Dtarget=arm-linux-musleabihf
|
||||
zig build -Doptimize=ReleaseFast -Dtarget=arm-linux-musleabihf -Dcpu=baseline
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-linux-musl-arm
|
||||
@ -146,13 +143,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Zig
|
||||
uses: goto-bus-stop/setup-zig@869a4299cf8ac7db4ebffaec36ad82a682f88acb
|
||||
uses: goto-bus-stop/setup-zig@6fede2f0550d71291c0accf2834b216e69a2d67a
|
||||
with:
|
||||
version: 0.10.1
|
||||
version: 0.11.0
|
||||
- uses: actions/checkout@v3
|
||||
- name: build
|
||||
run: |
|
||||
zig build -Drelease-fast -Dtarget=aarch64-linux-musl
|
||||
zig build -Doptimize=ReleaseFast -Dtarget=aarch64-linux-musl -Dcpu=baseline
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-linux-musl-arm64
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user